CSR-2130 payment method page corrections
CSR-2130 payment method page corrections
This commit is contained in:
parent
febea7909a
commit
9d37938535
3 changed files with 18 additions and 28 deletions
|
|
@ -9,10 +9,8 @@
|
|||
:answers="paymentMethodAnswerData"
|
||||
isRequired
|
||||
:validationRules="validationRules"
|
||||
:hasRecal="hasRecal"
|
||||
:showApplePay="showApplePay"
|
||||
:isInsurance="isInsurance"
|
||||
:isPiaEnabled="isPiaEnabled"
|
||||
v-model="selectedMethod"
|
||||
textPosition="text-start" />
|
||||
</div>
|
||||
|
|
@ -21,8 +19,6 @@
|
|||
<script>
|
||||
import buttonQuestion from "@/digital-components/button-question/button-question";
|
||||
import paymentMethodListButton from "./payment-method-list-button/payment-method-list-button";
|
||||
import store from "@/store";
|
||||
import { paymentMethods, paymentTimes } from "@/constants/payment-method-constants";
|
||||
|
||||
export default {
|
||||
name: "payment-method-question",
|
||||
|
|
@ -34,10 +30,8 @@ export default {
|
|||
props: {
|
||||
modelValue: String,
|
||||
validationRules: String,
|
||||
hasRecal: Boolean,
|
||||
showApplePay: Boolean,
|
||||
isInsurance: Boolean,
|
||||
isPiaEnabled: Boolean,
|
||||
},
|
||||
methods: {
|
||||
getAnswersNullSafe(widgetName) {
|
||||
|
|
@ -64,14 +58,10 @@ export default {
|
|||
},
|
||||
paymentMethodAnswerData() {
|
||||
var cmsData;
|
||||
if (this.hasRecal) {
|
||||
cmsData = this.getAnswersNullSafe("PaymentMethodHasRecalWidget");
|
||||
if (this.showApplePay) {
|
||||
cmsData = this.getAnswersNullSafe("PaymentMethodWidget");
|
||||
} else {
|
||||
if (this.showApplePay) {
|
||||
cmsData = this.getAnswersNullSafe("PaymentMethodWidget");
|
||||
} else {
|
||||
cmsData = this.getAnswersNullSafe("PaymentMethodHasRecalWidget");
|
||||
}
|
||||
cmsData = this.getAnswersNullSafe("PaymentMethodHasRecalWidget");
|
||||
}
|
||||
|
||||
var tempItems = cmsData.map((answer) => {
|
||||
|
|
@ -84,20 +74,13 @@ export default {
|
|||
};
|
||||
});
|
||||
|
||||
if (this.hasRecal || this.isInsurance) {
|
||||
if (this.isInsurance) {
|
||||
tempItems.splice(
|
||||
tempItems.findIndex((a) => a.value === "Insurance"),
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
if (this.hasRecal || !this.isPiaEnabled) {
|
||||
tempItems.splice(
|
||||
tempItems.findIndex((a) => a.value === "PayNow"),
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
return tempItems;
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -65,16 +65,14 @@
|
|||
</div>
|
||||
|
||||
<paymentMethodQuestion
|
||||
v-if="isPiaEnabled && totalAmountDue > 0"
|
||||
v-if="showPaymentMethodQuestions"
|
||||
v-model="paymentMethodInternalModel"
|
||||
:hasRecal="hasRecal"
|
||||
:showApplePay="showApplePay"
|
||||
:isInsurance="isInsurance"
|
||||
:isPiaEnabled="isPiaEnabled"
|
||||
validationRules="payment-method-required" />
|
||||
|
||||
|
||||
<alert
|
||||
v-if="!isPiaEnabled && totalAmountDue > 0"
|
||||
v-if="!showPaymentMethodQuestions && !forwardClicked"
|
||||
:isDismissible="false"
|
||||
alertClass="alert-info"
|
||||
cmsWidgetName="NoPiaDisclaimerWidget"
|
||||
|
|
@ -348,6 +346,7 @@ export default {
|
|||
paymentMethodInternalModel: this.getPaymentMethodFromStore(),
|
||||
inactivePromos: this.getInactivePromosFromStore(),
|
||||
isRecalAckOptIn: false,
|
||||
forwardClicked: false, // this prevents the pia disclaimer from showing when switching to insurance and nav forward
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -490,6 +489,8 @@ export default {
|
|||
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||
},
|
||||
async forwardButtonAction() {
|
||||
this.forwardClicked = true;
|
||||
|
||||
await this.dispatchStoreAction(
|
||||
storeActions.SAVE_PAYMENT_METHOD_CHOICE,
|
||||
this.paymentMethod,
|
||||
|
|
@ -641,6 +642,12 @@ export default {
|
|||
return null;
|
||||
}
|
||||
},
|
||||
showPaymentMethodQuestions() {
|
||||
if (this.isPiaEnabled && this.totalAmountDue > 0 && !this.hasRecal) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
totalAmountDue() {
|
||||
return baseMixin.methods.getAmountDue(this.lineItems);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -665,8 +665,8 @@ export default {
|
|||
iframe.contentWindow.postMessage("hybrid", "*");
|
||||
console.log(new Date() + ": Sent hybrid: new hop no applepay");
|
||||
}
|
||||
|
||||
if (this.paymentType == "cc") {
|
||||
|
||||
if (this.paymentType == "cc" || this.paymentType == "PayNow") {
|
||||
iframe.contentWindow.postMessage("CreditCardChosen", "*");
|
||||
console.log(new Date() + ": Sent creditcard");
|
||||
} else if (this.paymentType == "ap") {
|
||||
|
|
|
|||
Loading…
Reference in a new issue