Skip to main content

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_url parameter 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 methodPOST
Request body formatJSON
HeaderValueDescription
SignaturecalculatedSignature string. For the information on how the signature is generated, see Signature generation.
Content-TypejsonHTTP header indicating the media type of the resource sent in the callback body.

Parameters that may be passed in callbacks:

Object/ParameterTypeDescription
client_idintegerAccount ID you obtained from PagaSul when integrating.
client_payment_idstringPayment ID unique within your system.
payment_idintegerPayment ID the PagaSul payment platform assigned to the payment.
payment_typestringPayment direction, e.g., pay-in.
currencystringCode of the payment currency in the ISO-4217 alpha-3 format.
amountnumberPayment amount in major currency units, e.g., 12.34 for the 12 dollars 34 cents amount.
payment_methodstringPayment method's code.
statusstringStatus the payment is currently in. See the statuses that may be passed in this parameter in the Payment statuses section.
result_codestringRequest processing result code. See the codes that may be passed in this parameter in the Result codes section.
result_messagestringDescription of the request processing result code.
checkout_dataobject
checkout_data.methodstringHTTP method for retrieving the checkout page, e.g., POST or GET.
checkout_data.urlstringURL 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"
}'