From 18eb35b138721276ac647631c3df4cba6dd0936d Mon Sep 17 00:00:00 2001 From: Win Date: Wed, 26 Mar 2025 23:05:36 +0700 Subject: [PATCH 1/7] MOL-747 - fix empty entryPointUriPath --- application/custom-application-config.ts | 5 ----- application/src/constants.ts | 26 ++++++++++++++++++------ 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/application/custom-application-config.ts b/application/custom-application-config.ts index 5a8d35f..d6c8751 100644 --- a/application/custom-application-config.ts +++ b/application/custom-application-config.ts @@ -32,11 +32,6 @@ const config = { labelAllLocales: [], permissions: [PERMISSIONS.Manage], }, - headers: { - csp: { - 'connect-src': ['*.euope-west1.gcp.commercetoolsr.app'], - }, - }, }; export default config; diff --git a/application/src/constants.ts b/application/src/constants.ts index 557d351..076d1d0 100644 --- a/application/src/constants.ts +++ b/application/src/constants.ts @@ -1,12 +1,26 @@ // Make sure to import the helper functions from the `ssr` entry point. import { entryPointUriPathToPermissionKeys } from '@commercetools-frontend/application-shell/ssr'; -export const entryPointUriPath = process.env.ENTRY_POINT_URI_PATH ?? 'mollie'; +declare global { + interface Window { + app?: { + [key: string]: string; + entryPointUriPath: string; + }; + } +} + +const getConfig = (processKey: string, windowKey: string) => { + return typeof window === 'undefined' ? process.env[processKey] : window.app?.[windowKey]; +} + +export const entryPointUriPath = getConfig('ENTRY_POINT_URI_PATH', 'entryPointUriPath') ?? ''; + export const PERMISSIONS = entryPointUriPathToPermissionKeys(entryPointUriPath); -export const CLOUD_IDENTIFIER = process.env.CLOUD_IDENTIFIER ?? 'gcp-eu'; -export const CUSTOM_APPLICATION_ID = process.env.CUSTOM_APPLICATION_ID ?? ''; -export const APPLICATION_URL = - process.env.APPLICATION_URL ?? 'https://mollie.app'; +export const CLOUD_IDENTIFIER = getConfig('CLOUD_IDENTIFIER', 'cloudIdentifier') ?? ''; +export const CUSTOM_APPLICATION_ID = getConfig('CUSTOM_APPLICATION_ID', 'customApplicationId') ?? ''; +export const APPLICATION_URL = getConfig('APPLICATION_URL', 'applicationUrl') ?? ''; + export const OBJECT_CONTAINER_NAME = 'sctm-app-methods'; export const EXTENSION_KEY = 'sctm-payment-create-update-extension'; export const EXTENSION_URL_PATH = '/processor'; @@ -16,4 +30,4 @@ export const USER_AGENT = { version: '1.3.1', libraryName: 'ShopmacherMollieCommercetoolsConnector/1.3.1', contactEmail: 'info@mollie.com', -}; +}; \ No newline at end of file From 2ea481ac07cb5a883827fdd2af352299f6ffb99e Mon Sep 17 00:00:00 2001 From: Win Date: Thu, 27 Mar 2025 00:03:30 +0700 Subject: [PATCH 2/7] MOL-747 - fix prettier check --- application/src/constants.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/application/src/constants.ts b/application/src/constants.ts index 076d1d0..ec6142b 100644 --- a/application/src/constants.ts +++ b/application/src/constants.ts @@ -11,15 +11,21 @@ declare global { } const getConfig = (processKey: string, windowKey: string) => { - return typeof window === 'undefined' ? process.env[processKey] : window.app?.[windowKey]; -} + return typeof window === 'undefined' + ? process.env[processKey] + : window.app?.[windowKey]; +}; -export const entryPointUriPath = getConfig('ENTRY_POINT_URI_PATH', 'entryPointUriPath') ?? ''; +export const entryPointUriPath = + getConfig('ENTRY_POINT_URI_PATH', 'entryPointUriPath') ?? ''; export const PERMISSIONS = entryPointUriPathToPermissionKeys(entryPointUriPath); -export const CLOUD_IDENTIFIER = getConfig('CLOUD_IDENTIFIER', 'cloudIdentifier') ?? ''; -export const CUSTOM_APPLICATION_ID = getConfig('CUSTOM_APPLICATION_ID', 'customApplicationId') ?? ''; -export const APPLICATION_URL = getConfig('APPLICATION_URL', 'applicationUrl') ?? ''; +export const CLOUD_IDENTIFIER = + getConfig('CLOUD_IDENTIFIER', 'cloudIdentifier') ?? ''; +export const CUSTOM_APPLICATION_ID = + getConfig('CUSTOM_APPLICATION_ID', 'customApplicationId') ?? ''; +export const APPLICATION_URL = + getConfig('APPLICATION_URL', 'applicationUrl') ?? ''; export const OBJECT_CONTAINER_NAME = 'sctm-app-methods'; export const EXTENSION_KEY = 'sctm-payment-create-update-extension'; From f9894e3dccb96da73a644550afcb0754f70407e9 Mon Sep 17 00:00:00 2001 From: Win Date: Thu, 27 Mar 2025 00:09:36 +0700 Subject: [PATCH 3/7] MOL-747 - fix prettier check --- application/src/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/src/constants.ts b/application/src/constants.ts index ec6142b..9f18118 100644 --- a/application/src/constants.ts +++ b/application/src/constants.ts @@ -36,4 +36,4 @@ export const USER_AGENT = { version: '1.3.1', libraryName: 'ShopmacherMollieCommercetoolsConnector/1.3.1', contactEmail: 'info@mollie.com', -}; \ No newline at end of file +}; From 5618443ec1d1513b651e4c608aa3fa6b724d29b3 Mon Sep 17 00:00:00 2001 From: Win Date: Thu, 27 Mar 2025 00:14:53 +0700 Subject: [PATCH 4/7] MOL-747 - set fallback value for entryPointUriPath + cloudIdentifier --- application/src/constants.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/src/constants.ts b/application/src/constants.ts index 9f18118..1b4f1d5 100644 --- a/application/src/constants.ts +++ b/application/src/constants.ts @@ -17,11 +17,11 @@ const getConfig = (processKey: string, windowKey: string) => { }; export const entryPointUriPath = - getConfig('ENTRY_POINT_URI_PATH', 'entryPointUriPath') ?? ''; + getConfig('ENTRY_POINT_URI_PATH', 'entryPointUriPath') ?? 'mollie'; export const PERMISSIONS = entryPointUriPathToPermissionKeys(entryPointUriPath); export const CLOUD_IDENTIFIER = - getConfig('CLOUD_IDENTIFIER', 'cloudIdentifier') ?? ''; + getConfig('CLOUD_IDENTIFIER', 'cloudIdentifier') ?? 'gcp-eu'; export const CUSTOM_APPLICATION_ID = getConfig('CUSTOM_APPLICATION_ID', 'customApplicationId') ?? ''; export const APPLICATION_URL = From 449a193a33bbb0e820a7c87658413d96118d57e0 Mon Sep 17 00:00:00 2001 From: Win Date: Thu, 27 Mar 2025 00:19:21 +0700 Subject: [PATCH 5/7] MOL-747 - set fallback value for applicationUrl --- application/src/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/src/constants.ts b/application/src/constants.ts index 1b4f1d5..e7157e6 100644 --- a/application/src/constants.ts +++ b/application/src/constants.ts @@ -25,7 +25,7 @@ export const CLOUD_IDENTIFIER = export const CUSTOM_APPLICATION_ID = getConfig('CUSTOM_APPLICATION_ID', 'customApplicationId') ?? ''; export const APPLICATION_URL = - getConfig('APPLICATION_URL', 'applicationUrl') ?? ''; + getConfig('APPLICATION_URL', 'applicationUrl') ?? 'https://your-app-url.com'; export const OBJECT_CONTAINER_NAME = 'sctm-app-methods'; export const EXTENSION_KEY = 'sctm-payment-create-update-extension'; From ba4b1f1831abc852eb135c13799b91a27d9033bc Mon Sep 17 00:00:00 2001 From: Win Date: Thu, 22 May 2025 10:51:18 +0700 Subject: [PATCH 6/7] [UPDATE] Release version 1.4.3 --- CHANGELOG.md | 6 ++++++ application/package.json | 2 +- application/src/constants.ts | 6 +++--- processor/package-lock.json | 6 +++--- processor/package.json | 2 +- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1520755..9d998a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## v1.4.3 + +Fixed + +- Failed to the process key during custom application initialization + ## v1.4.2 - Support for payment methods `in3`, `alma`, `payconiq` diff --git a/application/package.json b/application/package.json index d7bc7fc..5e497c4 100644 --- a/application/package.json +++ b/application/package.json @@ -1,6 +1,6 @@ { "name": "shopmacher-mollie-application", - "version": "1.4.2", + "version": "1.4.3", "description": "Integration application between commercetools and mollie payment service provider", "private": true, "scripts": { diff --git a/application/src/constants.ts b/application/src/constants.ts index 72d6b6a..360a2c2 100644 --- a/application/src/constants.ts +++ b/application/src/constants.ts @@ -32,8 +32,8 @@ export const EXTENSION_KEY = 'sctm-payment-create-update-extension'; export const EXTENSION_URL_PATH = '/processor'; export const APPLICATION_URL_PATH = '/application/methods'; export const USER_AGENT = { - name: 'ShopmacherMollieCommercetoolsConnector/1.4.2', - version: '1.4.2', - libraryName: 'ShopmacherMollieCommercetoolsConnector/1.4.2', + name: 'ShopmacherMollieCommercetoolsConnector/1.4.3', + version: '1.4.3', + libraryName: 'ShopmacherMollieCommercetoolsConnector/1.4.3', contactEmail: 'info@mollie.com', }; diff --git a/processor/package-lock.json b/processor/package-lock.json index f11a8cf..9b0e424 100644 --- a/processor/package-lock.json +++ b/processor/package-lock.json @@ -1,12 +1,12 @@ { "name": "shopmacher-mollie-processor", - "version": "1.4.2", + "version": "1.4.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "shopmacher-mollie-processor", - "version": "1.4.2", + "version": "1.4.3", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -9325,4 +9325,4 @@ } } } -} \ No newline at end of file +} diff --git a/processor/package.json b/processor/package.json index 024bde8..2001242 100644 --- a/processor/package.json +++ b/processor/package.json @@ -1,7 +1,7 @@ { "name": "shopmacher-mollie-processor", "description": "Integration between commercetools and mollie payment service provider", - "version": "1.4.2", + "version": "1.4.3", "main": "index.js", "private": true, "scripts": { From d2429a8804d236b9b8bc3aa67f24d02d7cb4cef1 Mon Sep 17 00:00:00 2001 From: Win Date: Thu, 22 May 2025 10:52:20 +0700 Subject: [PATCH 7/7] [UPDATE] Release version 1.4.3 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d998a1..fa5224b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p Fixed -- Failed to the process key during custom application initialization +- Failed to get the process key during custom application initialization ## v1.4.2