Vaultera switch is designed to facilitate the integration and management of payment-related functionalities in a decoupled or headless architecture with flexibility to customize your checkout UI. Customize the payment experience using Headless functions
clientSecret
returned by your endpoint is used to initialize the payment session.
initPaymentSession
options (Required) | Description |
---|---|
clientSecret (string) | Required. Required to use as the identifier of the payment. |
paymentSession
object, the default customer payment method data can be fetched, using which you can craft your own payments experience. The paymentSession
object also exposes a confirmWithCustomerDefaultPaymentMethod
function, using which you can confirm and handle the payment session.
confirmWithCustomerDefaultPaymentMethod(payload)
options (Required) | Description |
---|---|
confirmParams (object) | Parameters that will be passed on to the Switch API. |
redirect (string) | (web only) Can be either ‘always’ or ‘if_required’ By default, confirmWithCustomerDefaultPaymentMethod() will always redirect to your return_url after a successful confirmation. If you set redirect: “if_required”, then this method will only redirect if your user chooses a redirection-based payment method. |
confirmParams | Description |
---|---|
return_url (string) | (web only) The url your customer will be directed to after they complete payment. |