Callback
Callback is a system message that the Pagasul payment platform sends to your system to pass some information, e.g., payment result.
PagaSul sends callbacks to either one of the following URLs:
- the URL that you provide Pagasul with when integrating
- the URL that you pass in the
payment_options.callback_urlparameter of your payment request (if you pass this parameter in the request, the PagaSul payment platform will ignore the URL you provided when integrating and will send callbacks for this specific payment to the URL passed in the parameter)
Check out the information below to learn more details about callbacks the PagaSul payment platform sends to your system.
| HTTP request method | POST |
| Request body format | JSON |
| Header | Value | Description |
|---|---|---|
| Signature | calculated | Signature string. For the information on how the signature is generated, see Signature generation. |
| Content-Type | json | HTTP header indicating the media type of the resource sent in the callback body. |
Parameters that may be passed in callbacks:
| Object/Parameter | Type | Description |
|---|---|---|
client_id | integer | Account ID you obtained from PagaSul when integrating. |
client_payment_id | string | Payment ID unique within your system. |
payment_id | integer | Payment ID the PagaSul payment platform assigned to the payment. |
payment_type | string | Payment direction, e.g., pay-in. |
currency | string | Code of the payment currency in the ISO-4217 alpha-3 format. |
amount | number | Payment amount in major currency units, e.g., 12.34 for the 12 dollars 34 cents amount. |
payment_method | string | Payment method's code. |
status | string | Status the payment is currently in. See the statuses that may be passed in this parameter in the Payment statuses section. |
result_code | string | Request processing result code. See the codes that may be passed in this parameter in the Result codes section. |
result_message | string | Description of the request processing result code. |
checkout_data | object | |
checkout_data.method | string | HTTP method for retrieving the checkout page, e.g., POST or GET. |
checkout_data.url | string | URL to redirect the customer to. |
Here is an example of a callback you may receive from the PagaSul payment platform.
--header 'Content-Type: application/json'
--header 'Signature: NTU1YjUwY2M1MTU3ZjE2ZmY5MjMDI1lZNDQ2NDQ='
--data '{
"client_id": 123,
"client_payment_id": "payment_35",
"payment_type": "pay-in",
"payment_id": 301150550709,
"payment_method": "BR.PIX",
"currency": "BRL",
"amount": 192.21,
"status": "redirect",
"checkout_data": {
"method": "GET",
"url": "https://example.com/redirect"
},
"result_code": "0",
"result_message": "payment processing"
}'