> ## Documentation Index
> Fetch the complete documentation index at: https://primer.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Ecommpay

> Process Card, Apple Pay and Google Pay payments through Ecommpay.

Ecommpay is a payment service provider for online businesses. Connect Ecommpay to Primer to process Card, Apple Pay and Google Pay payments, and route them using Workflows.

## At a glance

### Supported payment methods

| Payment method | Payment method type | Integration guide |
| - | - | - |
| Card | `PAYMENT_CARD` | [Card](https://primer.io/docs/connections/payment-methods/card/overview.md) |
| Apple Pay | `APPLE_PAY` | [Apple Pay](https://primer.io/docs/connections/payment-methods/apple-pay/overview.md) |
| Google Pay | `GOOGLE_PAY` | [Google Pay](https://primer.io/docs/connections/payment-methods/google-pay/overview.md) |

Ecommpay uses Primer's standard card form and Primer's native Apple Pay and Google Pay integrations, so no Ecommpay-specific SDK code is required.

### Supported capabilities

| Capability | Card | Apple Pay | Google Pay |
| - | - | - | - |
| Authorization and capture | Yes | Yes | Yes |
| Partial capture | Yes | Yes | Yes |
| Full, partial and multiple refunds | Yes | Yes | Yes |
| Adjust authorization | Yes | Yes | Yes |
| Merchant-initiated transactions | Yes | Yes | Yes |

### 3D Secure

Primer performs 3D Secure authentication using the [Perform 3DS action](https://primer.io/docs/workflows/apps/native-apps/primer-payments-app/perform-3ds-action.md) and passes the result to Ecommpay. Ecommpay does not run its own 3D Secure for payments processed through Primer.

## Get started with Ecommpay

### Before you begin

If this is your first connection, make sure to follow the [Get started guide](https://primer.io/docs/get-started/overview.md) to begin processing payments with Primer.

You need an Ecommpay account with a test project for sandbox and a production project for live payments. Contact Ecommpay to get your test project credentials.

> [!NOTE]
>
> Only users with the **Merchant Admin role** and two-factor authentication (2FA) enabled can view a project's Secret Key in the Ecommpay Dashboard. Please ensure that someone with these permissions is available to retrieve the Secret Key during the integration setup.

### Credentials

In your Ecommpay Dashboard, go to **Management** > **Projects**, open your project and stay on the **General** tab.

| Field | Where to find it |
| - | - |
| **Project ID** | Shown on the project's **General** tab |
| **Secret Key** | Select **Tap to see the secret key** and enter your 2FA code. Copy the key that appears. |

### Configure in the Dashboard

**1. Add Ecommpay to your Dashboard**

Go to [Integrations](https://dashboard.primer.io/integrations), select **New integration**, search for Ecommpay and enter your **Project ID** and **Secret Key**.

**2. Add a callback in Ecommpay**

In your Ecommpay Dashboard, go to **Projects**, open **Callbacks** and select **Add new**. Enter the callback URL shown in the Primer Dashboard and save. Primer uses this callback to receive payment updates from Ecommpay.

**3. Activate the payment methods on the Checkout**

Go to [Checkout](https://dashboard.primer.io/checkout) and activate Card, Apple Pay and Google Pay.

**4. Route payments with Workflows**

In [Workflows](https://primer.io/docs/workflows/overview.md), select Ecommpay in the **Authorize payment** action for the payment methods you want to route to it. Add the **Perform 3DS** action before authorization for card payments.

### Prepare the client session

In addition to the parameters required by each payment method, Ecommpay requires the following:

| Parameter | Required | Description |
| - | - | - |
| `customer.emailAddress` | Yes | The customer's email address |
| `customer.mobileNumber` | Yes | The customer's phone number, as 4 to 24 digits only. Do not include spaces, hyphens, a leading `+` or other characters. |
| `cardholderName` | One of the options below is required | The cardholder's name |
| `customer.first_name` + `customer.last_name` | Alternative to `cardholderName` | The customer's first and last name. Both fields must be provided together. |

## Considerations

* **CVV required.** Ecommpay requires a CVV for card payments, including payments with saved cards. Merchant-initiated transactions do not need a CVV when the initial payment included one.
* **3D Secure required.** Ecommpay requires 3D Secure for GBP and EUR card payments. Payments routed to Ecommpay without a 3D Secure result may be declined.
* **Asynchronous processing.** Ecommpay completes some transactions asynchronously. Use the PAYMENT.STATUS webhook to get the final status of a payment.

## Test in sandbox

Connect your Ecommpay project to your Primer Sandbox environment. In the Ecommpay sandbox, the result depends on the amount, the currency and the card you use.

> [!WARNING]
>
> Use an amount of `1000` in minor units (for example, 10.00 EUR) for every sandbox transaction.

**Card**

**Test a 3DS challenge.** Use EUR or GBP with one of these cards, and enter the OTP when the challenge appears.

| Network | Card number | OTP |
| - | - | - |
| Visa | `4916 9940 6425 2017` | `9798` |
| Mastercard | `5306 8899 4283 3340` | `1234` |

**Test without a 3DS challenge.** Use a currency such as AUD or USD. The payment is authorized without a challenge.

**Test a saved card.** Include the CVV when you pay with a saved card.

**Apple Pay**

Apple Pay payments do not require a 3DS challenge. See [Apple Pay](https://primer.io/docs/connections/payment-methods/apple-pay/overview.md) for how to test recurring Apple Pay payments.

**Google Pay**

**Test Google Pay on Android.** Use an Android device and a Mastercard from the Google Pay test card suite. These sandbox payments do not require a 3D Secure challenge.

Your Workflow must include the **is tokenized** condition for Google Pay payments routed to Ecommpay.

> [!WARNING]
>
> Google Pay through a website or browser cannot be tested in the Ecommpay sandbox. Test this flow in production, including its 3D Secure behaviour.

**Merchant-initiated**

In the Ecommpay sandbox, you can test merchant-initiated transactions with a **Visa** card only. Make a customer-initiated payment that saves the card, then create a merchant-initiated payment with the saved payment method.

## Go live

Before switching to production, confirm that:

1. Your Ecommpay production project is active for Card, Apple Pay and Google Pay.
2. You have added Ecommpay in your Primer **production** environment using your production **Project ID** and **Secret Key**.
3. You have added a callback to your production Ecommpay project using the callback URL from your Primer production Dashboard.
4. Your 3D Secure configuration is ready for production. See [3D Secure](https://primer.io/docs/payment-services/3d-secure/get-started.md).
5. You have tested Google Pay on the web in production.
6. You handle the [payment.status webhook](https://primer.io/docs/api-reference/endpoints/v2.4/payment-webhooks/payment-status-update.md) and fulfil orders only on a final status.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.