Products · Card

International Gateway

Card-not-present (CNP) acceptance via Cybersource. Accept Visa, Mastercard, Amex from 80+ countries. 3DS2 challenge flows handled automatically.

3DS2pm_

How it works

  1. 1

    Tokenise the card

    POST to /v1/payment_methods with type=card and the raw card fields. This returns a pm_ token. Your servers only ever handle the token — the raw PAN never touches your infrastructure again.
  2. 2

    Create a PaymentIntent

    POST to /v1/payment_intents with provider=cybersource_cnp, the payment_method token, and the charge amount. Pass setup_future_usage=off_session if you plan to charge the card again without the cardholder present.
  3. 3

    3DS2 challenge (if required)

    If the issuer requires authentication, next_action.type is three_d_secure. Redirect the customer to next_action.redirect_url. MerasPay hosts the 3DS challenge flow and handles the ACS callback.
  4. 4

    Customer completes challenge

    The cardholder authenticates with their issuing bank on the 3DS page. MerasPay receives the authentication result and passes it to Cybersource.
  5. 5

    Intent transitions automatically

    After authentication (or immediately if 3DS was not required), Cybersource authorises the charge and MerasPay transitions the intent to succeeded. No confirm call is needed for the 3DS path.
  6. 6

    Receive the webhook

    payment_intent.succeeded fires on your webhook endpoint. Use this as the authoritative fulfillment signal.

Endpoints

POST/v1/payment_methods

Tokenise a card — returns a reusable pm_ token.

POST/v1/payment_intents

Create a CNP charge using provider=cybersource_cnp.

GET/v1/payment_intents/{id}

Poll intent status (use webhooks in production).

POST/v1/payment_intents/{id}/cancel

Cancel a pending authorisation.

The International Gateway uses the same PaymentIntents API as domestic rails. Pass provider=cybersource_cnp — no separate endpoint set.

Tokenise a card

NameTypeDescription
type
required
enumcard
card[number]
required
stringPAN — 13–19 digits, no spaces.
card[exp_month]
required
integer1–12.
card[exp_year]
required
integerFour-digit year, e.g. 2029.
card[cvc]
required
string3–4 digit card verification code.
billing_detailsobjectOptional { name, email, address }. Improves auth rates and required for AVS checks.

The returned pm_ token is reusable — store it against the customer for future charges.

3DS2 next_action shape

When the intent requires 3DS authentication, the create response contains:

next_action for 3DSjson
{
  "type": "three_d_secure",
  "redirect_url": "https://3ds.merashub.com/auth/pi_01J4KM...",
  "return_url": "https://yourapp.com/checkout/return"
}

Redirect the customer to redirect_url. After the challenge, MerasPay redirects the cardholder to return_url and the intent transitions server-side. Poll or listen for the webhook — do not rely solely on the return redirect.

Supported cards and currencies

Card networks

  • Visa
  • Mastercard
  • American Express
  • Diners Club
  • JCB (via Cybersource routing)

Settlement currencies

  • USDUS Dollar
  • EUREuro
  • GBPPound Sterling
  • AEDUAE Dirham
  • SARSaudi Riyal
  • DJFDjibouti Franc

Test cards

Card numberNetworkBehaviour
4111111111111111VisaCharge succeeds immediately — no 3DS.
4000000000000002VisaCharge declined. intent transitions to canceled.
4000000000003220Visa3DS challenge required. Use any OTP to pass.
5500005555555559MastercardCharge succeeds immediately.
371449635398431AmexCharge succeeds immediately.

Use any future expiry date, CVC 123 (or 1234 for Amex), and any billing postcode in sandbox.

Example — card payment with pm_ token

1. Tokenise cardbash
curl -X POST https://api.merashub.com/v1/payment_methods \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "type": "card",
    "card": {
      "number": "4111111111111111",
      "exp_month": 12,
      "exp_year": 2029,
      "cvc": "123"
    },
    "billing_details": {
      "name": "Amina Hassan",
      "email": "amina@example.com"
    }
  }'
pm_ token returnedjson
{
  "id": "pm_01J5RQ2XVZB3RN4TQ8E7PWCARD",
  "type": "card",
  "card": {
    "brand": "visa",
    "last4": "1111",
    "exp_month": 12,
    "exp_year": 2029,
    "funding": "credit"
  },
  "billing_details": {
    "name": "Amina Hassan",
    "email": "amina@example.com"
  },
  "created_at": "2026-05-25T10:00:00Z"
}
2. Create PaymentIntentbash
curl -X POST https://api.merashub.com/v1/payment_intents \
  -H "Authorization: Bearer sk_test_..." \
  -H "Idempotency-Key: order_7791" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 12000,
    "currency": "USD",
    "provider": "cybersource_cnp",
    "payment_method": "pm_01J5RQ2XVZB3RN4TQ8E7PWCARD",
    "description": "Order #7791"
  }'
Response — succeeded (no 3DS)json
{
  "id": "pi_01J5RQ9ABCDE4TM5FW9E2VKCNP",
  "status": "succeeded",
  "amount_minor": 12000,
  "currency": "USD",
  "provider": "cybersource_cnp",
  "payment_method": "pm_01J5RQ2XVZB3RN4TQ8E7PWCARD",
  "fraud_details": {
    "decision": "ACCEPT",
    "score": 14
  },
  "succeeded_at": "2026-05-25T10:00:02Z"
}

Recurring charges and 3DS exemptions

For recurring charges, save the payment method (pm_) and set setup_future_usage=off_session on the initial intent. Subsequent charges pass the stored credential flag to Cybersource, and the issuer may grant a 3DS exemption — reducing friction for your customers on repeat payments.

Risk and fraud screening

All CNP transactions pass through Cybersource Decision Manager before authorisation. High-risk transactions may be reviewed or declined automatically. Inspect the fraud_details field on the intent object — decision is one of ACCEPT, REVIEW, or REJECT. Contact support to tune Decision Manager rules for your business.