Response
After sending a request to the PagaSul payment platform, your system should be ready to accept a response which PagaSul returns synchronously, i.e. within the same HTTP session.
The response may contain the following information:
- the data you passed in the initial request
- the payment ID the PagaSul payment platform assigned to your payment
- the status the payment's currently in. To learn more about payment statuses in the PagaSul payment platform, see the Payment statuses and result codes section
- the data you should use to redirect the customer so that they could complete the payment
Check out the information below to learn more details about the responses that the PagaSul payment platform returns to your requests.
| 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 response body. |
Parameters that may be passed in the response:
| 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, pay-out. |
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 response that the PagaSul payment platform may return to a pay-in request.
--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"
}'
Here is an example of a response that the PagaSul payment platform may return to a pay-out request.
--header 'Content-Type: application/json'
--header 'Signature: NTU1YjUwY2M1MTU3ZjE2ZmY5MjMDI1lZNDQ2NDQ='
--data '{
"client_id": 123,
"client_payment_id": "payment_35",
"payment_type": "pay-out",
"payment_id": 301150550709,
"payment_method": "BR.PIX",
"currency": "BRL",
"amount": 192.21,
"status": "new",
"result_code": "0",
"result_message": "payment processing"
}'