It is possible to cancel an unpaid Boleto Flash® payment request before the expiration date. Once cancelled, your customer will not be able to open the link to view the boleto, although this may not prevent a payment to be processed if the customer has already scheduled the payment at their bank.
Your POST must be sent to https://sandbox.pagbrasil.com/api/order/cancel setting the content-type of the request header and body as "x-www-form-urlencoded".
Please note that this URL shall only be used for integration and testing procedures. Once the Payment Service Agreement is signed, you will receive the production environment's URL when you request your account to go live.
Request parameters:
Field | Description | Required | Length |
---|---|---|---|
secret | Secret phrase as defined in the PagBrasil Dashboard | Yes | 128 |
pbtoken | Token assigned to your merchant account. Your token is displayed at the PagBrasil Dashboard, menu Account > Settings. | Yes | 32 |
order | Order number | Yes | 64 |
Note:
The response for the "/api/order/cancel" call will be an XML with the order details, in exactly the same format as a "/api/order/get" response (see item 5.2).
From the response's parameter "order_status" you will be able to determine if the order was successfully cancelled or not.
A cancelled order has the payment status "PR" (Payment Rejected). Please refer to item 5.2 for further information on the XML elements of the response.