Redirect (checkout) flow
The redirect flow is the fastest way to accept payments: you create a transaction, redirect the customer to a page Pesepay hosts, and they pick a payment method and complete the payment there. Pesepay handles the method-specific UI for you — including card entry, which keeps card data out of your systems entirely.
- Customer → Your server Starts checkout
- Your server → Pesepay Create transaction POST /payments/initiate
- Pesepay → Your server redirectUrl + referenceNumber
- Your server → Customer Redirect to Pesepay
- Customer → Pesepay Picks a method and pays
- Pesepay → Payment provider Charges the customer
- Pesepay → Your server Result callback POST resultUrl
- Your server → Pesepay Confirm the status GET /payments/check-payment
Building it
Section titled “Building it”- Build the request — amount, currency, reason for payment, plus your
resultUrlandreturnUrl. - Encrypt and send it to Initiate Transaction.
- Decrypt the response to get a
redirectUrlandreferenceNumber. Store thereferenceNumberagainst your order now. - Redirect the customer’s browser to
redirectUrl. - The customer chooses a method and pays on Pesepay’s page.
- They land back on your
returnUrl, and separately, Pesepay posts the final status to yourresultUrl— see The Result Callback. - Confirm before you fulfil with
Check Payment Status, and only act on
SUCCESS.
Full request/response fields, headers, and code samples in five languages: Initiate Transaction reference →