From d25d453efee424fd998f5469a3ceaa797556d65f Mon Sep 17 00:00:00 2001 From: Nghia Tran Date: Tue, 23 Jul 2024 11:07:14 +0700 Subject: [PATCH 1/2] Temporarily comment out unsupported properties --- processor/src/utils/map.utils.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/processor/src/utils/map.utils.ts b/processor/src/utils/map.utils.ts index 3c3360d..4c18e98 100644 --- a/processor/src/utils/map.utils.ts +++ b/processor/src/utils/map.utils.ts @@ -142,8 +142,12 @@ export const createMollieCreatePaymentParams = (payment: Payment): PaymentCreate // captureMode: paymentRequest.captureMode ?? null, PICT-204 is on hold // captureDelay: paymentRequest.captureMode ?? null, PICT-204 is on hold applicationFee: paymentRequest.applicationFee ?? {}, - profileId: paymentRequest.profileId ?? null, - testmode: paymentRequest.testmode ?? null, + + // TODO: Conflicts between docs and Mollie API Client + // The official document pointed out that these 2 fields are supported + // But if we send them along with the payload even hard-coded the value, Mollie return with the error: "Non-existent body parameter 'profileId' or 'testmode'" + // profileId: paymentRequest.profileId ?? null, + // testmode: paymentRequest.testmode ?? null, ...specificParam, }; From 3bfe392df2c1169651637e5e7dab63f952b211ef Mon Sep 17 00:00:00 2001 From: Nghia Tran Date: Tue, 23 Jul 2024 11:16:57 +0700 Subject: [PATCH 2/2] Fix unit test --- processor/tests/utils/map.utils.spec.ts | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/processor/tests/utils/map.utils.spec.ts b/processor/tests/utils/map.utils.spec.ts index 3370ddb..e9b415c 100644 --- a/processor/tests/utils/map.utils.spec.ts +++ b/processor/tests/utils/map.utils.spec.ts @@ -94,10 +94,8 @@ describe('createMollieCreatePaymentParams', () => { billingAddress: {}, issuer: '', metadata: null, - profileId: null, restrictPaymentMethodsToCountry: null, shippingAddress: {}, - testmode: null, cardToken: '', include: '', }); @@ -156,10 +154,8 @@ describe('createMollieCreatePaymentParams', () => { billingAddress: {}, issuer: '', metadata: null, - profileId: null, restrictPaymentMethodsToCountry: null, shippingAddress: {}, - testmode: null, cardToken: customFieldObject.cardToken, include: '', }); @@ -223,10 +219,8 @@ describe('createMollieCreatePaymentParams', () => { applicationFee: {}, billingAddress: {}, metadata: null, - profileId: null, restrictPaymentMethodsToCountry: null, shippingAddress: {}, - testmode: null, }); }); @@ -289,10 +283,8 @@ describe('createMollieCreatePaymentParams', () => { applicationFee: {}, billingAddress: {}, metadata: null, - profileId: null, restrictPaymentMethodsToCountry: null, shippingAddress: {}, - testmode: null, }); }); @@ -352,10 +344,8 @@ describe('createMollieCreatePaymentParams', () => { applicationFee: {}, billingAddress: {}, metadata: null, - profileId: null, restrictPaymentMethodsToCountry: null, shippingAddress: {}, - testmode: null, }); }); @@ -413,10 +403,8 @@ describe('createMollieCreatePaymentParams', () => { applicationFee: {}, billingAddress: {}, metadata: null, - profileId: null, restrictPaymentMethodsToCountry: null, shippingAddress: {}, - testmode: null, }); }); @@ -472,10 +460,8 @@ describe('createMollieCreatePaymentParams', () => { applicationFee: {}, billingAddress: {}, metadata: null, - profileId: null, restrictPaymentMethodsToCountry: null, shippingAddress: {}, - testmode: null, }); }); @@ -583,10 +569,8 @@ describe('createMollieCreatePaymentParams', () => { applicationFee: {}, billingAddress: {}, metadata: null, - profileId: null, restrictPaymentMethodsToCountry: null, shippingAddress: {}, - testmode: null, }); }); @@ -646,10 +630,8 @@ describe('createMollieCreatePaymentParams', () => { applicationFee: {}, billingAddress: {}, metadata: null, - profileId: null, restrictPaymentMethodsToCountry: null, shippingAddress: {}, - testmode: null, }); }); @@ -709,10 +691,8 @@ describe('createMollieCreatePaymentParams', () => { applicationFee: {}, billingAddress: {}, metadata: null, - profileId: null, restrictPaymentMethodsToCountry: null, shippingAddress: {}, - testmode: null, }); }); });