diff --git a/processor/package-lock.json b/processor/package-lock.json index 0021ee4..c7fc649 100644 --- a/processor/package-lock.json +++ b/processor/package-lock.json @@ -11,9 +11,7 @@ "dependencies": { "@adyen/api-library": "16.1.0", "@commercetools-backend/loggers": "22.20.0", - "@commercetools/connect-payments-sdk": "0.3.0", - "@commercetools/platform-sdk": "7.4.0", - "@commercetools/sdk-client-v2": "2.3.0", + "@commercetools/connect-payments-sdk": "0.4.0", "@fastify/autoload": "5.8.0", "@fastify/cors": "9.0.1", "@fastify/formbody": "7.4.0", @@ -815,35 +813,35 @@ } }, "node_modules/@commercetools/connect-payments-sdk": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@commercetools/connect-payments-sdk/-/connect-payments-sdk-0.3.0.tgz", - "integrity": "sha512-Oc8vISVDJY3VpnoV0PbQKgVi08MmPkotYchRiyvzFzxuvQv2YLBrhV7N9vLtRgC2J9y3oekECFRaiqzAsx7ZdQ==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@commercetools/connect-payments-sdk/-/connect-payments-sdk-0.4.0.tgz", + "integrity": "sha512-l9KiUmtkc6+/fqXkDhcTYbwfOWRWvX/RhDd8V46ENpt1HHvWk/3Czm02qfX96BL8vpd0OBsnFwpmV2l5vjCtJQ==", "dependencies": { - "@commercetools/platform-sdk": "7.4.0", - "@commercetools/sdk-client-v2": "2.3.0", + "@commercetools/platform-sdk": "7.5.0", + "@commercetools/sdk-client-v2": "2.4.0", "jsonwebtoken": "9.0.2", "jwks-rsa": "3.1.0" } }, "node_modules/@commercetools/platform-sdk": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@commercetools/platform-sdk/-/platform-sdk-7.4.0.tgz", - "integrity": "sha512-F6qcCvOR1Ikzw3klkfgUq/XkB4FrddBhMFkTGUISPxh6UQq9v70rPRY7pIu9z8bt0P926avOZe5Mk/MHYr+YYw==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@commercetools/platform-sdk/-/platform-sdk-7.5.0.tgz", + "integrity": "sha512-CVkZzFeIhU0zXnff2XXuodtatvzio4yZ5vsQkMUb2P7x4U7O1n2MlIaODXhJaxFmGSnMghyKriUdbsCHQ0xNtQ==", "dependencies": { - "@commercetools/sdk-client-v2": "^2.2.2", + "@commercetools/sdk-client-v2": "^2.4.0", "@commercetools/sdk-middleware-auth": "^7.0.0", "@commercetools/sdk-middleware-http": "^7.0.0", "@commercetools/sdk-middleware-logger": "^3.0.0", - "@commercetools/ts-client": "^1.1.1" + "@commercetools/ts-client": "^1.2.0" }, "engines": { "node": ">=14" } }, "node_modules/@commercetools/sdk-client-v2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@commercetools/sdk-client-v2/-/sdk-client-v2-2.3.0.tgz", - "integrity": "sha512-+vS6qRoKBbkunZCpdozung+7te97nFxaidLPqOTlz/9TmJaRfMMcYC/KUZCTS8S5a/4BFfY6DYujddolaU7e6Q==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@commercetools/sdk-client-v2/-/sdk-client-v2-2.4.0.tgz", + "integrity": "sha512-EEp8lPcBSPOsozGydWtF3llLmb83G2ILtep7UQ+uvAztfMYgjYLUI2MfYlVfjbVoZKbWTfmW2Ed69UQ6lwYCng==", "dependencies": { "buffer": "^6.0.3", "node-fetch": "^2.6.1" @@ -918,9 +916,9 @@ } }, "node_modules/@commercetools/ts-client": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@commercetools/ts-client/-/ts-client-1.1.1.tgz", - "integrity": "sha512-otm9bDdR/N1KVGUZdJvhMx/vmKr8ojWAYT5s7RVuiENuJyNNqNxN98apBo5m4hLOfa9AiOUFn3Qtm11QGrRlWg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@commercetools/ts-client/-/ts-client-1.2.0.tgz", + "integrity": "sha512-oMuv9AFFyx/lbkbw+/AYpUGPUNMa1AiCgAcAVU798fOHMrDn3/NrVmuMM+PDwaPoTISUUUoPRheMNXSwprxHrw==", "dependencies": { "abort-controller": "3.0.0", "buffer": "^6.0.3", @@ -9910,32 +9908,32 @@ } }, "@commercetools/connect-payments-sdk": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@commercetools/connect-payments-sdk/-/connect-payments-sdk-0.3.0.tgz", - "integrity": "sha512-Oc8vISVDJY3VpnoV0PbQKgVi08MmPkotYchRiyvzFzxuvQv2YLBrhV7N9vLtRgC2J9y3oekECFRaiqzAsx7ZdQ==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@commercetools/connect-payments-sdk/-/connect-payments-sdk-0.4.0.tgz", + "integrity": "sha512-l9KiUmtkc6+/fqXkDhcTYbwfOWRWvX/RhDd8V46ENpt1HHvWk/3Czm02qfX96BL8vpd0OBsnFwpmV2l5vjCtJQ==", "requires": { - "@commercetools/platform-sdk": "7.4.0", - "@commercetools/sdk-client-v2": "2.3.0", + "@commercetools/platform-sdk": "7.5.0", + "@commercetools/sdk-client-v2": "2.4.0", "jsonwebtoken": "9.0.2", "jwks-rsa": "3.1.0" } }, "@commercetools/platform-sdk": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@commercetools/platform-sdk/-/platform-sdk-7.4.0.tgz", - "integrity": "sha512-F6qcCvOR1Ikzw3klkfgUq/XkB4FrddBhMFkTGUISPxh6UQq9v70rPRY7pIu9z8bt0P926avOZe5Mk/MHYr+YYw==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@commercetools/platform-sdk/-/platform-sdk-7.5.0.tgz", + "integrity": "sha512-CVkZzFeIhU0zXnff2XXuodtatvzio4yZ5vsQkMUb2P7x4U7O1n2MlIaODXhJaxFmGSnMghyKriUdbsCHQ0xNtQ==", "requires": { - "@commercetools/sdk-client-v2": "^2.2.2", + "@commercetools/sdk-client-v2": "^2.4.0", "@commercetools/sdk-middleware-auth": "^7.0.0", "@commercetools/sdk-middleware-http": "^7.0.0", "@commercetools/sdk-middleware-logger": "^3.0.0", - "@commercetools/ts-client": "^1.1.1" + "@commercetools/ts-client": "^1.2.0" } }, "@commercetools/sdk-client-v2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@commercetools/sdk-client-v2/-/sdk-client-v2-2.3.0.tgz", - "integrity": "sha512-+vS6qRoKBbkunZCpdozung+7te97nFxaidLPqOTlz/9TmJaRfMMcYC/KUZCTS8S5a/4BFfY6DYujddolaU7e6Q==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@commercetools/sdk-client-v2/-/sdk-client-v2-2.4.0.tgz", + "integrity": "sha512-EEp8lPcBSPOsozGydWtF3llLmb83G2ILtep7UQ+uvAztfMYgjYLUI2MfYlVfjbVoZKbWTfmW2Ed69UQ6lwYCng==", "requires": { "buffer": "^6.0.3", "node-fetch": "^2.6.1" @@ -9980,9 +9978,9 @@ "integrity": "sha512-DhMXAA2yIch/AaGxy7st85Z1HFmeLtHWGkr9z5rX4xKjan4PHGB/IE5saAR+SNGHhs6+1Lp8vZEHDo3tFqVLmg==" }, "@commercetools/ts-client": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@commercetools/ts-client/-/ts-client-1.1.1.tgz", - "integrity": "sha512-otm9bDdR/N1KVGUZdJvhMx/vmKr8ojWAYT5s7RVuiENuJyNNqNxN98apBo5m4hLOfa9AiOUFn3Qtm11QGrRlWg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@commercetools/ts-client/-/ts-client-1.2.0.tgz", + "integrity": "sha512-oMuv9AFFyx/lbkbw+/AYpUGPUNMa1AiCgAcAVU798fOHMrDn3/NrVmuMM+PDwaPoTISUUUoPRheMNXSwprxHrw==", "requires": { "abort-controller": "3.0.0", "buffer": "^6.0.3", diff --git a/processor/package.json b/processor/package.json index 6c9f929..eb665e5 100644 --- a/processor/package.json +++ b/processor/package.json @@ -21,9 +21,7 @@ "dependencies": { "@adyen/api-library": "16.1.0", "@commercetools-backend/loggers": "22.20.0", - "@commercetools/connect-payments-sdk": "0.3.0", - "@commercetools/platform-sdk": "7.4.0", - "@commercetools/sdk-client-v2": "2.3.0", + "@commercetools/connect-payments-sdk": "0.4.0", "@fastify/autoload": "5.8.0", "@fastify/cors": "9.0.1", "@fastify/formbody": "7.4.0", @@ -57,4 +55,4 @@ "ts-node": "10.9.2", "typescript": "5.4.2" } -} +} \ No newline at end of file diff --git a/processor/src/services/abstract-payment.service.ts b/processor/src/services/abstract-payment.service.ts index 144e40a..d324c74 100644 --- a/processor/src/services/abstract-payment.service.ts +++ b/processor/src/services/abstract-payment.service.ts @@ -3,6 +3,7 @@ import { CommercetoolsPaymentService, ErrorInvalidJsonInput, ErrorInvalidOperation, + Payment, } from '@commercetools/connect-payments-sdk'; import { CancelPaymentRequest, @@ -18,7 +19,6 @@ import { PaymentIntentResponseSchemaDTO, PaymentModificationStatus, } from '../dtos/operations/payment-intents.dto'; -import { Payment } from '@commercetools/platform-sdk'; import { SupportedPaymentComponentsSchemaDTO } from '../dtos/operations/payment-componets.dto'; export abstract class AbstractPaymentService { diff --git a/processor/src/services/adyen-payment.service.ts b/processor/src/services/adyen-payment.service.ts index a1717c2..7faf144 100644 --- a/processor/src/services/adyen-payment.service.ts +++ b/processor/src/services/adyen-payment.service.ts @@ -4,6 +4,8 @@ import { ErrorInvalidOperation, healthCheckCommercetoolsPermissions, statusHandler, + Cart, + Payment, } from '@commercetools/connect-payments-sdk'; import { ConfirmPaymentRequestDTO, @@ -46,7 +48,6 @@ import { SupportedPaymentComponentsSchemaDTO } from '../dtos/operations/payment- import { PaymentDetailsResponse } from '@adyen/api-library/lib/src/typings/checkout/paymentDetailsResponse'; import { CancelPaymentConverter } from './converters/cancel-payment.converter'; import { RefundPaymentConverter } from './converters/refund-payment.converter'; -import { Cart, Payment } from '@commercetools/platform-sdk'; const packageJSON = require('../../package.json'); export type AdyenPaymentServiceOptions = { diff --git a/processor/src/services/converters/create-payment.converter.ts b/processor/src/services/converters/create-payment.converter.ts index d37cf09..ca742e9 100644 --- a/processor/src/services/converters/create-payment.converter.ts +++ b/processor/src/services/converters/create-payment.converter.ts @@ -1,7 +1,7 @@ import { PaymentRequest } from '@adyen/api-library/lib/src/typings/checkout/paymentRequest'; import { config } from '../../config/config'; import { ThreeDSRequestData } from '@adyen/api-library/lib/src/typings/checkout/threeDSRequestData'; -import { Cart, Payment } from '@commercetools/platform-sdk'; +import { Cart, Payment } from '@commercetools/connect-payments-sdk'; import { buildReturnUrl, populateCartAddress, populateLineItems } from './helper.converter'; import { CreatePaymentRequestDTO } from '../../dtos/adyen-payment.dto'; diff --git a/processor/src/services/converters/create-session.converter.ts b/processor/src/services/converters/create-session.converter.ts index 9ca967d..23efc3b 100644 --- a/processor/src/services/converters/create-session.converter.ts +++ b/processor/src/services/converters/create-session.converter.ts @@ -2,7 +2,7 @@ import { CreateCheckoutSessionRequest } from '@adyen/api-library/lib/src/typings import { config } from '../../config/config'; import { buildReturnUrl, convertAllowedPaymentMethodsToAdyenFormat, populateCartAddress } from './helper.converter'; import { CreateSessionRequestDTO } from '../../dtos/adyen-payment.dto'; -import { Cart, Payment } from '@commercetools/platform-sdk'; +import { Cart, Payment } from '@commercetools/connect-payments-sdk'; export class CreateSessionConverter { constructor() {} diff --git a/processor/src/services/converters/helper.converter.ts b/processor/src/services/converters/helper.converter.ts index c033a54..052ee01 100644 --- a/processor/src/services/converters/helper.converter.ts +++ b/processor/src/services/converters/helper.converter.ts @@ -1,6 +1,11 @@ import { Address } from '@adyen/api-library/lib/src/typings/checkout/address'; import { LineItem } from '@adyen/api-library/lib/src/typings/checkout/lineItem'; -import { Cart, LineItem as CoCoLineItem, CustomLineItem, Address as CartAddress } from '@commercetools/platform-sdk'; +import { + Cart, + LineItem as CoCoLineItem, + CustomLineItem, + Address as CartAddress, +} from '@commercetools/connect-payments-sdk'; import { getAllowedPaymentMethodsFromContext, getCtSessionIdFromContext, diff --git a/processor/src/services/converters/notification.converter.ts b/processor/src/services/converters/notification.converter.ts index f41c76f..e84daf9 100644 --- a/processor/src/services/converters/notification.converter.ts +++ b/processor/src/services/converters/notification.converter.ts @@ -1,7 +1,6 @@ -import { Money } from '@commercetools/platform-sdk'; import { NotificationRequestItem } from '@adyen/api-library/lib/src/typings/notification/notificationRequestItem'; import { NotificationRequestDTO } from '../../dtos/adyen-payment.dto'; -import { TransactionData, UpdatePayment } from '@commercetools/connect-payments-sdk'; +import { TransactionData, UpdatePayment, Money } from '@commercetools/connect-payments-sdk'; export class NotificationConverter { constructor() {} diff --git a/processor/src/services/types/operation.type.ts b/processor/src/services/types/operation.type.ts index e8a64a7..581b27b 100644 --- a/processor/src/services/types/operation.type.ts +++ b/processor/src/services/types/operation.type.ts @@ -5,7 +5,7 @@ import { PaymentModificationStatus, } from '../../dtos/operations/payment-intents.dto'; import { StatusResponseSchemaDTO } from '../../dtos/operations/status.dto'; -import { Payment } from '@commercetools/platform-sdk'; +import { Payment } from '@commercetools/connect-payments-sdk'; export type CapturePaymentRequest = { amount: AmountSchemaDTO; diff --git a/processor/test/services/converters/helper.converter.spec.ts b/processor/test/services/converters/helper.converter.spec.ts index 218cb90..2e6ad29 100644 --- a/processor/test/services/converters/helper.converter.spec.ts +++ b/processor/test/services/converters/helper.converter.spec.ts @@ -5,7 +5,7 @@ import { populateCartAddress, } from '../../../src/services/converters/helper.converter'; import { Address as AdyenAddress } from '@adyen/api-library/lib/src/typings/checkout/address'; -import { Address } from '@commercetools/platform-sdk'; +import { Address } from '@commercetools/connect-payments-sdk'; describe('helper.converter', () => { beforeEach(() => { jest.setTimeout(10000); diff --git a/processor/test/utils/mock-cart-data.ts b/processor/test/utils/mock-cart-data.ts index 48e4f92..27e2bc0 100644 --- a/processor/test/utils/mock-cart-data.ts +++ b/processor/test/utils/mock-cart-data.ts @@ -1,6 +1,5 @@ -import { LineItem, CustomLineItem, ShippingInfo } from '@commercetools/platform-sdk'; +import { LineItem, CustomLineItem, ShippingInfo, Cart } from '@commercetools/connect-payments-sdk'; import { randomUUID } from 'crypto'; -import { Cart } from '@commercetools/platform-sdk'; export const mockGetCartResult = () => { const cartId = randomUUID(); diff --git a/processor/test/utils/mock-payment-data.ts b/processor/test/utils/mock-payment-data.ts index 5267e88..7a2cb36 100644 --- a/processor/test/utils/mock-payment-data.ts +++ b/processor/test/utils/mock-payment-data.ts @@ -1,5 +1,4 @@ -import { Payment } from '@commercetools/platform-sdk'; -import { Transaction } from '@commercetools/platform-sdk/dist/declarations/src'; +import { Payment, Transaction } from '@commercetools/connect-payments-sdk'; import { PaymentCancelResponse } from '@adyen/api-library/lib/src/typings/checkout/paymentCancelResponse'; import { PaymentMethodsResponse } from '@adyen/api-library/lib/src/typings/checkout/paymentMethodsResponse'; import { PaymentCaptureResponse } from '@adyen/api-library/lib/src/typings/checkout/paymentCaptureResponse';