Receiving payment method data

To receive payment method data to display to the user in the payment UI, you can use either ready-to-use components, or SDK methods.

Use components

  1. Add the psdk-payment-methods component to the HTML markup of the payment UI to display the list of available payment methods.
Example:
Copy
Full screen
Small screen
<psdk-payment-methods country="US"></psdk-payment-methods>
  1. Add the handling of the selectionChange event sent when the user selects a particular payment method.
Example:
Copy
Full screen
Small screen
const paymentMethods = document.querySelector('psdk-payment-methods');
paymentMethods?.addEventListener('selectionChange', (event) => {
  console.log(event.detail);
});

Use SDK methods

SDK method nameDescription
getRegularMethods
Returns a list of available payment methods.
getQuickMethods
Returns a list of available quick payment methods, e.g., Apple Pay and Google Pay.
getSavedMethods
Returns a list of saved payment methods for a particular user.
Example of calling the getRegularMethods method:
Copy
Full screen
Small screen
const methods = await headlessCheckout.getRegularMethods();
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: March 4, 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!