session.onvalidatemerchant = (event) => {
// Gets the Apple Pay Token from the event payment data
const applePayToken = event.payment.token.paymentData;
// Gets the billing address from the event
const applePaymentBilling = event.payment.billingContact;
const createPaymentRequest: CreatePaymentRequest = {
name: 'Apple Pay',
type: 'APPLE_PAY',
gatewayType: 'CHASE_ORBITAL',
amount: '122.85',
shouldSavePaymentForFutureUse: false,
isSingleUsePaymentMethod: true,
paymentMethodProperties: {
paymentInstrumentType: "APPLE_PAY_ENCRYPTED_BUNDLE",
applePayToken: JSON.stringify(applePayToken),
latitudeLongitude: latitudeLongitude,
},
billingAddress: getBillingAddressForApplePayment(applePaymentBilling),
};
// Call PaymentTransactionService with the `createPaymentRequest`
}