Boleto is a Brazilian alternative payment method provided by PAGSMILE that allows customers to make payments at various locations, including banks, lottery retailers, and authorized agents. It is a popular option for individuals who do not have credit cards or prefer not to use them online. When a customer chooses Boleto as a payment method, they receive a payment slip with a unique barcode and a reference number. This slip can be printed and taken to a participating location to complete the payment, or the customer can use a mobile app or internet banking to scan the barcode and pay electronically.
There are two ways to integrate it: by redirection or push payment.
Integration by redirection
To integrate by redirection, the user must be present at the time of payment, which must be processed through a browser. First we must generate a payment order.
"extra_data": {
"profile": {
"first_name": "Carlos",
"last_name": "Moreno",
"email": "test@gmail.com",
"document_identification_number": "11032341882"
},
"billing_address": {
"address1": "calle",
"city": "",
"state_code": "",
"zip_code": "38082365",
"country": "BRL"
}
}
As service identifier, the service_uuid of the PAGSMILE service you have activated in your Paylands Backend → Manage → Payment Services → Listing must be indicated.
Once the order is generated, the user must be redirected to the payment screen indicating the token of the order and in the query, the name of the APM:
We construct the redirection URL by replacing the token with the value returned in the previous call.
https://api.paylands.com/v1/sandbox/payment/process/{token}?apm=BOLETO
Once the user is redirected to this screen, they will be able to view the payment slip containing the unique reference code and barcode for Boleto. They can either print it and take it to a physical payment location, or scan the barcode with their bank's mobile application or internet banking to make an electronic payment.
Push payment integration
If the merchant prefers to send the reference to the user through a channel other than the browser, it is possible to integrate the push payment method, which will return the reference to the server so that it can be sent to the user.
To do this, we must first generate a payment order. Mandatory with the user's first name, email, document identification number and zip code.
"extra_data": {
"profile": {
"first_name": "Carlos",
"last_name": "Moreno",
"email": "test@gmail.com",
"document_identification_number": "11032341882"
},
"billing_address": {
"address1": "calle",
"city": "",
"state_code": "",
"zip_code": "38082365",
"country": "BRL"
}
}
Then we must launch the push payment request indicating the UUID of the order. The response will contain the payment barcode and bank_code. These fields are included within the payment transaction, in the field payment_data
. An example is included below:
"payment_data": {
"barcode": "23793864800029999003380260980157275200633330",
"bank_code": "21890010070215182080679309377384187050000001125"
}
Once the payment is completed, the merchant will receive the payment notification to the URL indicated in the `url_post' field when generating the payment order.
Testing
For more information on how to test this payment method, visit the PAGSMILE documentation.
Custom fields
Optionally, within the extra_data
we can include the payment_reason
field, which allows us to indicate a description of the payment.
"extra_data": {
"payment": {
"payment_reason": "Payment description"
}
}