Checkout page
RexPay supports a wide variety of methods for your customers to pay you, across a wide range of countries. When accepting payments, you can specify what payment methods you are willing to accept from your customers.
There are two ways to specify your accepted payment methods.
Step 1. Assemble payment details
From your server, call our create payment endpoint with the payment details.
var myHeaders = new Headers(); myHeaders.append("Content-Type", "application/json"); var raw = JSON.stringify({ "reference": "sm23oyr1122", "amount": 2, "currency": "NGN", "userId": "ga@gmail.com", "callbackUrl": "https://your_callback_url.com", "metadata": { "email": "ga@gmail.com", "customerName": "Global Accelerex" } }); var requestOptions = { method: 'POST', headers: myHeaders, body: raw, redirect: 'follow' }; fetch("{{URL}}/api/pgs/payment/v2/createPayment", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));
Step 2: Get a payment link
We will return a link to a payment page. Redirect your customer to this link to make the payment.

After redirecting to the payment URL, you will see the checkout page as shown below.

Step 3: Redirect the customer back to merchant website
When the transaction is completed, we will redirect the customer back to you.
Step 4: After the payment
Three things will happen when payment is done (successful):
- 1We will redirect to your callback URL after payment is complete.
- 2We will send an email receipt to your customer if the payment was successful (if not disabled).
- 3We will send you an email notification (if not disabled).
On your server, you should handle the redirect and always verify the final state of the transaction.
Did you find this page helpful?