diff --git a/src/layouts/payment-method/payment-method-question/payment-method-question.vue b/src/layouts/payment-method/payment-method-question/payment-method-question.vue index b4001e32f..e8122d0ef 100644 --- a/src/layouts/payment-method/payment-method-question/payment-method-question.vue +++ b/src/layouts/payment-method/payment-method-question/payment-method-question.vue @@ -10,6 +10,8 @@ isRequired :validationRules="validationRules" :hasRecal="hasRecal" + :isApplePay="isApplePay" + :isInsurance="isInsurance" v-model="selectedMethod" textPosition="text-start" /> @@ -31,6 +33,8 @@ export default { modelValue: String, validationRules: String, hasRecal: Boolean, + isApplePay: Boolean, + isInsurance: Boolean, }, methods: { getAnswersNullSafe(widgetName) { @@ -60,8 +64,27 @@ export default { if (this.hasRecal) { cmsData = this.getAnswersNullSafe("PaymentMethodHasRecalWidget"); } else { - cmsData = this.getAnswersNullSafe("PaymentMethodWidget"); + if (this.isApplePay) { + cmsData = this.getAnswersNullSafe("PaymentMethodWidget"); + } else { + cmsData = this.getAnswersNullSafe("PaymentMethodHasRecalWidget"); + } } + + if (this.hasRecal || this.isInsurance) { + var tempItems = cmsData.map((answer) => { + return { + buttonLabel: answer.Text, + altText: answer.Text, + groupName: "payment-method", + value: answer.Name, + buttonImage: answer.AnswerImageUrl, + }; + }); + + return tempItems.filter((a) => a.value != "Insurance"); + } + return cmsData.map((answer) => { return { buttonLabel: answer.Text, diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index ad075c287..9c663cc1b 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -68,6 +68,8 @@ v-if="isPiaEnabled && totalAmountDue > 0" v-model="paymentMethodInternalModel" :hasRecal="hasRecal" + :isApplePay="isApplePay" + :isInsurance="isInsurance" validationRules="payment-method-required" />