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