---
title: Testing CheckCard
slug: testing-checkcard
docTags: 
createdAt: 2024-06-10T10:11:06.765Z
---

These scenarios do not include 3D Secure 2 authentication testing.
See [Testing 3D Secure 2 Flows](docId\:BdCGiYQDm3mlE-UBxp1yR) for 3D Secure 2 authentication testing for your app.

## CheckCard Scenarios (Positive Flow)

`CheckCard` conducts a zero amount pre-authorisation on the consumer's account.

### Important to Consider

:::hint{type="info"}
Zero Auth means it does not hold any funds on the customer’s account.
:::

- CheckCard tests involve verification of:
  - The **card**:
    - cardNumber
    - cardExpiryDate
    - cv2
  - The **account**:
    - Is not blocked or blacklisted
    - Exists
- Tokenises the card number into an encrypted string.

A successful checkCard request verifies the card with the issuer and can be authenticated using 3D Secure 2, providing you with the confidence the card is **valid&#x20;**&#x74;o make future payments.

| **Suggested Test Scenario**                                                                                                                                                           | **Expected Outcome** | **Tip**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Process a Card Payment.<br />This will check the card is valid.                                                                                                                       | 200<br />Successful  | The checkCard response provides the:<br />* cardToken
* yourConsumerReference<br />Ensure you use the correct **cardToken** and **yourConsumerReference** to make future payments, otherwise they may fail.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Process a Card preAuth.<br />This will check the card is valid.                                                                                                                       | 200<br />Successful  | The checkCard response provides the:<br />* cardToken
* yourConsumerReference<br />Ensure you use the correct **cardToken** and **yourConsumerReference** to make future payments, otherwise they may fail.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Process a checkCard request using the different card schemes you will be implementing on your app.                                                                                    | 200<br />Successful  | Ensure you have the correct card schemes enabled on your app.<br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Process a checkCard request with the billing address information (cardAddress block) included in the request.<br />This will validate the billing address is registered to that card. | 200<br />Successful  | Ensure the **cardAddress** block has the correct fields:<br />* `address1`
* `address2`
* `town`
* `postCode`
  - Required
* `countryCode`
  - See [here](docId\:XZE369mFK5UVOSaNzM8UO) for the list of valid **ISO 3166-1** format country codes.<br />Example cardAddress block:<br />:::BlockQuote
"cardAddress": \{ &#xA;"address1": "CardHolder House", &#xA;"address2": "1 CardHolder Street",&#xA;"town": "CardHolder Town", &#xA;"postCode": "AB1 2CD", &#xA;"countryCode": 826, &#xA;"state": "FL", &#xA;},
:::<br />To validate the card is registered to the correct post code, ensure the following permission on your sandbox API Credentials is enabled:<br />* **Enforce AVS checks**.<br />**The default setting = disabled**. |

For more information on API credentials and permissions, see [Permissions](docId\:S_8hOAMytkgY13t0P657-).

***

### Test Card Data

To simulate a successful checkCard request use the [Test Cards](docId:_OBafnuC1Umhk-vIhHs5D).

***

### Check Card Request Parameters

Sandbox endpoint:
`https://api-sandbox.judopay.com/transactions/checkcard`

HTTP Method: **POST**

**Header Parameters:**

Depending on how you integrate with Judopay, you can authenticate requests by:

- `/paymentsession`, or
- TokenSecretAuth
  - The token and secret pair

For more information, see [Authentication Methods](docId\:ylKW5coh5NQnfQ3j_Wjk2).

| API-Version:                                                     | 6.26<br />For the latest version of the Judopay Transaction API, see [Latest Version](docId\:bcXNM5keOk-nlNrZTafUT).                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Content-Type:                                                    | application/json                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Accept:                                                          | application/json                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **Authorization Method**:<br />TokenSecretAuth                   | In the Authorization Header:<br />* Supply: **Basic** \{`authstring`}<br />Example:<br />**Basic**`TXpFdPdRSzWmSGk4djhxeTpjBTS4YjQ5OTdkZmO7CTk1YTE0OWEyMDg1MmY3YWYyZWEyZTcwYmQyZGY3O`<br />Replace \{`authstring`} with **base64 encoding** of:<br />* <font color="#6a4ee1">**API Token**</font> (username)
* <font color="#ef5b2e">**Colon**</font>
* **API Secret** (password)<br />Example:<br /><font color="#6a4ee1">**MzPdkQK1mGi8v3ky**</font><font color="#ef5b2e">**:**</font>**y158n4732dfc7595a149a20381f7af2ea2e70gr6df794b8rnwc019cc5f799kk3** |
| **Authorization Method**:<br />PaymentSessionAuthToken<br />     | **For Payment Session authentication**<br />In the Api-Token header:<br />* Supply the token used to authenticate the call to generate a payment session<br />Th&#x65;**&#x20;Payment-Session header** value must also be supplied.                                                                                                                                                                                                                                                                                                                          |
| **Authorization Method**:<br />PaymentSessionAuthReference<br /> | **For Payment Session authentication**<br />In the Payment-Session header:<br />* Supply the reference returned in the create payment session response<br />Th&#x65;**&#x20;Api-Token header** value must also be supplied.                                                                                                                                                                                                                                                                                                                                  |

***

**Body Parameters**:

**Configuration Property Descriptions**

:::hint{type="warning"}
**\*Mastercard Recommends:**
These fields are recommended rather than mandatory. Transactions will continue to be processed if not supplied.&#x20;
See, [Mastercard Recommended 3D Secure 2 Fields](docId\:WpFMF662qaIGEGrpU_Mow).
:::

| **Parameter**                                                                                                           | **Description**                                                                                                                                                                                                                                                                                                                                                                   |
| ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `judoId`<br />String&#xD;<br />&#xD;<font color="#ef5b2e">Required</font><br />                                        | Unique ID supplied by Judopay.<br />Specific to a merchant and/or location.<br />Format:<br />* 100100100&#xD;
* Maximum length 9 characters.&#xD;
* Do not include spaces or dashes.                                                                                                                                                                                             |
| `amount`<br />Decimal<br /><font color="#ef5b2e">Required</font>                                                        | The amount to process.<br />Format:<br />* Two decimal places<br />For currencies using a different structure please contact Judopay for support.                                                                                                                                                                                                                                 |
| `currency`<br />String<br /><font color="#ef5b2e">Required</font>                                                       | The currency of the transaction. <br />Any ISO 4217 alphabetic currency code:<br />* GBP
* USD
* EUR                                                                                                                                                                                                                                                                              |
| `phoneCountryCode`<br />String<br /><font color="#ef5b2e">Recommended</font> <font color="#ef5b2e">*</font><br /><br /> | The country code of the consumer's phone.<br />Format:<br />* Maximum length 3 characters.
* Only numbers allowed.
* Do not include special characters or spaces.<br />Must be set if **mobileNumber** is set.<br />If not set, default = 44                                                                                                                                      |
| `challengeRequestIndicator`<br />String<br /><font color="#42cbd4">Optional</font><br /><br />                          | Indicates the type of challenge request you wish to apply.<br />Values:<br />* `NoPreference`
* `NoChallenge`
  - No challenge required.
* `ChallengePreferred`
  - A challenge is preferred for this transaction.
* `ChallengeAsMandate`
  - Must challenge this transaction.                                                                                                    |
| `scaExemption`<br />String<br /><font color="#42cbd4">Optional</font><br /><br />                                       | To apply for an exemption from SCA, for a customer initiated transaction.<br />Values:<br />* `TrustedBeneficiary`
  - Provides the cardholder the option to add the merchant to their trusted list.
* `TransactionRiskAnalysis`
  - Allows for certain remote transactions to be exempt from SCA including low value transactions, provided a robust risk analysis is performed. |
| `yourConsumerReference`<br />String&#xD;<br />&#xD;<font color="#bf5b2e">Required</font>                               | Unique reference to anonymously identify your customer.<br />Advisable to use GUIDs.<br />Must be below 40 characters.                                                                                                                                                                                                                                                            |
| `yourPaymentReference`<br />String&#xD;<br />&#xD;<font color="#bf5b2e">Required</font>                                | Your unique reference for this payment.<br />Format:<br />* Maximum length 50 characters.<br />This value should be unique in order to protect your customers against duplicate transactions. <br />With a server side integration, if a payment reference is not supplied, the transaction will not be processed.                                                                |
| `billingAddress`<br />Object<br /><font color="#42cbd4">Optional</font>                                                 | Card holder's billing address.<br />* `address1` <font color="#ef5b2e">(</font><font color="#ef5b2e">Recommended)</font><font color="#ef5b2e">*</font><br />If the billingAddress is provided, the postcode is **required**.                                                                                                                                                      |
| `emailAddress`<br />String<br /><font color="#ef5b2e">Recommended</font> <font color="#ef5b2e">*</font>                 | Consumer’s valid email address.<br /><br />Mastercard recommends providing at least **one contact method** for Mastercard 3D Secure authenticated transactions.                                                                                                                                                                                                                   |
| `mobileNumber`<br />String<br /><font color="#ef5b2e">Recommended</font> <font color="#ef5b2e">*</font><br /><br />     | Consumer’s valid mobile number.<br /><br />Mastercard recommends providing at least **one contact method** for Mastercard 3D Secure authenticated transactions.<br />Format:<br />* Maximum length 15 characters.
* Only numbers allowed.
* Do not include special characters or spaces.<br />Must be set if **phoneCountryCode** is set.                                         |
| `primaryAccountDetails`<br />Object<br /><font color="#42cbd4">Optional</font><br /><br />                              | This is **Mandatory&#x20;**&#x66;or merchants who have an MCC code of **6012**, **6051&#x20;**&#x61;nd **7299**.<br />Primary Account Holder Details:<br />* `Name`&#xA;**This is the surname**.
* `accountNumber`
* `dateOfBirth`
  - Format: YYYY-MM-DD
* `postCode`                                                                                                            |
| `initialRecurringPayment`<br />Boolean<br /><font color="#42cbd4">Optional</font>                                       | Indicates if this initial payment is part of a recurring payment.                                                                                                                                                                                                                                                                                                                 |



:::CodeblockTabs
Check Card Request Example

```json
{
  "cardNumber": 4111111111111111,
  "cv2": 123,
  "expiryDate": "12/30",
  "cardAddress": {
    "address1": "CardHolder House",
    "address2": "1 CardHolder Street",
    "town": "CardHolder Town",
    "postCode": "AB1 2CD",
    "countryCode": 826
  },
  "judoId": 100100100,
  "yourConsumerReference": "2b45fd3f-cee5-4e7e-874f-28051db65408",
  "yourPaymentReference": "6482c678-cad3-4efd-b081-aeae7a89a134",
  "cardHolderName": "John Doe",
  "mobileNumber": 7999999999,
  "phoneCountryCode": 44,
  "emailAddress": "test.user@judopay.com",
  "shippingAddress": {
    "isBillingAddress": true
  },
  "threeDSecure": {
    "authenticationSource": "Browser",
    "methodNotificationUrl": "https://api-sandbox.judopay.com/order/3ds/methodNotification",
    "challengeNotificationUrl": "https://api-sandbox.judopay.com/order/3ds/challengeNotification",
    "methodCompletion": false
  }
}
```

Response Example

```json
{
    "receiptId": "915607863668412416",
    "yourPaymentReference": "cd6fcd20-9c0a-436c-9ec8-2caee5324e6a",
    "type": "CheckCard",
    "createdAt": "2022-12-01T14:18:46.5375+00:00",
    "result": "Success",
    "message": "AuthCode: 0",
    "judoId": 100502814,
    "merchantName": "Shodan - Cybersource Routing",
    "appearsOnStatementAs": "APL*/ShodanCybersourceRo",
    "originalAmount": "0.00",
    "netAmount": "0.00",
    "amount": "0.00",
    "currency": "GBP",
    "externalBankResponseCode": "0",
    "authCode": "0",
    "paymentNetworkTransactionId": "123456789012345",
    "cardDetails": {
        "cardLastfour": "1111",
        "endDate": "1230",
        "cardToken": "oALxtKjEIG9mJtTeNUPFNgNZoG62ryT9",
        "cardType": 1,
        "cardScheme": "VISA",
        "cardFunding": "Credit",
        "cardCategory": "",
        "cardCountry": "US",
        "bank": "JPMORGAN CHASE BANK, N.A."
    },
    "billingAddress": {
        "postCode": "TR14 8PA"
    },
    "consumer": {
        "yourConsumerReference": "cv2 test"
    },
    "device": {
        "identifier": "bd9b254a156847e9a73f54929c465701"
    },
    "threeDSecure": {
        "attempted": false
    },
    "risks": {
        "postCodeCheck": "UNKNOWN",
        "cv2Check": "PASSED",
        "merchantSuggestion": "Allow"
    }
}
```
:::

***

## CheckCard Scenarios (Negative Flow)

Declines can occur for various reasons, it can be impossible to simulate all the negative flows in a sandbox environment.

### Important to Consider

- How your app handles negative flows
- Your customer's experience should a negative flow occur:
  - Logic to communicate error messages
  - Customise how your app responds
- How to maintain application consistency

Follow our suggested guidelines to simulate negative scenarios, to test your app’s error handling:

| **Suggested Negative Test Scenario**                                                                                                       | **Expected Error Code** | **Error Description**                                                                                |
| ------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------- | ---------------------------------------------------------------------------------------------------- |
| Attempt to perform a checkCard using an invalid card expiry date.                                                                          | 161                     | Sorry, but the card expiry date must be in the future.<br />                                         |
| Attempt to perform a checkCard using an invalid card number.                                                                               | 196                     | Unable to process transaction as the card number is invalid. Please try again with a different card. |
| **Simulate a decline using the following test card details:**                                                                              |                         |                                                                                                      |
| Attempt to perform a checkCard decline using the following:<br />* **cardNumber**: 4221690000004963
* **cv2**: 452
* **expiryDate**: 12/24 | Declined<br />          | Card declined.                                                                                       |

:::hint{type="warning"}
Where the codes remain fixed, the descriptions may change.&#x20;
You **should not&#x20;**&#x62;uild any error handling logic based on these descriptions.
:::

For a list of possible error codes, types and descriptions, see  [Error Codes and Descriptions](docId:_zrsihomUEW-XnRQ4PBtJ).

