UNPKG

@playmoweb/payline-typescript-sdk

Version:
57 lines 1.83 kB
import { PaylineOrder } from "../payline-order.js"; import { PaylineBaseRequest } from "./payline-base-request.js"; import { PaylineUtils } from "../../services/payline-utils.js"; import { PaylinePayment } from "../payline-payment.js"; class PaylineDoScheduledWalletPaymentRequest extends PaylineBaseRequest { payment; orderRef; orderDate; scheduledDate; walletId; cardInd; order; // extras privateDataList; // metadata media; subMerchant; constructor(walletId) { super(); this.walletId = walletId; this.payment = new PaylinePayment(); this.order = new PaylineOrder(); this.order.ref = walletId; this.order.date = PaylineUtils.getPaylineNowDateFormat(); } changeContractNumber(contractNumber, force = false) { if (!this.payment.contractNumber || force) { this.payment.contractNumber = contractNumber; } return this; } setCurrency(currency) { this.payment.currency = currency; this.order.currency = currency; return this; } setAmount(amount) { this.payment.amount = amount; this.order.amount = amount; return this; } setPaymentDetails(action, mode, differedActionDate) { this.payment.action = action.code; this.payment.mode = mode; if (differedActionDate) { this.payment.differedActionDate = differedActionDate; } return this; } setOrderDetails(deliveryMode, country, details = {}) { this.order.deliveryMode = deliveryMode.code; this.order.country = country; this.order.details = details; return this; } } export { PaylineDoScheduledWalletPaymentRequest }; //# sourceMappingURL=payline-do-scheduled-wallet-payment-request.js.map