Skip to main content

Payment

Test environment: https://api-onramp.stg.eopay.io/payment/create-api-on-ramp-payment

Production environment: https://api-onramp.eopay.io/payment/create-api-on-ramp-payment

Request Parameters

ParameterRequiredTypeDescription
typeystringSSO login type. Constant: 'sso_login'.
paymentTypeystringIndicates a card payment. Constant: 'card'.
merchantIdystringMerchant ID assigned during onboarding.
orderUuidystringOrder UUID returned when creating the order.
clientIpystringCustomer IP address.
currencyystringFiat currency code for the payment.
issuerCountryystringCard issuing country. ISO-3166-1 alpha-2 code.
successUrlystringURL to redirect the customer to after a successful order.
failureUrlystringURL to redirect the customer to after a failed order.
merchantEnable3DSybooleanWhether to force 3D Secure.
cardInfo.cardNumberystringCard number used for payment.
cardInfo.cardSchemeystringCard scheme, e.g., Visa, Master.
cardInfo.cardTypeystringCard type. Default: CREDIT.
cardInfo.expiryMonthystringExpiry month.
cardInfo.expiryYearystringExpiry year.
cardInfo.cvvystringCard CVV.
billingAddress.addressLine1ystringCardholder street address.
billingAddress.cityystringCardholder city.
billingAddress.zipystringCardholder postal code.
billingAddress.countryystringCardholder country.
billingAddress.statenstringRequired for the United States and Canada. Provide the ISO 3166-2 subdivision code. US, CA. Example: US-AL.
customer.idystringUnique customer ID from the merchant system, e.g., sso_customer_id = "abc0000001".
customer.emailystringCustomer email.
customer.nameystringCustomer full name. First and last name must be separated by a space, e.g., "Thomas Reed".
customer.phone.numbernstringCustomer phone number.
browserInfo.acceptHeadernstringBrowser metadata.
browserInfo.javaEnablednstringBrowser metadata.
browserInfo.javaScriptEnablednstringBrowser metadata.
browserInfo.languagenstringBrowser metadata.
browserInfo.colorDepthnstringBrowser metadata.
browserInfo.screenHeightnstringBrowser metadata.
browserInfo.screenWidthnstringBrowser metadata.
browserInfo.timeZonenstringBrowser metadata.
browserInfo.userAgentnstringBrowser metadata.

Request Example

{
"type": "sso_login",
"merchantId": "1",
"paymentType": "card",
"orderUuid": "6212f63f-c308-419b-81c3-bfa9cd14bec0",
"clientIp": "1.2.3.4",
"cardInfo": {
"cardNumber": "4242424242424242",
"cardScheme": "Visa",
"cardType": "CREDIT",
"expiryMonth": "12",
"expiryYear": "2012",
"cvv": 123
},
"currency": "USD",
"issuerCountry": "AD",
"billingAddress": {
"addressLine1": "hanghzou",
"city": "HANGZHOU",
"zip": "460000",
"country": "AD"
"state": "AL"
},
"successUrl": "https...ess",
"failureUrl": "https...rue",
"customer": {
"id": 1,
"email": "tester@paymentgateway-system.com",
"name": "cooper",
"phone": { "number": "123123123" }
},
"browserInfo": {
"acceptHeader": "text/html,application/xhtml+xml",
"javaEnabled": "FALSE",
"javaScriptEnabled": "TRUE",
"language": "zh-CN",
"colorDepth": 24,
"screenHeight": 1440,
"screenWidth": 2560,
"timeZone": "3",
"userAgent": "Mozil....36"
}
}

2D Payment Success Response Example

{
ok: true,
status: 200,
order: {
ssoOrderId: "TEST-f6ab5532",
orderUuid: "6212f63f-c308-419b-81c3-bfa9cd14bec0",
merchantId: 1,
fiatAmount: 10,
cryptoAmount: 10.00176,
processingFee: 1.5,
liquidityQuote: 1.0002,
cryptoId: 4,
currencyId: 108,
status: 5,
type: 0,
customerWalletId: 135,
},
"3ds": false,
"2dResponse": {
message: "APPROVED",
responseCode: 10000,
},
}

2D Payment Failure Response Example

{
order: {
ssoOrderId: "API-TEST-NUVEI- TESTER-02",
orderUuid: "20fee2f5-edb5-4163-a94a-2d5819ad685e",
merchantId: 1,
fiatAmount: 10,
cryptoAmount: 8.5215,
processingFee: 1.48,
liquidityQuote: 1.0002,
cryptoId: 5,
currencyId: 108,
status: 6,
type: 0,
customerWalletId: 3669,
},
"3ds": false,
"2dResponse": {
message: "DECLINED",
responseCode: 30004,
},
}

Order Status Codes Returned by 2D Payments

  • SUCCESS: order status = 5
  • ERROR: order status = 6 or order status = 16

3D Trigger Success Response Example

{
status: 200,
order: {
ssoOrderId: "API-TEST-NUVEI- TESTER-03",
orderUuid: "d26a8fe8-236b-4804-aa8d-346fea79f8a9",
merchantId: 1,
fiatAmount: 150,
cryptoAmount: 142.245031,
processingFee: 7.78,
liquidityQuote: 1.0002,
cryptoId: 5,
currencyId: 108,
status: 17,
type: 0,
customerWalletId: 3669,
},
"3ds": true,
"3dResponse": {
acsUrl: "https://3dsn.sandbox.safecharge.com/ThreeDSACSEmulatorChallenge/api/ThreeDSACSChallengeController/ChallengePage?eyJub3RpZmljYXRpb25VUkwiOiJodHRwczovL2FwaS13ZWJob29rLnN0Zy5wZy5ibG9ja2RhbmNlLmlvL2FjcXVpcmVyL3dlYmhvb2svbnV2ZWkvdGhyZWUtZC1jaGFsbGVuZ2UtZG1uIiwidGhyZWVEU1NlcnZlclRyYW5zSUQiOiJkNDliNTRmZC0xMmNjLTQ4YTgtODE5Yy00NjgyYWZiZDNjMmQiLCJhY3NUcmFuc0lEIjoiYzA0ZGJiM2EtMDBmMC00ZmQ0LWJjZGQtY2VlMTI1YzgzZjYyIiwiZHNUcmFuc0lEIjoiN2MyZDkxMDktYWFmMi00MzhkLTgyZTktMTBiYTc1NGJlMmQ4IiwiZGF0YSI6bnVsbCwiTWVzc2FnZVZlcnNpb24iOiIyLjEuMCJ9",
cReq: "eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6ImQ0OWI1NGZkLTEyY2MtNDhhOC04MTljLTQ2ODJhZmJkM2MyZCIsImFjc1RyYW5zSUQiOiJjMDRkYmIzYS0wMGYwLTRmZDQtYmNkZC1jZWUxMjVjODNmNjIiLCJjaGFsbGVuZ2VXaW5kb3dTaXplIjoiMDUiLCJtZXNzYWdlVHlwZSI6IkNSZXEiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMS4wIn0",
},
}

3D Response Fields

tip

Depending on the acquiring channel, cReq can be empty.

If cReq is empty, redirect the customer directly to acsUrl.

ParameterTypeDescription
3dResponse.acsUrlstring3D request endpoint.
3dResponse.cReqstring3D request payload.

Frontend 3D Integration Flow

// making api call
const url = 'https://api-onramp.eopay.io/payment/create-api-on-ramp-payment'
const response = await fetch(url, {
method: 'POST',
body: JSON.stringify({...}),
headers: {
Authorization: 'Bearer jwt-token-returned-after-successful-login'
}
})

const data = await response.json()

// data would be like :
const res = {
"status":200,
"order": {
"ssoOrderId": "API-TEST-NUVEI- TESTER-03",
"orderUuid": "d26a8fe8-236b-4804-aa8d-346fea79f8a9",
"merchantId": 1,
"fiatAmount": 150,
"cryptoAmount": 142.245031,
"processingFee": 7.78,
"liquidityQuote": 1.0002,
"cryptoId": 5,
"currencyId": 108,
"status": 17,
"type": 0,
"customerWalletId": 3669
},
"3ds": true,
"3dResponse": {
"acsUrl": "https://3dsn.sandbox.safecharge.com/ThreeDSACSEmulatorChallenge/api/ThreeDSACSChallengeController/ChallengePage?eyJub3RpZmljYXRpb25VUkwiOiJodHRwczovL2FwaS13ZWJob29rLnN0Zy5wZy5ibG9ja2RhbmNlLmlvL2FjcXVpcmVyL3dlYmhvb2svbnV2ZWkvdGhyZWUtZC1jaGFsbGVuZ2UtZG1uIiwidGhyZWVEU1NlcnZlclRyYW5zSUQiOiJkNDliNTRmZC0xMmNjLTQ4YTgtODE5Yy00NjgyYWZiZDNjMmQiLCJhY3NUcmFuc0lEIjoiYzA0ZGJiM2EtMDBmMC00ZmQ0LWJjZGQtY2VlMTI1YzgzZjYyIiwiZHNUcmFuc0lEIjoiN2MyZDkxMDktYWFmMi00MzhkLTgyZTktMTBiYTc1NGJlMmQ4IiwiZGF0YSI6bnVsbCwiTWVzc2FnZVZlcnNpb24iOiIyLjEuMCJ9",
"cReq": "eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6ImQ0OWI1NGZkLTEyY2MtNDhhOC04MTljLTQ2ODJhZmJkM2MyZCIsImFjc1RyYW5zSUQiOiJjMDRkYmIzYS0wMGYwLTRmZDQtYmNkZC1jZWUxMjVjODNmNjIiLCJjaGFsbGVuZ2VXaW5kb3dTaXplIjoiMDUiLCJtZXNzYWdlVHlwZSI6IkNSZXEiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMS4wIn0"
}
}
// auto submit 3DS Challenge Request
if (res.status === 200 && res['3ds']) {
try {
document.open()
document.write(
`<div style="visibility: hidden">
<form method="POST" action=` + res['3dResponse'].acsUrl + `>
<input type="area" id="creq" name="creq" value=` + res['3dResponse'].cReq + ` />
<input id='send-challenge' type="submit" value="proceed to issuer"/>
</form>
</div>`
)
document.close()
setTimeout(() => {
document.getElementById('send-challenge').click()
}, 100)
return
} catch (error) {
console.error('Error auto submit 3DS Challenge Request form :', error)
}
}

Test Cards

2D

MASTERVISAAMEXDISCOVERDINERSCHINA UNION PAY
5101081046006034476134413614139037551051316953765098216653510053612534337274256221272566426206
5101084411423750476120138147529737551028865692462212674654402743860095402252866233050545583578

3D

ScenarioTest AmountCardholder NameCard Number
Frictionless>=150FL-BRW14000020951595032
Challenge151CL-BRW22221008123677736
non-3DS10Jane Smith4000027891380961