SIBS Payment Gateway Integration Guide
Overview
SIBS Payment Gateway provides to merchants an all-in-one on-line payment solution.
Get StartedAvailable Payment Methods
MB WAY
payments using mobile phone number
MULTIBANCO
payments using MULTIBANCO reference ("Pagamento de Serviços")
CARD
payments using credit or debit card details
Available Integration Options
SPG Payment Form
simple integration with javascript based widget
Server-to-server Integration
direct integration and full UX/UI flexibility
Plugin Integration
direct integration and full UX/UI flexibility
Form Integration
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.
1. Prepare the checkout
First, perform a server-to-server POST request to prepare the checkout with the required data, including the order type, amount, currency and payment methods allowed. The response to a successful request is a JSON with an transactionID, which is required in the second step to create the payment form.
POST /api/v1/payments
Request Body
Response Body
2. 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
transactionIDthat you got in the response from step 1 - The
{formContext}that you get in response from step 2, a{formConfig}(2.1) and optionally{formStyle} (2.2)
<script src="/assets/js/widget.js?id={transactionID}"></script>
<form class="paymentSPG" spg-context="{formContext}"
spg-config="{formConfig}" spg-style="{formStyle}"><form>
2.1 Form Configuration
Configures the redirectUrl which is the page on your site where the customer should be redirected to after the payment and other configurations
2.2 Form Style
Optional parameter that allows the user to change the form style
(Attention: After perform the payment the form will redirect this page to
the url redirectUrl defined in 2.1)
3. Get the payment status
Once the payment has been processed, the customer is redirected to your redirectUrl (defined in 2.1), you can check the status of your transaction making a GET request.
GET /api/v1/payments//status
Response Body
Server-to-Server Integration
Server-to-Server Integration is based on the following steps:
1. Prepare the checkout: sends payment data, including payment method data.
2. Display payment method option to customer: displays payment method option to customer.
3. Inquiry QR Code capture status: gets the QR Code capture status.(1)
4. Update payment method data: sends payment method and its required data.
5. Get the payment status: gets the payment status(2)
1- This step should only be performed when QR Code payment method is in place. It should be performed in loop (every 5 seconds) until either get a response that the QR Code was successfully captured or that the customer selected another form of payment.2- For MB WAY payments using mobile phone number, this step should be performed in loop (every 5 seconds up to 4 minutes) until get a response that payment was accepted/rejected by customer.
MB WAY with mobile phone number
Purchase
POST /api/v1/payments/ /mbway-id/purchase
Request Body
Response Body
MULTIBANCO
Generate
POST /api/v1/payments/ /service-reference/generate
Request Body
Response Body
Card
Purchase
POST /api/v1/payments/ /card/purchase
Request Body
Response Body
Configuration on Server-To-Server
Note that all the following requests need an Authorization Header with the "transactionsSignature" returned from checkout operation.
In this requests, the Bearer Token is replaced by the checkout response "transactionSignature". Example:
Authorization: Digest <transactionSignature>
SPG BackOffice APIs
There are also provided BackOffice APIs to perform a recurring, capture, refund or cancellation.
Recurring
POST /api/v1/payments/ /recurring
Request Body
Response Body
Capture
POST /api/v1/payments/ /capture
Request Body
Response Body
Refund
POST /api/v1/payments/ /refund
Request Body
Response Body
Cancellation
POST /api/v1/payments//cancellation
Request Body
Response Body
Configurations
Note that all the following requests need an Authorization Bearer Token and Client Id provided by SIBS. You can download your Token in SIBS Business Portal and Generate your Client Id in SIBS API Market.
This information is sent using HTTP Headers. The Authorization Beater Token is sent on the "Authorization" header and the Client Id on the "X-IBM-Client-Id" header. Examples: