Payment Form
The Form integration solution enables merchants to integrate either to the Gateway thru a secure Form avoiding a PCI-DSS Certification.
This is the quickest and simplest way to integrate allowing merchants to use 3 different payment methods (Credit Cards, Pay by Link and BLIK) using a single Form..
Besides this, Form integration offers three types of layouts to suit better the merchant needs.
Form Integration is based on three simple steps:
- Prepare the checkout: sends payment data, including payment method data.
- Create the payment form: displays a Payment Form to allow customers submit payment method data.
- Get the payment status: gets the payment status.
Prepare the Checkout
Firstly, perform a server-to-server POST request to prepare the checkout with the required data, where you should include the payment type, amount, currency and payment methods allowed.
The JSON of your POST body, can be composed of various Complex Types:
The response to a successful request is a JSON with an transactionID, which is required in the second step to create the payment form.
With the transactionID, will be present as well a formContext that will be used on the following step
Create the Payment Form
To create the payment form you just need to add the following lines of HTML/Javascript to your page and populating the following variables:
- The checkout’s transactionID that you got in the response from step 1:
<script src="https://stargate-cer.qly.site1.sibs.pt/assets/js/widget.js?id={transactionID}"></script>
- The
{formContext}
that you get in response from the firs step, a{formConfig}
and optionally{formStyle}
<form class="paymentSPG" spg-context="{formContext}" spg-config="{formConfig}" spg-style="{formStyle}"><form>
{formConfig}
and optionally {formStyle}
are importante to being able to create the from correctly. About this two below you can find an example of each:
Create the Payment Form
Once the payment has been processed, the customer is redirected to your redirectUrl (defined in "spg-config"
code>), you can check the status of your transaction making a GET request.
GET {transactionID}/status