-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.js
45 lines (39 loc) · 1.02 KB
/
example.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
/**
* Created by Aureliano on 25/02/2016.
*/
var PaypalService = require('./PaypalService');
var service = new PaypalService(<USER>,<PWD>,<SIGNATURE>);
service.askAuthorization(
100,
'EUR',
'http://digitalx.it/',
'http://digitalx.it/',
{
'NOSHIPPING':1,
'ADDROVERRIDE':0
},
function onOk(err,res){
"use strict";
console.log(service.generatePaymentUrlFromRaw(res));
}
);
service.askExpressCheckoutDetails(<TRANSACTIONID>,{},
function onOk(err,res) {
console.log(JSON.stringify(service.objectify(res)));
}
)
service.doExpressCheckoutPayment(<TRANSACTIONID>,<PAYERID>,100,'EUR',{},
function onOk(err,res) {
console.log(JSON.stringify(service.objectify(res)));
}
)
service.doCapture(<TRANSACTIONID>,100,'EUR',{},
function onOk(err,res) {
console.log(JSON.stringify(service.objectify(res)));
}
)
service.doVoid(<TRANSACTIONID>,{},
function onOk(err,res) {
console.log(JSON.stringify(service.objectify(res)));
}
)