...
Steps | What to do |
---|---|
| Register with Razorpay and get an API key |
| Create the app |
| Set up basic app information |
| Set up app authentication |
| Add the "create payment link" action and edit action information and inputs |
| Edit subflow for the action and get action outputs |
| Edit action outputs |
| Install the draft app and test it |
| Add a one-time URL to receive the payment result |
10. Triggers | Add a trigger to send payment result |
11. Testing | Test again |
...
Register
First thing first, registers a Razorpay account and get your API key in your Settings - API Key:
...
...
Create
...
On your dashboard, follow steps 1 to 7 in the above screenshot to create a version 2 app and enter the app builder.
...
Settings
...
In the settings section, click on Edit to edit app information including app name, description, logo and cover image.
...
Users can view your app information before they download your app.
...
Auth
According to Razorpay Auth Document, key_id
and key_secret
are required with Basic Auth authentication.
...
Click on Save when you finish adding key_id
and key_secret
:
...
...
Actions - Inputs
Now we have set up the authentication part of your app, let's add actions!
...
After editing the action information and inputs, create a subflow to run when users call this action:
...
...
Flows
Go to the Flows section and enter the subflow we just created:
...
Info |
---|
TIP - When you use |
For authentication, we've mentioned Razorpay API is using Basic Auth:
...
Save and publish your subflow, then let's get back to the Actions section:
...
Actions - Outputs
...
Add the 2 outputs and click on 2 Save buttons to save not only the output editing, but also the action editing.
...
Testing
On your dashboard, follow the screenshots below to install your app in the draft version since it hasn't been published yet:
...
Fill in your credentials and save:
...
The action seems working just fine!
...
One Time Urls
Your app is almost there! Wait, the payment is done on Razorpay's website, how do I know was the payment paid or failed? Well, payment providers usually provide a parameter called Callback URL:
...
Listen to payload for a live test. Please note that the test URL need to be pasted in "Test body contents" instead of "Body content":
...
When you finish, click on Test and you will get a payment link as you have seen before. Visit the payment link and make a test payment:
...
Save the editing and publish the subflow.
...
Triggers
The app now can receive payment results from Razorpay, let's send the result back to the chatbot via a trigger.
...
After that, we can fire the trigger in the subflow which the one-time URL runs when payment is received:
...
...
Testing
Info |
---|
TIP - Since your app is still in the draft version, any changes made to the app will be updated to all installed apps as well. Simply refresh the webpage to get the most updated version of the app. |
...