UNPKG

@muhammedaksam/sipay-node

Version:

Node.js TypeScript SDK for Sipay payment gateway

54 lines 1.75 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Payments = void 0; const base_1 = require("./base"); class Payments extends base_1.SipayResource { /** * Process a 2D payment (direct payment without 3D Secure) */ async pay2D(paymentData, options) { const data = this.addMerchantKey(paymentData); return this.post('/api/paySmart2D', data, options); } /** * Process a 3D payment (with 3D Secure authentication) * Returns HTML form that should be rendered and auto-submitted */ async pay3D(paymentData, options) { const data = this.addMerchantKey(paymentData); return this.postForm('/api/paySmart3D', data, options); } /** * Get POS information and installment options for a credit card */ async getPos(posData, options) { const data = this.addMerchantKey({ ...posData, credit_card: posData.credit_card, }); return this.post('/api/getpos', data, options); } /** * Check the status of a payment */ async checkStatus(statusData, options) { const data = this.addMerchantKey(statusData); return this.post('/api/checkstatus', data, options); } /** * Refund a payment */ async refund(refundData, options) { const data = this.addMerchantKey(refundData); return this.post('/api/refund', data, options); } /** * Legacy 2D payment method (maintains compatibility) */ async pay(paymentData, options) { const data = this.addMerchantKey(paymentData); return this.post('/api/pay', data, options); } } exports.Payments = Payments; //# sourceMappingURL=payments.js.map