Testing
We have a test environment (sandbox) prepared to simulate different cases of success and failure when processing your operations.
To start testing, check the following:
Have your keys in order to use the API. If you're using the javascript client you must use your public key, otherwise you must use your private key.
Use test data for card numbers, security codes cvv2 and expiration dates.
Properly handle the errors that the API returns.
If you are using Webhooks, be sure that your implementation is ready to receive the messages that the Openpay platform sends.
While you're in your testing phase, we recommend to use the dashboard from which you can view the following information:
Public and private keys as well as your registration data in general.
Records of all your transactions.
Records of all your requests whether they are charges and payments operations or administrative operations.
Charging a card
Valid card numbers
To simulate charging a card, we provide the following valid numbers:
Card number | Brand | Bank |
---|---|---|
4111111111111111 | Visa | BANAMEX |
4242424242424242 | Visa | BANCOMER |
5555555555554444 | MasterCard | BANCO SANTANDER SERFIN (Supports reward points) |
5105105105105100 | MasterCard | SCOTIABANK (Supports reward points) |
345678000000007 | AmericanExpress | AMERICAN EXPRESS |
341111111111111 | AmericanExpress | AMERICAN EXPRESS |
343434343434343 | AmericanExpress | AMERICAN EXPRESS |
5062541600005232 | Carnet | |
5064050100000063 | Carnet | |
5064510000300020 | Carnet |
Note: If you try to charge any other credit card number, the system will return an error code.
Effective dates and security codes valid.
Only have to use a higher date of the current month and any security code 3 digit for VISA, MASTERCARD and 4 digits for AMEX
Invalid card numbers **
In order to be able to simulate more error cases, we provide the following card numbers:
Card number | Error | Description |
---|---|---|
4222222222222220 | 3001 | The card has been rejected. |
4000000000000069 | 3002 | The card has expired. |
4444444444444448 | 3003 | The card doesn’t have enough funds. |
4000000000000119 | 3004 | The card has been identified as stolen. |
4000000000000044 | 3005 | The card has been identified as fraudulent. |
5454545454545454 | 3005 | The card has been identified as fraudulent. |
340000000000009 | 3001 | The card has been rejected. |
373737373737374 | 3002 | The card has expired. |
370000000000002 | 3003 | The card doesn’t have enough funds. |
To see the complete list of the different errors click here.
Saving cards
In the sandbox environment all operations are simulated, so you can only store the following card numbers:
Card number | Brand | Bank | Tipo |
---|---|---|---|
4111111111111111 | Visa | BANAMEX | Debit |
4242424242424242 | Visa | BANCOMER | Credit |
5555555555554444 | MasterCard | BANCO SANTANDER SERFIN | Debit |
5105105105105100 | MasterCard | SCOTIABANK | Credit |
4444444444444448 | Visa | BANCO MERCANTIL DEL NORTE | Credit |
345678000000007 | AmericanExpress | AMERICAN EXPRESS | Credit |
341111111111111 | AmericanExpress | AMERICAN EXPRESS | Credit |
343434343434343 | AmericanExpress | AMERICAN EXPRESS | Credit |
370000000000002 | AmericanExpress | AMERICAN EXPRESS | Credit |
Note: Any other card you try to register, the system will return an error code.
Sending payments
To test sending payments to a debit card, you can use the following number:
Card number | Bank | Brand |
---|---|---|
4111111111111111 | BANAMEX(002) | Visa |
To send payments to a CLABE account use:
Account number | Bank |
---|---|
012298026516924616 | BANCOMER(012) |
Note: You can also use any CLABE number valid in Mexico.
Webhooks
If you have Webhooks configured, you don’t have to do anything but have your site ready to start receiving notifications.
The sandbox environment is prepared to send notifications like a production environment.