thawani-nodejs
Version:
Node.js library for Thawani Payment Gateway
42 lines • 1.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PaymentIntents = void 0;
const base_1 = require("./base");
const constants_1 = require("../constants");
class PaymentIntents extends base_1.BaseResource {
async create(params) {
return this.request({
method: 'POST',
url: constants_1.API_ENDPOINTS.paymentIntents,
data: params
});
}
async retrieve(paymentIntentId) {
return this.request({
method: 'GET',
url: `${constants_1.API_ENDPOINTS.paymentIntents}/${paymentIntentId}`
});
}
async confirm(paymentIntentId, data) {
return this.request({
method: 'POST',
url: `${constants_1.API_ENDPOINTS.paymentIntents}/${paymentIntentId}/confirm`,
data
});
}
async cancel(paymentIntentId) {
return this.request({
method: 'POST',
url: `${constants_1.API_ENDPOINTS.paymentIntents}/${paymentIntentId}/cancel`
});
}
async list(limit = 10, skip = 0) {
return this.request({
method: 'GET',
url: constants_1.API_ENDPOINTS.paymentIntents,
params: { limit, skip }
});
}
}
exports.PaymentIntents = PaymentIntents;
//# sourceMappingURL=payment-intents.js.map