Apple Pay

Keep in mind:

  • Payment via Apple Pay is only available on supported devices.
  • The SDK only verifies that a payment can be made on the user’‎s device and sends all required data. The payment is then processed in an external tab: https://secure.xsolla.com/paystation4/payment/external-pages/apple-pay.
  • For convenience, the psdk-apple-pay component is included in the psdk-submit-button component.
Implementation sample
Refer to the detailed sample on GitHub.

How to set it up

To use Headless checkout to accept payments via Apple Pay:

  1. Add the handling of the show_fields event for displaying additional fields.
Example:
Copy
Full screen
Small screen
1headlessCheckout.form.onNextAction((nextAction) => {
2  switch (nextAction.type) {
3    case 'show_fields':
4      this.handleShowFieldsAction(nextAction);
5  }
6});
  1. Add the psdk-payment-form component to the HTML markup of the payment UI to display additional fields.
Example:
Copy
Full screen
Small screen
1<psdk-payment-form></psdk-payment-form>
2<psdk-submit-button text="Pay" />

One-click payment

One-click payment allows users to pay with Apple Pay, a familiar and secure native payment method, on supported devices. To configure one-click payment:

  1. Create a request to enable this option. To do so:

    a. Open your Publisher Account and go to the Support Hub section.

    b. Click Submit request.

    c. In the window that opens, fill in the fields:

    • Summary. For example, Apple Pay one-click payment setup.
    • Description. Specify the domain used for opening the payment UI, e.g., amazing.store.com.
    • Project ID. Select a project ID from the drop-down list. If you want to configure the one-click payment option for multiple projects, specify their IDs in the Description field.

    d. Click Send.

  2. Wait for your domain association file. This step is performed by Xsolla:
    1. Xsolla registers your domain with Apple.
    2. Xsolla receives the domain association file from Apple.
    3. Xsolla emails you the domain association file and provides instructions on where to upload it.
Notice
To ensure that automatic verification of the domain association file completes successfully, check that it is accessible via network requests.
  1. Update the SDK initialization script as shown below:
Copy
Full screen
Small screen
1const config: InitialOptions = {
2  isWebview: false,
3  theme: 'default',
4  language: parameters.language,
5  topLevelDomain: 'amazing.store.com',
6  isApplePayInstantFlowEnabled: true
7};
8
9await initHeadlessCheckoutLib(config);
Note
Refer to the instructions for detailed information about testing Apple Pay in sandbox mode.
Was this article helpful?
Thank you!
Is there anything we can improve? Message
We’re sorry to hear that
Please explain why this article wasn’t helpful to you. Message
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.
Last updated: October 8, 2025

Found a typo or other text error? Select the text and press Ctrl+Enter.

Report a problem
We always review our content. Your feedback helps us improve it.
Provide an email so we can follow up
Thank you for your feedback!
We couldn't send your feedback
Try again later or contact us at doc_feedback@xsolla.com.