From 628f63c243976860c7fb12bcb8e142e7d08f3fe4 Mon Sep 17 00:00:00 2001 From: praveenkumarct Date: Mon, 22 Jan 2024 11:30:38 +0100 Subject: [PATCH 01/14] Add existing implementation --- enabler/index.html | 2 +- enabler/{lib => src}/components/base.ts | 0 .../components/payment-methods/applepay.ts | 0 .../components/payment-methods/card.ts | 0 .../components/payment-methods/dropin.ts | 0 .../components/payment-methods/googlepay.ts | 0 .../components/payment-methods/ideal.ts | 0 enabler/{lib => src}/main.ts | 0 .../adyenPaymentConnector.ts | 0 .../payment-connector/paymentConnector.ts | 0 enabler/{lib => src}/public/confirm.html | 0 enabler/{lib => src}/public/session.js | 0 enabler/tsconfig.json | 3 +- processor/.dockerignore | 3 + processor/.env.template | 29 ++ processor/.eslintrc.json | 37 ++ processor/.gitignore | 24 ++ processor/.prettierignore | 4 + processor/.prettierrc.js | 10 + processor/Dockerfile | 8 + processor/README.md | 15 + processor/jest.config.ts | 6 + processor/src/clients/adyen/adyen.client.ts | 14 + processor/src/config/config.ts | 39 ++ processor/src/dtos/notification.dto.ts | 3 + processor/src/dtos/payment-methods.dto.ts | 13 + processor/src/dtos/payment.dto.ts | 93 +++++ processor/src/global.d.ts | 19 + processor/src/libs/fastify/context/context.ts | 79 ++++ .../src/libs/fastify/error-handler.spec.ts | 85 +++++ processor/src/libs/fastify/error-handler.ts | 95 +++++ processor/src/libs/logger/index.ts | 3 + processor/src/libs/logger/pino.ts | 24 ++ processor/src/main.ts | 19 + .../src/mocks/adyen-notification.mock.ts | 32 ++ processor/src/mocks/auth.mock.ts | 6 + processor/src/mocks/cart.mock.ts | 238 ++++++++++++ processor/src/mocks/ct-api-error.mock.ts | 19 + processor/src/mocks/payment.mock.ts | 35 ++ processor/src/payment-sdk.ts | 66 ++++ processor/src/routes/config.route.ts | 17 + processor/src/routes/notification.route.ts | 31 ++ .../src/routes/payment-confirmation.route.ts | 46 +++ .../src/routes/payment-modification.route.ts | 53 +++ processor/src/routes/payment.route.ts | 59 +++ processor/src/routes/status.route.ts | 58 +++ .../src/routes/stored-payment-method.route.ts | 26 ++ .../src/security/auth/adyen-hmac.auth.ts | 20 + processor/src/security/auth/token.auth.ts | 0 processor/src/server.ts | 100 +++++ .../converters/cancel-payment.converter.ts | 14 + .../converters/capture-payment.converter.ts | 18 + .../converters/confirm-payment.converter.ts | 12 + .../converters/create-payment.converter.ts | 69 ++++ .../converters/create-session.converter.ts | 44 +++ .../services/converters/helper.converter.ts | 95 +++++ .../converters/notification.converter.ts | 82 +++++ .../converters/payment-methods.converter.ts | 57 +++ .../converters/refund-payment.converter.ts | 18 + .../src/services/notification.service.ts | 40 ++ processor/src/services/payment.service.ts | 346 ++++++++++++++++++ .../services/stored-payment-method.service.ts | 16 + .../src/services/types/notification.type.ts | 27 ++ processor/src/services/types/payment.type.ts | 100 +++++ .../types/stored-payment-method.type.ts | 8 + processor/tsconfig.client.json | 29 ++ processor/tsconfig.server.json | 25 ++ processor/vite.config.ts | 28 ++ 68 files changed, 2459 insertions(+), 2 deletions(-) rename enabler/{lib => src}/components/base.ts (100%) rename enabler/{lib => src}/components/payment-methods/applepay.ts (100%) rename enabler/{lib => src}/components/payment-methods/card.ts (100%) rename enabler/{lib => src}/components/payment-methods/dropin.ts (100%) rename enabler/{lib => src}/components/payment-methods/googlepay.ts (100%) rename enabler/{lib => src}/components/payment-methods/ideal.ts (100%) rename enabler/{lib => src}/main.ts (100%) rename enabler/{lib => src}/payment-connector/adyenPaymentConnector.ts (100%) rename enabler/{lib => src}/payment-connector/paymentConnector.ts (100%) rename enabler/{lib => src}/public/confirm.html (100%) rename enabler/{lib => src}/public/session.js (100%) create mode 100644 processor/.dockerignore create mode 100644 processor/.env.template create mode 100644 processor/.eslintrc.json create mode 100644 processor/.gitignore create mode 100644 processor/.prettierignore create mode 100644 processor/.prettierrc.js create mode 100644 processor/Dockerfile create mode 100644 processor/README.md create mode 100644 processor/jest.config.ts create mode 100644 processor/src/clients/adyen/adyen.client.ts create mode 100644 processor/src/config/config.ts create mode 100644 processor/src/dtos/notification.dto.ts create mode 100644 processor/src/dtos/payment-methods.dto.ts create mode 100644 processor/src/dtos/payment.dto.ts create mode 100644 processor/src/global.d.ts create mode 100644 processor/src/libs/fastify/context/context.ts create mode 100644 processor/src/libs/fastify/error-handler.spec.ts create mode 100644 processor/src/libs/fastify/error-handler.ts create mode 100644 processor/src/libs/logger/index.ts create mode 100644 processor/src/libs/logger/pino.ts create mode 100644 processor/src/main.ts create mode 100644 processor/src/mocks/adyen-notification.mock.ts create mode 100644 processor/src/mocks/auth.mock.ts create mode 100644 processor/src/mocks/cart.mock.ts create mode 100644 processor/src/mocks/ct-api-error.mock.ts create mode 100644 processor/src/mocks/payment.mock.ts create mode 100644 processor/src/payment-sdk.ts create mode 100644 processor/src/routes/config.route.ts create mode 100644 processor/src/routes/notification.route.ts create mode 100644 processor/src/routes/payment-confirmation.route.ts create mode 100644 processor/src/routes/payment-modification.route.ts create mode 100644 processor/src/routes/payment.route.ts create mode 100644 processor/src/routes/status.route.ts create mode 100644 processor/src/routes/stored-payment-method.route.ts create mode 100644 processor/src/security/auth/adyen-hmac.auth.ts create mode 100644 processor/src/security/auth/token.auth.ts create mode 100644 processor/src/server.ts create mode 100644 processor/src/services/converters/cancel-payment.converter.ts create mode 100644 processor/src/services/converters/capture-payment.converter.ts create mode 100644 processor/src/services/converters/confirm-payment.converter.ts create mode 100644 processor/src/services/converters/create-payment.converter.ts create mode 100644 processor/src/services/converters/create-session.converter.ts create mode 100644 processor/src/services/converters/helper.converter.ts create mode 100644 processor/src/services/converters/notification.converter.ts create mode 100644 processor/src/services/converters/payment-methods.converter.ts create mode 100644 processor/src/services/converters/refund-payment.converter.ts create mode 100644 processor/src/services/notification.service.ts create mode 100644 processor/src/services/payment.service.ts create mode 100644 processor/src/services/stored-payment-method.service.ts create mode 100644 processor/src/services/types/notification.type.ts create mode 100644 processor/src/services/types/payment.type.ts create mode 100644 processor/src/services/types/stored-payment-method.type.ts create mode 100644 processor/tsconfig.client.json create mode 100644 processor/tsconfig.server.json create mode 100644 processor/vite.config.ts diff --git a/enabler/index.html b/enabler/index.html index 4a0a8b9..4addda9 100644 --- a/enabler/index.html +++ b/enabler/index.html @@ -17,7 +17,7 @@