Merge branch 'develop' into feature/csr-1465
This commit is contained in:
commit
945f3c8366
16 changed files with 320 additions and 148 deletions
|
|
@ -11,12 +11,12 @@ const applicationConfig = {
|
|||
SITE_ENTRY_TRIGGER_VALUE: "FixMyGlass",
|
||||
CASH_PARENT_ACCOUNT_NUMBER: 167132,
|
||||
MY_ACCOUNT: process.env.VUE_APP_MY_ACCOUNT,
|
||||
PAYPAL_SUCCESS_URL:
|
||||
PIA_RESPONSE_URL:
|
||||
location.protocol +
|
||||
"//" +
|
||||
location.host +
|
||||
"/fmg/?fmgPage=payment-pia-return&src=concept-funnel",
|
||||
PAYPAL_CANCEL_URL:
|
||||
PIA_CANCEL_URL:
|
||||
location.protocol +
|
||||
"//" +
|
||||
location.host +
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Note: querystring-helper will change all keys to lowercase so make sure they are here as well
|
||||
const queryStrings = {
|
||||
FMG_PAGE: "fmgPage",
|
||||
START_TYPE: "start_type",
|
||||
|
|
@ -6,6 +7,18 @@ const queryStrings = {
|
|||
ERROR: "error",
|
||||
TOKEN: "token",
|
||||
PAYERID: "payerid",
|
||||
SUBSCRIPTIONID: "subscriptionid",
|
||||
REFERRAL_SEQ_NUM: "referralseqnum",
|
||||
CARD_EXPIRATION_MONTH: "card_expirationmonth",
|
||||
CARD_EXPIRATION_YEAR: "card_expirationyear",
|
||||
CARD_TYPE: "sgcardtype",
|
||||
BILL_TO_POSTAL_CODE: "billto_postalcode",
|
||||
BILL_TO_FIRST_NAME: "billto_firstname",
|
||||
BILL_TO_LAST_NAME: "billto_lastname",
|
||||
REFERENCE_NUMBER: "req_reference_number",
|
||||
AUTH_CODE: "auth_code",
|
||||
TRANSACTION_ID: "transaction_id",
|
||||
TRANS_REFERENCE_NUMBER: "auth_trans_ref_no",
|
||||
};
|
||||
|
||||
export { queryStrings };
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ const storeActions = {
|
|||
SAVE_WORK_ORDER_FLAG: "saveWorkOrderFlag",
|
||||
SAVE_PIA_ERROR_CODE: "savePiaErrorCode",
|
||||
SAVE_PIA_WORK_ORDER: "savePiaWorkOrder",
|
||||
SAVE_CCTOKEN: "saveCCToken",
|
||||
};
|
||||
|
||||
export { storeActions };
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
const storeMutations = {
|
||||
// PAYMENT MUTATIONS
|
||||
UPDATE_WORK_ORDER_FLAG: "updateWorkOrderFlag",
|
||||
UPDATE_PIA_ERROR_CODE: "updatePiaErrorCode",
|
||||
UPDATE_PIA_WORK_ORDER: "updatePiaWorkOrder",
|
||||
UPDATE_CCTOKEN: "updateCCToken",
|
||||
|
||||
// VEHICLE MUTATIONS
|
||||
UPDATE_YEAR: "updateYear",
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@ export default {
|
|||
answer.SubText = "+$" + this.wipersPrice;
|
||||
answers.push(answer);
|
||||
}
|
||||
|
||||
if (this.showAddRainDefense) {
|
||||
const answer = getAnswer("RainDefenseModal", this.answersCmsData);
|
||||
answer.SubText = "+$" + this.rainDefensePrice;
|
||||
|
|
|
|||
|
|
@ -7,12 +7,14 @@
|
|||
@click="toggleClass()">
|
||||
<div class="col d-flex justify-content-between">
|
||||
<span class="label">Amount Due</span
|
||||
><span class="label amount-due">{{ amountDue }}</span>
|
||||
><span class="label amount-due">{{ currencyFormatter.format(amountDue) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="price-table">
|
||||
<div class="service-type" :class="{ packageWithVAPS: packageWithVAPS }">
|
||||
<textBlock :cmsWidgetName="packageNameWidget" /><span>{{ packagePrice }}</span>
|
||||
<textBlock :cmsWidgetName="packageNameWidget" /><span>{{
|
||||
currencyFormatter.format(packagePrice)
|
||||
}}</span>
|
||||
</div>
|
||||
<div
|
||||
v-for="(lineItem, i) in displayedPackageLineItems"
|
||||
|
|
@ -22,7 +24,7 @@
|
|||
<textLink
|
||||
ref="removeLink"
|
||||
linkType="text"
|
||||
text="showMoreShopsLinkText"
|
||||
text="removeLinkText"
|
||||
href="#!"
|
||||
@click-event="removeItem(lineItem)" />
|
||||
</div>
|
||||
|
|
@ -35,7 +37,7 @@
|
|||
<textLink
|
||||
ref="removeLink"
|
||||
linkType="text"
|
||||
text="showMoreShopsLinkText"
|
||||
text="removeLinkText"
|
||||
href="#!"
|
||||
@click-event="removeItem(lineItem)" />
|
||||
<span>{{ lineItem.price }}</span>
|
||||
|
|
@ -45,9 +47,15 @@
|
|||
><span>{{ recycleFee }}</span>
|
||||
</div>
|
||||
<!-- Sub total, sales tax, total columns -->
|
||||
<div class="sub-total"><span>Subtotal</span><span>$320</span></div>
|
||||
<div class="sales-tax"><span>Sales tax</span><span>$1</span></div>
|
||||
<div class="amount-due"><span>Amount due</span><span>$321</span></div>
|
||||
<div class="sub-total">
|
||||
<span>Subtotal</span><span>{{ currencyFormatter.format(subTotal) }}</span>
|
||||
</div>
|
||||
<div class="sales-tax">
|
||||
<span>Sales tax</span><span>{{ currencyFormatter.format(salesTax) }}</span>
|
||||
</div>
|
||||
<div class="amount-due">
|
||||
<span>Amount due</span><span>{{ currencyFormatter.format(amountDue) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -76,28 +84,16 @@ export default {
|
|||
return {
|
||||
isActive: false,
|
||||
packageWithVAPS: false,
|
||||
amountDue: this.getAmountDue(),
|
||||
currencyFormatter: new Intl.NumberFormat("en-US", {
|
||||
style: "currency",
|
||||
currency: "USD",
|
||||
}),
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
toggleClass: function (event) {
|
||||
this.isActive = !this.isActive;
|
||||
},
|
||||
getPackagePriceString(packageName) {
|
||||
const formattedPriceFloat = parseFloat(this.getPackagePrice(packageName)).toFixed(2);
|
||||
return (this.isInsuranceSelected ? "As little as $" : "$") + formattedPriceFloat;
|
||||
},
|
||||
getPackagePrice(packageName) {
|
||||
let priceFloat = this.isInsuranceSelected
|
||||
? 0
|
||||
: baseMixin.methods.getTierOnePackagePrice(
|
||||
baseMixin.methods.filterOutFees(this.availableLineItems)
|
||||
);
|
||||
|
||||
priceFloat += this.getVapsPrice(packageName);
|
||||
|
||||
return priceFloat;
|
||||
},
|
||||
getVapsPrice(packageName) {
|
||||
const vapsItems = this.getVapsLineItemsForSelectedPackage(packageName);
|
||||
|
||||
|
|
@ -157,19 +153,24 @@ export default {
|
|||
this.isRepair,
|
||||
this.vaps
|
||||
);
|
||||
|
||||
return tier;
|
||||
},
|
||||
packagePrice() {
|
||||
let packagePriceString;
|
||||
if (this.packageLevel.length > 0) {
|
||||
packagePriceString = this.getPackagePriceString(this.packageLevel);
|
||||
}
|
||||
return packagePriceString;
|
||||
// return (packagePriceString.length > 0) ? packagePriceString : "Test String";
|
||||
let packagePrice = this.isInsuranceSelected
|
||||
? 0
|
||||
: baseMixin.methods.getTierOnePackagePrice(
|
||||
baseMixin.methods.filterOutFees(this.availableLineItems)
|
||||
);
|
||||
|
||||
packagePrice += this.getVapsPrice(this.packageLevel);
|
||||
|
||||
return packagePrice;
|
||||
},
|
||||
displayedPackageLineItems() {
|
||||
const displayedPackageLineItems = [];
|
||||
const packageLineItems = this.getVapsLineItemsForSelectedPackage(this.packageLevel);
|
||||
|
||||
// TODO Determine if we could get the same list from this.lineItems?
|
||||
packageLineItems?.forEach((item) => {
|
||||
let price = item.sellingPrice + item.kitPrice + item.laborAmount;
|
||||
|
|
@ -181,6 +182,7 @@ export default {
|
|||
};
|
||||
displayedPackageLineItems.push(packageLineItem);
|
||||
});
|
||||
|
||||
return displayedPackageLineItems;
|
||||
},
|
||||
displayedNonPackageLineItems() {
|
||||
|
|
@ -229,6 +231,9 @@ export default {
|
|||
const supportingItems = this.lineItems?.supportingItems;
|
||||
return supportingItems?.length > 0 ? supportingItems : [];
|
||||
},
|
||||
removeLinkText() {
|
||||
return "Remove"; // TODO: get from CMS
|
||||
},
|
||||
recycleLabel() {
|
||||
return "Recycling";
|
||||
},
|
||||
|
|
@ -244,6 +249,29 @@ export default {
|
|||
// }
|
||||
return true;
|
||||
},
|
||||
subTotal() {
|
||||
let subTotal = 0;
|
||||
|
||||
this.lineItems.forEach((lineItem) => {
|
||||
subTotal +=
|
||||
(lineItem.kitPrice ?? 0) +
|
||||
(lineItem.laborAmount ?? 0) +
|
||||
(lineItem.sellingPrice ?? 0);
|
||||
});
|
||||
|
||||
return subTotal;
|
||||
},
|
||||
salesTax() {
|
||||
let salesTax = 0;
|
||||
this.lineItems.forEach((lineItem) => {
|
||||
salesTax += lineItem.salesTax;
|
||||
});
|
||||
|
||||
return salesTax;
|
||||
},
|
||||
amountDue() {
|
||||
return this.subTotal + this.salesTax;
|
||||
},
|
||||
},
|
||||
components: {
|
||||
textBlock,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@
|
|||
@click-event="buttonClick"
|
||||
data-bs-target="#footerModal"
|
||||
data-test-id="nav-bar-main-button"
|
||||
data-bs-dismiss="modal" />
|
||||
data-bs-dismiss="modal"
|
||||
v-if="!isSubmitHidden" />
|
||||
</div>
|
||||
<div v-if="!isBackButtonHidden" class="col-auto link-col py-1 text-break">
|
||||
<textLink
|
||||
|
|
@ -44,6 +45,7 @@ export default {
|
|||
isBackButtonHidden: { type: Boolean, default: false },
|
||||
cmsWidgetName: String,
|
||||
buttonSize: { type: Boolean, default: false },
|
||||
isSubmitHidden: { type: Boolean, default: false },
|
||||
},
|
||||
components: {
|
||||
textLink,
|
||||
|
|
|
|||
|
|
@ -39,12 +39,14 @@ export function getAvailablePackages(glassToReplace, availableLineItems, isRepai
|
|||
isRepair,
|
||||
packageNames.TIER_ONE
|
||||
);
|
||||
|
||||
let tierTwoVaps = getPackageContents(
|
||||
glassToReplace,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_TWO
|
||||
);
|
||||
|
||||
let tierThreeVaps = getPackageContents(
|
||||
glassToReplace,
|
||||
availableLineItems,
|
||||
|
|
@ -87,9 +89,11 @@ export function getPackageContents(glassToReplace, availableLineItems, isRepair,
|
|||
if (shouldFrontWipersBeAvailable(glassToReplace, availableLineItems, isRepair, targetTier)) {
|
||||
vaps.push(partTypeStrings.FRONT_WIPER);
|
||||
}
|
||||
|
||||
if (shouldRearWipersBeAvailable(glassToReplace, availableLineItems, isRepair, targetTier)) {
|
||||
vaps.push(partTypeStrings.REAR_WIPER);
|
||||
}
|
||||
|
||||
if (shouldRainDefenseBeAvailable(glassToReplace, availableLineItems, isRepair, targetTier)) {
|
||||
vaps.push(partTypeStrings.RAIN_DEFENSE);
|
||||
}
|
||||
|
|
@ -107,6 +111,7 @@ export function shouldFrontWipersBeAvailable(
|
|||
partTypeStrings.FRONT_WIPER,
|
||||
availableLineItems
|
||||
);
|
||||
|
||||
const isFrontWindshieldTask =
|
||||
isRepair || containsGlassPieceWithLocation(glassLocations.WINDSHIELD, glassToReplace);
|
||||
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@
|
|||
|
||||
<div>
|
||||
<alert
|
||||
ref="paypalErrorAlert"
|
||||
ref="piaErrorAlert"
|
||||
class="my-4"
|
||||
v-if="displayPaypalAlert"
|
||||
cmsWidgetName="PaypalErrorAlertWidget"
|
||||
v-if="displayPiaAlert"
|
||||
cmsWidgetName="PIAErrorAlertWidget"
|
||||
alertClass="alert-danger"
|
||||
v-bind:isDismissible="false" />
|
||||
</div>
|
||||
|
|
@ -139,7 +139,7 @@ export default {
|
|||
|
||||
const resultMap = await settleAllPromises(promiseResultMap);
|
||||
|
||||
const glassParts = (await store.getters.order.lineItems.glassParts) ?? [];
|
||||
const glassParts = store.getters.order.lineItems.glassParts ?? [];
|
||||
|
||||
const availableLineItems = [
|
||||
resultMap.rainDefense,
|
||||
|
|
@ -156,7 +156,24 @@ export default {
|
|||
"payment-method",
|
||||
false
|
||||
);
|
||||
const lineItems = store.getters.lineItems;
|
||||
|
||||
const lineItems = store.getters.order.lineItems;
|
||||
|
||||
const combinedLineItems = [...glassParts, ...lineItems.supportingItems, ...lineItems.vaps];
|
||||
|
||||
const taxedLineItems = await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
|
||||
{
|
||||
billToAccountNumber: "87291",
|
||||
providerNumber: store.getters.order.serviceLocation.provider.providerNumber,
|
||||
appointmentType: store.getters.order.serviceLocation.appointmentType,
|
||||
serviceLocationState: store.getters.order.serviceLocation.state,
|
||||
serviceLocationZipCode: store.getters.order.serviceLocation.zipCode,
|
||||
pricedLineItems: combinedLineItems,
|
||||
},
|
||||
"payment-method",
|
||||
false
|
||||
);
|
||||
|
||||
const cartItems = [...glassParts, ...lineItems.supportingItems, ...lineItems.vaps]; // TOBEREMOVED BY AJC IN CSR-1384
|
||||
|
||||
|
|
@ -166,7 +183,7 @@ export default {
|
|||
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
vm.availableLineItems = pricedAvailableLineItems;
|
||||
vm.lineItems = lineItems;
|
||||
vm.lineItems = taxedLineItems;
|
||||
});
|
||||
},
|
||||
data() {
|
||||
|
|
@ -175,8 +192,8 @@ export default {
|
|||
|
||||
lineItems: [],
|
||||
availableLineItems: [],
|
||||
displayPaypalAlert: this.getPaypalAlert(),
|
||||
paymentMethodInternalModel: this.getPaymentMethodFromStore(),
|
||||
displayPiaAlert: this.getPiaAlert(),
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -235,7 +252,7 @@ export default {
|
|||
openModal(modalName) {
|
||||
this.$refs[modalName].openModal();
|
||||
},
|
||||
getPaypalAlert() {
|
||||
getPiaAlert() {
|
||||
return store.getters.order.payment.piaErrorCode ? true : false;
|
||||
},
|
||||
getPaymentMethodFromStore() {
|
||||
|
|
@ -338,7 +355,6 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
damageInfo() {
|
||||
// console.log("this.$store.getters.damage ", this.$store.getters.damage)
|
||||
return this.$store.getters.damage;
|
||||
},
|
||||
noPiaDisclaimer() {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import { submitWorkOrder } from "@/helpers/heritage-integration/order-helper.js"
|
|||
import { queryStrings } from "@/constants/query-strings";
|
||||
import { getQuerystringParameter } from "@/helpers/querystring-helper";
|
||||
import { storeActions } from "@/constants/store-actions";
|
||||
import store from "@/store";
|
||||
import baseMixin from "@/mixins/base-mixin.js";
|
||||
import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue";
|
||||
import { Form } from "vee-validate";
|
||||
|
|
@ -17,11 +18,16 @@ export default {
|
|||
name: "payment-pia-return",
|
||||
async mounted() {
|
||||
this.$refs.loadingModal.showModal();
|
||||
// from paypal
|
||||
const piaError = getQuerystringParameter(queryStrings.ERROR);
|
||||
const token = getQuerystringParameter(queryStrings.TOKEN);
|
||||
const payerId = getQuerystringParameter(queryStrings.PAYERID);
|
||||
|
||||
// from credit card
|
||||
const subscriptionID = getQuerystringParameter(queryStrings.SUBSCRIPTIONID);
|
||||
|
||||
if (piaError) {
|
||||
console.log("Error during payment: " + piaError);
|
||||
baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.SAVE_PIA_ERROR_CODE,
|
||||
piaError,
|
||||
|
|
@ -30,32 +36,24 @@ export default {
|
|||
this.$router.navigateWithoutSaving(this.navigationScenarios.PIA_ERROR, this.$route);
|
||||
} else {
|
||||
if (token && payerId) {
|
||||
baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.SAVE_PIA_ERROR_CODE,
|
||||
null,
|
||||
false
|
||||
);
|
||||
baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.SAVE_WORK_ORDER_FLAG,
|
||||
true,
|
||||
false
|
||||
);
|
||||
|
||||
// Final work order submit after returning from PIA.
|
||||
await this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
|
||||
await submitWorkOrder({ pageNameToLog: "payment-pia-return" });
|
||||
this.$refs.loadingModal.isModalVisible = false;
|
||||
this.$router.navigateWithoutSaving(
|
||||
this.navigationScenarios.PIA_SUCCESS,
|
||||
this.$route
|
||||
);
|
||||
await this.processPaypalResponse();
|
||||
} else {
|
||||
baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.SAVE_PIA_ERROR_CODE,
|
||||
piaError,
|
||||
false
|
||||
);
|
||||
this.$router.navigateWithoutSaving(this.navigationScenarios.PIA_ERROR, this.$route);
|
||||
if (subscriptionID) {
|
||||
await this.processCreditCardResponse(subscriptionID);
|
||||
} else {
|
||||
console.log(
|
||||
"Error during payment: " + token + " : " + payerId + " : " + subscriptionID
|
||||
);
|
||||
baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.SAVE_PIA_ERROR_CODE,
|
||||
piaError,
|
||||
false
|
||||
);
|
||||
this.$router.navigateWithoutSaving(
|
||||
this.navigationScenarios.PIA_ERROR,
|
||||
this.$route
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -63,6 +61,68 @@ export default {
|
|||
arePagePrerequisitesValid() {
|
||||
return true;
|
||||
},
|
||||
async processPaypalResponse() {
|
||||
baseMixin.methods.dispatchStoreAction(storeActions.SAVE_PIA_ERROR_CODE, null, false);
|
||||
baseMixin.methods.dispatchStoreAction(storeActions.SAVE_WORK_ORDER_FLAG, true, false);
|
||||
|
||||
await this.saveAndSubmitWorkOrder();
|
||||
},
|
||||
async processCreditCardResponse(subscriptionID) {
|
||||
baseMixin.methods.dispatchStoreAction(storeActions.SAVE_PIA_ERROR_CODE, null, false);
|
||||
baseMixin.methods.dispatchStoreAction(storeActions.SAVE_WORK_ORDER_FLAG, true, false);
|
||||
|
||||
const referralSeqNum = getQuerystringParameter(queryStrings.REFERRAL_SEQ_NUM);
|
||||
if (referralSeqNum != store.getters.order.referralSequenceNumber) {
|
||||
console.log(
|
||||
"error: unknown ref:" +
|
||||
referralSeqNum +
|
||||
" " +
|
||||
store.getters.order.referralSequenceNumber
|
||||
);
|
||||
baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.SAVE_PIA_ERROR_CODE,
|
||||
"unknown error",
|
||||
false
|
||||
);
|
||||
this.$router.navigateWithoutSaving(this.navigationScenarios.PIA_ERROR, this.$route);
|
||||
} else {
|
||||
const expMonth = getQuerystringParameter(queryStrings.CARD_EXPIRATION_MONTH);
|
||||
const expYear = getQuerystringParameter(queryStrings.CARD_EXPIRATION_YEAR);
|
||||
const cardType = getQuerystringParameter(queryStrings.CARD_TYPE);
|
||||
const billToPostalCode = getQuerystringParameter(queryStrings.BILL_TO_POSTAL_CODE);
|
||||
const billToFirstName = getQuerystringParameter(queryStrings.BILL_TO_FIRST_NAME);
|
||||
const billToLastName = getQuerystringParameter(queryStrings.BILL_TO_LAST_NAME);
|
||||
const referenceNumber = getQuerystringParameter(queryStrings.REFERENCE_NUMBER);
|
||||
const authCode = getQuerystringParameter(queryStrings.AUTH_CODE);
|
||||
const transactionId = getQuerystringParameter(queryStrings.TRANSACTION_ID);
|
||||
const transReferenceNumber = getQuerystringParameter(
|
||||
queryStrings.TRANS_REFERENCE_NUMBER
|
||||
);
|
||||
|
||||
var ccToken = {
|
||||
subscriptionId: subscriptionID,
|
||||
expMonth: expMonth,
|
||||
expYear: expYear,
|
||||
cardType: cardType,
|
||||
billToPostalCode: billToPostalCode,
|
||||
billToFirstName: billToFirstName,
|
||||
billToLastName: billToLastName,
|
||||
referenceNumber: referenceNumber,
|
||||
authCode: authCode,
|
||||
transactionId: transactionId,
|
||||
transReferenceNumber: transReferenceNumber,
|
||||
};
|
||||
baseMixin.methods.dispatchStoreAction(storeActions.SAVE_CCTOKEN, ccToken, false);
|
||||
await this.saveAndSubmitWorkOrder();
|
||||
}
|
||||
},
|
||||
async saveAndSubmitWorkOrder() {
|
||||
// Final work order submit after returning from PIA.
|
||||
await this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
|
||||
await submitWorkOrder({ pageNameToLog: "payment-pia-return" });
|
||||
this.$refs.loadingModal.isModalVisible = false;
|
||||
this.$router.navigateWithoutSaving(this.navigationScenarios.PIA_SUCCESS, this.$route);
|
||||
},
|
||||
forwardButtonAction() {
|
||||
this.$router.navigateWithoutSaving(this.navigationScenarios.PIA_SUCCESS, this.$route);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,31 +1,35 @@
|
|||
<template>
|
||||
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
||||
<loadingModal notFullScreen ref="loadingModal" />
|
||||
<div class="page-container-grouped-styles">
|
||||
<funnelHeader cmsWidgetName="FunnelHeaderWidget" v-if="!isPaypal" />
|
||||
<funnelSubHeader
|
||||
class="mb-5"
|
||||
cmsWidgetName="FunnelSubHeaderWidget"
|
||||
leftAlignHeader
|
||||
v-if="!isPaypal" />
|
||||
<hr class="mt-0" />
|
||||
<div id="card-container">
|
||||
<iframe
|
||||
ref="paymentFrame"
|
||||
class="hop-iframe payment-iframe"
|
||||
name="card-frame"
|
||||
id="card-frame"
|
||||
seamless
|
||||
scrolling="no">
|
||||
</iframe>
|
||||
<div class="container-fluid page-container-grouped-styles">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<funnelHeader cmsWidgetName="FunnelHeaderWidget" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="fade-on-route-transition sub-container make-tall">
|
||||
<navbar
|
||||
cmsWidgetName="FunnelFooterWidget"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
:isBackButtonHidden="shouldHideBackButton"
|
||||
@back-clicked="backButtonAction"
|
||||
@ForwardClicked="forwardButtonAction" />
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6 col-xl-4">
|
||||
<div id="card-container">
|
||||
<iframe
|
||||
ref="paymentFrame"
|
||||
class="hop-iframe payment-iframe"
|
||||
name="card-frame"
|
||||
id="card-frame"
|
||||
seamless
|
||||
scrolling="no">
|
||||
</iframe>
|
||||
</div>
|
||||
<div class="fade-on-route-transition sub-container make-tall">
|
||||
<navbar
|
||||
cmsWidgetName="FunnelFooterWidget"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
:isBackButtonHidden="shouldHideBackButton"
|
||||
isSubmitHidden="true"
|
||||
@back-clicked="backButtonAction"
|
||||
@ForwardClicked="forwardButtonAction" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Form>
|
||||
|
|
@ -54,18 +58,9 @@
|
|||
<input type="hidden" name="styleSheetCode" :value="dynamicCSSUrl" />
|
||||
<input type="hidden" name="styleSheetCode2" :value="dynamicCSSUrl" />
|
||||
|
||||
<input
|
||||
type="hidden"
|
||||
name="sgReceiptResponseURL"
|
||||
value="https://fixmyglasstest.safelite.com/FixMyGlass/Payment/Success.aspx" />
|
||||
<input
|
||||
type="hidden"
|
||||
name="sgDeclineResponseURL"
|
||||
value="https://fixmyglasstest.safelite.com/FixMyGlass/Payment/Cancel.aspx" />
|
||||
<input
|
||||
type="hidden"
|
||||
name="sgErrorResponseURL"
|
||||
value="https://fixmyglasstest.safelite.com/FixMyGlass/Payment/Error.aspx" />
|
||||
<input type="hidden" name="sgReceiptResponseURL" :value="piaResponseUrl" />
|
||||
<input type="hidden" name="sgDeclineResponseURL" :value="piaResponseUrl" />
|
||||
<input type="hidden" name="sgErrorResponseURL" :value="piaResponseUrl" />
|
||||
|
||||
<input type="hidden" name="sgheaderline1" :value="sgHeaderline1" />
|
||||
<input type="hidden" name="sgHeader1subtitle" value="" />
|
||||
|
|
@ -133,20 +128,14 @@
|
|||
<input type="hidden" name="sgWorkOrder" :value="workOrderNumber" />
|
||||
<input type="hidden" name="sgEmailAddress" :value="emailAddress" />
|
||||
<input type="hidden" name="paypalInvoiceNumber" :value="invoiceNumber" />
|
||||
<input type="hidden" name="payPalSuccessUrl" :value="payPalSuccessUrl" />
|
||||
<input type="hidden" name="paypalCancelUrl" :value="payPalCancelUrl" />
|
||||
<input type="hidden" name="paypalSuccessUrl" :value="piaResponseUrl" />
|
||||
<input type="hidden" name="paypalCancelUrl" :value="piaCancelUrl" />
|
||||
|
||||
<input
|
||||
type="hidden"
|
||||
name="sgCCDeclineURL"
|
||||
value="https://fixmyglasstest.safelite.com/FixMyGlass/Payment.aspx?error=ccDecline" />
|
||||
<input
|
||||
type="hidden"
|
||||
name="sgCCTimeoutURL"
|
||||
value="https://fixmyglasstest.safelite.com/FixMyGlass/Payment.aspx?error=ccTimeout" />
|
||||
<input type="hidden" name="sgCCDeclineURL" :value="piaCancelUrl" />
|
||||
<input type="hidden" name="sgCCTimeoutURL" :value="piaCancelUrl" />
|
||||
|
||||
<input type="hidden" name="sgTransactionType" value="authorization" />
|
||||
<input type="hidden" name="amount" :value="amountDue" />
|
||||
<input type="hidden" name="amount" :value="totalAmount" />
|
||||
<input type="hidden" name="ctu" :value="ctu" />
|
||||
<input type="hidden" name="orderNumber" :value="workOrderNumber" />
|
||||
|
||||
|
|
@ -171,7 +160,6 @@
|
|||
// Components
|
||||
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
||||
import navbar from "@/fmg-components/nav-bar/nav-bar";
|
||||
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
||||
import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue";
|
||||
|
||||
import { storeActions } from "@/constants/store-actions";
|
||||
|
|
@ -190,8 +178,8 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
checkoutUrl: externalUrls.SAFELITE_HOP,
|
||||
payPalSuccessUrl: applicationConfig.PAYPAL_SUCCESS_URL,
|
||||
payPalCancelUrl: applicationConfig.PAYPAL_CANCEL_URL,
|
||||
piaResponseUrl: applicationConfig.PIA_RESPONSE_URL,
|
||||
piaCancelUrl: applicationConfig.PIA_CANCEL_URL,
|
||||
paymentType: this.getPaymentType(),
|
||||
authToken: "",
|
||||
authSignature: "",
|
||||
|
|
@ -257,7 +245,7 @@ export default {
|
|||
|
||||
// no work order, set pia error and return
|
||||
this.dispatchStoreAction(storeActions.SAVE_PIA_ERROR_CODE, "NO WORK ORDER", false);
|
||||
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||
this.backButtonAction();
|
||||
},
|
||||
getInvoiceNumber() {
|
||||
if (store.getters.order.workOrderNumber) {
|
||||
|
|
@ -266,7 +254,7 @@ export default {
|
|||
|
||||
// no work order, set pia error and return
|
||||
this.dispatchStoreAction(storeActions.SAVE_PIA_ERROR_CODE, "NO WORK ORDER", false);
|
||||
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||
this.backButtonAction();
|
||||
},
|
||||
getAddress1() {
|
||||
return store.getters.order.serviceLocation.address
|
||||
|
|
@ -324,10 +312,12 @@ export default {
|
|||
return itemsForPia;
|
||||
},
|
||||
getAmountDue() {
|
||||
return baseMixin.methods.getAmountDue(store.getters.order.lineItems);
|
||||
return 350.0;
|
||||
//return baseMixin.methods.getAmountDue(store.getters.order.lineItems);
|
||||
},
|
||||
getDisplayAmountDue() {
|
||||
return baseMixin.methods.getDisplayAmountDue(store.getters.order.lineItems);
|
||||
return "$350.00";
|
||||
//return baseMixin.methods.getDisplayAmountDue(store.getters.order.lineItems);
|
||||
},
|
||||
isPaypal() {
|
||||
if (this.getPaymentType() == "pp") {
|
||||
|
|
@ -367,7 +357,6 @@ export default {
|
|||
components: {
|
||||
funnelHeader,
|
||||
navbar,
|
||||
funnelSubHeader,
|
||||
Form,
|
||||
loadingModal,
|
||||
},
|
||||
|
|
@ -375,13 +364,9 @@ export default {
|
|||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.payment-iframe {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.hop-iframe {
|
||||
position: relative;
|
||||
min-height: 1300px;
|
||||
min-height: 1350px;
|
||||
width: 100%;
|
||||
border: 0 none;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -439,16 +439,16 @@ export default {
|
|||
this.appointmentType === AppointmentTypeStrings.MOBILE &&
|
||||
this.selectedTimeSlotInfo?.isPremiumAppointment
|
||||
) {
|
||||
const earlyBirdIndex = supportingItems.findIndex(
|
||||
const premiumFeeIndex = supportingItems.findIndex(
|
||||
(item) => item.partType == PREMIUM_FEE_PART_TYPE
|
||||
);
|
||||
|
||||
if (earlyBirdIndex >= 0) {
|
||||
supportingItems[earlyBirdIndex].laborAmount =
|
||||
if (premiumFeeIndex >= 0) {
|
||||
supportingItems[premiumFeeIndex].laborAmount =
|
||||
this.mobilePremiumAppointmentFee.laborAmount;
|
||||
supportingItems[earlyBirdIndex].selingPrice =
|
||||
this.mobilePremiumAppointmentFee.selingPrice;
|
||||
supportingItems[earlyBirdIndex].kitPrice =
|
||||
supportingItems[premiumFeeIndex].sellingPrice =
|
||||
this.mobilePremiumAppointmentFee.sellingPrice;
|
||||
supportingItems[premiumFeeIndex].kitPrice =
|
||||
this.mobilePremiumAppointmentFee.kitPrice;
|
||||
} else {
|
||||
supportingItems.push(this.mobilePremiumAppointmentFee);
|
||||
|
|
@ -461,12 +461,12 @@ export default {
|
|||
);
|
||||
} else {
|
||||
// if it's not a mobile and/or premium early bird, then make sure we remove any that may have been added
|
||||
const removeEarlyBirdIndex = supportingItems.findIndex(
|
||||
const removePremiumFeeIndex = supportingItems.findIndex(
|
||||
(item) => item.partType == PREMIUM_FEE_PART_TYPE
|
||||
);
|
||||
|
||||
if (removeEarlyBirdIndex >= 0) {
|
||||
supportingItems.splice(removeEarlyBirdIndex, 1);
|
||||
if (removePremiumFeeIndex >= 0) {
|
||||
supportingItems.splice(removePremiumFeeIndex, 1);
|
||||
this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING,
|
||||
supportingItems,
|
||||
|
|
|
|||
|
|
@ -441,7 +441,7 @@ export default {
|
|||
// If it already exists, update the price with latest data
|
||||
if (mobileFeeIndex >= 0) {
|
||||
supportingItems[mobileFeeIndex].laborAmount = this.mobileFeePart.laborAmount;
|
||||
supportingItems[mobileFeeIndex].selingPrice = this.mobileFeePart.selingPrice;
|
||||
supportingItems[mobileFeeIndex].sellingPrice = this.mobileFeePart.sellingPrice;
|
||||
supportingItems[mobileFeeIndex].kitPrice = this.mobileFeePart.kitPrice;
|
||||
} else {
|
||||
supportingItems.push(this.mobileFeePart);
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ export default {
|
|||
lineItem.partType != partTypeStrings.RAIN_DEFENSE
|
||||
);
|
||||
});
|
||||
|
||||
let totalPrice = this.getTotalPriceOfAllLineItemsAndChildParts(lineItemsToPrice);
|
||||
return totalPrice;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -99,6 +99,19 @@ const getDefaultState = () => {
|
|||
piaType: null,
|
||||
piaErrorCode: null,
|
||||
inactivePromos: null,
|
||||
ccToken: {
|
||||
subscriptionId: null,
|
||||
expMonth: null,
|
||||
expYear: null,
|
||||
cardType: null,
|
||||
billToPostalCode: null,
|
||||
billToFirstName: null,
|
||||
billToLastName: null,
|
||||
referenceNumber: null,
|
||||
authCode: null,
|
||||
transactionId: null,
|
||||
transReferenceNumber: null,
|
||||
},
|
||||
},
|
||||
schedule: {
|
||||
date: null,
|
||||
|
|
@ -244,6 +257,19 @@ export const mutations = {
|
|||
updateWorkOrderNumber(state, workOrderNumber) {
|
||||
state.order.workOrderNumber = workOrderNumber;
|
||||
},
|
||||
updateCCToken(state, ccToken) {
|
||||
state.order.payment.ccToken.subscriptionId = ccToken.subscriptionId;
|
||||
state.order.payment.ccToken.expMonth = ccToken.expMonth;
|
||||
state.order.payment.ccToken.expYear = ccToken.expYear;
|
||||
state.order.payment.ccToken.cardType = ccToken.cardType;
|
||||
state.order.payment.ccToken.billToPostalCode = ccToken.billToPostalCode;
|
||||
state.order.payment.ccToken.billToFirstName = ccToken.billToFirstName;
|
||||
state.order.payment.ccToken.billToLastName = ccToken.billToLastName;
|
||||
state.order.payment.ccToken.referenceNumber = ccToken.referenceNumber;
|
||||
state.order.payment.ccToken.authCode = ccToken.authCode;
|
||||
state.order.payment.ccToken.transactionId = ccToken.transactionId;
|
||||
state.order.payment.ccToken.transReferenceNumber = ccToken.transReferenceNumber;
|
||||
},
|
||||
updateInsuranceVerifiedStatus(state, isVerified) {
|
||||
state.order.payment.insuranceCoverage.isVerified = isVerified;
|
||||
},
|
||||
|
|
@ -1618,6 +1644,19 @@ export const actions = {
|
|||
isInsurance: order.payment.isInsurance,
|
||||
parentAccountNumber: order.payment.parentAccountNumber,
|
||||
inactivePromos: order.payment.inactivePromos,
|
||||
ccToken: {
|
||||
subscriptionId: order.payment.ccToken.subscriptionId,
|
||||
expMonth: order.payment.ccToken.expMonth,
|
||||
expYear: order.payment.ccToken.expYear,
|
||||
cardType: order.payment.ccToken.cardType,
|
||||
billToPostalCode: order.payment.ccToken.billToPostalCode,
|
||||
billToFirstName: order.payment.ccToken.billToFirstName,
|
||||
billToLastName: order.payment.ccToken.billToLastName,
|
||||
referenceNumber: order.payment.ccToken.referenceNumber,
|
||||
authCode: order.payment.ccToken.authCode,
|
||||
transactionId: order.payment.ccToken.transactionId,
|
||||
transReferenceNumber: order.payment.ccToken.transReferenceNumber,
|
||||
},
|
||||
},
|
||||
serviceLocation: {
|
||||
streetAddress: order.serviceLocation.address,
|
||||
|
|
@ -1735,6 +1774,9 @@ export const actions = {
|
|||
savePiaWorkOrder(context, piaWorkOrder) {
|
||||
context.commit(storeMutations.UPDATE_PIA_WORK_ORDER, piaWorkOrder);
|
||||
},
|
||||
saveCCToken(context, ccToken) {
|
||||
context.commit(storeMutations.UPDATE_CCTOKEN, ccToken);
|
||||
},
|
||||
|
||||
// Business domain actions
|
||||
|
||||
|
|
@ -2021,9 +2063,11 @@ export const actions = {
|
|||
},
|
||||
|
||||
savePaymentType(context, isInsurance) {
|
||||
context.commit(storeMutations.UPDATE_IS_INSURANCE, isInsurance);
|
||||
if (isInsurance !== context.getters.payment.isInsurance) {
|
||||
context.commit(storeMutations.RESET_PAYMENT_METHOD_CHOICE);
|
||||
}
|
||||
|
||||
context.commit(storeMutations.RESET_PAYMENT_METHOD_CHOICE);
|
||||
context.commit(storeMutations.UPDATE_IS_INSURANCE, isInsurance);
|
||||
},
|
||||
|
||||
savePaymentMethodChoice(context, paymentMethod) {
|
||||
|
|
@ -2131,14 +2175,13 @@ export const actions = {
|
|||
pageNameToLog,
|
||||
}
|
||||
) {
|
||||
const flattenedLineItemsWithChildParts =
|
||||
getFlattenedArrayOfLineItemsWithChildParts(pricedLineItems);
|
||||
|
||||
const lineItemsWithOnlyPriceInfo = flattenedLineItemsWithChildParts.map((lineItem) => ({
|
||||
// const flattenedLineItemsWithChildParts =
|
||||
// getFlattenedArrayOfLineItemsWithChildParts(pricedLineItems);
|
||||
const lineItemsWithOnlyPriceInfo = pricedLineItems.map((lineItem) => ({
|
||||
partNumber: lineItem.partNumber,
|
||||
laborAmount: lineItem.laborAmount,
|
||||
kitPrice: lineItem.kitPrice,
|
||||
sellingPrice: lineItem.sellingPrice,
|
||||
laborAmount: lineItem.laborAmount ?? 0,
|
||||
kitPrice: lineItem.kitPrice ?? 0,
|
||||
sellingPrice: lineItem.sellingPrice ?? 0,
|
||||
}));
|
||||
|
||||
const pricedLineItemsFormattedForRequest =
|
||||
|
|
@ -2487,13 +2530,15 @@ function addPricesToLineItems(lineItems, pricingLineItems) {
|
|||
lineItem.laborAmount = pricedLineItem.laborAmount;
|
||||
lineItem.sellingPrice = pricedLineItem.sellingPrice;
|
||||
lineItem.kitPrice = pricedLineItem.kitPrice;
|
||||
lineItem.salesTax = pricedLineItem.salesTax;
|
||||
});
|
||||
|
||||
return pricedLineItems;
|
||||
}
|
||||
|
||||
function addTaxesToPricedLineItems(lineItems, taxingLineItems) {
|
||||
lineItems.forEach((lineItem) => {
|
||||
const taxedLineItems = deepClone(lineItems);
|
||||
taxedLineItems.forEach((lineItem) => {
|
||||
let lineItemIndex = taxingLineItems.findIndex(
|
||||
(taxingLineItem) => taxingLineItem.partNumber === lineItem.partNumber
|
||||
);
|
||||
|
|
@ -2503,10 +2548,10 @@ function addTaxesToPricedLineItems(lineItems, taxingLineItems) {
|
|||
}
|
||||
|
||||
let taxedLineItem = taxingLineItems.splice(lineItemIndex, 1)[0];
|
||||
lineItem.SalesTax = taxedLineItem.SalesTax;
|
||||
lineItem.salesTax = taxedLineItem.salesTax;
|
||||
});
|
||||
|
||||
return lineItems;
|
||||
return taxedLineItems;
|
||||
}
|
||||
|
||||
function getArrayOfAllLineItems(lineItems) {
|
||||
|
|
|
|||
|
|
@ -753,6 +753,19 @@ describe("Actions", () => {
|
|||
isVerified: false,
|
||||
},
|
||||
isInsurance: false,
|
||||
ccToken: {
|
||||
subscriptionId: null,
|
||||
expMonth: null,
|
||||
expYear: null,
|
||||
cardType: null,
|
||||
billToPostalCode: null,
|
||||
billToFirstName: null,
|
||||
billToLastName: null,
|
||||
referenceNumber: null,
|
||||
authCode: null,
|
||||
transactionId: null,
|
||||
transReferenceNumber: null,
|
||||
},
|
||||
},
|
||||
serviceLocation: {},
|
||||
customer: {},
|
||||
|
|
|
|||
Loading…
Reference in a new issue