mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 03:13:56 +08:00
3.9 KiB
3.9 KiB
Try out hyperswitch sandbox environment
Table Of Contents:
Set up your accounts
- Sign up on the payment connector's (say Stripe, Adyen, etc.) dashboard and store your connector API key (and any other necessary secrets) securely.
- Sign up on our dashboard.
- Create a merchant account on our dashboard and generate your API keys. Ensure to save the merchant ID, API key and publishable key displayed on the dashboard securely.
- Configure the merchant return URL and the webhooks URL, which will be used on completion of payments and for sending webhooks, respectively.
- Create a payments connector account by selecting a payment connector among the options displayed and fill in the connector credentials you obtained in Step 1.
- Sign up or sign in to Postman.
- Open our Postman collection and switch to the
"Variables" tab.
Add the API key received in Step 3 under the "current value" column for the
api_keyvariable.
Try out our APIs
Create a payment
-
Open the "Quick Start" folder in the collection.
-
Open the "Payments - Create" request, switch to the "Body" tab and update any request parameters as required. Click on the "Send" button to create a payment. If all goes well and you had provided the correct connector credentials, the payment should be created successfully. You should see the
statusfield of the response body having a value ofsucceededin this case.- If the
statusof the payment created wasrequires_confirmation, setconfirmtotruein the request body and send the request again.
- If the
-
Open the "Payments - Retrieve" request and click on the "Send" button (without modifying anything). This should return the payment object for the payment created in Step 2.
Create a refund
- Open the "Refunds - Create" request in the
"Quick Start" folder folder and switch to the "Body" tab.
Update the amount to be refunded, if required, and click on the "Send" button.
This should create a refund against the last payment made for the specified
amount.
Check the
statusfield of the response body to verify that the refund hasn't failed. - Open the "Refunds - Retrieve" request and switch to the
"Params" tab.
Set the
idpath variable in the "Path Variables" table to therefund_idvalue returned in the response during the previous step. This should return the refund object for the refund created in the previous step.
That's it! Hope you got a hang of our APIs. To explore more of our APIs, please check the remaining folders in the Postman collection.