Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Field

Description

Length

secret

Secret phrase as defined in the PagBrasil Dashboard

128

pbtoken

Token assigned to your merchant account. Your token is displayed at the PagBrasil Dashboard, menu Account > Settings.

32

order

Order number

64

amount_refunded

Amount requested to be refunded (Brazilian Real)

57.2

customer_bank

Only used when a refund is rejected. See note 6.2, item "b".

40

customer_branch

Only used when a refund is rejected. See note 6.2, item "b".

12

customer_account

Only used when a refund is rejected. See note 6.2, item "b".

12

...

6.2. Receiving the refund confirmation

You need to login to the PagBrasil Dashboard and specify the URL you want PagBrasil to notify you when the refund is processed.

...

Field

Description

Length

secret

Secret phrase as defined in the PagBrasil Dashboard

128

payment_method

Value "D". This value specifies that the data being posted is the response to a debit card refund request.

1

order

Order number

64

amount_brl

Amount in Brazilian Real

57.2

amount_refunded

Amount refunded (Brazilian Real)

57.2

payment_status

P = Refund Processed See note "a"   
J = Refund rejected See note "b"   

1

signature

HMAC-MD5 hash that authenticates the IPN. See note "c"   

32

...

b) The payment status is returned as "J" (Refund rejected) when the refund request was not accepted by the debit card issuing bank. This usually happens when the order is older than 300 days. In this case our system will also send a notification to the e-mail address you registered at the PagBrasil Dashboard, and you may refund the transaction through PagBrasil via bank transfer, by including the following parameters when requesting the refund via API:

customer_bank = Customer's bank number (número do banco). Please find the bank numbers here (column "COD COMPENSAÇÃONúmero Código").
customer_branch = Branch number (agência).
customer_account = Account number (conta corrente). Must include the hyphen and the verification digit; for example: "12345-6".

...

c) To authenticate the legitimacy of the IPN, you may check the parameter secret and/or the parameter signature, which is a HMAC-MD5 hash based on three parameters and a key defined at the PagBrasil Dashboard, menu Account > Settings. The HMAC-MD5 source string is the concatenation of the values of the parameters order, amount_brl and payment_status and the total length for these three parameters. For example, if parameter order="1234567890", amount_brl="39.50" and payment_status="P", the parameter signature would be "3093a7dffa0c04e74e827d1b52ef514e". In this example, the hash for the signature was computed using the string "123456789039.50P16" with the key "36d5f7184574caf84f5b48530ac0d690".