From 3d3d48a1ec2722102c252a1db6f85463d58ece40 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 7 Jan 2026 11:17:14 -0500 Subject: [PATCH] Move hardcoded test values to env variables --- environment-variables.js | 2 ++ src/constants/application-config.js | 2 ++ src/helpers/adyen-helper.js | 5 +++-- src/layouts/payment-adyen/payment-adyen.vue | 1 - 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/environment-variables.js b/environment-variables.js index 4d894b006..17c797cfd 100644 --- a/environment-variables.js +++ b/environment-variables.js @@ -13,6 +13,8 @@ const environmentVariables = { ['__VUE_APP_SAFELITE_HOP__']: "https://sv2-safelitehop-dev.safelite.com/fmgCheckoutShared.aspx", ['__VUE_APP_SESSION_TIMEOUT_MINUTES__']: 30, ['__VUE_APP_SOLARWINDS_MONITORING_SCRIPT__']: "", + ['__VUE_APP_ADYEN_ENVIRONMENT__']: "test", + ['__VUE_APP_ADYEN_CLIENT_KEY__']: "test_WYGT4F5ZT5BRRL5MPWHK6QLYOIXZXROD", }; const keysOnly = Object.keys(environmentVariables); diff --git a/src/constants/application-config.js b/src/constants/application-config.js index b739d9ff9..91873d455 100644 --- a/src/constants/application-config.js +++ b/src/constants/application-config.js @@ -32,6 +32,8 @@ const applicationConfig = { COOKIE_NAME_LENGTH_MAX_LIMIT: 44, SESSION_TIMEOUT_MINUTES: process.env.__VUE_APP_SESSION_TIMEOUT_MINUTES__, RETURN_USER_PAGE: "/fmg/return-user", + ADYEN_CLIENT_KEY: process.env.__VUE_APP_ADYEN_CLIENT_KEY__, + ADYEN_ENVIRONMENT: process.env.__VUE_APP_ADYEN_ENVIRONMENT__, }; export { applicationConfig }; diff --git a/src/helpers/adyen-helper.js b/src/helpers/adyen-helper.js index 96d04f767..8de92bf89 100644 --- a/src/helpers/adyen-helper.js +++ b/src/helpers/adyen-helper.js @@ -4,6 +4,7 @@ import globalMethods from "@/global-methods"; import { endpoints } from "@/constants/endpoints"; import { AppointmentTypeStrings } from "@/constants/schedule-constants"; import { paymentMethods } from "@/constants/payment-method-constants"; +import { applicationConfig } from "../constants/application-config"; export async function getNewSession(sessionConfig) {} @@ -42,8 +43,8 @@ export async function createAdyenCheckout({ id: id, sessionData: sessionData, }, - clientKey: "test_WYGT4F5ZT5BRRL5MPWHK6QLYOIXZXROD", - environment: "test", + clientKey: applicationConfig.ADYEN_CLIENT_KEY, + environment: applicationConfig.ADYEN_ENVIRONMENT, locale: "en_US", countryCode: "US", showPayButton: showPayButton, diff --git a/src/layouts/payment-adyen/payment-adyen.vue b/src/layouts/payment-adyen/payment-adyen.vue index a8b1704a1..d09ffd14e 100644 --- a/src/layouts/payment-adyen/payment-adyen.vue +++ b/src/layouts/payment-adyen/payment-adyen.vue @@ -281,7 +281,6 @@ export default { value: this.adyenPriceTotal, currency: "USD", }, - environment: "test", // Change this to "live" when you're ready to accept live PayPal payments countryCode: "US", // Only needed for test. This will be automatically retrieved when you are in production. blockPayPalVenmoButton: true, blockPayPalPayLaterButton: true,