Integrate SDK on application side

After installing and initializing SDK:

  1. Initialize the payment UI specifying the payment method ID and redirect URL:
    • The headlessCheckout.form.init method returns an object used for further interaction with the payment UI.
    • The redirect URL is used to redirect the user, for example, after completing the 3-D Secure verification.
Note

You can’t initialize multiple payment methods on the same page.

When initializing some payment methods, you can get the isFormAutoSubmitted: true parameter in response. It means that the step was automatically skipped because the user didn’‎t have to provide any data in the payment form, e.g., when paying via QR code.

Example:
Copy
Full screen
Small screen
1await headlessCheckout.form.init({
2  paymentMethodId: ID,
3  returnUrl: 'returnUrl',
4});
  1. Add the following components to the HTML markup of the payment UI:
    • Mandatory components:
      • psdk-legal — to display information about legal documents.
      • psdk-total — to display the total purchase amount.
    • Payment form components. You can either use the built-in psdk-payment-form component or manually create payment UI elements using the ready-to-use components.
    • The payment button component — psdk-submit-button.
Example:
Copy
Full screen
Small screen
1<psdk-legal></psdk-legal>
2<psdk-total></psdk-total>
3
4
5<psdk-payment-form></psdk-payment-form>
6<psdk-submit-button text="Pay"></psdk-submit-button>
  1. Add the handling of the check_status event for the payment status change.
Example:
Copy
Full screen
Small screen
1headlessCheckout.form.onNextAction((nextAction) => {
2  switch (nextAction.type) {
3    case 'check_status': {
4      showStatus = true;
5    }
6  }
7});
  1. Add the psdk-status component to the HTML markup of the payment UI to display a payment status.
Example:
Copy
Full screen
Small screen
1@if (showStatus) {
2  <psdk-status></psdk-status>
3}
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: April 30, 2026

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.