Skip to content

Commit

Permalink
test: debug process.env.CONNECT_SERVICE_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Tung-Huynh-Shopmacher committed Jul 26, 2024
1 parent 0ec1f7a commit 481b9fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion processor/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
9 changes: 4 additions & 5 deletions processor/src/utils/map.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,21 @@ 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,
'SCTM - PAYMENT PROCESSING',
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,
Expand All @@ -123,6 +124,4 @@ export const createMollieCreatePaymentParams = (payment: Payment): PaymentCreate
include: paymentRequest.include ?? '',
...getSpecificPaymentParams(method as PaymentMethod, paymentRequest),
};

return molliePaymentParams;
};

0 comments on commit 481b9fc

Please sign in to comment.