UNPKG

@playmoweb/payline-typescript-sdk

Version:
53 lines 1.74 kB
import { PaylineBaseRequest } from "./payline-base-request.js"; import { PaylineBuyer } from "../payline-buyer.js"; class PaylineCreateWebWalletRequest extends PaylineBaseRequest { contractNumber; selectedContractList; updatePersonalDetails; buyer; owner; languageCode; customPaymentPageCode; securityMode; returnURL; cancelURL; notificationURL; privateDataList; // metadata customPaymentTemplateURL; contractNumberWalletList; constructor() { super(); this.buyer = new PaylineBuyer(); } changeContractNumber(contractNumber, force = false) { if (!this.contractNumber || force) { this.contractNumber = contractNumber; if (!this.selectedContractList || this.selectedContractList.length === 0) { this.selectedContractList = [{ selectedContract: contractNumber }]; } } return this; } setSelectedContracts(contractsNumber) { this.selectedContractList = (contractsNumber || []).map(selectedContract => ({ selectedContract })); return this; } setClientDetails(email, firstName, lastName) { this.buyer.email = email; this.buyer.firstName = firstName; this.buyer.lastName = lastName; return this; } setCallbackUrls(returnURL, cancelURL, notificationURL = null) { this.returnURL = returnURL; this.cancelURL = cancelURL; this.notificationURL = notificationURL; return this; } setCustomPageCode(code) { this.customPaymentPageCode = code; return this; } } export { PaylineCreateWebWalletRequest }; //# sourceMappingURL=payline-create-web-wallet-request.js.map