...
Anchor | ||
---|---|---|
|
...
|
...
4.1. Sending the request
Your POST must be sent to https://sandbox.pagbrasil.com/api/order/add setting the content-type of the request header and body as "x-www-form-urlencoded".
...
That allows them to view/print the boleto at a later time. PagBrasil offers a service that automatically sends confirmation e-mails and SMS' to the customers, and a payment reminder before the boleto expires. Please contact us for further information on this service.
...
Anchor | ||||
---|---|---|---|---|
|
If you try to submit two different transactions with the same order number but a different customer_taxid, our server will respond with the message "Duplicated order.".
...
Characters allowed in the parameter order (regular expression): [a-zA-Z0-9\.\-\_\/]
...
Anchor | ||||
---|---|---|---|---|
|
...
Anchor | ||||
---|---|---|---|---|
|
If they select "pessoa física", you need to ask for their full name and CPF (see note "g").
If they select "pessoa jurídica", you need to ask for the "razão social" (official company name registered at the local tax authority) and CNPJ (see note "g").
...
Anchor | ||||
---|---|---|---|---|
|
CPF: 11 digits, with no separator. Customers use to write CPFs with separators (example: 123.123.123-12), but you must allow to enter only digits from 0 to 9 (example: 12312312312).
...
For testing purposes, please use CPF 91051605962 and CNPJ 78797547000157.
...
Anchor | ||||
---|---|---|---|---|
|
State | Abbreviation |
---|---|
Acre | AC |
Alagoas | AL |
Amapá | AP |
Amazonas | AM |
Bahia | BA |
Ceará | CE |
Distrito Federal | DF |
Espírito Santo | ES |
Goias | GO |
Maranhão | MA |
Mato Grosso | MT |
Mato Grosso do Sul | MS |
Minas Gerais | MG |
Pará | PA |
Paraíba | PB |
Paraná | PR |
Pernambuco | PE |
Piauí | PI |
Rio de Janeiro | RJ |
Rio Grande do Norte | RN |
Rio Grande do Sul | RS |
Rondônia | RO |
Roraima | RR |
Santa Catarina | SC |
São Paulo | SP |
Sergipe | SE |
Tocantins | TO |
...
Anchor | ||||
---|---|---|---|---|
|
...
...
You need to login to the PagBrasil Dashboard and specify the URL (webhook) you want PagBrasil to send the IPN (Instant Payment Notification) to with the list of Boletos Bancários paid.
...
Field | Description | Required | Length |
---|---|---|---|
secret | Secret phrase as defined in the PagBrasil Dashboard. | Yes | 128 |
payment_method | Value "B". This value specifies that the data being posted is for paid boletos bancários (either for traditional Boletos Bancários or Boleto Flash®). | Yes | 1 |
content | XML as described. See note "c" | Yes | Unlimited |
signature | HMAC-MD5 hash that authenticates the parameter content. | Yes | 32 |
Notes:
Anchor | ||||
---|---|---|---|---|
|
It is a HMAC-MD5 hash based on the values of all XML elements and a key defined at the PagBrasil Dashboard, menu Account > Settings. The HMAC-MD5 source string is the concatenation of all the elements that are present in the XML and its total length. The XML examples below describe how the signature is computed.
...
Please note that any IPN can be resent manually at any time at the PagBrasil Dashboard, menu IPN History.
...
Anchor | ||||
---|---|---|---|---|
|
Field | Description |
---|---|
order | Order number you informed when requesting the boleto (item 4.1). |
payment_date | Date the Boleto Bancário was paid by the customer (not considering holidays, as explained in item 4.3). Format: MM/DD/YYYY. |
amount_paid | Amount paid by the customer in Brazilian Real – may not be the exact amount due, so it must be validated and treated according to your policy. |
amount_due | Amount printed in the Boleto Bancário (as informed in the parameter amount_brl – item 4.1). |
param_url | String (encoded) that was passed to our server when the order was submitted. See item 4.1. |
...
Anchor | ||||
---|---|---|---|---|
|
Code Block | ||
---|---|---|
| ||
content="<boletos_list> <boleto> <order>1234567890</order> <payment_date>10/15/2010</payment_date> <amount_paid>29.95</amount_paid> <amount_due>29.95</amount_due> </boleto> <boleto> <order>1234567891</order> <payment_date>10/15/2010</payment_date> <amount_paid>15.50</amount_paid> <amount_due>16.50</amount_due> </boleto> <boleto> <order>1234567892</order> <payment_date>10/15/2010</payment_date> <amount_paid>45.00</amount_paid> <amount_due>35.00</amount_due> <param_url>customer_id=12345%26newsletter=yes</param_url> </boleto> </boletos_list>" |
...
In this example, the hash for the signature was computed using the concatenation of the parameter content and its total length (555) with the key "36d5f7184574caf84f5b48530ac0d690".
...
Anchor | ||
---|---|---|
|
...
|
...
4.3. Processing Schedule
Boletos Bancários are processed in the next day after it was paid (until 10 AM – Brasília time zone).
...