-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrenew.js
51 lines (48 loc) · 1.28 KB
/
renew.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
51
/*
Scanpay Node.js client library (Node >= v6.6.0)
Docs: https://docs.scanpay.dk/
[email protected] || irc.libera.chat:6697 #scanpay
*/
const apikey = '1089:bx2a4DATi8ad87Nm4uaxg5nggYA8J/Hv99CON977YiEdvYa6DmMwdoRPoYWyBJSi';
const scanpay = require('../')(apikey);
const subscriberid = 5;
const options = {
auth: apikey, // Set an API key for this request (optional)
hostname: 'api.test.scanpay.dk',
headers: {
'X-Cardholder-IP': '189.127.159.146' // Customer IP address
}
};
const data = {
language: 'da',
successurl: 'https://blixen.dk/',
billing: {
name: 'John Doe',
company: 'The Shop A/S',
email: '[email protected]',
phone: '+4512345678',
address: ['Langgade 23, 2. th'],
city: 'Havneby',
zip: '1234',
country: 'DK',
vatin: '35413308',
gln: '7495563456235'
},
shipping: {
name: 'Jan Dåh',
email: '[email protected]',
phone: '+45 87654321',
address: [
'Langgade 23, 1. th',
'C/O The Choppa'
],
city: 'Haveby',
zip: '1235',
country: 'DK'
}
};
scanpay.renew(subscriberid, data, options).then((url) => {
console.log('Subscriber renewal URL: ' + url);
}, (err) => {
console.log(err);
});