Skip to content

Commit

Permalink
Fix: Always use default connector webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
NghiaDTr committed Jul 19, 2024
1 parent 6087c2f commit 9f4d89a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion processor/src/utils/map.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const createMollieCreatePaymentParams = (payment: Payment): PaymentCreate
description: paymentRequest.description ?? '',
amount: makeMollieAmount(amountPlanned),
redirectUrl: paymentRequest.redirectUrl ?? null,
webhookUrl: paymentRequest.webhookUrl ?? defaultWebhookEndpoint,
webhookUrl: defaultWebhookEndpoint,
billingAddress: paymentRequest.billingAddress ?? {},
shippingAddress: paymentRequest.shippingAddress ?? {},
locale: paymentRequest.locale ?? null,
Expand Down
5 changes: 4 additions & 1 deletion processor/tests/utils/map.utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ describe('createMollieCreatePaymentParams', () => {
};

const mollieCreatePaymentParams = createMollieCreatePaymentParams(CTPayment);
// Always use our default webhook endpoint
const defaultWebhookEndpoint = new URL(process.env.CONNECT_SERVICE_URL ?? '').origin + '/webhook';

expect(mollieCreatePaymentParams).toEqual({
method: 'creditcard',
amount: {
Expand All @@ -147,7 +150,7 @@ describe('createMollieCreatePaymentParams', () => {
},
locale: customFieldObject.locale,
redirectUrl: customFieldObject.redirectUrl,
webhookUrl: customFieldObject.webhookUrl,
webhookUrl: defaultWebhookEndpoint,
description: customFieldObject.description,
applicationFee: {},
billingAddress: {},
Expand Down

0 comments on commit 9f4d89a

Please sign in to comment.