react-native-unit-components
Version:
Unit React Native components
42 lines (40 loc) • 1.8 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getBookPaymentScript = exports.getBookPaymentParams = void 0;
var _bodyScript = require("./../../scripts/html/bodyScript");
var _paymentsMessage = require("../../messages/webMessages/paymentsMessage");
const getBookPaymentParams = props => {
const accountIdParam = props.accountId ? `account-id="${props.accountId}"` : '';
const counterpartyAccountIdParam = props.counterPartyAccountId ? `counterparty-account-id="${props.counterPartyAccountId}"` : '';
const counterpartyNameParam = props.counterPartyName ? `counterparty-name="${props.counterPartyName}"` : '';
return `
${accountIdParam}
is-same-customer="${props.isSameCustomer || false}"
${counterpartyAccountIdParam}
${counterpartyNameParam}
is-auto-focus="${props.isAutoFocus || false}"
initial-stage-back-button="${props.initialStageBackButton ?? false}"
final-stage-done-button="${props.finalStageDoneButton ?? false}"
style="height: 100%"
`;
};
exports.getBookPaymentParams = getBookPaymentParams;
const getBookPaymentScript = () => {
return `
window.addEventListener("${_paymentsMessage.PaymentMessage.PAYMENT_CREATED}", (e) => {
const response = e.detail
response.then((data) => {
postMessageToSDK({ type: "${_paymentsMessage.PaymentMessage.PAYMENT_CREATED}", details: { data: JSON.stringify(data.data) }})
}).catch((e) => {
console.log(e)
})
});
${_bodyScript.LISTENERS.requestRefresh}
${_bodyScript.LISTENERS.unitPaymentInitialStageBackButtonClicked}
${_bodyScript.LISTENERS.unitPaymentFinalStageDoneButtonClicked}
`;
};
exports.getBookPaymentScript = getBookPaymentScript;
//# sourceMappingURL=UNBookPaymentComponent.utils.js.map
;