How to test credit card interactions?

后端 未结 4 985
名媛妹妹
名媛妹妹 2020-12-28 10:23

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条回答
  • 2020-12-28 10:35

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

    0 讨论(0)
  • 2020-12-28 10:38

    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.

    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.

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

    0 讨论(0)
  • 2020-12-28 10:41

    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.

    0 讨论(0)
  • 2020-12-28 10:46
    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
    
    0 讨论(0)
提交回复
热议问题