@playmoweb/payline-typescript-sdk
Version:
Payline Typescript SDK
60 lines • 1.95 kB
JavaScript
import { PaylineBuyer } from "../payline-buyer.js";
import { PaylineBaseRequest } from "./payline-base-request.js";
class PaylineManageWebWalletRequest extends PaylineBaseRequest {
contractNumber;
selectedContractList;
updatePersonalDetails = "0";
buyer;
owner;
languageCode;
customPaymentPageCode;
securityMode;
returnURL;
cancelURL;
notificationURL;
privateDataList; // metadata
customPaymentTemplateURL;
contractNumberWalletList;
merchantName;
threeDSInfo;
constructor(walletId) {
super();
this.buyer = new PaylineBuyer();
this.buyer.walletId = walletId;
}
changeContractNumber(contractNumber, force = false) {
if (!this.contractNumber || force) {
this.contractNumber = contractNumber;
if (!this.selectedContractList || this.selectedContractList.length === 0) {
this.selectedContractList = [{ selectedContract: contractNumber }];
}
}
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;
}
allowPersonalDetailsUpdate(allow) {
this.updatePersonalDetails = allow ? "1" : "0";
return this;
}
setSelectedContracts(contractsNumber) {
this.selectedContractList = (contractsNumber || []).map(selectedContract => ({ selectedContract }));
return this;
}
setCustomPageCode(code) {
this.customPaymentPageCode = code;
return this;
}
}
export { PaylineManageWebWalletRequest };
//# sourceMappingURL=payline-manage-web-wallet-request.js.map