UNPKG

thawani-nodejs

Version:

Node.js library for Thawani Payment Gateway

31 lines 1.47 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ThawaniClient = void 0; const config_1 = require("./config"); const checkout_1 = require("./resources/checkout"); const customers_1 = require("./resources/customers"); const payment_intents_1 = require("./resources/payment-intents"); const payment_methods_1 = require("./resources/payment-methods"); const payments_1 = require("./resources/payments"); const refunds_1 = require("./resources/refunds"); const webhooks_1 = require("./resources/webhooks"); class ThawaniClient { constructor(config) { this.config = new config_1.Config(config); this.checkout = new checkout_1.Checkout(this.config); this.customers = new customers_1.Customers(this.config); this.paymentIntents = new payment_intents_1.PaymentIntents(this.config); this.paymentMethods = new payment_methods_1.PaymentMethods(this.config); this.payments = new payments_1.Payments(this.config); this.refunds = new refunds_1.Refunds(this.config); this.webhooks = new webhooks_1.WebhookHandler(this.config.secretKey); } getPublicCheckoutUrl(sessionId) { const baseUrl = this.config.isSandbox ? 'https://uatcheckout.thawani.om/pay' : 'https://checkout.thawani.om/pay'; return `${baseUrl}/${sessionId}?key=${this.config.publishableKey}`; } } exports.ThawaniClient = ThawaniClient; //# sourceMappingURL=client.js.map