Payment Methods Management
Hyperswitch is designed to facilitate the management of saved payment methods
This section guides you through the integration of Hyperswitch Payment Methods Management
1. Setup the server
1.1 Create an ephemeral key
Get your API key from Hyperswitch dashboard.
Add an endpoint on your server that creates an Ephemeral Key. An ephemeral key is a temporary, short-lived key used to securely manage sensitive operations, such as updating or deleting payment methods, without exposing full access credentials. It has a limited validity period and restricted capabilities, ensuring that it can only be used for specific tasks and not for initiating payments. This enhances security by minimizing the risk of unauthorized access and reducing the exposure of sensitive data. Return the secret
obtained in the response to setup Payment Methods Management on client.
2. Build Payment Management Page on the client
2.1 Install the hyper-js
and react-hyper-js
libraries
hyper-js
and react-hyper-js
librariesInstall the packages and import it into your code
2.2 Add hyper
to your React app
hyper
to your React app2.3 Load hyper-js
hyper-js
Call loadHyper
with your publishable API keys to configure the library. To get an publishable Key please find it here.
2.4 Fetch the Payment
Make a request to the endpoint on your server to create a new Ephemeral Key. The ephemeralKey
returned by your endpoint is used to fetch all the customer saved payment methods.
2.5 Initialise HyperManagementElements
HyperManagementElements
Pass the promise from loadHyper
to the HyperManagementElements
component. This allows the child components to access the Hyper service via the HyperManagementElements
parent component. Additionally, pass the ephemeralKey
in options to the HyperManagementElements
component.
2.6 Add the Payment Methods Management Element
Add the PaymentMethodsManagementElement
to your Payment Management Form. This embeds an iframe with a dynamic form that displays saved payment methods, allowing your customer to see all their saved payment methods and delete them.
Congratulations! Now that you have integrated the Hyperswitch Payment Methods Management on your app, you can customize the it to blend with the rest of your app.
Last updated