Credit and Debit cards

Learn how to integrate your solution to process credit or debit card payments.

Request parameters

You need to include specific fields for this payment method to work correctly. Check the Request parameters section for details on basic purchase parameters such as amount and currency.

PropertyTypeMandatory?Description
TrxTokenstringYesThe token that identifies the customer’s card.
For more information about how to create the token, refer to Customers.
TargetCountryISOstringYesIndicate the destination country.
InstallmentsintegerNoThis parameter refers to the number of payments that a credit card purchase is divided into.
CustomerEmailstringYesCustomer’s email.
CustomerFirstNamestringYesCustomer’s first name.
CustomerLastNamestringYesCustomer’s last name.
CustomerDocumentTypeIdnumericNoCustomer’s document type.
Refer to the Document types table to see the possible values.
CustomerDocNumberstringNoCustomer’s Document Number.
CustomerPhoneNumberstringYesCustomer’s phone number.
CustomerBillingAddressCountrystringYesCustomer’s Country.
CustomerBillingAddressStatestringYesCustomer’s State.
CustomerBillingAddressCitystringYesCustomer’s City.
CustomerBillingAddressAddressDetailstringYesCustomer’s Address Detail.
CustomerBillingAddressPostalCodestringNoCustomer’s Postal Code.
Postal code is mandatory for the United States and Canada.
CustomerShippingAddressCountrystringNoCountry of the Shipping Address.
CustomerShippingAddressStatestringNoState of the Shipping Address.
CustomerShippingAddressCitystringNoCity of the Shipping Address.
CustomerShippingAddressAddressDetailstringNoAddress Detail of the Shipping Address.
CustomerShippingAddressPostalCodestringNoPostal Code of the Shipping Address.
CustomerIPstringNoIP of the customer that uses the service.
DataUYobjectNoSpecific data for Uruguay.
In Uruguay, two laws promote electronic payment methods by refunding VAT points. Law 19,210 (Financial inclusion law) and 17,934 for gastronomic and related services govern these benefits, and the data presented in this object is necessary for correct usage.
This parameter is required for the Gateway model.
DataUYIsFinalConsumerbooleanNoIndicates if the sale is performed to a final consumer.
This parameter is required for the Gateway model.
DataUYInvoicestringNo *Invoice number associated with the sale. This parameter only accepts numeric characters.
DataUYTaxableAmountnumberNo *Amount taxed by VAT.

Request example

{
  "TrxToken": "OT__AJrM-jq7nqEZUiuiTpUzImdM_6Cp7rxT4jiYpVJ8SzQ_",
  "Capture": true,
  "Order": "20201229",
  "Amount": "10000",
  "Currency": "USD",
  "TargetCountryISO": "UY",
  "Installments": 1,
  "Customer": {
    "BillingAddress": {
      "Country": "Uruguay",
      "City": "Montevideo",
      "State": "Montevideo",
      "PostalCode": "150000",
      "AddressDetail": "Calle falsa 4567/Depto/Provincia"
    },
    "Email": "rserrano@mail.com",
    "DocNumber": "47666489",
    "DocumentTypeId": 2,
    "PhoneNumber": "0930000111",
    "FirstName": "Rodrigo",
    "LastName": "Serrano"
  }
}

Response parameters

For more information on the response parameters, please refer to the Response parameters section of the Purchase creation.

Response example

{
  "Response": {
    "PurchaseId": 1248284,
    "Created": "2023-09-29T15:34:10.012",
    "TrxToken": null,
    "Order": "20201229",
    "Transaction": {
      "TransactionID": 1267112,
      "Created": "2023-09-29T15:34:10.012",
      "AuthorizationDate": "",
      "TransactionStatusId": 1,
      "Status": "Approved",
      "ErrorCode": "0",
      "Description": "",
      "ApprovalCode": null,
      "Steps": [
        {
          "Step": "Generic External",
          "Created": "",
          "Status": null,
          "ResponseCode": "00",
          "ResponseMessage": "Authorization - Function performed error-free",
          "Error": "0",
          "AuthorizationCode": "586316",
          "UniqueID": null,
          "AcquirerResponseDetail": "{\"TransactionResult\":\"APPROVED\",\"ProcessorResponseCode\":\"00\",\"ProcessorResponseMessage\":\"Function performed error-free\",\"ApprovalCode\":\"Y:586316:4637904926:PPXX:5863160734\",\"OrderId\":\"A-79d7a01b-5b36-4326-b872-82c29f196ec0\",\"IpgTransactionId\":\"84637904926\",\"ProcessorApprovalCode\":\"586316\",\"ProcessorReceiptNumber\":\"0734\",\"ProcessorBatchNumber\":\"001\",\"ProcessorReferenceNumber\":\"586316586316\",\"ProcessorTraceNumber\":\"586316\"}"
        }
      ]
    },
    "Capture": true,
    "Amount": 10000,
    "OriginalAmount": 10000,
    "TaxableAmount": 0,
    "Tip": 0,
    "Installments": 1,
    "Currency": "USD",
    "Description": null,
    "Customer": {
      "CustomerId": 254952,
      "Created": "2023-09-29T15:34:05.713",
      "CommerceCustomerId": null,
      "Owner": "Anonymous",
      "Email": "rserrano@mail.com",
      "Enabled": true,
      "ShippingAddress": null,
      "BillingAddress": {
        "AddressId": 377785,
        "AddressType": 2,
        "Country": "Uruguay",
        "City": "Montevideo",
        "State": "Montevideo",
        "PostalCode": "150000",
        "AddressDetail": "Calle falsa 4567/Depto/Provincia"
      },
      "Plans": null,
      "AdditionalData": null,
      "PaymentProfiles": [
        {
          "PaymentProfileId": 259793,
          "PaymentMediaId": 2,
          "Created": "2023-09-29T15:34:05.713",
          "LastUpdate": null,
          "Brand": "MasterCard",
          "CardOwner": "Rodrigo Serrano",
          "Bin": null,
          "IssuerBank": null,
          "Installments": null,
          "Type": "CreditCard",
          "IdCommerceToken": 0,
          "Token": null,
          "Expiration": "202912",
          "Last4": "0008",
          "Enabled": null,
          "DocumentNumber": null,
          "DocumentTypeId": null,
          "ExternalValue": null,
          "AffinityGroup": null
        }
      ],
      "CaptureURL": null,
      "UniqueID": null,
      "URL": "https://api.stage.bamboopayment.com/Customer/254952",
      "FirstName": "Rodrigo",
      "LastName": "Serrano",
      "DocNumber": "47666489",
      "DocumentTypeId": 2,
      "PhoneNumber": "0930000111",
      "ExternalValue": null
    },
    "RefundList": null,
    "PlanID": null,
    "UniqueID": null,
    "AdditionalData": null,
    "CustomerUserAgent": null,
    "CustomerIP": null,
    "URL": "https://api.stage.bamboopayment.com/Purchase/1248284",
    "DataUY": {
      "IsFinalConsumer": false,
      "Invoice": null,
      "TaxableAmount": 0
    },
    "DataDO": {
      "Invoice": null,
      "Tax": 0
    },
    "Acquirer": {
      "AcquirerID": 73,
      "Name": "FiservIPG",
      "CommerceNumber": null
    },
    "CommerceAction": null,
    "PurchasePaymentProfileId": 259793,
    "LoyaltyPlan": null,
    "DeviceFingerprintId": null,
    "MetadataIn": null,
    "MetadataOut": null,
    "CrossBorderData": null,
    "CrossBorderDataResponse": null,
    "Redirection": null,
    "IsFirstRecurrentPurchase": false,
    "AntifraudData": {
      "AntifraudFingerprintId": null,
      "AntifraudMetadataIn": null
    },
    "PaymentMediaId": null,
    "PurchaseType": 1,
    "HasCvv": null,
    "TargetCountryISO": null
  },
  "Errors": []
}

Testing cards

When generating valid card data for testing, you must first establish which acquirer you want to test and what type of test you want to perform.

Determination of BIN

When setting up an acquirer, the card’s BIN (Bank Identification Number) is also created. This BIN should align with one of the BINs associated with the brands processed by the acquirer. For instance, if you are conducting an integration test with MasterCard, the BIN of the generated card should adhere to the following format: ^ 5 \ [1-5] \ [0-9]*

This format means it must start with the number 5; the second number must be between 1 and 5, then any other number is accepted. For example, the BIN to test can be 510000. The valid Bines in the system and their related acquirer are listed below.

BIN (format)BrandNotes
^4\[0-9]*VISAAny card that starts with 4.
^5\[1-5]\[0-9]*MasterCardAny card that starts with 51 through 5.
^589892|^542991OCAAny card that starts with 589892 or 542991.

Configured Behaviors for the Payfac model

The behavior of the response will depend on the amount sent. Use the following cards to simulate the different purchase statuses.

BrandPANCVVExpiration Date
Mastercard516585000000000812312/29
Visa470455000000000512312/29

Cards without CVV

BrandPANExpiration Date
Mastercard Credit510198000000000012/29
Mastercard Prepaid559926000000000612/29
Visa Credit410377000000000612/29
Visa Debit421300000000000512/29
Visa International Credit414796000000000112/29
Visa International Debit434559000000000612/29
BehaviorAmount
Result: Rejected
Error: The card can’t operate with installments.
UYU 1045,00
Result: Rejected
Error: Expired card.
UYU 1046,00
Result: Rejected
Error: Insufficient funds.
UYU 1051,00
Result: OK
Approved
  • Less than or equal to UYU 1000,00
  • Greater than UYU 1061,00

Configured Behaviors for the Gateway model

The behavior of the response will depend on the termination of the card. Generate the card using the corresponding bin of the brand, and send the following last four digits according to the expected result.

TerminationBehavior
0001Result: OK
Approved.
0002Result: Rejected
Error: TR007
Error with some data of the payment method (card number, verification code or expiration date).
0013Result: Rejected
Error: TR012
Credit limit exceeded.

Special features for the Gateway model

  • You can make purchases in installments as long as the Issuing Bank has it enabled.
  • You can make purchases with Debit Cards as long as the Issuing Bank has it enabled
  • Visanet requires the inclusion of the CVV in the customer’s first purchase or the customer’s registration.
    Once you make the registration and obtain the Commerce Token, it is not necessary to request the CVV in future transactions.
  • Fiserv requires you to send the CVV, even if you have the Commerce Token. You need to execute Verification Code Request Flow.
    This modality is enabled by default. If you wish to deactivate it, you must negotiate with Fiserv and notify us.
  • Creditel and PassCard require that the purchase message include the cardholder’s document and type of document (fields Customer.DocumentTypeId and Customer.DocNumber).
  • PassCard requires you to send the CVV, even if you have the Commerce Token. Therefore, you need to execute Verification Code Request Flow.
  • When using OCAOneClick2 (OCA Multi-Acquiring), you need to include the IP address of the person making the purchase. To do this, you must send the CustomerIP parameter in the request.

Purchases using MasterCard through OCA

When using MasterCard, sending the device FingerPrint using the SetDeviceFingerPrint method is recommended.

Add this function to the script used for the checkout form (PWCheckOut) to generate and return the value used in the purchases.

In this example, we show how to invoke and obtain the result.

<script type="text/javascript">
    PWCheckout.SetDeviceFingerprint();
</script>

Then, include the token in the purchase creation according to the following scenarios.

  • For OneTimeToken, send the device FingerPrint you generate and the OT token.
  • For CommerceToken, there are two cases:
    • For Recurring purchases (Without CVV), send the device FingerPrint you generate and the CT token. You can use an existing CT token or generate one.
    • For Purchases with CVV, generating a DeviceFingerPrint is unnecessary since when the customer enters the CVV, the system sends the value generated when displaying the CVV request page. Then, the system generates a Purchase in the Pending state, and you need to redirect the customer to the URL returned in the actionUrl parameter where they enter the CVV.
footer
Last modified June 24, 2024

© Bamboo | All rights reserved 2024