From fc3c0ba98a5c594acaccfbc693d1edf335df481d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 21:33:19 +0000 Subject: [PATCH 1/4] @kkerti has signed the CLA in vendure-ecommerce/vendure#3187 --- license/signatures/version1/cla.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/license/signatures/version1/cla.json b/license/signatures/version1/cla.json index 0d5409580c..8a7650cabb 100644 --- a/license/signatures/version1/cla.json +++ b/license/signatures/version1/cla.json @@ -279,6 +279,14 @@ "created_at": "2024-10-31T08:42:52Z", "repoId": 136938012, "pullRequestNo": 3174 + }, + { + "name": "kkerti", + "id": 47832952, + "comment_id": 2458191015, + "created_at": "2024-11-05T21:33:05Z", + "repoId": 136938012, + "pullRequestNo": 3187 } ] -} +} \ No newline at end of file From a3dc427c4d76714660bdaba55b273fddf633b435 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 6 Nov 2024 10:15:48 +0000 Subject: [PATCH 2/4] @shingoaoyama1 has signed the CLA in vendure-ecommerce/vendure#3192 --- license/signatures/version1/cla.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/license/signatures/version1/cla.json b/license/signatures/version1/cla.json index 8a7650cabb..f8f21b3f32 100644 --- a/license/signatures/version1/cla.json +++ b/license/signatures/version1/cla.json @@ -287,6 +287,14 @@ "created_at": "2024-11-05T21:33:05Z", "repoId": 136938012, "pullRequestNo": 3187 + }, + { + "name": "shingoaoyama1", + "id": 17615101, + "comment_id": 2459213307, + "created_at": "2024-11-06T10:15:37Z", + "repoId": 136938012, + "pullRequestNo": 3192 } ] } \ No newline at end of file From 961297dcdbd19ca37e0b69f1a8af2d49404a8baf Mon Sep 17 00:00:00 2001 From: Martijn Date: Thu, 7 Nov 2024 14:37:18 +0100 Subject: [PATCH 3/4] feat(payments-plugin): prevent false positive logging (#3195) --- packages/payments-plugin/src/mollie/mollie.service.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/payments-plugin/src/mollie/mollie.service.ts b/packages/payments-plugin/src/mollie/mollie.service.ts index 995fe7b495..0dbcbd3908 100644 --- a/packages/payments-plugin/src/mollie/mollie.service.ts +++ b/packages/payments-plugin/src/mollie/mollie.service.ts @@ -264,7 +264,12 @@ export class MollieService { `Unable to find order ${mollieOrder.orderNumber}, unable to process Mollie order ${mollieOrder.id}`, ); } + if (mollieOrder.status === OrderStatus.expired) { + // Expired is fine, a customer can retry the payment later + return; + } if (order.orderPlacedAt) { + // Verify if the Vendure order isn't already paid for, and log if so const paymentWithSameTransactionId = order.payments.find( p => p.transactionId === mollieOrder.id && p.state === 'Settled', ); @@ -293,10 +298,6 @@ export class MollieService { return; } const amount = amountToCents(mollieOrder.amount); - if (mollieOrder.status === OrderStatus.expired) { - // Expired is fine, a customer can retry the payment later - return; - } if (mollieOrder.status === OrderStatus.paid) { // Paid is only used by 1-step payments without Authorized state. This will settle immediately await this.addPayment(ctx, order, amount, mollieOrder, paymentMethod.code, 'Settled'); From c4cd542e59e039db5b37219cef5db0602dec8131 Mon Sep 17 00:00:00 2001 From: d46 Date: Thu, 7 Nov 2024 20:40:06 +0100 Subject: [PATCH 4/4] feat(chore): Channel awareness for findByCode --- .../src/service/services/facet.service.ts | 63 ++++++++++++------- 1 file changed, 41 insertions(+), 22 deletions(-) diff --git a/packages/core/src/service/services/facet.service.ts b/packages/core/src/service/services/facet.service.ts index f996431c64..eeeeee4c27 100644 --- a/packages/core/src/service/services/facet.service.ts +++ b/packages/core/src/service/services/facet.service.ts @@ -111,29 +111,48 @@ export class FacetService { lang?: LanguageCode, ): Promise | undefined> { const relations = ['values', 'values.facet']; - const [repository, facetCode, languageCode] = - ctxOrFacetCode instanceof RequestContext - ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - [this.connection.getRepository(ctxOrFacetCode, Facet), facetCodeOrLang, lang!] - : [ - this.connection.rawConnection.getRepository(Facet), - ctxOrFacetCode, - facetCodeOrLang as LanguageCode, - ]; + if (ctxOrFacetCode instanceof RequestContext) { + // New method using channel-aware query + return this.connection + .getRepository(ctxOrFacetCode, Facet) + .createQueryBuilder('facet') + .leftJoinAndSelect('facet.values', 'values') + .leftJoinAndSelect('values.facet', 'facetValue') + .where('facet.code = :code', { code: facetCodeOrLang }) + .andWhere('facet.channels.id = :channelId', { channelId: ctxOrFacetCode.channelId }) + .getOne() + .then(facet => { + if (facet) { + const channelLanguageCode = ctxOrFacetCode.languageCode; + return translateDeep(facet, lang || channelLanguageCode, [ + 'values', + ['values', 'facet'], + ]); + } + return undefined; + }); + } else { + // Old method + const [repository, facetCode, languageCode] = [ + this.connection.rawConnection.getRepository(Facet), + ctxOrFacetCode, + facetCodeOrLang as LanguageCode, + ]; - // TODO: Implement usage of channelLanguageCode - return repository - .findOne({ - where: { - code: facetCode, - }, - relations, - }) - .then( - facet => - (facet && translateDeep(facet, languageCode, ['values', ['values', 'facet']])) ?? - undefined, - ); + return repository + .findOne({ + where: { + code: facetCode, + }, + relations, + }) + .then(facet => { + if (facet) { + return translateDeep(facet, languageCode, ['values', ['values', 'facet']]); + } + return undefined; + }); + } } /**