MercadoPago
Accept MercadoPago, including its sandbox testing rules.
MercadoPago is Latin America's most popular digital wallet. It offers instant processing and is widely used by frequent online shoppers. It uses a redirect flow where the customer authenticates on MercadoPago's platform.
When to use MercadoPago
- E-commerce customers familiar with digital wallets.
- Markets with strong MercadoPago adoption.
- Repeat customers who value a quick checkout.
Step 1: create the request
curl -X POST https://stage.tonder.io/api/v1/process/ \
-H "Authorization: Token YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"operation_type": "payment",
"amount": 350.00,
"currency": "MXN",
"customer": { "name": "José Antonio Ramírez", "email": "jose.ramirez@email.com" },
"payment_method": { "type": "MERCADOPAGO" },
"client_reference": "ORD-001",
"return_url": "https://yourstore.com/payment/return"
}'Always include a return_url for MercadoPago: it's where the customer is redirected after completing
the payment.
Step 2: handle the response and redirect
The response includes redirect information. MercadoPago requires a redirect flow where the customer authenticates:
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"operation_type": "payment",
"status": "pending",
"amount": 350.00,
"currency": "MXN",
"next_action": {
"redirect_to_url": {
"url": "https://mercadopago.com/checkout/123456789",
"return_url": "https://yourstore.com/payment/return"
}
},
"created_at": "2024-07-26T10:30:00Z"
}Step 3: redirect the customer
Use the URL from next_action.redirect_to_url.url.
Logs into their MercadoPago account and confirms the payment details.
Selects their funding source and confirms.
After payment, they return to your return_url.
For MercadoPago testing, the customer email must use the @testuser.com domain (e.g.
testuser@testuser.com). For the payment to be approved in sandbox, the cardholder name must
be APRO.
Limits
MercadoPago limits depend on the merchant's MercadoPago account. See Limits.
