Skip to content

Commit

Permalink
Merge pull request #39 from mollie/feature/MOL-268/MOL-282
Browse files Browse the repository at this point in the history
MOL-268/MOL-282: update logic checking
  • Loading branch information
Tung-Huynh-Shopmacher authored Aug 13, 2024
2 parents 6f44362 + b0c7dd8 commit 1c27f5a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 14 deletions.
1 change: 1 addition & 0 deletions processor/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ MOLLIE_API_TEST_KEY=<YOUR_MOLLIE_API_TEST_KEY>
MOLLIE_API_LIVE_KEY=<YOUR_MOLLIE_API_LIVE_KEY>
MOLLIE_PROFILE_ID=<YOUR_MOLLIE_PROFILE_ID>
MOLLIE_CARD_COMPONENT=0 ## Either 1 for enable or 0 for disable
MOLLIE_BANK_TRANSFER_DUE_DATE=14d

## NGROK
CONNECTOR_EXTENSION_TOKEN=<YOUR_NGROK_AUTH_TOKEN>
2 changes: 1 addition & 1 deletion processor/.env.jest
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ MOLLIE_CARD_COMPONENT=0
CONNECTOR_MODE=test ## Either test or live
MOLLIE_API_TEST_KEY=test_12345
MOLLIE_API_LIVE_KEY=live_12345
MOLLIE_BANK_TRANSFER_DUE_DATE=
MOLLIE_BANK_TRANSFER_DUE_DATE=14d

CONNECT_SERVICE_URL=http://localhost:3000/processor
4 changes: 2 additions & 2 deletions processor/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.27",
"version": "0.0.28",
"main": "index.js",
"private": true,
"scripts": {
Expand Down
11 changes: 3 additions & 8 deletions processor/src/service/payment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,11 @@ export const handleListPaymentMethodsByPayment = async (ctPayment: Payment): Pro
);
}

methods.splice(
methods.findIndex((method: Method) => {
return !SupportedPaymentMethods[method.id.toString() as SupportedPaymentMethods];
}),
1,
);

const availableMethods = JSON.stringify({
count: methods.length,
methods: methods.length ? methods : [],
methods: methods.length
? methods.filter((method: Method) => SupportedPaymentMethods[method.id.toString() as SupportedPaymentMethods])
: [],
});

ctUpdateActions.push(
Expand Down
2 changes: 0 additions & 2 deletions processor/tests/utils/config.utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { readConfiguration } from '../../src/utils/config.utils';
import CustomError from '../../src/errors/custom.error';
import { describe, expect, test } from '@jest/globals';

const env = process.env;

describe('Test src/utils/config.utils.ts', () => {
test('should return the correct configuration when all env vars are valid', () => {
const config = readConfiguration();
Expand Down

0 comments on commit 1c27f5a

Please sign in to comment.