-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprocess-basic.js
50 lines (49 loc) · 1.21 KB
/
process-basic.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const fetch = require('node-fetch');
fetch('https://api.nexiopaysandbox.com/pay/v3/process', {
method: 'post',
body: JSON.stringify({
"tokenex": {
"token": "125ecc00-a616-4585-9584-f0e0d8666ea9"
},
"data": {
"amount":1.34,
"currency":"USD",
"customer": {
"firstName": "Rocky",
"lastName": "Squirrel",
"phone": "5555551234",
"email": "[email protected]",
"billToAddressOne": "123 Test St",
"billToAddressTwo": "Suite 123",
"billToCity": "Testerville",
"billToState": "UT",
"billToPostal": "12345",
"billToCountry": "US",
"billToPhone": "8015551234",
"shipToAddressOne": "123 Ship St",
"shipToAddressTwo": "Warehouse 456",
"shipToCity": "Shipperville",
"shipToState": "OR",
"shipToPostal": "67890",
"shipToCountry": "US",
"shipToPhone": "5033335678"
}
},
"uiOptions": {
"displaySubmitButton": true,
"useLegacyIframe": false,
"hideCvc": false,
"requireCvc": true,
"hideBilling": false,
"forceExpirationSelection": true
}
}),
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic eW91clVzZXJOYW1lOnlvdXJQYXNzd29yZA=='
},
}).then((res) => {
return res.json()
}).then((json) => {
console.log(json)
});