Test Credit Cards

 

Below is a list of credit card numbers that can be used to simulate different success and error API responses.

For each scenario, you will first need to post the required credit card number to the /credit_card end point and then use the code received to replace {credit_card_code} in the URL below. As noted previously, the ExternalID value can be used to attach an identifier that your system is aware of to the credit card charge attempt, this can help facilitate querying charges at a later date.

Any number not in the below list will return a card declined result.

 

POST: /credit_cards/{credit_card_code}/charges
{
    "Amount" : 123.45,
    "Description" : "Weekly Fee",
    "OnchargeFees" : true (default is false),
    "ExternalID" : “Your system ID”,
    "CVN" : null (set to null if card not present. NEVER STORE THIS!)
}

 

Successful Response

Visa: 4200000000000000

MasterCard: 5520000000000000

Response:

{
    "Status": "Succeeded",
    "Description": "Test payment",
    "ExternalID": "12",
    "CreditCard": {
        "Code": "ABC123"
    },
    "Payment": {
        "Code": "B44444",
        "Amount": 126,
        "AmountIncFees": 126,
        "FailReason": null,
        "FailCode": null,
        "DateClears": null,
        "URI": "/v2/payments/B4E5E2"
    },
    "Route": "credit_cards/{credit_card_code}/charges"
}

 

Card Declined

Visa: 4000000000000002

MasterCard: 5510000000000002

Response:

{
    "Status": "Succeeded",
    "Description": "Test payment",
    "ExternalID": "12",
    "CreditCard": {
        "Code": "123ZZZ"
    },
    "Payment": {
        "Code": "123ABC",
        "Amount": 2,
        "AmountIncFees": 2,
        "FailReason": "Failed - Card Declined",
        "FailCode": "CreditCardDeclined",
        "DateClears": null,
        "URI": "/v2/payments/123ABC"
    },
    "Route": "credit_cards/123ZZZ/charges"
}

 

Insufficient Funds

Visa: 4100000000000001

MasterCard: 5560000000000001

Response:

{
    "Status": "Succeeded",
    "Description": "Test payment",
    "ExternalID": "12",
    "CreditCard": {
        "Code": "123ZZZ"
    },
    "Payment": {
        "Code": "123ABC",
        "Amount": 2,
        "AmountIncFees": 2,
        "FailReason": "Failed - Insufficient Funds",
        "FailCode": "CreditCardInsufficientFunds",
        "DateClears": null,
        "URI": "/v2/payments/123ABC"
    },
    "Route": "credit_cards/123ZZZ/charges"
}

 

Suspected Fraud

Visa: 4900000000000003

MasterCard: 5550000000000003

Response:

{
    "Status": "Succeeded",
    "Description": "Test payment",
    "ExternalID": "12",
    "CreditCard": {
        "Code": "123ZZZ"
    },
    "Payment": {
        "Code": "123ABC",
        "Amount": 2,
        "AmountIncFees": 2,
        "FailReason": "Failed - Suspected fraud",
        "FailCode": "CreditCardSuspectedFraud",
        "DateClears": null,
        "URI": "/v2/payments/123ABC"
    },
    "Route": "credit_cards/123ZZZ/charges"
}

 

Processing Error

Visa: 4800000000000004

MasterCard: 5500000000000004

Response:

{
    "Status": "Succeeded",
    "Description": "Test payment",
    "ExternalID": "12",
    "CreditCard": {
        "Code": "123ZZZ"
    },
    "Payment": {
        "Code": "123ABC",
        "Amount": 2,
        "AmountIncFees": 2,
        "FailReason": "Failed - Processing Error",
        "FailCode": "CreditCardProcessingError",
        "DateClears": null,
        "URI": "/v2/payments/123ABC"
    },
    "Route": "credit_cards/123ZZZ/charges"
}

 

Undetermined Error

Visa: 4700000000000005

MasterCard: 5590000000000005

Response:

{
    "Status": "Undetermined",
    "Description": "Test payment",
    "ExternalID": "12",
    "CreditCard": {
        "Code": "ABC123"
    },
    "Payment": null,
    "Route": "credit_cards/ABC123/charges"
}

 

An undetermined error occurs on the rare instance where we can not confirm if the issuing bank has properly received the request or if the charge has been approved or declined. If an undetermined response is received you should NOT reattempt to charge the card until a valid determination is received by querying the response credit card code until a valid final result is received.

The test system has been configured to update an undetermined response to a valid response after 5 minutes.

For example, below is the request that post would be used to check the above credit card token for an updated response.

GET: /credit_cards/ABC123/charges
Have more questions? Submit a request

Comments