Skip to main content
Beta in Progress – The beta version is under active development and coming soon to our platform.
Pesaswap 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

1. Initialize the Pesaswap SDK

Initialize Pesaswap Headless SDK onto your app with your publishable key. To get a Publishable Key please find it here.

2. Create a Payment Intent

Make a request to the endpoint on your server to create a new payment. The clientSecret returned by your endpoint is used to initialize the payment session.
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 the initPaymentSession.

Options (Required)

4. Craft a Customized Payments Experience

Using the paymentSession object, you can fetch the customer’s default payment method data and confirm the payment using confirmWithCustomerDefaultPaymentMethod.

Payload for confirmWithCustomerDefaultPaymentMethod(payload)

Options (Required)

ConfirmParams Object