diff --git a/src/constants/application-config.js b/src/constants/application-config.js
index 6a747617f..e49426afb 100644
--- a/src/constants/application-config.js
+++ b/src/constants/application-config.js
@@ -24,6 +24,11 @@ const applicationConfig = {
"//" +
location.host +
"/fmg/?fmgPage=payment-method&src=concept-funnel",
+ PIA_ERROR_URL:
+ location.protocol +
+ "//" +
+ location.host +
+ "/fmg/?fmgPage=payment-pia-return&src=concept-funnel",
CONFIRMATION_URL: location.protocol + "//" + location.host + "/fmg/?fmgPage=confirmation",
GOOGLE_CALENDAR: "https://www.google.com/calendar/render?action=TEMPLATE",
YAHOO_CALENDAR: "https://calendar.yahoo.com/?v=60",
diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js
index 2b5c654e5..10b8b3483 100644
--- a/src/constants/endpoints.js
+++ b/src/constants/endpoints.js
@@ -134,7 +134,7 @@ const endpoints = {
},
PriceOrderItems: {
url: "/price/api/v1/price/order-items",
- method: "GET",
+ method: "POST",
},
ValidatePromo: {
url: "/price/api/v1/price/order-promo",
diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue
index d0f4d6ed4..e841d8849 100644
--- a/src/fmg-components/cart/cart.vue
+++ b/src/fmg-components/cart/cart.vue
@@ -305,9 +305,9 @@ export default {
if (!this.lineItems || this.lineItems.length < 1) return;
const lineItemsCopy = deepClone(this.lineItems);
- lineItemsCopy.supportingItems = lineItemsCopy.supportingItems ? baseMixin.methods.filterOutRecalibration(
- lineItemsCopy?.supportingItems
- ) : [];
+ lineItemsCopy.supportingItems = lineItemsCopy.supportingItems
+ ? baseMixin.methods.filterOutRecalibration(lineItemsCopy?.supportingItems)
+ : [];
return lineItemsCopy;
},
showCoverageAsPending() {
@@ -438,13 +438,15 @@ export default {
packagePrice() {
let packagePrice = 0;
- if (!this.isInsurance && this.shouldHideRecalibration) { // Update packagePrice if Cash only && is part of RemoveRecal experiment
+ if (!this.isInsurance && this.shouldHideRecalibration) {
+ // Update packagePrice if Cash only && is part of RemoveRecal experiment
packagePrice = baseMixin.methods.getTierOnePackagePrice(
baseMixin.methods.filterOutFees(
baseMixin.methods.filterOutRecalibration(this.availableLineItems) // Strip out recal before filtering out fees
)
);
- } else if (!this.showCoverageAsVerified && !this.showCoverageAsPending) { // Update packagePrice if is verified insurance OR if Cash && not part of RemoveRecal experiment
+ } else if (!this.showCoverageAsVerified && !this.showCoverageAsPending) {
+ // Update packagePrice if is verified insurance OR if Cash && not part of RemoveRecal experiment
packagePrice = baseMixin.methods.getTierOnePackagePrice(
baseMixin.methods.filterOutFees(this.availableLineItems)
);
@@ -1001,7 +1003,7 @@ export default {
if (!this.lineItems || this.lineItems.length < 1) return;
return this.isInsurance || !this.shouldHideRecalibration
? baseMixin.methods.getSubTotal(this.lineItems) // calculate with recal (if on order)
- : baseMixin.methods.getSubTotal(this.lineItemsWithoutRecal); // calculated without recal
+ : baseMixin.methods.getSubTotal(this.lineItemsWithoutRecal); // calculate without recal
},
salesTax() {
if (!this.lineItems || this.lineItems.length < 1) return;
diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue
index df3a3dfe7..acb97cba2 100644
--- a/src/layouts/confirmation/confirmation.vue
+++ b/src/layouts/confirmation/confirmation.vue
@@ -170,9 +170,7 @@ export default {
},
computed: {
shouldHideRecalibration() {
- return this.getSettingValue(
- experimentSettings.RECAL_PRICE_REMOVE
- );
+ return this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE);
},
ShowCart() {
if (this.isPia && this.submittedOrder?.settledTenderAmount == 0) {
diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue
index ccf4e1524..85fb84a63 100644
--- a/src/layouts/payment-method/payment-method.vue
+++ b/src/layouts/payment-method/payment-method.vue
@@ -55,7 +55,9 @@
class="service-questions" />
+
-
+
@@ -235,6 +235,7 @@ export default {
checkoutUrl: externalUrls.SAFELITE_HOP,
piaResponseUrl: applicationConfig.PIA_RESPONSE_URL,
piaCancelUrl: applicationConfig.PIA_CANCEL_URL,
+ piaErrorUrl: applicationConfig.PIA_ERROR_URL,
paymentType: this.getPaymentType(),
authToken: "",
authSignature: "",
diff --git a/src/layouts/quote/quote.spec.js b/src/layouts/quote/quote.spec.js
index 4f2ac213e..ca2bfd78e 100644
--- a/src/layouts/quote/quote.spec.js
+++ b/src/layouts/quote/quote.spec.js
@@ -750,7 +750,10 @@ function setupMocks({ customMountOptions }) {
baseMixin.methods.ResetExternalParamsAndHideModal = jest.fn();
baseMixin.methods.isFormValid = jest.fn().mockReturnValue(true);
mountOptions.global.mocks["$store"] = store;
+ store.getters.experimentSettings = "test value";
+
mountOptions["attachTo"] = document.body;
+
const wrapper = shallowMount(quote, mountOptions);
wrapper.vm.setCmsContent = jest.fn();
return { wrapper };
diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue
index c0e6165ea..599ba0f6a 100644
--- a/src/layouts/quote/quote.vue
+++ b/src/layouts/quote/quote.vue
@@ -32,6 +32,8 @@
:availableLineItems="availableLineItems"
:shouldHideRecalibration="shouldHideRecalibration"
:isInsuranceSelected="isInsuranceSelected"
+ :isRecalibrationOnOrder="isRecalibrationOnOrder"
+ :shouldHideRecalibration="shouldHideRecalibration"
@vapsItemsSelected="vapsItemsSelectedAction"
@servicePackageDiscountSelected="servicePackageDiscountSelectedAction"
:servicePackage="servicePackage"
@@ -140,9 +142,6 @@ export default {
async beforeRouteEnter(to, from, next) {
// Call APIs
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
- const experimentForLogging = store.getters.applicationUser.experiments.find(
- (e) => e.universeName === experimentUniverses.RECAL_PRICE_REMOVAL
- );
const wipersPromise = baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.GET_WIPERS,
{
@@ -210,30 +209,6 @@ export default {
...servicePackageDiscountPart,
];
- // If the recal experiment is found then log the experiment exposure.
- const isRecalibrationOnOrder = containsRecalParts(availableLineItems);
- const canSafeliteRecalibrate = nullSafeGlassParts.some((glassPart) => {
- return glassPart.partType === "WINDSHIELD" && glassPart.canSafeliteRecalibrate;
- });
- if (
- experimentForLogging !== undefined &&
- isRecalibrationOnOrder &&
- canSafeliteRecalibrate
- ) {
- // Log experiment exposure
- baseMixin.methods.dispatchStoreActionWithLogging(
- storeActions.LOG_EXPERIMENT_EXPOSURE,
- {
- userId: getUserIdValue(),
- sessionKey: getSessionKeyValue(),
- pageName: to.query.fmgPage,
- experiment: experimentForLogging,
- },
- "quote",
- false
- );
- }
-
// When calling pricing from the quote page, always use the cash parent account
baseMixin.methods.dispatchStoreAction(
storeActions.SAVE_PARENT_ACCOUNT_NUMBER,
diff --git a/src/layouts/quote/service-package-question/service-package-question.spec.js b/src/layouts/quote/service-package-question/service-package-question.spec.js
index 07d37ed19..a23d1ead6 100644
--- a/src/layouts/quote/service-package-question/service-package-question.spec.js
+++ b/src/layouts/quote/service-package-question/service-package-question.spec.js
@@ -475,6 +475,7 @@ describe("service-package-question.vue, matching business rules for package disp
mockProps.availableLineItems.push(recalLineItem);
mockProps.availableLineItems.push(driverFrontWiperLineItem);
mockProps.availableLineItems.push(passengerFrontWiperLineItem);
+ mockProps.isRecalibrationOnOrder = true;
Object.assign(processedCmsContent, mockProcessedCmsContent[packageNameKey]);
const wrapper = setupMocks({
mountOptionsMockData: {
diff --git a/src/layouts/quote/service-package-question/service-package-question.vue b/src/layouts/quote/service-package-question/service-package-question.vue
index f17fe908a..6dfe4fed6 100644
--- a/src/layouts/quote/service-package-question/service-package-question.vue
+++ b/src/layouts/quote/service-package-question/service-package-question.vue
@@ -50,6 +50,7 @@ export default {
availableLineItems: null,
activePromos: null,
servicePackage: null,
+ isRecalibrationOnOrder: Boolean,
shouldHideRecalibration: Boolean,
},
data() {
@@ -143,9 +144,6 @@ export default {
}));
return modifiedAnswers;
},
- isRecalibrationOnOrder() {
- return containsRecalParts(this.nullSafeAvailableLineItems);
- },
isServicePackageDiscountOnOrder() {
return containsLineItemWithPartType(
partTypeStrings.SERVICE_PACKAGE_DISCOUNT,
@@ -241,7 +239,8 @@ export default {
},
getPackagePrice(packageName, { discountedPrice = false, servicePackageDiscount = false }) {
var lineItemsToPrice = [...this.nullSafeAvailableLineItems];
- if (this.shouldHideRecalibration && this.isRecalibrationOnOrder) {
+
+ if (this.isRecalibrationOnOrder && this.shouldHideRecalibration) {
lineItemsToPrice = getItemsWithoutRecalParts(lineItemsToPrice);
}
diff --git a/src/store/index.js b/src/store/index.js
index a6a8c6ca9..c95366add 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -2413,14 +2413,6 @@ export const actions = {
context,
{ payload: { availableLineItems, serviceZipCode, serviceZipCodeCtu }, pageNameToLog }
) {
- const zipCodeToUse = serviceZipCode
- ? serviceZipCode
- : context.getters.order.serviceLocation.zipCode;
-
- const ctuToUse = serviceZipCodeCtu
- ? serviceZipCodeCtu
- : context.getters.order.serviceLocation.zipCodeCtu;
-
const flattenedLineItemsWithChildParts =
getFlattenedArrayOfLineItemsWithChildParts(availableLineItems);
@@ -2428,34 +2420,39 @@ export const actions = {
partNumber: lineItem.partNumber,
}));
- const availableLineItemsFormattedForRequest =
- buildQueryStringParameterFromArrayOfComplexObjects(
- lineItemsWithOnlyPartNumbers,
- "lineItems"
- );
-
- const vehicle = context.getters.order.vehicle;
-
- // TODO: Insurance pricing...`ParentAccountNumber=${context.getters.order.payment.parentAccountNumber}`
- let queryString =
- `ParentAccountNumber=${context.getters.order.payment.parentAccountNumber}` +
- `&CTU=${ctuToUse}` +
- `&CarId=${vehicle.carId}` +
- `&Make=${vehicle.make}` +
- `&Model=${vehicle.model}` +
- `&Year=${vehicle.year}` +
- `&EON=${context.getters.order.eon}` +
- `&ZipCode=${zipCodeToUse}` +
- `&${availableLineItemsFormattedForRequest}`;
-
- const lineItemServerData = context.getters.order.lineItems.serverData;
- if (lineItemServerData) {
- queryString += `&ServerData=${encodeURIComponent(lineItemServerData)}`;
+ const order = context.getters.order;
+
+ var providerNumber = order.serviceLocation?.provider?.providerNumber ?? order.serviceLocation?.zipCodeCtu;
+ if (providerNumber.startsWith("00")) {
+ providerNumber = providerNumber.substring(1);
}
const response = await globalMethods.callHttpClient({
method: endpoints.PriceOrderItems.method,
- endpoint: `${endpoints.PriceOrderItems.url}?${queryString}`,
+ endpoint: endpoints.PriceOrderItems.url,
+ payload: {
+ parentAccountNumber: order.payment?.parentAccountNumber,
+ billToAccountNumber:
+ order.payment?.billToAccountNumber ??
+ applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER,
+ providerNumber: providerNumber,
+ carId: order.vehicle.carId,
+ year: order.vehicle.year,
+ make: order.vehicle.make,
+ model: order.vehicle.model,
+ eon: order.eon,
+ state: order.serviceLocation?.state,
+ referralNumber: order.referralNumber,
+ referralSequenceNumber: order.referralSequenceNumber,
+ zipCode: order.serviceLocation?.zipCode,
+ serviceZipCode: serviceZipCode ?? order.serviceLocation?.zipCode,
+ referralDate: order.referralDate,
+ isReplacement: !order.damage.isRepair,
+ deductible: order.policy?.currentDeductible,
+ coverageStatus: order.payment?.insuranceCoverage?.coverageStatus,
+ lineItems: lineItemsWithOnlyPartNumbers,
+ serverData: order.lineItems.serverData ? order.lineItems.serverData : "",
+ },
logApiCall: true,
pageNameToLog: pageNameToLog,
});