1. Initialize the Vaultera Switch SDK
Initialize Vaultera Switch Headless SDK onto your app with your publishable key. To get a Publishable Key please find it here.- HTML + JavaScript
2. Create a Payment Intent
Make a request to the endpoint on your server to create a new Payment. TheclientSecret returned by your endpoint is used to initialize the payment session.
Important: Make sure to never share your API key with your client application as this could potentially compromise your security
3. Initialize your Payment Session
Initialize a Payment Session by passing the clientSecret to theinitPaymentSession
- JavaScript
4. Craft a customized payments experience
Using thepaymentSession 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.
- JavaScript
confirmWithCustomerDefaultPaymentMethod(payload)
ConfirmParams object