-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.js
99 lines (86 loc) · 3.39 KB
/
main.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
require('dotenv').config();
const util = require('util');
const Payoneer = require('./src/payoneer');
const payoneer = new Payoneer({
uri: process.env.URI,
username: process.env.PARTNER_USERNAME,
apiPassword: process.env.PARTNER_API_PASSWORD,
partnerId: process.env.PARTNER_ID
});
// Return the status of the API
// payoneer.echo().then(function(data) {
// console.log('Response:');
// console.log(util.inspect(data, { depth: null, colors: true }));
// }).catch(function(error) {
// console.log(error.message);
// });
// Return the API version
// payoneer.getVersion().then(function(data) {
// console.log('Response:');
// console.log(util.inspect(data, { depth: null, colors: true }));
// }).catch(function(error) {
// console.log(error.message);
// });
// Submit a payment request to Payoneer's system
// payoneer.sendPayment('AGILITYFEAT100069280-PAY', 9, 10, 20, 'Created from the wrapper', null, null, 'USD').then(function(data) {
// console.log('Response:');
// console.log(util.inspect(data, { depth: null, colors: true }));
// }).catch(function(error) {
// console.log(error.message);
// });
// Report the status of a payment that was previously sent to Payoneer system
// payoneer.getPaymentStatus(10, 7).then(function(data) {
// console.log('Response:');
// console.log(util.inspect(data, { depth: null, colors: true }));
// }).catch(function(error) {
// console.log(error.message);
// });
// Return the client's account balance
// payoneer.getAccountDetails().then(function(data) {
// console.log('Response:');
// console.log(util.inspect(data, { depth: null, colors: true }));
// }).catch(function(error) {
// console.log(error.message);
// });
// Return details about the requested payee and its status at Payoneer
// payoneer.getPayeeDetails(10).then(function(data) {
// console.log('Response:');
// console.log(util.inspect(data, { depth: null, colors: true }));
// }).catch(function(error) {
// console.log(error.message);
// });
// Change the ID of an existing payee (old) to a new one
// payoneer.changePayeeId(10, 13).then(function(data) {
// console.log('Response:');
// console.log(util.inspect(data, { depth: null, colors: true }));
// }).catch(function(error) {
// console.log(error.message);
// });
// Return all payments made to payees, grouped by a payment method
// payoneer.getPayeesReport(0, '02/01/2016', '02/28/2016').then(function(data) {
// console.log('Response:');
// console.log(util.inspect(data, { depth: null, colors: true }));
// }).catch(function(error) {
// console.log(error.message);
// });
// Return all payments made to a specified payee
// payoneer.getSinglePayeeReport(10).then(function(data) {
// console.log('Response:');
// console.log(util.inspect(data, { depth: null, colors: true }));
// }).catch(function(error) {
// console.log(error.message);
// });
// Return a list of all payments that are unclaimed in XML format
// payoneer.getUnclaimedPaymentsXml().then(function(data) {
// console.log('Response:');
// console.log(util.inspect(data, { depth: null, colors: true }));
// }).catch(function(error) {
// console.log(error.message);
// });
// Cancel a payment that has not been processed and loaded to an account
// payoneer.cancelPayment(8).then(function(data) {
// console.log('Response:');
// console.log(util.inspect(data, { depth: null, colors: true }));
// }).catch(function(error) {
// console.log(error.message);
// });