Creating Payment Session
We use sessions to securely redirect buyers from the merchant's e-commerce store to our PayTo customer experience. Once redirected to us, buyers can observe their PayTo payment being processed to completion in real-time.
Payment Session Flow
Payment Session API
To successfully create a new Payment Session and redirect the buyer to us, you must use the POST Payment Session API as follows:
- Supply the buyer identifier and name for whom the session is being created.
Buyer
We expect the buyer to exist in our platform from a prior Checkout Session or Instrument Session activity.
- Specify the instrument identifier under which this payment will be initiated.
Instrument
Please ensure the instrument belongs to this buyer, otherwise we will reject your Payment Session request.
- Specify the payment identifier and the amount to be initiated. This identifier needs to be unique so you can always refer back to it.
Payment Reference, Description, and Creditor Reference
You may provide optional references to be included as part of the PayTo payment. These references will be visible in the buyer's banking statement.
- Supply a return URL where we redirect the buyer back upon completion. Typically this would be the checkout or the order confirmation page.
API Response
We will respond immediately, and provide you with the redirect URL for you to redirect the buyer's browser.
Buyer redirected to Wpay
Once the buyer is redirected to Wpay, the Payment Session is launched, and the buyer will be able to:
- View the payment being processed in real-time,
- View the payment outcome.
Buyer redirected back to merchant
Once we return the buyer back to you, the Payment Session will be closed. To find out the outcome we recommend that you:
-
Listen to our Payment Events notifications. These will be sent to you at the completion of each step and before the browser redirect back takes place:
- PayTo Payment Completed
- PayTo Payment Rejected
-
Call our Session Details API in the case that you do not receive any event notifications from us. This API will confirm the latest status of the session and the payment requested to be initiated.
Updated 4 months ago