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 (Acepta pago con puntos)

5105105105105100

MasterCard

SCOTIABANK (Acepta pago con puntos)

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

Card is expired.

4444444444444448

3003

Card has not enough funds.

4000000000000119

3004

Card has been flagged as stolen.

4000000000000044

3005

Card has been rejected by the antifraud system.

5454545454545454

3005

Card has been rejected by the antifraud system.

340000000000009

3001

The card has been rejected.

373737373737374

3002

Card is expired.

370000000000002

3003

Card has not enough funds.

Saving cards

In the sandbox environment all operations are simulated, so you can only store the following card numbers:

Card number

Brand

Bank

Type

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.

Selective authentication

Card number

Brand

Bank

Type

5454545454545454

MasterCard

HSBC

Credit

Note: This card will be approved in a charge with 3D Secure, in any other way it will be rejected by the anti-fraud tool.

Webhooks

If you have Webhooksconfigured, 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.