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..424241b 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', 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; };