Headless Apple Pay
Headless Apple Pay is a lightweight, embeddable UI module that allows partners to offer Apple Pay as a payment method directly within their own application without loading any widget.
Problem Statement
Currently, Transak requires loading the full widget for Apple pay, which forces users to go through multiple screens before reaching payment module. This creates friction and limits the partner control over the payment experience.
Here are some of the key challenges with the current approach:
Our Solution
Headless Apple Pay exposes just the Apple Pay button as a standalone, embeddable component. Partners control where it sits, how it looks, and what happens after payment. Transak handles all the payment infrastructure in the background.
Here are some of the key benefits of the Headless Apple Pay solution:
How does it work?
Current Limitations
How to integrate?
User Authentication
You can use either of the following authentication options:
Please refer to the tutorial on how to create partner access token.
User KYC
KYC is a mandatory step in compliance with regulatory requirements. Each user should be KYC Approved. You can use either of the following KYC options:
Generate a quote using the Quote API
Call the Get Quote API to get a quote for the transaction. Pass the apiKey, fiatAmount, fiatCurrency, cryptoCurrency, network, and paymentMethod.
Set paymentMethod to apple_pay while creating a quote.
A successful response returns a quoteId.
Create a transaction session (using Backend only)
Call the Transaction Session API from your backend using the quoteId and the user’s wallet address. You can optionally pass a config object to customise the look and feel of the Apple Pay component.
A successful response returns a sessionId.
Load the Apple Pay Component via Transak UI SDK
Use the Transak UI SDK to render the Apple Pay component. Pass the sessionId received in previous Step.
React Native
Recommended implementation
The code snippet below wraps TransakApplePay in a view that supports dark/light mode, displays a loading spinner until the component is ready, and fades in a blur overlay when the Apple Pay sheet opens.
SDK Error codes
The onError callback receives a code value. Use it to handle specific failure scenarios:
Here’s how the Apple Pay module appears :
.png)
Process the payment with requestId (using Backend only)
Once the SDK fires onSuccess with a requestId, call the Transaction Process API from your backend to complete the payment and create the order.
A successful response returns the full order details.
Track the requestId (using Backend only)
Call the Transaction Request Status API to check whether the request has been processed. Poll this endpoint after calling the Transaction Process API until the status reaches a terminal state.
Once you receive an orderId, use the Get Order by ID API to fetch full order details.
API Overview
Creates a transaction session using a quote ID and wallet address, returns a sessionId to initialise the Apple Pay component.
Processes the Apple Pay payment using the requestId returned by the SDK’s onSuccess callback, completing the order creation.
Polls the status of the requestId until it reaches a terminal state.