Getting started: single payment
Three steps are required for integrating a payment form on the merchant website:
- Initialize the embedded form
- Display the embedded form
- Check the transaction status and the end of payment
The following diagram presents the interactions between the different actors (embedded form, merchant server, payment gateway) at each of these stages:
Payment gateway server
1. Initializing the form
Before displaying a new payment form on the merchant website, you must initialize the form by generating a formToken that summarizes all the payment related options.
In order to create a formToken, you must call the Charge/CreatePayment REST Web Service via your server:
|1||Call to the Charge/CreatePayment REST Web Service via merchant servers.|
|2||Reception of the result containing the formToken.|
The formToken is valid for 15 minutes.
See the list of use cases that will help you initialize your form.
2. Displaying the form
It is imperative for the main library to be loaded very early on, well before the other JS libraries used on your page :.
Once the form is displayed, the buyer can enter their bank details. If the payment is rejected, the buyer stays on the merchant website. If the payment is accepted, the transaction details are sent to the merchant server.
3. Checking the transaction status
|6||Once the transaction has been processed, we make a call via our servers to the URL specified by you. The complete Transaction object will be sent to allow you to update your information system before the browser return. The IPN (Instant Payment Notification).|
Processing the IPN allows you to update your information system more securely and guarantees that you will not lose any payments if the Buyer loses their Internet connection. For more information, see the article IPN: Presentation.
Let’s get started
After this theoretical part, it is time to move on to the practical steps and Create a formToken.