paystack-sdk
Version:
Paystack SDK written in Typescript
28 lines (27 loc) • 867 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.PaymentPage = void 0;
class PaymentPage {
constructor(http) {
this.http = http;
}
async create(data) {
return await this.http.post('/page', JSON.stringify(data));
}
async list(queryParams) {
return await this.http.get('/page', { params: { ...queryParams } });
}
async fetch(id) {
return await this.http.get(`/page/${id}`);
}
async update(id, data) {
return await this.http.put(`/page/${id}`, JSON.stringify(data));
}
async slugAvailable(slug) {
return await this.http.get(`/page/check_slug_availability/${slug}`);
}
async addProduct(id, products) {
return await this.http.post(`/page/${id}/product`, JSON.stringify({ products }));
}
}
exports.PaymentPage = PaymentPage;
;