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.
Initialize Pesaswap Headless SDK onto your app with your publishable key. To get a Publishable Key please find it here.
Copy
// Source Hyperloader on your HTML file using the <script /> taghyper = Hyper.init("YOUR_PUBLISHABLE_KEY", { customBackendUrl: "YOUR_BACKEND_URL", // You can configure this as an endpoint for all the API calls such as session, payments, confirm call.});
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.
Using the paymentSession object, you can fetch the customer’s default payment method data and confirm the payment using confirmWithCustomerDefaultPaymentMethod.