diff --git a/jest.config.js b/jest.config.js
index 10af0ccf0..7b59ea2c1 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -10,7 +10,6 @@ module.exports = {
},
transformIgnorePatterns: ["'/node_modules/(?!vee-validate)"],
moduleFileExtensions: ["js", "vue"],
- modulePathIgnorePatterns: ["vin-lookup"],
collectCoverageFrom: [
"src/**/*.{js,vue}",
"!src/main.js",
diff --git a/src/constants/experiments.js b/src/constants/experiments.js
index 1d689d727..f81484058 100644
--- a/src/constants/experiments.js
+++ b/src/constants/experiments.js
@@ -36,6 +36,9 @@ const experimentSettings = {
SHOW_PM_MOBILE_DAYS: "Show_PMmobileDays",
SHOW_NO_PM_MOBILE_DAYS: "Show_NoPMmobileDays",
SHOW_NO_MOBILE_AVAILABLE_DAYS: "Show_NoMobileAvailableDays",
+ SHOW_MOBILE_FIRST_POPUP_REPAIR: "Show_Mobile_First_Popup_Repair",
+ SHOW_MOBILE_FIRST_POPUP_REPLACE_WITHOUT_MSR: "Show_Mobile_First_Popup_Replace_Without_MSR",
+ SHOW_MOBILE_FIRST_POPUP_REPLACE_WITH_MSR: "Show_Mobile_First_Popup_Replace_With_MSR",
OFFER_OEM: "OfferOem",
USE_ADYEN_PAYMENT: "UseAdyenPayment",
};
diff --git a/src/digital-components/date-picker/date-picker.vue b/src/digital-components/date-picker/date-picker.vue
index fa8d14b62..59297ae05 100644
--- a/src/digital-components/date-picker/date-picker.vue
+++ b/src/digital-components/date-picker/date-picker.vue
@@ -289,7 +289,7 @@ export default {
if (event.screenX === 0 && event.screenY === 0) {
return;
}
- this.$emit("date-clicked", date);
+ this.$emit("date-selected", date);
},
getWeekStartDate(dateString) {
const date = convertDateStringToDate(dateString);
@@ -332,9 +332,9 @@ export default {
let preSelectedDateMonthEnd = this.getMonthEnd(
preSelectedDate.replace("-mobile", "")
);
- let weekIncludesPreSelectedMonthEnd = false;
+ let monthEndsByThisWeek = false;
let i = 0;
- while (!weekIncludesPreSelectedMonthEnd) {
+ while (!monthEndsByThisWeek && i < 52) {
if (i > 0) {
weekStartDate = this.getNextWeekSunday(weekEndDate);
weekEndDate = this.getWeekEndDate(weekStartDate);
@@ -346,7 +346,12 @@ export default {
preSelectedDateMonthEnd === weekEndDate
) {
weekEndDate = preSelectedDateMonthEnd;
- weekIncludesPreSelectedMonthEnd = true;
+ monthEndsByThisWeek = true;
+ } else if (preSelectedDateMonthEnd < weekEndDate) {
+ // Additional case: if month ends before this week (but not necessarily during it),
+ // still cut the loop here, but don't truncate the week.
+
+ monthEndsByThisWeek = true;
}
}
weeks.push({
diff --git a/src/digital-components/sierra-webchat/sierra-webchat.vue b/src/digital-components/sierra-webchat/sierra-webchat.vue
index 162367a62..2ba74b33a 100644
--- a/src/digital-components/sierra-webchat/sierra-webchat.vue
+++ b/src/digital-components/sierra-webchat/sierra-webchat.vue
@@ -138,10 +138,7 @@ export default {
}
// Pass data to Salesforce chat if available
const transfer = event.detail;
- if (
- window.embeddedservice_bootstrap &&
- typeof window.embeddedservice_bootstrap.bootstrapEmbeddedService === "function"
- ) {
+ if (window.embeddedservice_bootstrap && window.embeddedservice_bootstrap.prechatAPI) {
if (
transfer &&
transfer.data &&
diff --git a/src/layouts/payment-adyen/payment-adyen.vue b/src/layouts/payment-adyen/payment-adyen.vue
index 9d5f21785..cddb2189c 100644
--- a/src/layouts/payment-adyen/payment-adyen.vue
+++ b/src/layouts/payment-adyen/payment-adyen.vue
@@ -246,7 +246,7 @@ export default {
console.log(`Price = ${this.amountDue}`);
console.log(`Adyen Price = ${this.adyenPriceTotal}`);
- const requestBody = this.adyenInitRequestInfo;
+ const requestBody = this.getAdyenInitRequestInfo();
console.log(`Calling with:`);
console.log(requestBody);
@@ -294,6 +294,15 @@ export default {
console.log(checkout);
+ const expiryTime = new Date(checkout.options.expiresAt);
+ const expiryInterval = expiryTime.getTime() - new Date().getTime();
+
+ const handleTimeout = () => {
+ this.resetAdyenDropin();
+ };
+
+ const timeout = setTimeout(handleTimeout, expiryInterval);
+
const configuration = {
paymentMethodsConfiguration: {
ideal: {
@@ -496,7 +505,7 @@ export default {
await baseMixin.methods.dispatchStoreAction(storeActions.CREATE_SUBMITTED_STATE);
this.$router.navigateWithoutSaving(
- this.navigationScenarios.CLICKED_FORWARD,
+ this.navigationScenarios.CLICKED_PAY_LATER,
this.pageName
);
} catch (error) {
@@ -505,14 +514,26 @@ export default {
return;
}
},
- },
- computed: {
- piaType() {
- return this.$store.getters.order.payment.piaType;
+ async resetAdyenDropin() {
+ this?.dropinComponent?.unmount();
+ await this.initializeAdyen();
},
- adyenInitRequestInfo() {
+ // Now a Method so it is always freshly called and not cached.
+ getIdempotencyKey() {
+ const currentDateTime = new Date();
+ const currentHour = currentDateTime.getUTCHours();
+ const currentDate = currentDateTime.getUTCDate();
+ const id = this?.$store?.getters?.order?.referralCorrelationId;
+ const system = this.sourceSystem;
+ const total = this.adyenPriceTotal;
+
+ return `${id}-${system}-${currentDate}-${currentHour}-${total}`;
+ },
+
+ // Now a Method so it is always freshly called and not cached.
+ getAdyenInitRequestInfo() {
return {
sourceSystem: this.sourceSystem,
referralSequenceNumber: this.$store.getters.order.referralSequenceNumber,
@@ -529,9 +550,15 @@ export default {
IP: "127.0.0.1", // TODO
firstName: this.$store.getters.order.customer.firstName,
lastName: this.$store.getters.order.customer.lastName,
- idempotencyKey: this.idempotencyKey,
+ idempotencyKey: this.getIdempotencyKey(),
};
},
+ },
+
+ computed: {
+ piaType() {
+ return this.$store.getters.order.payment.piaType;
+ },
workOrderNumberLastSixDigits() {
const workOrderNumber = this.$store.getters.order.workOrderNumber ?? "";
@@ -588,10 +615,6 @@ export default {
};
},
- idempotencyKey() {
- return `${this.$store.getters.order.referralCorrelationId}-${this.sourceSystem}`;
- },
-
sourceSystem() {
return "FMG-2.0";
},
@@ -601,7 +624,7 @@ export default {
},
adyenPriceTotal() {
- return this.amountDue * 100;
+ return Math.round(this.amountDue * 100);
},
// Cart info
diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue
index e8ce97d63..c4d566ae7 100644
--- a/src/layouts/schedule/schedule.vue
+++ b/src/layouts/schedule/schedule.vue
@@ -28,6 +28,7 @@
cmsWidgetName="ScheduleYourServiceWidget"
id="schedule-your-service" />