paystack-sdk
Version:
Paystack SDK written in Typescript
56 lines (55 loc) • 2.24 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Charge = void 0;
class Charge {
constructor(http) {
this.http = http;
}
create(data) {
return __awaiter(this, void 0, void 0, function* () {
return yield this.http.post('/charge', JSON.stringify(data));
});
}
submitPIN(data) {
return __awaiter(this, void 0, void 0, function* () {
return yield this.http.post('/charge/submit_pin', JSON.stringify(data));
});
}
submitOTP(data) {
return __awaiter(this, void 0, void 0, function* () {
return yield this.http.post('/charge/submit_otp', JSON.stringify(data));
});
}
submitPhone(data) {
return __awaiter(this, void 0, void 0, function* () {
return yield this.http.post('/charge/submit_phone', JSON.stringify(data));
});
}
submitBirthday(data) {
return __awaiter(this, void 0, void 0, function* () {
return yield this.http.post('/charge/submit_birthday', JSON.stringify(data));
});
}
submitAddress(data) {
return __awaiter(this, void 0, void 0, function* () {
return yield this.http.post('/charge/submit_address', JSON.stringify(data));
});
}
checkPending(reference) {
return __awaiter(this, void 0, void 0, function* () {
return yield this.http.get('/charge/submit_address', {
params: { reference },
});
});
}
}
exports.Charge = Charge;