palmpaywrappersdk
Version:
PalmPay Wrapper Sdk
94 lines (93 loc) • 3.14 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PayOutPaymentRequestBuilder = exports.PayOutPaymentRequest = void 0;
const PaymentRequest_1 = require("./PaymentRequest");
class PayOutPaymentRequest extends PaymentRequest_1.PaymentRequest {
constructor(paymentRequest, orderId, title, description, payeeName, payeeBankCode, payeeBankAccNo, payeePhoneNo, amount, currency, notifyUrl, remark) {
super(paymentRequest.requestTime, paymentRequest.version, paymentRequest.nonceStr);
this.orderId = orderId;
this.title = title;
this.description = description;
this.payeeName = payeeName;
this.payeeBankCode = payeeBankCode;
this.payeeBankAccNo = payeeBankAccNo;
this.payeePhoneNo = payeePhoneNo;
this.currency = currency;
this.amount = amount;
this.currency = currency;
this.notifyUrl = notifyUrl;
this.remark = remark;
}
toJSON() {
return {
requestTime: this.requestTime,
version: this.version,
nonceStr: this.nonceStr,
orderId: this.orderId,
title: this.title,
description: this.description,
payeeName: this.payeeName,
payeeBankCode: this.payeeBankCode,
payeeBankAccNo: this.payeeBankAccNo,
payeePhoneNo: this.payeePhoneNo,
amount: this.amount,
currency: this.currency,
notifyUrl: this.notifyUrl,
remark: this.remark,
};
}
}
exports.PayOutPaymentRequest = PayOutPaymentRequest;
class PayOutPaymentRequestBuilder extends PaymentRequest_1.BuildPayload {
constructor(requestTime, version, nonceStr) {
super(requestTime, version, nonceStr);
}
setOrderId(orderId) {
this.orderId = orderId;
return this;
}
setTitle(title) {
this.title = title;
return this;
}
setDescription(description) {
this.description = description;
return this;
}
setPayeeName(payeeName) {
this.payeeName = payeeName;
return this;
}
setPayeeBankCode(payeeBankCode) {
this.payeeBankCode = payeeBankCode;
return this;
}
setPayeeBankAccNo(payeeBankAccNo) {
this.payeeBankAccNo = payeeBankAccNo;
return this;
}
setPayeePhoneNo(payeePhoneNo) {
this.payeePhoneNo = payeePhoneNo;
return this;
}
setAmount(amount) {
this.amount = amount;
return this;
}
setCurrency(currency) {
this.currency = currency;
return this;
}
setNotifyUrl(notifyUrl) {
this.notifyUrl = notifyUrl;
return this;
}
setRemark(remark) {
this.remark = remark;
return this;
}
build() {
return new PayOutPaymentRequest(super.build(), this.orderId, this.title, this.description, this.payeeName, this.payeeBankCode, this.payeeBankAccNo, this.payeePhoneNo, this.amount, this.currency, this.notifyUrl, this.remark);
}
}
exports.PayOutPaymentRequestBuilder = PayOutPaymentRequestBuilder;