UNPKG

paystack-sdk

Version:
41 lines (40 loc) 1.29 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Transfer = void 0; const control_1 = require("./control"); class Transfer { constructor(http) { this.http = http; this.control = new control_1.Control(http); } /** * # Initiate Transfer * Status of transfer object returned will be `pending` if OTP is disabled. * In the event that an OTP is required, status will read `otp`. */ async initiate(data) { return await this.http.post('/transfer', JSON.stringify(data)); } /** * # Finalize Transfer * Finalize an initiated transfer */ async finalize(transferCode, otp) { return await this.http.post('/transfer/finalize_transfer', JSON.stringify({ transfer_code: transferCode, otp })); } async bulk(data) { return await this.http.post('/transfer/bulk', JSON.stringify(data)); } async list(queryParams) { return await this.http.get('/transfer', { params: { ...queryParams }, }); } async fetch(idOrCode) { return await this.http.get(`/transfer/${idOrCode}`); } async verify(reference) { return await this.http.get(`transfer/verify/${reference}`); } } exports.Transfer = Transfer;