From 78a50a787cfae83c50fa9a9c815846340e13bfff Mon Sep 17 00:00:00 2001 From: Tung Huynh Date: Fri, 26 Jul 2024 12:03:47 +0700 Subject: [PATCH] test: debug process.env.CONNECT_SERVICE_URL --- processor/package.json | 2 +- processor/src/utils/map.utils.ts | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/processor/package.json b/processor/package.json index c170a4e..7c842bb 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": "0.0.17", + "version": "0.0.18", "main": "index.js", "private": true, "scripts": { diff --git a/processor/src/utils/map.utils.ts b/processor/src/utils/map.utils.ts index cb6587f..4dc2d84 100644 --- a/processor/src/utils/map.utils.ts +++ b/processor/src/utils/map.utils.ts @@ -94,10 +94,9 @@ const getSpecificPaymentParams = (method: PaymentMethod, paymentRequest: any) => }; export const createMollieCreatePaymentParams = (payment: Payment): PaymentCreateParams => { - const { amountPlanned, paymentMethodInfo, custom } = payment; + const { amountPlanned, paymentMethodInfo } = payment; const [method, issuer] = paymentMethodInfo?.method?.split(',') ?? [null, null]; - const requestCustomField = custom?.fields?.[CustomFields.createPayment.request]; const paymentRequest = parseStringToJsonObject( payment.custom?.fields?.[CustomFields.createPayment.request], CustomFields.createPayment.request, @@ -105,9 +104,11 @@ export const createMollieCreatePaymentParams = (payment: Payment): PaymentCreate payment.id, ); + logger.debug(process.env); + const defaultWebhookEndpoint = new URL(process.env.CONNECT_SERVICE_URL ?? '').origin + '/webhook'; - const molliePaymentParams: PaymentCreateParams = { + return { amount: makeMollieAmount(amountPlanned), description: paymentRequest.description ?? '', redirectUrl: paymentRequest.redirectUrl ?? null, @@ -123,6 +124,4 @@ export const createMollieCreatePaymentParams = (payment: Payment): PaymentCreate include: paymentRequest.include ?? '', ...getSpecificPaymentParams(method as PaymentMethod, paymentRequest), }; - - return molliePaymentParams; };