forked from xendit/xendit-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrefund.js
More file actions
28 lines (23 loc) · 751 Bytes
/
Copy pathrefund.js
File metadata and controls
28 lines (23 loc) · 751 Bytes
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
const x = require('../xendit');
const { Refund } = x;
const r = new Refund({});
(async function() {
try {
let refund = await r.createRefund({
invoice_id: '63676ed0eb10cf38ce0550b7',
reason: 'OTHERS',
amount: 1,
});
console.log('created refund', refund); // eslint-disable-line no-console
const refundDetails = await r.getRefundById({ id: refund.id });
// eslint-disable-next-line no-console
console.log('retrieved refund', refundDetails);
const refundList = await r.listRefunds({});
// eslint-disable-next-line no-console
console.log('list of refunds', refundList);
process.exit(0);
} catch (e) {
console.error(e); // eslint-disable-line no-console
process.exit(1);
}
})();