CSR-2130 filter insurance

CSR-2130 filter insurance
This commit is contained in:
CarlNation 2024-07-11 14:05:38 -04:00
parent 9b889be3bb
commit 2b636e6127
2 changed files with 32 additions and 2 deletions

View file

@ -10,6 +10,8 @@
isRequired isRequired
:validationRules="validationRules" :validationRules="validationRules"
:hasRecal="hasRecal" :hasRecal="hasRecal"
:isApplePay="isApplePay"
:isInsurance="isInsurance"
v-model="selectedMethod" v-model="selectedMethod"
textPosition="text-start" /> textPosition="text-start" />
</div> </div>
@ -31,6 +33,8 @@ export default {
modelValue: String, modelValue: String,
validationRules: String, validationRules: String,
hasRecal: Boolean, hasRecal: Boolean,
isApplePay: Boolean,
isInsurance: Boolean,
}, },
methods: { methods: {
getAnswersNullSafe(widgetName) { getAnswersNullSafe(widgetName) {
@ -60,8 +64,27 @@ export default {
if (this.hasRecal) { if (this.hasRecal) {
cmsData = this.getAnswersNullSafe("PaymentMethodHasRecalWidget"); cmsData = this.getAnswersNullSafe("PaymentMethodHasRecalWidget");
} else { } else {
if (this.isApplePay) {
cmsData = this.getAnswersNullSafe("PaymentMethodWidget"); 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 cmsData.map((answer) => {
return { return {
buttonLabel: answer.Text, buttonLabel: answer.Text,

View file

@ -68,6 +68,8 @@
v-if="isPiaEnabled && totalAmountDue > 0" v-if="isPiaEnabled && totalAmountDue > 0"
v-model="paymentMethodInternalModel" v-model="paymentMethodInternalModel"
:hasRecal="hasRecal" :hasRecal="hasRecal"
:isApplePay="isApplePay"
:isInsurance="isInsurance"
validationRules="payment-method-required" /> validationRules="payment-method-required" />
<alert <alert
@ -344,7 +346,6 @@ export default {
availableVaps: [], availableVaps: [],
paymentMethodInternalModel: this.getPaymentMethodFromStore(), paymentMethodInternalModel: this.getPaymentMethodFromStore(),
inactivePromos: this.getInactivePromosFromStore(), inactivePromos: this.getInactivePromosFromStore(),
isAppleDevice: false,
isRecalAckOptIn: false, isRecalAckOptIn: false,
}; };
}, },
@ -574,6 +575,12 @@ export default {
} }
return false; return false;
}, },
isApplePay() {
if (window.ApplePaySession && window.ApplePaySession.canMakePayments()) {
return true;
}
return false;
},
damageInfo() { damageInfo() {
return this.$store.getters.damage; return this.$store.getters.damage;
}, },