paystack-sdk
Version:
Paystack SDK written in Typescript
31 lines (30 loc) • 1.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Subscription = void 0;
class Subscription {
constructor(http) {
this.http = http;
}
async create(data) {
return await this.http.post('/subscription', JSON.stringify(data));
}
async list(queryParams) {
return await this.http.get('/subscription', { params: { ...queryParams } });
}
async fetch(idOrCode) {
return await this.http.get(`/subscription/${idOrCode}`);
}
async enable(data) {
return await this.http.post('/subscription/enable', JSON.stringify(data));
}
async disable(data) {
return await this.http.post('/subscription/disable', JSON.stringify(data));
}
async generateSubscriptionLink(code) {
return await this.http.get(`/subscription/${code}/manage/link`);
}
async sendUpdateSubscriptionLink(code) {
return await this.http.post(`/subscription/${code}/manage/email`);
}
}
exports.Subscription = Subscription;