- Set up your server to create a
Checkout Session - Set up the Fintoc SDK on your frontend
- Create and mount the Express Checkout component
- Handle the
onPaymentRequestcallback - Submit the payment to Fintoc
- Test the integration
Step 1: Set up your server
Server-sideExpress Checkout calls the
onPaymentRequest callback after the customer authorizes the Apple Pay sheet. In that callback you must create a Checkout Session from your backend and return its session_token to the browser.
Expose an endpoint on your server that creates a Checkout Session with Fintoc’s API:
Node
Step 2: Set up the Fintoc SDK
Client-sideExpress Checkout is automatically available as a feature of the Fintoc SDK. Include the Fintoc script on your checkout page by adding it to the
<head> of your HTML file. Always load the SDK directly from js.fintoc.com to receive security updates. Don’t include the script in a bundle or host a copy of it yourself.
Step 3: Create and mount the Express Checkout
Client-sideThe Express Checkout component renders the wallet button inside an iframe that securely sends the payment information to Fintoc over an HTTPS connection. The checkout page address must also start with
https://, rather than http://, for your integration to work.
First, create an empty DOM node (container) with a unique ID in your payment form:

Button styles: black, white, and white with outline
Step 4: Handle the onPaymentRequest callback
Client-side
onPaymentRequest runs when the SDK needs a sessionToken to continue the flow. For Apple Pay, the SDK calls it after the customer authorizes the Apple Pay sheet. When you call widget.open() for bank transfer, the SDK calls the same callback before it opens the widget. In that callback you must call your server, obtain a session_token, and return it to the SDK.
The callback receives a single argument with information about the requested method:
Your callback must resolve to
{ sessionToken: string } within 30 seconds, or the SDK emits payment_error.
You can use the
payment_method_type and wallet fields to reuse a single endpoint for wallets and bank transfer, or to route to different endpoints if your backend logic differs.Step 5: Submit the payment to Fintoc
Client-sideOnce the customer authorizes the wallet payment, the SDK automatically completes the flow. You don’t need to call a
confirmPayment method yourself.
The sequence is:
- The SDK opens the Apple Pay sheet and requests a payment token from Apple Pay.
- Once the customer authorizes, the SDK emits
processing_express_checkout_payment. - The SDK calls your
onPaymentRequestcallback to get a freshsessionToken. - The SDK submits both tokens to the Fintoc backend, which creates the Payment Resource and charges the wallet.
- When the payment reaches
status === 'succeeded', the SDK callsonSuccess(data)with the resulting resource.
If the payment status is anything other than
succeeded, or any step in the flow fails, the SDK emits payment_error instead of calling onSuccess.Handling the loading state during payment processing
While Express Checkout is processing a payment, you should display a loading state to give clear feedback to your customer and prevent duplicate interactions. Manage it from theonEvent and onSuccess callbacks you already pass to Fintoc.create:
processing_express_checkout_paymentfires once the customer authorizes the payment. Use it to show your loading indicator while the SDK gets a freshsessionTokenfrom your server and submits the payment.- The payment then resolves through
onSuccesswhen it succeeds, or through apayment_errorevent when it fails. Use both to clear the loading indicator.
onSuccess and payment_error so the UI never gets stuck after a payment attempt.
Step 6: Test the integration
Before you go live, test the integration on a device that supports Apple Pay. Requirements for testing:- Use your test public key and a test recipient account.
- Open your checkout on iOS or macOS.
- Make sure your staging domain is enabled for Apple Pay. If you haven’t done this yet, follow Enabling Apple Pay first.
- The Apple Pay button renders on page load on a supported device.
-
express_checkout_readyfires withwallets.applePay === true. - Authorizing the Apple Pay sheet triggers
onPaymentRequestwithpayment_method_type: 'card',wallet: 'apple_pay'. -
processing_express_checkout_paymentfires while the payment is in progress. -
onSuccessfires with the payment resource after a successful authorization. - Cancelling the Apple Pay sheet does not emit
payment_error. - Calling
widget.open()(bank transfer fallback) invokesonPaymentRequestwithpayment_method_type: 'bank_transfer'and opens the widget.
Optional configurations
Listen to the express_checkout_ready event
After mounting, Express Checkout won’t show buttons until the SDK initializes and checks wallet availability. To animate the element when the button appears, listen to theexpress_checkout_ready event. Inspect the wallets value to determine which buttons, if any, to display:
Style the button
You can tune the look of the Apple Pay button through the optional fields ofexpressCheckout.
Values outside the allowed range are clamped rather than rejected. For example,
buttonHeight: 200 is treated as 100.The same
widget object returned by Fintoc.create exposes the usual widget methods. When expressCheckout is configured, calling widget.open() automatically invokes onPaymentRequest with payment_method_type: 'bank_transfer' before opening the widget, so you don’t need a second initialization.
Event reference
Express Checkout uses the sameonEvent callback as the rest of the widget (widget events reference), plus the events specific to this component:
Full option reference
Fintoc.create(options)
ExpressCheckoutConfig
Enabling Apple Pay
Apple Pay won’t load on a domain until Fintoc has registered it with Apple. Registration is a prerequisite for both testing and going live. Complete the registration for every domain that will show the button, in both staging and production. Each registered domain must use HTTPS. The process works like this:- Tell Fintoc you want to use Apple Pay. Contact your account manager, customer success contact, or sales contact, and share the domains you plan to integrate.
- Host the verification file Fintoc sends you. Fintoc sends you a domain association file. Host it on each domain under the path
/.well-known/apple-developer-merchantid-domain-association, so it’s reachable athttps://your-domain.com/.well-known/apple-developer-merchantid-domain-association. The file must return200 OKand be downloadable. - Confirm the file is live. Let Fintoc know once the file is hosted on every domain. Fintoc then registers each domain with Apple.
- Test your integration. Once your domains are registered, the Apple Pay button can load, and you can follow the testing steps on a supported device.
See also
- Accept a payment: standard Checkout Session integration guide.
- Web Integration: full widget integration guide.
- Listen to Widget events: complete event catalog.
- WebView Integration: integrating the widget inside a native app.