Generating a Payment Link
Merchant's Backend - Payment Session Creation
Include a form on the client side (app, dapp, or webpage) to gather and send the order details to the merchant's backend. Add a custom "Pay with Payram" button for the payment option.
On the merchant's server side, implement the logic to process the form data and send a POST request to your Payram backend server to create a payment session.
To obtain a payment link, the merchant's backend needs to send a request with the customer's email, Customer ID, and the payment amount. Sample Request and Response for payment session creation
curl --location 'https://yourdomain.com/api/v1/payment' \
--header 'API-Key: api_key' \
--header 'Content-Type: application/json' \
--data '{
"customerEmail": "abc12@gmail.com",
"customerId": "abc12456",
"amountInUSD": 24.334
}'
When the response is received, extract the
reference_id
and store it in your database to track payments.Then, retrieve the payment URL and redirect the user to that link.
Last updated