Credit and Debit cards
You can create the purchase using API or Redirection flow.
Card payments using API flow
Using this flow, you can offer the possibility to receive payments using cards without the intervention of the payer.
Request parameters
You need to include specific fields for this payment method to work correctly. Check the Purchase operation article for details on authentication, languages of the response, and basic purchase parameters such as amount and currency.
Property | Type | Mandatory? | Description |
---|---|---|---|
TrxToken | string | Yes | The token that identifies the customer’s card. For more information about how to create the token, refer to Customers. |
TargetCountryISO | string | Yes | Indicate the destination country. |
Installments | integer | No | This parameter refers to the number of payments that a credit card purchase is divided into. You can select 1 , 3 , 6 , 9 , and 12 installments.Default value is 1 . |
Customer → Email | string | Yes | Customer’s email. |
Customer → FirstName | string | No | Customer’s first name. |
Customer → LastName | string | No | Customer’s last name. |
Customer → DocumentNumber | string | No | Customer’s Document Number. |
Customer → PhoneNumber | string | No | Customer’s phone number. |
Customer → Address → Country | string | No | Customer’s Country. |
Customer → Address → State | string | No | Customer’s State. |
Customer → Address → City | string | No | Customer’s City. |
Customer → Address → AddressDetail | string | No | Customer’s Address Detail. |
Customer → Address → PostalCode | string | No | Customer’s Postal Code. |
AntifraudData → AntifraudFingerprintId | string | Yes | Session Id (AntifraudFingerprintId ) which is obtained by the javascript function getSessionAntifraud. |
CustomerIP | string | No | IP of to the customer connected to the commerce website. |
Info
Remember that for the Anti-fraud system’s correct functioning, we suggest sending additional data described in the section Anti-fraud.
Request example
{
"TrxToken": "OT__6dHAgJo6qeg62qIroA7H7_f_NWZZ6IEx4jiYpVJ8SzQ_",
"UniqueID": "paymentID3022",
"Capture": true,
"TargetCountryISO": "MX",
"Currency": "MXN",
"Amount": 25000,
"Installments": 1,
"Order": "CH2023-001",
"Description": "Purchase Test",
"Customer": {
"FirstName": "Joao",
"LastName": "Silva",
"ReferenceCode": "JS-001",
"PhoneNumber": "11987654321",
"Email": "joao.silva@example.com",
"Address": {
"Country": "MX",
"City": "Ciudad de Mexico",
"State": "SP",
"PostalCode": "01310-200",
"AddressDetail": "Avenida Paulista 1000"
}
}
}
Response parameters
For more information on the response parameters, please refer to the Response parameters section of the Purchase creation.
Response example
{
"TransactionId": "79632697147789184",
"Result": "COMPLETED",
"Status": "APPROVED",
"ErrorCode": null,
"ErrorDescription": null,
"Created": "2024-08-07T17:51:54.620",
"AuthorizationDate": "2024-08-07T17:51:56.879",
"AuthorizationCode": "839936",
"Amount": 25000,
"Currency": "MXN",
"Installments": 1,
"TaxableAmount": null,
"Tip": null,
"Url": "https://api.stage.bamboopayment.com/Purchase/79632697147789184",
"MetadataOut": null,
"Action": null,
"PaymentMethod": {
"Brand": "Visa",
"CardOwner": "Joao Silva",
"Bin": "450799",
"IssuerBank": "Santander",
"Type": "CreditCard",
"Expiration": "203008",
"Last4": "4905"
}
}
Testing cards
Use the following cards to simulate the different status of the purchase. These cards apply for both API and redirection flow.
Brand | PAN | CVV | Expiration Date |
---|---|---|---|
Visa | 4111111111111111 | 123 | 10/29 |
Visa | 4242424242424242 | 123 | 10/29 |
MasterCard | 5555555555554444 | 123 | 10/29 |
MasterCard | 5105105105105100 | 123 | 10/29 |
Amex | 345678000000007 | 1234 | 10/29 |
Amex | 341111111111111 | 1234 | 10/29 |
Amex | 343434343434343 | 1234 | 10/29 |
Carnet | 5062541600005232 | 123 | 10/29 |
Carnet | 5064050100000063 | 123 | 10/29 |
Carnet | 5064510000300020 | 123 | 10/29 |