---
title: Testing iOS SDK - Card Payments
slug: testing-ios-sdk-card-payments
docTags: 
createdAt: 2024-06-10T15:10:58.699Z
---

With Judopay’s iOS Mobile SDK solution, a minimal integration is all that is required to enable you to:

- Take a card payment
- Take a card preAuth
- Take a card token payment
- Take a card token preAuth
- Check the validity of a card, using checkCard

***

## Card Payment Scenarios (Positive Flow)

:::hint{type="info"}
Depending on you&#x72;**&#x20;use case and app configurations**, some of the following scenarios may not be relevant to you.
:::

Follow our suggested guidelines to simulate positive / happy path scenarios, in the sandbox environment, using the [Test Cards](docId:_OBafnuC1Umhk-vIhHs5D) to test your integration is working correctly.

This will give you confidence for when your integration goes live.

:::hint{type="warning"}
&#x20;**\***&#x54;hese images are from our dummy app, your interface may look different.
:::

***



::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
**Suggested Test Scenario**

Process a card:

- payment
- preAuth

Use the test card details [here](docId:_OBafnuC1Umhk-vIhHs5D).

***

<font color="#6a4ee1">**TIP**</font>:
The app is using the payment / preAuth flow, which has been set up in the payment configuration object.
:::

:::VerticalSplitItem
**Expected Outcome**

You will be directed to a successful transaction completed page.

**\***

::Image[]{src="https://api.archbee.com/api/optimize/QGXTyW3MgdNcMjdEa0v8r/UHl6ohZG042X0bvCDdwxc_payment-success.png" size="62" width="1460" height="3132" position="flex-start" alt="payment success" showCaption="false"}
:::
::::

***

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
**Suggested Test Scenario**

Process a card:

- token payment
- token preAuth

***

<font color="#6a4ee1">**TIP**</font>:
The app is using the token payment / token preAuth flow, which has been set up in the payment configuration object.

**If your app allows the consumer to save their card details, use the save card scenario and use the saved card token reference to make a payment**.
:::

:::VerticalSplitItem
**Expected Outcome**

You will be directed to a successful transaction completed page.****
****
**\***

::Image[]{src="https://api.archbee.com/api/optimize/QGXTyW3MgdNcMjdEa0v8r/UHl6ohZG042X0bvCDdwxc_payment-success.png" size="62" width="1460" height="3132" position="flex-start" alt="payment success" showCaption="false"}
:::
::::

***

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
**Suggested Test Scenario**

Process a card payment prompting the consumer to enter their billing address.


:::

:::VerticalSplitItem
**Expected Outcome**

Depending on your use case and app configuration:

- The iOS SDK prompts the consumer to enter their billing details.


:::
::::

**Example Flow: Prompting the consumer to enter their billing address: \***

![ios prompt enter billing details](https://api.archbee.com/api/optimize/QGXTyW3MgdNcMjdEa0v8r/J89D_TMlsi8xSyj4na1tD_ios-sdk-billing-details.png)

***

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
**Suggested Test Scenario**

Process a card payment without the billing address fields displayed.
:::

:::VerticalSplitItem
**Expected Outcome**

Depending on your use case and app configuration:

- The iOS SDK does not prompt the consumer to enter their billing details.

**If you process a token payment, the billing details form will not be displayed in the payment flow.**

****
This is due to the card token being used, which already has the cardholders details securely saved.


:::
::::

**Example 'No Challenge' Flow: \***

![ios no challenge flow](https://api.archbee.com/api/optimize/QGXTyW3MgdNcMjdEa0v8r/BdVDzFjgR4Iru6DV1wj9i_ios-no-challenge.png)

***

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
**Suggested Test Scenario**

Handle a 3D Secure 2 flow.

***

<font color="#6a4ee1">**TIP**</font>:&#x20;
It is useful to have an understanding of the full 3DS 2 payment flow, including the conditional steps, to verify how it relates to the user journey in your app.

For more information on the 3DS 2 flow, see [How 3D Secure Works](docId\:K7FnZbol73SsCtbct4NXM).&#x20;
:::

:::VerticalSplitItem
**Expected Outcome**

Depending on your use case and app configuration:

- Use the Card Holder Name table to trigger any 3D Secure 2 flow, see CardHolderName Table.
- Your app explicitly forces a challenge flow, so the consumer will be directed to the challenge page.

For the purpose of this exercise, below we have an example of a:

- Frictionless flow.
- Successful challenge flow.
- Unsuccessful challenge flow.
:::
::::

**Example 3D Secure 2 'Frictionless' Flow: \***

![ios no challenge flow](https://api.archbee.com/api/optimize/QGXTyW3MgdNcMjdEa0v8r/BdVDzFjgR4Iru6DV1wj9i_ios-no-challenge.png)

***

**Example Successful 3D Secure 2 'Challenge' Flow: \***

![ios prompt enter billing details](https://api.archbee.com/api/optimize/QGXTyW3MgdNcMjdEa0v8r/5QAOqmguX_NB4OMyHMXnM_ios-sdk-billing-details.png)

***

**Example Unsuccessful 3D Secure 2 'Challenge' Flow: \***

![ios unsuccessful challenge flow](https://api.archbee.com/api/optimize/QGXTyW3MgdNcMjdEa0v8r/bPVPgRUusTfKcnpAOeb1o_ios-sdk-card-challenge-unsuccessful.png)

***

### Test Card Data

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

***

**Calling the Mobile SDK Functions**

For more information on integrating your iOS app, including calling the Mobile SDK functions see [ Integrating with Judopay](docId\:FYeF-N37tnL1c5dssCmL3).

***

## Card Payment 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
-

:::hint{type="warning"}
&#x20;**\***&#x54;hese images are from our dummy app, your interface may look different.
:::

***

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
**Suggested Negative Test Scenario**

To handle a decline scenario, attempt to perform a card:

- payment
- preAuth&#x20;

request decline using the following:

- **cardNumber**: 4221690000004963
- **cv2**: 452
- **expiryDate**: 12/24
:::

:::VerticalSplitItem
**Expected Error and Description**

Card declined

You will be re-directed to an error page with an error message.

**\***

::Image[]{src="https://api.archbee.com/api/optimize/QGXTyW3MgdNcMjdEa0v8r/BBcykH2G9ftwxj62SEANi_payment-fail-page.png" size="70" width="1463" height="3135" position="flex-start" alt="ios payment failed screen" showCaption="false"}


:::
::::

***

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
**Suggested Negative Test Scenario**

To handle a decline scenario, attempt to perform a card:

- payment
- preAuth request decline.

Using the following example use cases:

- Enter an invalid cvv
- User taps the cancel button on the 3DS 2 challenge screen
:::

:::VerticalSplitItem
**Expected Error and Description**

Card declined

You will be re-directed to an error page with an error message.


**\***

::Image[]{src="https://api.archbee.com/api/optimize/QGXTyW3MgdNcMjdEa0v8r/BBcykH2G9ftwxj62SEANi_payment-fail-page.png" size="70" width="1463" height="3135" position="flex-start" alt="ios payment failed screen" showCaption="false"}
:::
::::

***

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
**Suggested Negative Test Scenario**

Attempt to perform a card payment where the incorrect card details are entered.

This will perform the field validation checks.
:::

:::VerticalSplitItem
**Expected Error and Description**

Payment declined

Form validation error messages will be displayed in the form.

The **Pay Now** button will be greyed out.&#x20;

**\***

::Image[]{src="https://api.archbee.com/api/optimize/QGXTyW3MgdNcMjdEa0v8r/YlIyKj6IHEuyYwYK0wgja_ios-error.png" size="70" width="1190" height="2546" position="flex-start" alt="ios button greyed out" showCaption="false"}
:::
::::

