如何测试信用卡互动?

时间:2022-03-13 17:22:39

After reading this answer, I wonder if there's a way to get a "testing" credit card number. One that you can experiment with but that doesn't actually charge anything.

看完这个答案后,我想知道是否有办法获得“测试”信用卡号码。一个你可以试验但实际上并没有收费的东西。

4 个解决方案

#1


27  

MasterCard: 5431111111111111
Amex: 341111111111111
Discover: 6011601160116611
American Express (15 digits)  378282246310005
American Express (15 digits)  371449635398431
American Express Corporate (15 digits)  378734493671000
Diners Club (14 digits)  30569309025904
Diners Club (14 digits) 38520000023237
Discover (16 digits)  6011111111111117
Discover (16 digits)  6011000990139424
JCB (16 digits) 3530111333300000
JCB (16 digits)  3566002020360505
MasterCard (16 digits)  5555555555554444
MasterCard (16 digits)  5105105105105100
Visa (16 digits)  4111111111111111
Visa (16 digits)  4012888888881881
Visa (13 digits)  4222222222222

Credit Card Prefix Numbers:

信用卡前缀号码:

Visa: 13 or 16 numbers starting with 4
MasterCard: 16 numbers starting with 5
Discover: 16 numbers starting with 6011
AMEX: 15 numbers starting with 34 or 37

#2


1  

Most payment gateways provide such numbers for testing their services, but they will generally only work on the staging/test versions of those gateways.

大多数支付网关提供用于测试其服务的这些数字,但它们通常仅适用于这些网关的登台/测试版本。

#3


1  

Depending on your payment gateway, there are two ways to test a transaction.

根据您的支付网关,有两种方法可以测试交易。

For example, with authorize.net, if you send "X_TEST_TRANSACTION=true" (or something like that, its been a long time), with your POST, it will run it in test mode.

例如,使用authorize.net,如果您发送“X_TEST_TRANSACTION = true”(或类似的东西,已经很长时间了),使用POST,它将在测试模式下运行它。

They also provide a test VISA and test Mastercard number that will always come back as approved if in test mode, and declined in production mode.

它们还提供测试VISA和测试万事达卡号,如果处于测试模式,它将始终返回批准状态,并在生产模式下被拒绝。

Look at your gateway API documentation, it will be clearly detailed there.

查看您的网关API文档,它将在那里清楚地详细说明。

#4


0  

Most payment processors provide either a testing number (PayPal does this) or the ability to go into testing mode (in which no transactions actually get processed). Consult the documentation.

大多数支付处理器提供测试编号(PayPal执行此操作)或进入测试模式(其中没有实际处理任何事务)的能力。请参阅文档。

#1


27  

MasterCard: 5431111111111111
Amex: 341111111111111
Discover: 6011601160116611
American Express (15 digits)  378282246310005
American Express (15 digits)  371449635398431
American Express Corporate (15 digits)  378734493671000
Diners Club (14 digits)  30569309025904
Diners Club (14 digits) 38520000023237
Discover (16 digits)  6011111111111117
Discover (16 digits)  6011000990139424
JCB (16 digits) 3530111333300000
JCB (16 digits)  3566002020360505
MasterCard (16 digits)  5555555555554444
MasterCard (16 digits)  5105105105105100
Visa (16 digits)  4111111111111111
Visa (16 digits)  4012888888881881
Visa (13 digits)  4222222222222

Credit Card Prefix Numbers:

信用卡前缀号码:

Visa: 13 or 16 numbers starting with 4
MasterCard: 16 numbers starting with 5
Discover: 16 numbers starting with 6011
AMEX: 15 numbers starting with 34 or 37

#2


1  

Most payment gateways provide such numbers for testing their services, but they will generally only work on the staging/test versions of those gateways.

大多数支付网关提供用于测试其服务的这些数字,但它们通常仅适用于这些网关的登台/测试版本。

#3


1  

Depending on your payment gateway, there are two ways to test a transaction.

根据您的支付网关,有两种方法可以测试交易。

For example, with authorize.net, if you send "X_TEST_TRANSACTION=true" (or something like that, its been a long time), with your POST, it will run it in test mode.

例如,使用authorize.net,如果您发送“X_TEST_TRANSACTION = true”(或类似的东西,已经很长时间了),使用POST,它将在测试模式下运行它。

They also provide a test VISA and test Mastercard number that will always come back as approved if in test mode, and declined in production mode.

它们还提供测试VISA和测试万事达卡号,如果处于测试模式,它将始终返回批准状态,并在生产模式下被拒绝。

Look at your gateway API documentation, it will be clearly detailed there.

查看您的网关API文档,它将在那里清楚地详细说明。

#4


0  

Most payment processors provide either a testing number (PayPal does this) or the ability to go into testing mode (in which no transactions actually get processed). Consult the documentation.

大多数支付处理器提供测试编号(PayPal执行此操作)或进入测试模式(其中没有实际处理任何事务)的能力。请参阅文档。