diff --git a/src/constants/experiments.js b/src/constants/experiments.js index b21571e7..18676ce4 100644 --- a/src/constants/experiments.js +++ b/src/constants/experiments.js @@ -4,7 +4,7 @@ const experimentUniverses = Object.freeze({ const experimentSettings = Object.freeze({ GOOGLE_CUSTOM_DIMENSION_INDEX: 'Google Custom Dimension Index', - ISS_DISPLAY_PAY_IN_ADVANCE: 'ISSDisplayPIAInsurance_ISS' + ISS_DISPLAY_PAY_IN_ADVANCE: 'DisplayPIAInsurance' }); const experimentTriggers = Object.freeze({ diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index a88967ea..0204a5a7 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -89,6 +89,7 @@ import bailoutMessage from '@/constants/bailoutMessage'; import { AppointmentTypeStrings } from '@/constants/schedule-constants'; import VehicleBanner from '@/iss-components/vehicle-banner/vehicle-banner.vue'; import { submitWorkOrder } from '@/helpers/order-helper.js'; +import { experimentSettings } from '@/constants/experiments'; export default { name: 'payment-method', @@ -183,7 +184,10 @@ export default { return this.$route.query[queryStrings.DISPLAY_PAY_IN_ADVANCE_ALERT]; }, isPayInAdvanceDisabled() { - return useMainStore().isUnverified; + const piaExperience = this.getSettingValue(experimentSettings.ISS_DISPLAY_PAY_IN_ADVANCE); + const isEnabled = piaExperience === 'true'; + + return !isEnabled || useMainStore().isUnverified; }, paymentMethod() { return this.paymentMethodInternalModel; diff --git a/src/store/index.js b/src/store/index.js index c78e3e59..bcba8a24 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -375,29 +375,30 @@ export const useMainStore = defineStore({ }; }, experimentOrder: (state) => ({ - issVehicleYear: state.order.vehicle.year, - issVehicleMake: state.order.vehicle.make, - issVehicleModel: state.order.vehicle.model, - issVehicleStyle: state.order.vehicle.style, - issIsRepair: state.order.damage.isRepair, - issNumberOfChips: state.order.damage.numberOfChips, - issCarId: state.order.vehicle.carId, - issServiceCity: state.order.serviceLocation.city, - issServiceState: state.order.serviceLocation.state, - issServiceZipCode: state.order.serviceLocation.zipCode, - issParentAccountNumber: state.order.accountNumber, - issIsCoverageVerified: state.order.payment.insuranceCoverage.isVerified, - issHasRecalibrationPart: getHasRecalibrationPart(state), - issSelectedMultiGlass: state.order.damage.glassToReplace?.length > 1, - issSelectedWindshieldGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation') + funnelVehicleYear: state.order.vehicle.year, + funnelVehicleMake: state.order.vehicle.make, + funnelVehicleModel: state.order.vehicle.model, + funnelVehicleStyle: state.order.vehicle.style, + funnelIsRepair: state.order.damage.isRepair, + funnelNumberOfChips: state.order.damage.numberOfChips, + funnelCarId: state.order.vehicle.carId, + funnelServiceCity: state.order.serviceLocation.city, + funnelServiceState: state.order.serviceLocation.state, + funnelServiceZipCode: state.order.serviceLocation.zipCode, + funnelServiceZipCodeCtu: state.order.serviceLocation.zipCodeCtu, + funnelParentAccountNumber: state.order.accountNumber, + funnelIsCoverageVerified: state.order.payment.insuranceCoverage.isVerified, + funnelHasRecalibrationPart: getHasRecalibrationPart(state), + funnelSelectedMultiGlass: state.order.damage.glassToReplace?.length > 1, + funnelSelectedWindshieldGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation') .includes(damageLocationsSelected.WINDSHIELD), - issSelectedBackGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation') + funnelSelectedBackGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation') .includes(damageLocationsSelected.REAR), - issSelectedDriverSideGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation') + funnelSelectedDriverSideGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation') .includes(damageLocationsSelected.DRIVER), - issSelectedPassengerSideGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation') + funnelSelectedPassengerSideGlass: getNonFalseValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, 'glassLocation') .includes(damageLocationsSelected.PASSENGER), - issOrderPartNumbers: [ + funnelOrderPartNumbers: [ ...getNonFalseValuesOfPropertyInArrayOfObjects( state.order.lineItems.glassParts, 'partNumber' @@ -407,7 +408,7 @@ export const useMainStore = defineStore({ 'partNumber' ) ], - issOrderPartTypes: [ + funnelOrderPartTypes: [ ...getNonFalseValuesOfPropertyInArrayOfObjects( state.order.lineItems.glassParts, 'recalibrationType' @@ -419,6 +420,7 @@ export const useMainStore = defineStore({ ] }), experimentSettings: (state) => state.applicationUser.experiments + .filter((x) => !!x.isActive) .map((x) => x.settings) .reduce((r, c) => Object.assign(r, c), {}) ?? {}, submittedOrder: () => JSON.parse(window.sessionStorage.getItem(webStorageConstants.SUBMITTED_ORDER))