@builton/node-sdk
Version:
Builton Node SDK.
30 lines (25 loc) • 666 B
JavaScript
const Component = require('./_objects');
const {
get,
refresh,
update,
del,
} = require('./_methods');
class Payment extends Component {
constructor(request, props) {
super(request, props, [get, refresh, update, del]);
this.apiPath = 'payments';
}
pay(body, { urlParams, json = false } = {}, done) {
return this.query({
type: 'post', resource: 'pay', body, urlParams, json,
}, done);
}
// Confirm the payment due to SCA triggered
confirm(body, { urlParams, json = false } = {}, done) {
return this.query({
type: 'post', resource: 'confirm', body, urlParams, json,
}, done);
}
}
module.exports = Payment;