Payment Methods
Important changes on the Public API
When creating transactions and payment sources, and because we keep our users privacy in the top of our priorities, the usage of Acceptance Tokens is now mandatory when creating either of these resources through our API.
Every time you create a transaction using our API, you have the option of processing the payment using different payment methods. Currently, the available payment methods are:
- Credit or Debit Cards: Allows your customers to pay using credit or debit cards.
- Bancolombia Transfer Button: Allows your customers to pay using their savings or checking account from Bancolombia.
- Nequi: Allows your customers to pay with Nequi using their cellphone to complete the payment.
- PSE: Allows your customers to pay with PSE using the savings or checking account from any Colombian bank.
- Cash Payment in Corresponsal Bancario Bancolombia: Allows your customers to pay with cash in any of the more than 15,000 physical points of payment from Bancolombia called Corresponsales Bancarios Bancolombia.
- PCOL: Allow your customer to pay redeeming points from Puntos Colombia loyalty program.
- BNPL BANCOLOMBIA: Enabling your clients to choose a BANCOLOMBIA free investment credit option, with zero interest, split into 4 monthly installments for transactions exceeding $100,000 pesos.
- DAVIPLATA: Provide your customers with the option to use their Daviplata account to make payments conveniently.
- SU+ PAY - COMMING SOON: It allows users to purchase products or services and pay for them in installments, facilitating financial management and access to a wide range of products.
To use a payment method you must POST in the /transactions endpoint with:
- Specify the field
payment_method_typeand specify one of these 3 values:CARD,NEQUIorPSE. - Specify the field
payment_methodwith a JSON object that contains more specific details with each of the methods outlined below.
To end the payment process for any of the available payment methods, we recommend periodically verifying (long polling) the state of a transaction, waiting for a final status (approved, denied, voided or error), using the transaction ID and our API, since none of the payment methods deliver an instant synchronous response. A transaction that has just been created always has a PENDING status.
Final status of a transaction
The final status of a transaction can be: APPROVED (approved) , DECLINED (declined), VOIDED (anulled, applies to transactions with card only) or ERROR (if there is an external error with a payment method during the transaction).
Credit or Debit Cards
In Wompi, your customers can process payments using a Visa, Mastercard or Amex Credit or Debit Card, as long as the card has a CVC (card verification code), usually printed on the back of the card.
The payment method type that you must use to create the transaction is CARD. When using the payment method CARD you need to take into account that:
- You must first tokenize a card (more details below).
- You must ask the end how many installments does he wants to make his payment.
Tokenize a Credit or Debit Card
To securely tokenize a credit or debit card, you must use the endpoint (using your public key on the authentication header):
POST /v1/tokens/cards
To this endpoint, you must send the following card information inside the request body:
{
"number": "4242424242424242", // Card number (13 to 19 digits)
"cvc": "123", // Card verification code (3 or 4 digits, depending on franchise)
"exp_month": "08", // Expiration month (2 digits string)
"exp_year": "28", // Expiration year (2 digits string)
"card_holder": "John Smith" // Card holder name
}
The endpoint will respond something like the following:
{
"status": "CREATED",
"data": {
"id": "tok_prod_1_BBb749EAB32e97a2D058Dd538a608301", // TOKEN you must when creating the transaction
"created_at": "2020-01-02T18:52:35.850+00:00",
"brand": "VISA",
"name": "VISA-4242",
"last_four": "4242",
"bin": "424242",
"exp_year": "28",
"exp_month": "08",
"card_holder": "John Smith",
"expires_at": "2020-06-30T18:52:35.000Z"
}
}
In this response, the value of the "id" field is the token you must use inside the "payment_method" object (in this case "tok_prod_1_BBb749EAB32e97a2D058Dd538a608301"), to later on create a transaction.