> ## 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.

# Emerchantpay

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

Emerchantpay is a payment service provider and acquirer for online businesses. Connect Emerchantpay 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) |

Emerchantpay uses Primer's standard card form and Primer's native Apple Pay and Google Pay integrations, so no Emerchantpay-specific SDK code is required. Card networks: Visa and Mastercard.

### Supported capabilities

| Capability | Card | Apple Pay | Google Pay |
| - | - | - | - |
| Authorization | Yes | Yes | Yes |
| Partial capture | Yes | Yes | Yes |
| Cancel | Yes | Yes | Yes |
| Partial and multiple refunds | Yes | Yes | Yes |
| Vaulted payments | Yes | Yes | Yes |
| Merchant-initiated transactions | Yes | Yes | Yes |

### 3D Secure

Primer performs 3D Secure authentication.

## Get started with Emerchantpay

### 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 Emerchantpay staging account for sandbox and a production account for live payments. Ask Emerchantpay to configure **both** accounts with the following settings:

* Smart Routing enabled
* 3rd-party MPI enabled, so Primer can perform 3D Secure
* `authorize` and `authorize3d` transaction types enabled
* Credential on file enabled, including `merchant_unscheduled` for merchant-initiated transactions
* Scheme-tokenized transactions enabled, for Apple Pay and Google Pay
* The currencies and card networks you plan to accept

### Configure in the Dashboard

**1. Add Emerchantpay to your Dashboard**

Go to [Integrations](https://dashboard.primer.io/integrations), select **New integration**, search for Emerchantpay and enter your **Login** and **Password**.

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

Go to [Checkout](https://dashboard.primer.io/checkout) and activate Card, Apple Pay and Google Pay. Primer decrypts Apple Pay and Google Pay tokens, so you do not need to upload wallet certificates to Emerchantpay.

**3. Route payments with Workflows**

In [Workflows](https://primer.io/docs/workflows/overview.md), select Emerchantpay in the **Authorize payment** action for the payment methods you want to route to it.

## Saved cards and merchant-initiated payments

Save the payment method on the first customer payment, then charge it later without the customer present. Primer links each merchant-initiated payment to the first payment automatically.

1. **First payment.** In the client session, set `paymentMethod.paymentType` to `FIRST_PAYMENT`, set `paymentMethod.firstPaymentReason` to `Recurring`, `Unscheduled` or `CardOnFile`, and set `paymentMethod.vaultOnSuccess` to `true`.
2. **Merchant-initiated payment.** Create a payment with the saved payment method token and set `paymentMethod.paymentType` to `UNSCHEDULED` or `SUBSCRIPTION`. A `paymentType` sent inside `metadata` is ignored.

By default, Emerchantpay requires the following fields on merchant-initiated payments:

| Parameter | Description |
| - | - |
| `customer.emailAddress` | The customer's email address |
| `metadata.remote_ip` | An IP address for the payment. |

## Test in sandbox

> [tab] Card
>
> Enter the below cards with a future expiry date. When the 3D Secure challenge appears, enter the OTP shown.
>
> | Scenario | Card number | OTP | Expected result |
> | - | - | - | - |
> | Mastercard, 3D Secure authenticated | `5252 5252 5252 5258` | `9798` | 3D Secure passes, payment authorized |
> | Visa, 3D Secure authenticated | `4916 9940 6425 2017` | `9798` | 3D Secure passes, payment authorized |
> | Visa, no 3D Secure | `4242 4242 4242 4242` | Not required | Payment authorized |
> | Mastercard, no 3D Secure | `5555 5555 5555 4444` | Not required | Payment authorized |

> [tab] Apple Pay
>
> Apple Pay payments are processed as tokenized cards with a cryptogram and do not need 3D Secure.

> [tab] Google Pay
>
> Google Pay payments made with a device token are processed with a cryptogram and do not need 3D Secure.

> [tab] Saved cards and MIT
>
> 1. Make a first payment with `vaultOnSuccess` set to `true`, as described in [Saved cards and merchant-initiated payments](#saved-cards-and-merchant-initiated-payments).
> 2. Create a merchant-initiated payment with the saved payment method token, `customer.emailAddress` and `metadata.remote_ip`.

## Go live

Before switching to production, confirm that:

1. Emerchantpay has configured your **production** account with the same settings as your staging account. See [Before you begin](#before-you-begin).
2. You have added Emerchantpay in your Primer **production** environment using your production **Login** and **Password**.
3. Your 3D Secure configuration is ready for production. See [3D Secure](https://primer.io/docs/payment-services/3d-secure/get-started.md).
4. Your merchant-initiated payments include `customer.emailAddress` and `metadata.remote_ip`.
5. 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.