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 integrated into thepsdk-submit-button
component.
To use Headless checkout to accept payments via Apple Pay:
- Add the handling of the
show_fields
event for displaying additional fields.
Example:
Copy
- typescript
headlessCheckout.form.onNextAction((nextAction) => {
switch (nextAction.type) {
case 'show_fields':
this.handleShowFieldsAction(nextAction);
}
});
- Add the
psdk-payment-form
component to the HTML markup of the payment UI to display additional fields.
Example:
Copy
- html
@if (showAdditionalFields) {
<psdk-payment-form></psdk-payment-form>
<psdk-submit-button text="Pay" />
}
Was this article helpful?
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.Found a typo or other text error? Select the text and press Ctrl+Enter.