UNPKG

afrimomo-sdk

Version:

A unified SDK for African payment providers

22 lines 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PawapayRefunds = void 0; const logger_1 = require("../../../utils/logger"); const serviceWrapper_1 = require("../../../utils/serviceWrapper"); class PawapayRefunds { networkHandler; baseEndpoint = "/refunds"; constructor(networkHandler) { this.networkHandler = networkHandler; } async createRefundRequest(refundData) { logger_1.logger.info("PawaPay: Creating refund request", refundData); return (0, serviceWrapper_1.wrapServiceCall)(() => this.networkHandler.post(this.baseEndpoint, refundData, "creating refund request"), this.networkHandler.handleApiError.bind(this.networkHandler), "creating refund request"); } async getRefundStatus(refundId) { logger_1.logger.info("PawaPay: Getting refund status", { refundId }); return (0, serviceWrapper_1.wrapServiceCall)(() => this.networkHandler.get(`${this.baseEndpoint}/${refundId}`, "getting refund status"), this.networkHandler.handleApiError.bind(this.networkHandler), "getting refund status"); } } exports.PawapayRefunds = PawapayRefunds; //# sourceMappingURL=index.js.map