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
| Parameter | Required | Type | Description |
|---|---|---|---|
| type | y | string | SSO login type. Constant: 'sso_login'. |
| paymentType | y | string | Indicates a card payment. Constant: 'card'. |
| merchantId | y | string | Merchant ID assigned during onboarding. |
| orderUuid | y | string | Order UUID returned when creating the order. |
| clientIp | y | string | Customer IP address. |
| currency | y | string | Fiat currency code for the payment. |
| issuerCountry | y | string | Card issuing country. ISO-3166-1 alpha-2 code. |
| successUrl | y | string | URL to redirect the customer to after a successful order. |
| failureUrl | y | string | URL to redirect the customer to after a failed order. |
| merchantEnable3DS | y | boolean | Whether to force 3D Secure. |
| cardInfo.cardNumber | y | string | Card number used for payment. |
| cardInfo.cardScheme | y | string | Card scheme, e.g., Visa, Master. |
| cardInfo.cardType | y | string | Card type. Default: CREDIT. |
| cardInfo.expiryMonth | y | string | Expiry month. |
| cardInfo.expiryYear | y | string | Expiry year. |
| cardInfo.cvv | y | string | Card CVV. |
| billingAddress.addressLine1 | y | string | Cardholder street address. |
| billingAddress.city | y | string | Cardholder city. |
| billingAddress.zip | y | string | Cardholder postal code. |
| billingAddress.country | y | string | Cardholder country. |
| billingAddress.state | n | string | Required for the United States and Canada. Provide the ISO 3166-2 subdivision code. US, CA. Example: US-AL. |
| customer.id | y | string | Unique customer ID from the merchant system, e.g., sso_customer_id = "abc0000001". |
| customer.email | y | string | Customer email. |
| customer.name | y | string | Customer full name. First and last name must be separated by a space, e.g., "Thomas Reed". |
| customer.phone.number | n | string | Customer phone number. |
| browserInfo.acceptHeader | n | string | Browser metadata. |
| browserInfo.javaEnabled | n | string | Browser metadata. |
| browserInfo.javaScriptEnabled | n | string | Browser metadata. |
| browserInfo.language | n | string | Browser metadata. |
| browserInfo.colorDepth | n | string | Browser metadata. |
| browserInfo.screenHeight | n | string | Browser metadata. |
| browserInfo.screenWidth | n | string | Browser metadata. |
| browserInfo.timeZone | n | string | Browser metadata. |
| browserInfo.userAgent | n | string | Browser 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.
| Parameter | Type | Description |
|---|---|---|
3dResponse.acsUrl | string | 3D request endpoint. |
3dResponse.cReq | string | 3D 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
| MASTER | VISA | AMEX | DISCOVER | DINERS | CHINA UNION PAY |
|---|---|---|---|---|---|
| 5101081046006034 | 4761344136141390 | 375510513169537 | 6509821665351005 | 361253433727425 | 6221272566426206 |
| 5101084411423750 | 4761201381475297 | 375510288656924 | 6221267465440274 | 386009540225286 | 6233050545583578 |
3D
| Scenario | Test Amount | Cardholder Name | Card Number |
|---|---|---|---|
| Frictionless | >=150 | FL-BRW1 | 4000020951595032 |
| Challenge | 151 | CL-BRW2 | 2221008123677736 |
| non-3DS | 10 | Jane Smith | 4000027891380961 |