diff --git a/CHANGELOG.md b/CHANGELOG.md index a6aaa26..f4355b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,20 +4,26 @@ 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.0.2 + +Fixes + +- Fix the issue that the payment method is not correctly set in some cases + ## v1.0.1 -### Added +Added - Changelog -### Updated +Updated - Postman collection - Interface interaction field naming to differentiate the connector itself to others ## v1.0.0 -### Added +Added - General configurations for Commercetools, Mollie and connector related - Package version for requests @@ -32,7 +38,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - [KBC/CBC](https://docs.mollie.com/docs/kbc) - [Paypal](https://docs.mollie.com/docs/paypal) - [Przelewy24](https://docs.mollie.com/docs/przelewy24) -- Supporting for [Apply pay direct](https://docs.mollie.com/docs/direct-integration-of-apple-pay) & [Mollie card component](https://docs.mollie.com/docs/mollie-components) +- Supporting for [Apply pay direct](https://docs.mollie.com/docs/direct-integration-of-apple-pay) & [Mollie card component](https://docs.mollie.com/docs/mollie-components) - Filter options for listing payment methods - Create/cancel payment via Payment API - Refund/cancel refund payment via Refund API diff --git a/processor/package-lock.json b/processor/package-lock.json index fd7e99a..8b01a13 100644 --- a/processor/package-lock.json +++ b/processor/package-lock.json @@ -1,12 +1,12 @@ { "name": "shopmacher-mollie-processor", - "version": "1.0.0", + "version": "1.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "shopmacher-mollie-processor", - "version": "1.0.0", + "version": "1.0.2", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/processor/package.json b/processor/package.json index 2ba675b..98e4a1d 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.0.0", + "version": "1.0.2", "main": "index.js", "private": true, "scripts": { diff --git a/processor/src/utils/map.utils.ts b/processor/src/utils/map.utils.ts index ad95dcb..f7f3570 100644 --- a/processor/src/utils/map.utils.ts +++ b/processor/src/utils/map.utils.ts @@ -9,7 +9,12 @@ import { parseStringToJsonObject, removeEmptyProperties } from './app.utils'; import { readConfiguration } from './config.utils'; const extractMethodsRequest = (ctPayment: Payment): ParsedMethodsRequestType | undefined => { - return ctPayment?.custom?.fields?.[CustomFields.payment.request]; + return parseStringToJsonObject( + ctPayment?.custom?.fields?.[CustomFields.payment.request], + CustomFields.payment.request, + 'SCTM - extractMethodsRequest', + ctPayment.id, + ); }; const buildMethodsListParams = (parsedMethodsRequest: ParsedMethodsRequestType): Partial => { diff --git a/processor/tests/service/payment.service.spec.ts b/processor/tests/service/payment.service.spec.ts index 371c94b..43dc30a 100644 --- a/processor/tests/service/payment.service.spec.ts +++ b/processor/tests/service/payment.service.spec.ts @@ -160,9 +160,9 @@ describe('Test listPaymentMethodsByPayment', () => { }, custom: { fields: { - sctm_payment_methods_request: { + sctm_payment_methods_request: JSON.stringify({ locale: 'de_DE', - }, + }), }, } as unknown as CustomFields, } as unknown as Payment; @@ -214,9 +214,9 @@ describe('Test listPaymentMethodsByPayment', () => { }, custom: { fields: { - sctm_payment_methods_request: { + sctm_payment_methods_request: JSON.stringify({ locale: 'de_DE', - }, + }), }, } as unknown as CustomFields, } as unknown as Payment; @@ -286,9 +286,9 @@ describe('Test listPaymentMethodsByPayment', () => { }, custom: { fields: { - sctm_payment_methods_request: { + sctm_payment_methods_request: JSON.stringify({ locale: 'de_DE', - }, + }), }, } as unknown as CustomFields, } as unknown as Payment; @@ -362,9 +362,9 @@ describe('Test listPaymentMethodsByPayment', () => { }, custom: { fields: { - sctm_payment_methods_request: { + sctm_payment_methods_request: JSON.stringify({ locale: 'de_DE', - }, + }), }, } as unknown as CustomFields, } as unknown as Payment; diff --git a/processor/tests/utils/map.utils.spec.ts b/processor/tests/utils/map.utils.spec.ts index be3c7bd..5d2b17a 100644 --- a/processor/tests/utils/map.utils.spec.ts +++ b/processor/tests/utils/map.utils.spec.ts @@ -28,14 +28,14 @@ describe('Test map.utils.ts', () => { }, custom: { fields: { - sctm_payment_methods_request: { + sctm_payment_methods_request: JSON.stringify({ sequenceType: 'oneoff', locale: 'de_DE', billingCountry: 'DE', resouce: 'payments', - includeWallets: 'momo', + includeWallets: 'applepay', orderLineCategories: 'demo,test,sandbox', - }, + }), }, }, } as unknown as Payment; @@ -49,7 +49,7 @@ describe('Test map.utils.ts', () => { sequenceType: 'oneoff', locale: 'de_DE', billingCountry: 'DE', - includeWallets: 'momo', + includeWallets: 'applepay', orderLineCategories: 'demo,test,sandbox', } as unknown as MethodsListParams;