@muhammedaksam/sipay-node
Version:
Node.js TypeScript SDK for Sipay payment gateway
45 lines • 1.54 kB
JavaScript
import { SipayHttpClient } from './utils/http-client';
import { Payments } from './resources/payments';
import { Recurring } from './resources/recurring';
import { BrandedSolution } from './resources/branded-solution';
import { Commissions } from './resources/commissions';
export class Sipay {
constructor(config) {
this.client = new SipayHttpClient(config);
// Initialize resources
this.payments = new Payments(this.client);
this.recurring = new Recurring(this.client);
this.brandedSolution = new BrandedSolution(this.client);
this.commissions = new Commissions(this.client);
}
/**
* Manually authenticate with Sipay API
* Note: This is automatically called when needed, but can be called manually
*/
async authenticate() {
return this.client.authenticate();
}
/**
* Get the current authentication token
*/
getToken() {
return this.client.getToken();
}
/**
* Set a custom authentication token
*/
setToken(token) {
this.client.setToken(token);
}
}
// Default export
export default Sipay;
// Named exports
export * from './types';
export { SipayHttpClient } from './utils/http-client';
export { SipayResource } from './resources/base';
export { Payments } from './resources/payments';
export { Recurring } from './resources/recurring';
export { BrandedSolution } from './resources/branded-solution';
export { Commissions } from './resources/commissions';
//# sourceMappingURL=index.js.map