Changes for Dev

This commit is contained in:
Chloe Herd 2025-12-16 11:10:56 -05:00
parent 72a3d8588e
commit 8385928d8c
7 changed files with 39 additions and 10 deletions

View file

@ -22,6 +22,7 @@ const applicationConfig = {
PIA_ERROR_URL:
location.protocol + "//" + location.host + "/fmg/payment-pia-return?src=concept-funnel",
CONFIRMATION_URL: location.protocol + "//" + location.host + "/fmg/confirmation",
PIA_ADYEN_RETURN_URL: location.protocol + "//" + location.host + "/fmg/virtual/payment/return",
GOOGLE_CALENDAR: "https://www.google.com/calendar/render?action=TEMPLATE",
YAHOO_CALENDAR: "https://calendar.yahoo.com/?v=60",
OUTLOOK_CALENDAR:

View file

@ -33,6 +33,7 @@ const experimentSettings = {
SHOW_PM_MOBILE_DAYS: "Show_PMmobileDays",
SHOW_NO_PM_MOBILE_DAYS: "Show_NoPMmobileDays",
SHOW_NO_MOBILE_AVAILABLE_DAYS: "Show_NoMobileAvailableDays",
USE_ADYEN_PAYMENT: "UseAdyenPayment",
};
const experimentTriggers = {

View file

@ -49,6 +49,7 @@ import { submitWorkOrder } from "@/helpers/heritage-integration/order-helper.js"
import { paymentMethods } from "@/constants/payment-method-constants";
import { createAdyenCheckout } from "@/helpers/adyen-helper";
import { Dropin } from "@adyen/adyen-web/auto";
import { applicationConfig } from "@/constants/application-config";
export default {
name: "payment-adyen",
@ -279,20 +280,29 @@ export default {
await this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
try {
await submitWorkOrder({
pageNameToLog: "payment-adyen",
pageNameToLog: this.pageName,
submitAfterSave: true,
});
} catch (error) {
console.log(`error: response from submit work order: ${error.message}`);
// navigate to error page
const errorPayload = {
cause: `Error while submitting work order after Adyen payment.`,
currentPage: this.pageName,
sessionId: this.sessionId,
idempotencyKey: this.idempotencyKey,
};
//this.$refs.loadingModal.isModalVisible = false;
this.$router.handleSoftError(errorPayload);
}
//this.$refs.loadingModal.isModalVisible = false;
// clear order
// navigate forward
await baseMixin.methods.dispatchStoreAction(storeActions.CREATE_SUBMITTED_STATE);
this.$router.navigateWithoutSaving(
this.navigationScenarios.CLICKED_FORWARD,
this.pageName
);
},
},
@ -309,12 +319,12 @@ export default {
street: this.splitStreetAddress.street,
zipCode: this.locationInfo.zipCode,
stateOrProvince: this.locationInfo.state,
returnUrl: "http://localhost:8080/fmg/virtual/payment/return",
returnUrl: applicationConfig.PIA_ADYEN_RETURN_URL,
email: this.$store.getters.order.customer.emailAddress,
IP: "127.0.0.1", // TODO
firstName: this.$store.getters.order.customer.firstName,
lastName: this.$store.getters.order.customer.lastName,
idempotencyKey: `${this.$store.getters.order.referralCorrelationId}-${this.sourceSystem}`,
idempotencyKey: this.idempotencyKey,
};
},
@ -373,6 +383,10 @@ export default {
};
},
idempotencyKey() {
return `${this.$store.getters.order.referralCorrelationId}-${this.sourceSystem}`;
},
sourceSystem() {
return "FMG-2.0";
},

View file

@ -170,6 +170,7 @@ import { consumeQueryFromStash } from "@/router/methods/helpers/querystring-stas
import { debugLog } from "@/helpers/debug-log-helper";
import { ErrorMessage } from "vee-validate";
import { Field } from "vee-validate";
import experimentMixin from "../../mixins/experiment-mixin";
defineRule("payment-method-required", required(errorMessages.OPTION_REQUIRED));
defineRule("recal-ack-required", required(errorMessages.RECAL_ACK_REQUIRED));
@ -609,10 +610,17 @@ export default {
}
this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
this.$router.navigateWithoutSaving(
this.navigationScenarios.CLICKED_PAY_NOW,
this.pageName
const shouldUseAdyen = experimentMixin.methods.hasSettingEqualTo(
experimentSettings.USE_ADYEN_PAYMENT,
"true"
);
const scenarioName = shouldUseAdyen
? this.navigationScenarios.CLICKED_PAY_NOW_ADYEN
: this.navigationScenarios.CLICKED_PAY_NOW;
this.$router.navigateWithoutSaving(scenarioName, this.pageName);
},
async evaluatePromosAndTaxItemsOnOrder() {
//Revalidate promos if there are any inactive, or active promos

View file

@ -61,6 +61,7 @@ const navigationScenarios = {
// Payment
CLICKED_INSURANCE: "CLICKED_INSURANCE",
CLICKED_PAY_NOW: "CLICKED_PAY_NOW",
CLICKED_PAY_NOW_ADYEN: "CLICKED_PAY_NOW_ADYEN",
CLICKED_PAY_LATER: "CLICKED_PAY_LATER",
PIA_ERROR: "PIA_ERROR",
PIA_CC_ERROR: "PIA_CC_ERROR",

View file

@ -535,6 +535,10 @@ const routingTable = function () {
},
{
scenario: navigationScenarios.CLICKED_PAY_NOW,
destinationPageData: routeData.PAYMENT,
},
{
scenario: navigationScenarios.CLICKED_PAY_NOW_ADYEN,
destinationPageData: routeData.PAYMENT_ADYEN,
},
{

View file

@ -1,5 +1,5 @@
import { AdyenCheckout } from "@adyen/adyen-web";
import { routeData } from "@router/constants/routes";
import { routeData } from "@/router/constants/routes";
import { createAdyenCheckout, getSessionInfo } from "@/helpers/adyen-helper";
export async function adyenReturnBeforeEnter(to, from) {