Server Setup
1. Create a payment using S2S Call (Recommended)
(We highly recommend using this S2S method for all production activities and functionalities, as it offers greater scalability and enhanced features designed for production environments)
To create a payment intent, send a request to either our sandbox or production endpoint. For detailed information, refer to the API Reference documentation.
Upon successful creation, you will receive a client_secret
, which must be provided to the SDK to render it properly.
2. Create a payment using Hyperswitch Node SDK
(We recommend using this method for local development and quick integration to test various use cases.)
2.1 Install the hyperswitch-node
library
hyperswitch-node
libraryInstall the package and import it in your code
2.2 Create a payment
Before creating a payment, import the hyper dependencies and initialize it with your API key. Get your API key from Hyperswitch dashboard.
Add an endpoint on your server that creates a Payment. Creating a Payment helps to establish the intent of the customer to start a payment. It also helps to track the customer’s payment lifecycle, keeping track of failed payment attempts and ensuring the customer is only charged once. Return the client_secret obtained in the response to securely complete the payment on the client.
3. Integrate Web SDK
To integrate Web SDK, follow Node And React, Node and HTML and Vanilla JS and REST API Integration.
In case your integrating the ExpressCheckout (mentioned later below), instead of creating multiple paymentIntents for the same customer session, you can also use paymentsUpdate API for better analytics.
Last updated