Overview
This section outlines the common user journeys that can occur while using the payment system.
Successful Payment
- The customer, on the client's website checks out his/her cart
- A payment
session
is created by the client, and thehosted checkout
process is initiated - The browser redirected to the payment page
- The customer fills in his/her payment information and completes the payment successfully
- The payment gateway redirects to the
return_url
on the clients website along with areference_number
- The client retrieves the transaction status based on the
reference_number
- The client displays an appropriate message for the customer
Cancelled Payment
- The customer, on the client's website checks out his/her cart
- A payment
session
is created by the client, and thehosted checkout
process is initiated - The browser redirected to the payment page
- The customer clicks cancel
- The payment gateway redirects to the
error_url
on the clients website along with areference_number
- The client retrieves the transaction status based on the
reference_number
- The client displays an appropriate message for the customer
Failed Payment
- The customer, on the client's website checks out his/her cart
- A payment
session
is created by the client, and thehosted checkout
process is initiated - The browser redirected to the payment page
- The customer fills in payment infromation, and process, but an error occurs
- The payment gateway redirects to the
error_url
on the clients website along with areference_number
- The client retrieves the transaction status based on the
reference_number
- The client displays an appropriate message for the customer
Development
As outlined by the above user journeys, the integration with our payment system requires code to be written both on the frontend(client-side) as well as on the backend(server-side).
Backend
On the backend, you will need services that perform the following tasks:
- Acquire a
session_id
using the/create-session
endpoint - Query the result of a transaction using the
/transaction
endpoint
Frontend
On the frontend, you will need pages to handle the below tasks:
- Checkout page: to initiate the checkout process
- Response handler: to handle
success
,failure
orcancel
events
Let us get into the details of this process in the next few sections