From bd994e8b748f870bca697e448b99893bfccd0e57 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Mon, 2 Oct 2023 10:26:54 -0400 Subject: [PATCH 1/4] CSR-1392 begin paypal integration work --- src/constants/endpoints.js | 4 + src/constants/store-actions.js | 2 + src/constants/store-mutations.js | 1 + src/layouts/payment-method/payment-method.vue | 38 +++ src/layouts/payment/payment.vue | 263 ++++++++++++++++++ .../router-constants/externalUrl-values.js | 3 + src/router/router-constants/fmgPage-values.js | 1 + .../router-constants/navigation-scenarios.js | 3 + src/router/router-constants/routing-table.js | 17 ++ src/store/index.js | 16 ++ vue.config.js | 5 + 11 files changed, 353 insertions(+) create mode 100644 src/layouts/payment/payment.vue diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index 373779380..8f4116c83 100644 --- a/src/constants/endpoints.js +++ b/src/constants/endpoints.js @@ -126,6 +126,10 @@ const endpoints = { url: "/order/api/v1/order/load-session", method: "POST", }, + GetSignature: { + url: "/order/api/v1/order/sign", + method: "POST", + }, ValidateZip: { url: "/location/api/v1/location/zip", method: "GET", diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index d8ea1854a..f03456c33 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -49,6 +49,7 @@ const storeActions = { RUN_EXPERIMENTS_FOR_TRIGGER: "runExperimentsForTrigger", CLEAR_VIN: "clearVin", RESET_SAVE_SESSION_PROMISE: "resetSaveSessionPromise", + GET_SIGNATURE: "getSignature", // DEPENDENCY MUTATIONS RESET_DAMAGE_STATE_AND_DEPENDENCIES: "resetDamageAndDependencies", @@ -76,6 +77,7 @@ const storeActions = { SAVE_MOLDING_QUESTION_ANSWERS: "saveMoldingQuestionAnswers", SAVE_CAPABILITY_QUESTION_ANSWERS: "saveCapabilityQuestionAnswers", SAVE_PAYMENT_TYPE: "savePaymentType", + SAVE_PAY_NOW_TYPE: "savePayNowType", SAVE_PARENT_ACCOUNT_NUMBER: "saveParentAccountNumber", SAVE_SUPPORTING_ITEMS: "saveSupportingItems", SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING: diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index 240a76762..8c2e4ff6d 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -46,6 +46,7 @@ const storeMutations = { UPDATE_IS_INSURANCE: "updateIsInsurance", UPDATE_SAVED_SESSION_ID: "updateSavedSessionId", UPDATE_CRM_CUSTOMER_ID: "updateCrmCustomerId", + UPDATE_PAY_NOW_TYPE: "updatePayNowType", // EVENT BUS MUTATIONS ADD_EVENT_TO_BUS: "addEventToBus", diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 90c3d0136..ef0437783 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -5,6 +5,35 @@
+
+ + + + +
+
+ +
+
+
+ + + +
+ +
+ +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + diff --git a/src/router/router-constants/externalUrl-values.js b/src/router/router-constants/externalUrl-values.js index 7dad02b62..98b894036 100644 --- a/src/router/router-constants/externalUrl-values.js +++ b/src/router/router-constants/externalUrl-values.js @@ -1,5 +1,8 @@ const externalUrls = { HERITAGE_FUNNEL: process.env.VUE_APP_HERITAGE_FUNNEL, + SAFELITE_HOP: process.env.VUE_APP_SAFELITE_HOP, + PAYPAL_SUCCESS_URL: process.env.VUE_APP_PAYPAL_SUCCESS_URL, + PAYPAL_CANCEL_URL: process.env.VUE_APP_PAYPAL_CANCEL_URL, }; export { externalUrls }; diff --git a/src/router/router-constants/fmgPage-values.js b/src/router/router-constants/fmgPage-values.js index 572b33e7c..cb787b8bf 100644 --- a/src/router/router-constants/fmgPage-values.js +++ b/src/router/router-constants/fmgPage-values.js @@ -17,6 +17,7 @@ const fmgPageValues = { CUSTOMER_DETAILS: "customer-details", REVIEW: "review", PAYMENT_METHOD: "payment-method", + PAYMENT: "payment", CONFIRMATION: "confirmation", }; diff --git a/src/router/router-constants/navigation-scenarios.js b/src/router/router-constants/navigation-scenarios.js index 1b7735e05..ec12163f6 100644 --- a/src/router/router-constants/navigation-scenarios.js +++ b/src/router/router-constants/navigation-scenarios.js @@ -51,6 +51,9 @@ const navigationScenarios = { CLICKED_SERVICE_LOCATION_EDIT: "CLICKED_SERVICE_LOCATION_EDIT", CLICKED_SCHEDULE_EDIT: "CLICKED_SCHEDULE_EDIT", CLICKED_CUSTOMER_EDIT: "CLICKED_CUSTOMER_EDIT", + + // Payment + CLICKED_PAY_NOW: "CLICKED_PAY_NOW", }; export { navigationScenarios }; diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 141186d23..2e9cfa15b 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -482,6 +482,23 @@ const routingTable = function (store) { scenario: navigationScenarios.CLICKED_FORWARD, destinationFmgPageValue: fmgPageValues.CONFIRMATION, }, + { + scenario: navigationScenarios.CLICKED_PAY_NOW, + destinationFmgPageValue: fmgPageValues.PAYMENT, + }, + ], + }, + { + fmgPageValue: fmgPageValues.PAYMENT, + maps: [ + { + scenario: navigationScenarios.CLICKED_BACK, + destinationFmgPageValue: fmgPageValues.PAYMENT_METHOD, + }, + { + scenario: navigationScenarios.CLICKED_FORWARD, + destinationFmgPageValue: fmgPageValues.CONFIRMATION, + }, ], }, { diff --git a/src/store/index.js b/src/store/index.js index 23e8ca8e0..af016bed2 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -92,6 +92,7 @@ const getDefaultState = () => { coverageStatus: null, }, parentAccountNumber: 0, + payNowType: "cc", }, schedule: { date: null, @@ -214,6 +215,9 @@ export const mutations = { updateIsInsurance(state, isInsurance) { state.order.payment.isInsurance = isInsurance; }, + updatePayNowType(state, payNowType) { + state.order.payment.payNowType = payNowType; + }, updateInsuranceVerifiedStatus(state, isVerified) { state.order.payment.insuranceCoverage.isVerified = isVerified; }, @@ -1490,6 +1494,14 @@ export const actions = { }); }, + // Signing Service for Payment + getSignature() { + return globalMethods.callHttpClient({ + method: endpoints.GetSignature.method, + endpoint: endpoints.GetSignature.url, + }); + }, + // Session API Actions saveSession(context, { pageNameToLog }) { const vehicle = context.getters.vehicle; @@ -1957,6 +1969,10 @@ export const actions = { context.commit(storeMutations.UPDATE_IS_INSURANCE, isInsurance); }, + savePayNowType(context, payNowType) { + context.commit(storeMutations.UPDATE_PAY_NOW_TYPE, payNowType); + }, + saveParentAccountNumber(context, parentAccountNumber) { context.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, parentAccountNumber); }, diff --git a/vue.config.js b/vue.config.js index 64c83dd9e..e8b1a489f 100644 --- a/vue.config.js +++ b/vue.config.js @@ -6,6 +6,11 @@ process.env.VUE_APP_GOOGLE_PLACES_API_KEY = "AIzaSyDptGCkOPgN2uWJOy4ou4M33phRD4MAoJo"; process.env.VUE_APP_CURRENT_ENVIRONMENT = "Localhost"; +//process.env.VUE_APP_SAFELITE_HOP = "http://localhost:60966/fmgCheckoutEmbedded.aspx"; +process.env.VUE_APP_SAFELITE_HOP = "https://sv2-safelitehop-sys.safelite.com/fmgCheckoutEmbedded.aspx"; +process.env.VUE_APP_PAYPAL_SUCCESS_URL = "http://localhost:8080/fmg/?fmgPage=payment-method&src=concept-funnel"; +process.env.VUE_APP_PAYPAL_CANCEL_URL = "http://localhost:8080/fmg/?fmgPage=payment-method&src=concept-funnel"; + // GA & GTM process.env.VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY = "(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl+ '>m_auth=amlAYNhxUxuskQo7jmjadg>m_preview=env-38>m_cookies_win=x';f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-M6XCRH');"; From c6bc872b05a8ecb856fb14d7cb67864c91fe6cee Mon Sep 17 00:00:00 2001 From: CarlNation Date: Mon, 2 Oct 2023 10:33:39 -0400 Subject: [PATCH 2/4] CSR-1392 fix merge conflict --- src/layouts/payment-method/payment-method.vue | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index a29047dc2..e00853557 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -27,6 +27,36 @@ :rainDefenseItem="availableRainDefense" vapsTilesCmsName="VapsProductTiles" /> +
+ + + + +
+
+ +
+ Date: Mon, 2 Oct 2023 10:39:27 -0400 Subject: [PATCH 3/4] CSR-1392 prettier --- src/layouts/payment/payment.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/layouts/payment/payment.vue b/src/layouts/payment/payment.vue index 7484b9e20..36f0133d4 100644 --- a/src/layouts/payment/payment.vue +++ b/src/layouts/payment/payment.vue @@ -1,5 +1,5 @@