Versions Compared

Key

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

...

Parameter

Attribute

Description

Required

Length

cc_prevsaved

PB_cc_prevsaved

To be used when charging a previously saved credit card on subsequent purchases. See note "i"   

No

80

cc_holder

PB_cc_holder

Credit card holder's name

Yes*

30

cc_number

PB_cc_number

Credit card number

Yes*

14 - 19

cc_expiration

PB_cc_expiration

Credit card expiration date.
Format: MM/YY.

Yes*

5

cc_cvv

PB_cc_cvv

Card verification value (security code).

Yes*

3 - 4

wallet_type

PB_wallet_type

Used only when processing Samsung Pay transactions. See note "k"   

No

2

wallet_payload

PB_wallet_payload

Used only when processing Samsung Pay transactions. See note "k"   

No

Unlimited

soft_descriptor

PB_soft_descriptor

Text identification that will appear on the customer's credit card statement next to the payee name (PB). See note "l"   

No

13

cc_save

PB_cc_save

Defines if the credit card information is stored at PagBrasil's server for future charges. This parameter must be always equal to "0" (zero) except when the customer has explicitly authorized future charges on their credit card. See note "m"   

Yes

1

cc_auth

PB_cc_auth

Used only for credit card transactions.
0 = Authorize and capture
1 = Authorize only
2 = Capture a previously authorized transaction
See note "n"   

No

1

Notes:

Anchor
#44.5.a#4
4.5.a
a) All fields are required except when noted otherwise.

...

Anchor
#44.5.b#4
4.5.b
b) If a parameter is sent with a size greater than the maximum allowed, process will not be aborted but the value will be truncated.

...

Anchor
#44.5.c#4
4.5.c
c) You need to let the customer selects if they are a "pessoa física" (individual) or a "pessoa jurídica" (company). If they select "pessoa física", you need to ask for their full name and CPF (see note "b"). 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 "b").

...

Anchor
#44.5.d#4
4.5.d
d) There are two types of tax IDs in Brazil: CPF (used by individuals, having 11 digits) and CNPJ (used by companies, having 14 digits). PagBrasil.JS will automatically remove the separators (e.g. "123.123.123-34" to "12312312334").

...

For testing purposes, please use CPF 91051605962 and CNPJ 78797547000157.

...

Anchor
#44.5.e#4
4.5.e
e) The parameter address_state must be the official abbreviation used in Brazil. To prevent customer from entering an invalid state, please see table below to create a select object (drop-down list).

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
#44.5.f#4
4.5.f
f) The order number must be unique for a specific customer. If you try to submit two different transactions with the same order number but a different customer_taxid, PagBrasil.JS calls back with error "Duplicated order.". Our server will also respond with "Duplicated order." if you try to re-submit an order that ir already paid. If parameters order and customer_taxid are equal to a previously submitted unpaid order, the previous order will be updated with the new information provided.
Characters allowed in the parameter order (regular expression): [a-zA-Z0-9\.\-\_\/]

...

Anchor
#44.5.g#4
4.5.g
g) The parameter product_name must contain the name of the product or service purchased, and it is required for compliance purposes.

...

Anchor
#44.5.h#4
4.5.h
h) The minimum amount of a credit card installment is BRL 5. For example, a purchase amount of BRL 20 can be paid to a maximum of 4 installments. If e.g. an amount of BRL 20 is submitted to be charged in 5 installments, the transaction will always be declined by the credit card company.

...

Anchor
#44.5.i#4
4.5.i
i) Parameter cc_prevsaved may be used to charge a previously saved credit card. You may use it to refer to a credit card used in a previous order, or a token created using the method doAddToken (see item 5.1).

...

  • IMPORTANT: The merchant using PagBrasil is contractually obliged to inform the end customer by email between 5 - 15 days before an upcoming recurring payment charge. Therefore the implementation of such an automated email must be an integral part of the recurring payment implementation.

...

Anchor
#44.5.j#4
4.5.j
j) Current accepted brands:

Brand

Code

CC Length

CVV Length

Sample

Mastercard

M

16

3

5555666677778884

Visa

V

16

3

4984123412341234

Diners

D

14

3

30111122223331

Amex

A

15

4

376411112222331

Hipercard

H

16

3

6062111122223339

Elo

E

16

3

6362970000457013

...

Anchor
#44.5.k#4
4.5.k
k) To process a Samsung Pay payment, please set parameter wallet_type="SP". You will also need to send us the parameter wallet_payload with the payload returned by Samsung Pay (entire JSON response). Credit card details will be decrypted from the wallet_payload, thus you will not submit parameters cc_holder, cc_number, cc_expiration and cc_cvv.

Please contact us to enable Samsung Pay in your account.

...

Anchor
#44.5.l#4
4.5.l
l) By default a transaction is shown on the customer's credit card statement as "PB*XXXXXXX, PORTO ALEGRE".

...

The soft_descriptor parameter accepts letters, digits and spaces (regular expression [a-zA-Z0-9\s]). The string is truncated to the maximum allowable length of 13 characters. When receiving the parameter soft_descriptor with invalid characters, we will accept it but remove those characters from the string. When this parameter is blank, it is replaced by the default soft descriptor defined in the PagBrasil Dashboard. If there's no default soft descriptor defined in the dashboard, this parameter is replaced by the merchant commercial name.

...

Anchor
#44.5.m#4
4.5.m
m) When parameter cc_save is set to "1" our server will allow the merchant to charge the same credit card again in the future without needing to inform parameters cc_holder, cc_number, cc_expiration and cc_cvv. To define cc_save=1 you need to have the customer explicitly authorized you to process recurring payments using their credit card. To charge a previously saved credit card please use the parameter cc_prevsaved. To delete a previously saved credit card please refer to the credit card documentation, item 7. Recurring payments are disabled by default. If you want to use the parameter cc_save for recurring payments, please contact PagBrasil for further information. Please note that when the order is not successfully authorized cc_save will not be applied. That prevents invalid credit card information from being stored.

...

Anchor
#44.5.n#4
4.5.n
n) Please find below information on each cc_auth value.

...

  • Charge BRL 100 to a credit card:

    order=test1
    amount_brl=100
    cc_auth=0

  • Pre-authorize BRL 100 and then later capture (charge) the full amount:

    Step 1:
    order=test2
    amount_brl=100
    cc_auth=1

    Step 2: (up to 14 days later than Step 1)
    order=test2
    amount_brl=100
    cc_auth=2

  • Pre-authorize BRL 100 and then later charge only BRL 75 (partial capture):

    Step 1:
    order=test3
    amount_brl=100
    cc_auth=1

    Step 2: (up to 14 days later than Step 1)
    order=test3
    amount_brl=75
    cc_auth=2

...

Anchor
#44.5.p#4
4.5.p
p) To emulate a successful payment, please refer to the documentation of each specific payment method available.