paystack-sdk
Version:
Paystack SDK written in Typescript
59 lines (58 loc) • 2.68 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Paystack = void 0;
const axios_1 = require("axios");
const apple_1 = require("./apple/apple");
const charge_1 = require("./charge/charge");
const customer_1 = require("./customer/customer");
const dedicated_1 = require("./dedicated/dedicated");
const invoice_1 = require("./invoice/invoice");
const payment_1 = require("./payment/payment");
const plan_1 = require("./plan");
const product_1 = require("./product/product");
const recipient_1 = require("./recipient/recipient");
const settlement_1 = require("./settlement/settlement");
const split_1 = require("./split/split");
const subaccount_1 = require("./subaccounts/subaccount");
const subscription_1 = require("./subscription/subscription");
const transaction_1 = require("./transaction/transaction");
const transfer_1 = require("./transfer/transfer");
const bulkcharge_1 = require("./bulkcharge/bulkcharge");
const verification_1 = require("./verification/verification");
const refund_1 = require("./refund/refund");
/**
* Paystack SDK
* @author Asaju Enitan <@tPriest>
*/
class Paystack {
constructor(key) {
this.key = key;
this.http = new axios_1.Axios({
baseURL: 'https://api.paystack.co',
headers: {
Authorization: `Bearer ${this.key}`,
'Content-Type': 'application/json',
},
});
this.http.interceptors.response.use((response) => (response.data = JSON.parse(response.data)));
this.bulkcharge = new bulkcharge_1.BulkCharge(this.http);
this.charge = new charge_1.Charge(this.http);
this.customer = new customer_1.Customer(this.http);
this.dedicated = new dedicated_1.DedicatedAccount(this.http);
this.plan = new plan_1.Plan(this.http);
this.product = new product_1.Product(this.http);
this.split = new split_1.TransactionSplit(this.http);
this.subscription = new subscription_1.Subscription(this.http);
this.transaction = new transaction_1.Transaction(this.http);
this.transfer = new transfer_1.Transfer(this.http);
this.applePay = new apple_1.ApplePay(this.http);
this.subAccount = new subaccount_1.SubAccount(this.http);
this.page = new payment_1.PaymentPage(this.http);
this.invoice = new invoice_1.Invoice(this.http);
this.settlement = new settlement_1.Settlement(this.http);
this.recipient = new recipient_1.Recipient(this.http);
this.refund = new refund_1.Refund(this.http);
this.verification = new verification_1.Verification(this.http);
}
}
exports.Paystack = Paystack;