From 36f0e3b76c213509dd3d733d1f3aa0f752a98db8 Mon Sep 17 00:00:00 2001 From: Blackfaded Date: Fri, 26 Jul 2024 13:10:33 +0200 Subject: [PATCH] refactor: update models and add example --- README.md | 6 +- example-app/package.json | 17 ++ .../src/examples/CommerceCaseApiExample.ts | 52 ++++ example-app/src/index.ts | 31 +++ example-app/tsconfig.json | 16 ++ example-app/yarn.lock | 162 +++++++++++ package.json | 5 +- src/RequestHeaderGenerator.ts | 16 +- src/endpoints/BaseApiClient.ts | 13 +- src/endpoints/CheckoutApiClient.ts | 8 +- src/endpoints/CommerceCaseApiClient.ts | 27 +- ...OrderManagementCheckoutActionsApiClient.ts | 6 +- src/endpoints/PaymentExecutionApiClient.ts | 6 +- src/endpoints/PaymentInformationApiClient.ts | 6 +- src/endpoints/index.ts | 3 +- src/errors/ApiErrorResponseException.ts | 4 +- src/errors/ApiResponseRetrievalException.ts | 2 +- src/errors/index.ts | 6 +- src/index.ts | 9 +- src/models/AddressPersonal.ts | 2 +- .../ApplePaymentDataTokenInformation.ts | 2 +- src/models/CancelPaymentRequest.ts | 2 +- src/models/CancelPaymentResponse.ts | 2 +- src/models/CancelRequest.ts | 6 +- src/models/CancelResponse.ts | 4 +- src/models/CaptureOutput.ts | 4 +- src/models/CapturePaymentRequest.ts | 6 +- src/models/CapturePaymentResponse.ts | 6 +- src/models/CardPaymentMethodSpecificInput.ts | 12 +- src/models/CardPaymentMethodSpecificOutput.ts | 4 +- src/models/CartItemInput.ts | 4 +- src/models/CartItemOrderStatus.ts | 2 +- src/models/CartItemPatch.ts | 4 +- src/models/CartItemResult.ts | 4 +- src/models/CheckoutResponse.ts | 18 +- src/models/CheckoutsResponse.ts | 2 +- src/models/CommerceCaseResponse.ts | 4 +- ...leteFinancingPaymentMethodSpecificInput.ts | 2 +- .../CompletePaymentMethodSpecificInput.ts | 2 +- src/models/CompletePaymentRequest.ts | 6 +- src/models/CompletePaymentResponse.ts | 6 +- src/models/CreateCheckoutRequest.ts | 10 +- src/models/CreateCheckoutResponse.ts | 20 +- src/models/CreateCommerceCaseRequest.ts | 50 +--- src/models/CreateCommerceCaseResponse.ts | 4 +- src/models/CreatePaymentResponse.ts | 6 +- src/models/Customer.ts | 8 +- src/models/DeliverRequest.ts | 6 +- src/models/DeliverResponse.ts | 4 +- src/models/DeliveryInformation.ts | 2 +- src/models/ErrorResponse.ts | 2 +- .../FinancingPaymentMethodSpecificInput.ts | 2 +- .../FinancingPaymentMethodSpecificOutput.ts | 2 +- src/models/InstallmentOption.ts | 4 +- src/models/MerchantAction.ts | 2 +- .../MobilePaymentMethodSpecificInput.ts | 4 +- .../MobilePaymentMethodSpecificOutput.ts | 4 +- src/models/Order.ts | 10 +- src/models/OrderLineDetailsInput.ts | 2 +- src/models/OrderLineDetailsPatch.ts | 4 +- src/models/OrderLineDetailsResult.ts | 4 +- src/models/OrderRequest.ts | 8 +- src/models/OrderResponse.ts | 4 +- src/models/PatchCheckoutRequest.ts | 12 +- src/models/PatchCommerceCaseRequest.ts | 2 +- src/models/PaymentEvent.ts | 8 +- src/models/PaymentExecution.ts | 16 +- src/models/PaymentExecutionRequest.ts | 4 +- src/models/PaymentExecutionSpecificInput.ts | 6 +- src/models/PaymentInformationRequest.ts | 6 +- src/models/PaymentInformationResponse.ts | 6 +- src/models/PaymentMethodSpecificInput.ts | 14 +- src/models/PaymentOutput.ts | 14 +- src/models/PaymentProduct320SpecificInput.ts | 2 +- src/models/PaymentProduct3391SpecificInput.ts | 2 +- .../PaymentProduct3391SpecificOutput.ts | 2 +- src/models/PaymentProduct3392SpecificInput.ts | 2 +- src/models/PaymentProduct840SpecificOutput.ts | 4 +- src/models/PaymentResponse.ts | 6 +- src/models/PaymentStatusOutput.ts | 2 +- src/models/PayoutOutput.ts | 4 +- src/models/PayoutResponse.ts | 6 +- src/models/PersonalInformation.ts | 2 +- src/models/ProcessingMandateInformation.ts | 4 +- .../RedirectPaymentMethodSpecificInput.ts | 4 +- .../RedirectPaymentMethodSpecificOutput.ts | 2 +- src/models/RefundErrorResponse.ts | 2 +- src/models/RefundOutput.ts | 4 +- src/models/RefundPaymentResponse.ts | 6 +- src/models/RefundRequest.ts | 6 +- src/models/ReturnInformation.ts | 2 +- src/models/ReturnRequest.ts | 4 +- src/models/ReturnResponse.ts | 4 +- ...paDirectDebitPaymentMethodSpecificInput.ts | 2 +- ...aDirectDebitPaymentMethodSpecificOutput.ts | 2 +- ...rectDebitPaymentProduct771SpecificInput.ts | 2 +- src/models/Shipping.ts | 2 +- src/models/ShoppingCartInput.ts | 2 +- src/models/ShoppingCartPatch.ts | 2 +- src/models/ShoppingCartResult.ts | 2 +- src/models/index.ts | 262 +++++++++--------- src/queries/GetCheckoutsQuery.ts | 4 +- src/queries/GetCommerceCasesQuery.ts | 4 +- src/queries/index.ts | 4 +- tsconfig.json | 14 +- yarn.lock | 4 +- 106 files changed, 698 insertions(+), 427 deletions(-) create mode 100644 example-app/package.json create mode 100644 example-app/src/examples/CommerceCaseApiExample.ts create mode 100644 example-app/src/index.ts create mode 100644 example-app/tsconfig.json create mode 100644 example-app/yarn.lock diff --git a/README.md b/README.md index 9910187..bed6818 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,11 @@ Welcome to the Node SDK for the PayOne PCP platform! This repository contains a ### Run the example app - +```sh +cd example-app +yarn +API_KEY=api_key API_SECRET=api_secret MERCHANT_ID=123 COMMERCE_CASE_ID=234 CHECKOUT_ID=345 yarn dev +``` ## Contributing diff --git a/example-app/package.json b/example-app/package.json new file mode 100644 index 0000000..ac21a23 --- /dev/null +++ b/example-app/package.json @@ -0,0 +1,17 @@ +{ + "name": "example-app", + "version": "1.0.0", + "description": "", + "type": "module", + "main": "index.js", + "scripts": { + "dev": "ts-node-esm ./src/index.ts" + }, + "author": "", + "license": "MIT", + "devDependencies": { + "ts-node": "10.9.2", + "typescript": "5.5.4", + "pcp-server-nodejs-sdk": "0.0.1" + } +} diff --git a/example-app/src/examples/CommerceCaseApiExample.ts b/example-app/src/examples/CommerceCaseApiExample.ts new file mode 100644 index 0000000..30e706a --- /dev/null +++ b/example-app/src/examples/CommerceCaseApiExample.ts @@ -0,0 +1,52 @@ +import { + CommerceCaseApiClient, + CommunicatorConfiguration, + CreateCommerceCaseRequest, + Customer, + GetCommerceCasesQuery, +} from 'pcp-server-nodejs-sdk'; + +export class CommerceCaseApiExample { + client: CommerceCaseApiClient; + merchantId = process.env.MERCHANT_ID!; + commerceCaseId = process.env.COMMERCE_CASE_ID!; + + constructor(config: CommunicatorConfiguration) { + this.client = new CommerceCaseApiClient(config); + } + + async runPostOne() { + const payload = new CreateCommerceCaseRequest(); + const res = await this.client.createCommerceCaseRequest(this.merchantId, payload); + console.log(res); + } + + async runGetAll() { + const query = new GetCommerceCasesQuery(); + query.setOffset(2); + query.setSize(1); + const res = await this.client.getCommerceCasesRequest(this.merchantId, query); + console.log(res); + } + async runGetOne() { + const res = await this.client.getCommerceCaseRequest(this.merchantId, this.commerceCaseId); + console.log(res); + } + async runUpdateOne() { + const getOneResponse = await this.client.getCommerceCaseRequest(this.merchantId, this.commerceCaseId); + + if (!getOneResponse.customer) { + throw new Error('Customer not found'); + } + const modifiedCustomer: Customer = { + ...getOneResponse.customer, + billingAddress: { + ...getOneResponse.customer.billingAddress, + city: 'New York', + }, + }; + + const res = await this.client.updateCommerceCaseRequest(this.merchantId, this.commerceCaseId, modifiedCustomer); + console.log(res); + } +} diff --git a/example-app/src/index.ts b/example-app/src/index.ts new file mode 100644 index 0000000..4009053 --- /dev/null +++ b/example-app/src/index.ts @@ -0,0 +1,31 @@ +import { CommunicatorConfiguration } from 'pcp-server-nodejs-sdk'; +import { CommerceCaseApiExample } from './examples/CommerceCaseApiExample'; + +const run = async () => { + const apiKey = process.env.API_KEY; + const apiSecret = process.env.API_SECRET; + const merchantId = process.env.MERCHANT_ID; + const commerceCaseId = process.env.COMMERCE_CASE_ID; + const checkoutId = process.env.CHECKOUT_ID; + if (!apiKey || !apiSecret || !merchantId || !commerceCaseId || !checkoutId) { + console.error( + 'Please provide API_KEY, API_SECRET, MERCHANT_ID, COMMERCE_CASE_ID and CHECKOUT_ID as environment variables', + ); + process.exit(1); + } + + const communicatorConfiguration = new CommunicatorConfiguration( + apiKey, + apiSecret, + 'https://preprod.commerce-api.payone.com', + ); + + const commerceCaseApiClientExample = new CommerceCaseApiExample(communicatorConfiguration); + + commerceCaseApiClientExample.runPostOne(); + // commerceCaseApiClientExample.runGetAll(); + // commerceCaseApiClientExample.runGetOne(); + // commerceCaseApiClientExample.runUpdateOne(); +}; + +run(); diff --git a/example-app/tsconfig.json b/example-app/tsconfig.json new file mode 100644 index 0000000..49a7ca9 --- /dev/null +++ b/example-app/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "ES6", + "module": "ESNext", + "moduleResolution": "Node", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "outDir": "dist" /* Skip type checking all .d.ts files. */ + }, + "ts-node": { + "esm": true, + "experimentalSpecifierResolution": "node" + } +} diff --git a/example-app/yarn.lock b/example-app/yarn.lock new file mode 100644 index 0000000..fc73d36 --- /dev/null +++ b/example-app/yarn.lock @@ -0,0 +1,162 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + +"@jridgewell/resolve-uri@^3.0.3": + version "3.1.2" + resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz" + integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== + +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.5.0" + resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz" + integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== + +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@tsconfig/node10@^1.0.7": + version "1.0.11" + resolved "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz" + integrity sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.4" + resolved "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz" + integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== + +"@types/node@*": + version "20.14.12" + resolved "https://registry.npmjs.org/@types/node/-/node-20.14.12.tgz" + integrity sha512-r7wNXakLeSsGT0H1AU863vS2wa5wBOK4bWMjZz2wj+8nBx+m5PeIn0k8AloSLpRuiwdRQZwarZqHE4FNArPuJQ== + dependencies: + undici-types "~5.26.4" + +acorn-walk@^8.1.1: + version "8.3.3" + resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.3.tgz" + integrity sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw== + dependencies: + acorn "^8.11.0" + +acorn@^8.11.0, acorn@^8.4.1: + version "8.12.1" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz" + integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== + +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + +data-uri-to-buffer@^4.0.0: + version "4.0.1" + resolved "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz" + integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== + +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +fetch-blob@^3.1.2, fetch-blob@^3.1.4: + version "3.2.0" + resolved "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz" + integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ== + dependencies: + node-domexception "^1.0.0" + web-streams-polyfill "^3.0.3" + +formdata-polyfill@^4.0.10: + version "4.0.10" + resolved "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz" + integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== + dependencies: + fetch-blob "^3.1.2" + +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + +node-domexception@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz" + integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== + +"pcp-server-nodejs-sdk@file:..": + version "0.0.1" + resolved "file:.." + dependencies: + node-fetch "3.3.2" + +ts-node@10.9.2: + version "10.9.2" + resolved "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz" + integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + +typescript@>=2.7, typescript@5.5.4: + version "5.5.4" + resolved "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz" + integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== + +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + +web-streams-polyfill@^3.0.3: + version "3.3.3" + resolved "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz" + integrity sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw== + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== diff --git a/package.json b/package.json index 800dd24..9330466 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "pcp-server-nodejs-sdk", "version": "0.0.1", "description": "", + "type": "module", "main": "dist/index.js", "scripts": { "build": "tsc", @@ -19,12 +20,12 @@ "@types/node": "20.14.12", "eslint": "9.7.0", "globals": "15.8.0", - "prettier": "^3.3.3", + "prettier": "3.3.3", "ts-node": "10.9.2", "typescript": "5.5.4", "typescript-eslint": "7.17.0" }, "dependencies": { - "node-fetch": "^3.3.2" + "node-fetch": "3.3.2" } } diff --git a/src/RequestHeaderGenerator.ts b/src/RequestHeaderGenerator.ts index 3fcc2fb..236331c 100644 --- a/src/RequestHeaderGenerator.ts +++ b/src/RequestHeaderGenerator.ts @@ -1,22 +1,22 @@ import * as crypto from 'crypto'; import { Headers, RequestInit } from 'node-fetch'; -import { CommunicatorConfiguration } from './CommunicatorConfiguration'; -import { ServerMetaInfo } from './utils/ServerMetaInfo'; +import { URL } from 'url'; + +import { CommunicatorConfiguration } from './CommunicatorConfiguration.js'; +import { ServerMetaInfo } from './utils/ServerMetaInfo.js'; export class RequestHeaderGenerator { public static readonly SERVER_META_INFO_HEADER_NAME = 'X-GCS-ServerMetaInfo'; public static readonly CLIENT_META_INFO_HEADER_NAME = 'X-GCS-ClientMetaInfo'; - private static readonly ALGORITHM = 'HmacSHA256'; + private static readonly ALGORITHM = 'sha256'; private static readonly WHITESPACE_REGEX = /\r?\n[h]*/g; private readonly DATE_HEADER_NAME = 'Date'; private readonly AUTHORIZATION_HEADER_NAME = 'Authorization'; private readonly config: CommunicatorConfiguration; - private readonly hmac: crypto.Hmac; constructor(config: CommunicatorConfiguration) { this.config = config; - this.hmac = crypto.createHmac(RequestHeaderGenerator.ALGORITHM, config.getApiSecret()); } public generateAdditionalRequestHeaders(url: string, request: RequestInit): RequestInit { @@ -46,7 +46,7 @@ export class RequestHeaderGenerator { let stringToSign = `${request.method}\n`; // 2. Content-Type if (headers.has('Content-Type')) { - stringToSign += `${headers.get('Content-Type')}\n`; + stringToSign += `${headers.get('Content-Type')}`; } stringToSign += '\n'; // 3. Date @@ -65,12 +65,14 @@ export class RequestHeaderGenerator { stringToSign += `${urlInternal.search}`; } stringToSign += '\n'; + console.log({ stringToSign }); const signature = this.sign(stringToSign); return `GCS v1HMAC:${this.config.getApiKey()}:${signature}`; } private sign(target: string): string { - const hash = this.hmac.update(target).digest(); + const hmac = crypto.createHmac(RequestHeaderGenerator.ALGORITHM, this.config.getApiSecret()); + const hash = hmac.update(target).digest(); return hash.toString('base64'); } diff --git a/src/endpoints/BaseApiClient.ts b/src/endpoints/BaseApiClient.ts index f5f85d3..a979173 100644 --- a/src/endpoints/BaseApiClient.ts +++ b/src/endpoints/BaseApiClient.ts @@ -1,8 +1,8 @@ import fetch, { RequestInit, Response } from 'node-fetch'; -import { CommunicatorConfiguration } from '../CommunicatorConfiguration'; -import { RequestHeaderGenerator } from '../RequestHeaderGenerator'; -import { ApiResponseRetrievalException } from '../errors'; -import { ErrorResponse } from '../models'; +import { CommunicatorConfiguration } from '../CommunicatorConfiguration.js'; +import { RequestHeaderGenerator } from '../RequestHeaderGenerator.js'; +import { ApiResponseRetrievalException } from '../errors/index.js'; +import { ErrorResponse } from '../models/index.js'; export class BaseApiClient { private readonly JSON_PARSE_ERROR = 'Expected valid JSON response, but failed to parse'; @@ -24,9 +24,10 @@ export class BaseApiClient { protected async makeApiCall(url: string, requestInit: RequestInit): Promise { requestInit = this.requestHeaderGenerator.generateAdditionalRequestHeaders(url, requestInit); - + console.log(requestInit.headers); const response = await fetch(url, requestInit); - await this.handleError(response); + console.log(response); + await this.handleError(response.clone()); return response.json() as Promise; } diff --git a/src/endpoints/CheckoutApiClient.ts b/src/endpoints/CheckoutApiClient.ts index d00f809..c7723f3 100644 --- a/src/endpoints/CheckoutApiClient.ts +++ b/src/endpoints/CheckoutApiClient.ts @@ -1,16 +1,16 @@ import { Headers, RequestInit } from 'node-fetch'; import { URLSearchParams } from 'url'; -import { CommunicatorConfiguration } from '../CommunicatorConfiguration'; +import { CommunicatorConfiguration } from '../CommunicatorConfiguration.js'; import { CheckoutResponse, CheckoutsResponse, CreateCheckoutRequest, CreateCheckoutResponse, PatchCheckoutRequest, -} from '../models'; +} from '../models/index.js'; -import { GetCheckoutsQuery } from '../queries'; -import { BaseApiClient } from './BaseApiClient'; +import { GetCheckoutsQuery } from '../queries/index.js'; +import { BaseApiClient } from './BaseApiClient.js'; export class CheckoutApiClient extends BaseApiClient { constructor(config: CommunicatorConfiguration) { diff --git a/src/endpoints/CommerceCaseApiClient.ts b/src/endpoints/CommerceCaseApiClient.ts index 18155d0..210d5f1 100644 --- a/src/endpoints/CommerceCaseApiClient.ts +++ b/src/endpoints/CommerceCaseApiClient.ts @@ -1,9 +1,14 @@ import { Headers, RequestInit } from 'node-fetch'; -import { URLSearchParams } from 'url'; -import { CommunicatorConfiguration } from '../CommunicatorConfiguration'; -import { CommerceCaseResponse, CreateCommerceCaseRequest, CreateCommerceCaseResponse, Customer } from '../models'; -import { GetCommerceCasesQuery } from '../queries/GetCommerceCasesQuery'; -import { BaseApiClient } from './BaseApiClient'; +import { URLSearchParams, URL } from 'url'; +import { CommunicatorConfiguration } from '../CommunicatorConfiguration.js'; +import { + CommerceCaseResponse, + CreateCommerceCaseRequest, + CreateCommerceCaseResponse, + Customer, +} from '../models/index.js'; +import { GetCommerceCasesQuery } from '../queries/GetCommerceCasesQuery.js'; +import { BaseApiClient } from './BaseApiClient.js'; export class CommerceCaseApiClient extends BaseApiClient { constructor(config: CommunicatorConfiguration) { @@ -20,13 +25,13 @@ export class CommerceCaseApiClient extends BaseApiClient { if (!payload) { throw new Error('Payload is required'); } - - const url = new URL(`/v1/${merchantId}/commerce-cases`, this.getConfig()?.getHost()); + console.log(payload); + const url = new URL(`/v1/${merchantId}/commerce-cases`, this.getConfig().getHost()); const requestInit: RequestInit = { method: 'POST', headers: new Headers({ - 'Content-Type': 'application/json', + 'Content-Type': 'application/json; charset=utf-8', }), body: JSON.stringify(payload), }; @@ -42,7 +47,7 @@ export class CommerceCaseApiClient extends BaseApiClient { throw new Error('Commerce Case ID is required'); } - const url = new URL(`/v1/${merchantId}/commerce-cases/${commerceCaseId}`, this.getConfig()?.getHost()); + const url = new URL(`/v1/${merchantId}/commerce-cases/${commerceCaseId}`, this.getConfig().getHost()); const requestInit: RequestInit = { method: 'GET', @@ -60,7 +65,7 @@ export class CommerceCaseApiClient extends BaseApiClient { throw new Error('Merchant ID is required'); } - const url = new URL(`/v1/${merchantId}/commerce-cases`, this.getConfig()?.getHost()); + const url = new URL(`/v1/${merchantId}/commerce-cases`, this.getConfig().getHost()); if (queryParams) { const params = new URLSearchParams(queryParams.toQueryMap()); @@ -86,7 +91,7 @@ export class CommerceCaseApiClient extends BaseApiClient { throw new Error('Payload is required'); } - const url = new URL(`/v1/${merchantId}/commerce-cases/${commerceCaseId}`, this.getConfig()?.getHost()); + const url = new URL(`/v1/${merchantId}/commerce-cases/${commerceCaseId}`, this.getConfig().getHost()); const requestInit: RequestInit = { method: 'PATCH', diff --git a/src/endpoints/OrderManagementCheckoutActionsApiClient.ts b/src/endpoints/OrderManagementCheckoutActionsApiClient.ts index 2cd4186..4b39c7a 100644 --- a/src/endpoints/OrderManagementCheckoutActionsApiClient.ts +++ b/src/endpoints/OrderManagementCheckoutActionsApiClient.ts @@ -1,5 +1,5 @@ import { Headers, RequestInit } from 'node-fetch'; -import { CommunicatorConfiguration } from '../CommunicatorConfiguration'; +import { CommunicatorConfiguration } from '../CommunicatorConfiguration.js'; import { CancelRequest, CancelResponse, @@ -9,8 +9,8 @@ import { OrderResponse, ReturnRequest, ReturnResponse, -} from '../models'; -import { BaseApiClient } from './BaseApiClient'; +} from '../models/index.js'; +import { BaseApiClient } from './BaseApiClient.js'; export class OrderManagementCheckoutActionsApiClient extends BaseApiClient { constructor(config: CommunicatorConfiguration) { diff --git a/src/endpoints/PaymentExecutionApiClient.ts b/src/endpoints/PaymentExecutionApiClient.ts index c56dff7..6e22e83 100644 --- a/src/endpoints/PaymentExecutionApiClient.ts +++ b/src/endpoints/PaymentExecutionApiClient.ts @@ -1,5 +1,5 @@ import { Headers, RequestInit } from 'node-fetch'; -import { CommunicatorConfiguration } from '../CommunicatorConfiguration'; +import { CommunicatorConfiguration } from '../CommunicatorConfiguration.js'; import { CancelPaymentRequest, CancelPaymentResponse, @@ -11,8 +11,8 @@ import { PaymentExecutionRequest, RefundPaymentResponse, RefundRequest, -} from '../models'; -import { BaseApiClient } from './BaseApiClient'; +} from '../models/index.js'; +import { BaseApiClient } from './BaseApiClient.js'; export class PaymentExecutionApiClient extends BaseApiClient { constructor(config: CommunicatorConfiguration) { diff --git a/src/endpoints/PaymentInformationApiClient.ts b/src/endpoints/PaymentInformationApiClient.ts index 00582ec..e1503aa 100644 --- a/src/endpoints/PaymentInformationApiClient.ts +++ b/src/endpoints/PaymentInformationApiClient.ts @@ -1,7 +1,7 @@ import { Headers, RequestInit } from 'node-fetch'; -import { CommunicatorConfiguration } from '../CommunicatorConfiguration'; -import { PaymentInformationRequest, PaymentInformationResponse } from '../models'; -import { BaseApiClient } from './BaseApiClient'; +import { CommunicatorConfiguration } from '../CommunicatorConfiguration.js'; +import { PaymentInformationRequest, PaymentInformationResponse } from '../models/index.js'; +import { BaseApiClient } from './BaseApiClient.js'; export class PaymentInformationApiClient extends BaseApiClient { constructor(config: CommunicatorConfiguration) { diff --git a/src/endpoints/index.ts b/src/endpoints/index.ts index 7dba859..245256f 100644 --- a/src/endpoints/index.ts +++ b/src/endpoints/index.ts @@ -1 +1,2 @@ -export { CheckoutApiClient } from './CheckoutApiClient'; +export { CheckoutApiClient } from './CheckoutApiClient.js'; +export { CommerceCaseApiClient } from './CommerceCaseApiClient.js'; diff --git a/src/errors/ApiErrorResponseException.ts b/src/errors/ApiErrorResponseException.ts index 34b2956..d86a46b 100644 --- a/src/errors/ApiErrorResponseException.ts +++ b/src/errors/ApiErrorResponseException.ts @@ -1,5 +1,5 @@ -import { APIError } from '../models/APIError'; -import { ApiException } from './ApiException'; +import { APIError } from '../models/APIError.js'; +import { ApiException } from './ApiException.js'; export class ApiErrorResponseException extends ApiException { private readonly errors: APIError[]; diff --git a/src/errors/ApiResponseRetrievalException.ts b/src/errors/ApiResponseRetrievalException.ts index f58c301..02c8085 100644 --- a/src/errors/ApiResponseRetrievalException.ts +++ b/src/errors/ApiResponseRetrievalException.ts @@ -1,4 +1,4 @@ -import { ApiException } from './ApiException'; +import { ApiException } from './ApiException.js'; export class ApiResponseRetrievalException extends ApiException { constructor(statusCode: number, responseBody: string, cause?: Error) { diff --git a/src/errors/index.ts b/src/errors/index.ts index d271684..9cadd28 100644 --- a/src/errors/index.ts +++ b/src/errors/index.ts @@ -1,3 +1,3 @@ -export { ApiErrorResponseException } from './ApiErrorResponseException'; -export { ApiException } from './ApiException'; -export { ApiResponseRetrievalException } from './ApiResponseRetrievalException'; +export { ApiErrorResponseException } from './ApiErrorResponseException.js'; +export { ApiException } from './ApiException.js'; +export { ApiResponseRetrievalException } from './ApiResponseRetrievalException.js'; diff --git a/src/index.ts b/src/index.ts index 2055404..88e6561 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,5 @@ -export * from './endpoints'; -export * from './errors'; -export * from './queries'; -export { CommunicatorConfiguration } from './CommunicatorConfiguration'; +export * from './endpoints/index.js'; +export * from './errors/index.js'; +export * from './queries/index.js'; +export * from './models/index.js'; +export { CommunicatorConfiguration } from './CommunicatorConfiguration.js'; diff --git a/src/models/AddressPersonal.ts b/src/models/AddressPersonal.ts index 9882098..ee6a1c8 100644 --- a/src/models/AddressPersonal.ts +++ b/src/models/AddressPersonal.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { PersonalName } from '../models/PersonalName'; +import { PersonalName } from './PersonalName.js'; /** * Object containing personal or shipping address information. diff --git a/src/models/ApplePaymentDataTokenInformation.ts b/src/models/ApplePaymentDataTokenInformation.ts index 8613ed0..39b54d1 100644 --- a/src/models/ApplePaymentDataTokenInformation.ts +++ b/src/models/ApplePaymentDataTokenInformation.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { ApplePaymentDataTokenHeaderInformation } from '../models/ApplePaymentDataTokenHeaderInformation'; +import { ApplePaymentDataTokenHeaderInformation } from './ApplePaymentDataTokenHeaderInformation.js'; /** * Additional information about the Apple payment data token. This information are needed for checking the validity of the payment data token before decryption. diff --git a/src/models/CancelPaymentRequest.ts b/src/models/CancelPaymentRequest.ts index 22dab42..8aab171 100644 --- a/src/models/CancelPaymentRequest.ts +++ b/src/models/CancelPaymentRequest.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { CancellationReason } from '../models/CancellationReason'; +import { CancellationReason } from './CancellationReason.js'; export class CancelPaymentRequest { 'cancellationReason'?: CancellationReason; diff --git a/src/models/CancelPaymentResponse.ts b/src/models/CancelPaymentResponse.ts index c8614a5..b32fff3 100644 --- a/src/models/CancelPaymentResponse.ts +++ b/src/models/CancelPaymentResponse.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { PaymentResponse } from '../models/PaymentResponse'; +import { PaymentResponse } from './PaymentResponse.js'; export class CancelPaymentResponse { 'payment'?: PaymentResponse; diff --git a/src/models/CancelRequest.ts b/src/models/CancelRequest.ts index 197d3f7..8f99f6e 100644 --- a/src/models/CancelRequest.ts +++ b/src/models/CancelRequest.ts @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -import { CancelItem } from '../models/CancelItem'; -import { CancelType } from '../models/CancelType'; -import { CancellationReason } from '../models/CancellationReason'; +import { CancelItem } from './CancelItem.js'; +import { CancelType } from './CancelType.js'; +import { CancellationReason } from './CancellationReason.js'; /** * Request to mark items as of the respective Checkout as cancelled and to automatically reverse the associated payment. A Cancel can be created for a full or the partial ShoppingCart of the Checkout. The platform will automatically calculate the respective amount to trigger the Cancel. For a partial Cancel a list of items must be provided. The cancellationReason is mandatory for BNPL payment methods (paymentProductId 3390, 3391 and 3392). For other payment methods the cancellationReason is not mandatory but can be used for reporting and reconciliation purposes. diff --git a/src/models/CancelResponse.ts b/src/models/CancelResponse.ts index 326173f..fb679af 100644 --- a/src/models/CancelResponse.ts +++ b/src/models/CancelResponse.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { CancelPaymentResponse } from '../models/CancelPaymentResponse'; -import { ShoppingCartResult } from '../models/ShoppingCartResult'; +import { CancelPaymentResponse } from './CancelPaymentResponse.js'; +import { ShoppingCartResult } from './ShoppingCartResult.js'; export class CancelResponse { 'cancelPaymentResponse'?: CancelPaymentResponse; diff --git a/src/models/CaptureOutput.ts b/src/models/CaptureOutput.ts index a45bae9..9c74e0b 100644 --- a/src/models/CaptureOutput.ts +++ b/src/models/CaptureOutput.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { AmountOfMoney } from '../models/AmountOfMoney'; -import { PaymentReferences } from '../models/PaymentReferences'; +import { AmountOfMoney } from './AmountOfMoney.js'; +import { PaymentReferences } from './PaymentReferences.js'; /** * Object containing Capture details. diff --git a/src/models/CapturePaymentRequest.ts b/src/models/CapturePaymentRequest.ts index d22a0c0..7aa8b35 100644 --- a/src/models/CapturePaymentRequest.ts +++ b/src/models/CapturePaymentRequest.ts @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -import { CancellationReason } from '../models/CancellationReason'; -import { DeliveryInformation } from '../models/DeliveryInformation'; -import { PaymentReferences } from '../models/PaymentReferences'; +import { CancellationReason } from './CancellationReason.js'; +import { DeliveryInformation } from './DeliveryInformation.js'; +import { PaymentReferences } from './PaymentReferences.js'; /** * If the shopping cart is specified, a Capture is made with the amount of the shopping cart for the items that are specified. diff --git a/src/models/CapturePaymentResponse.ts b/src/models/CapturePaymentResponse.ts index 69c153b..9156e4a 100644 --- a/src/models/CapturePaymentResponse.ts +++ b/src/models/CapturePaymentResponse.ts @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -import { CaptureOutput } from '../models/CaptureOutput'; -import { PaymentStatusOutput } from '../models/PaymentStatusOutput'; -import { StatusValue } from '../models/StatusValue'; +import { CaptureOutput } from './CaptureOutput.js'; +import { PaymentStatusOutput } from './PaymentStatusOutput.js'; +import { StatusValue } from './StatusValue.js'; export class CapturePaymentResponse { 'captureOutput'?: CaptureOutput; diff --git a/src/models/CardPaymentMethodSpecificInput.ts b/src/models/CardPaymentMethodSpecificInput.ts index 0c5a0c6..a62bf5f 100644 --- a/src/models/CardPaymentMethodSpecificInput.ts +++ b/src/models/CardPaymentMethodSpecificInput.ts @@ -10,12 +10,12 @@ * Do not edit the class manually. */ -import { AuthorizationMode } from '../models/AuthorizationMode'; -import { CardInfo } from '../models/CardInfo'; -import { CardRecurrenceDetails } from '../models/CardRecurrenceDetails'; -import { TransactionChannel } from '../models/TransactionChannel'; -import { UnscheduledCardOnFileRequestor } from '../models/UnscheduledCardOnFileRequestor'; -import { UnscheduledCardOnFileSequenceIndicator } from '../models/UnscheduledCardOnFileSequenceIndicator'; +import { AuthorizationMode } from './AuthorizationMode.js'; +import { CardInfo } from './CardInfo.js'; +import { CardRecurrenceDetails } from './CardRecurrenceDetails.js'; +import { TransactionChannel } from './TransactionChannel.js'; +import { UnscheduledCardOnFileRequestor } from './UnscheduledCardOnFileRequestor.js'; +import { UnscheduledCardOnFileSequenceIndicator } from './UnscheduledCardOnFileSequenceIndicator.js'; /** * Object containing the specific input details for card payments. diff --git a/src/models/CardPaymentMethodSpecificOutput.ts b/src/models/CardPaymentMethodSpecificOutput.ts index 8b575e4..9d107b3 100644 --- a/src/models/CardPaymentMethodSpecificOutput.ts +++ b/src/models/CardPaymentMethodSpecificOutput.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { CardFraudResults } from '../models/CardFraudResults'; -import { ThreeDSecureResults } from '../models/ThreeDSecureResults'; +import { CardFraudResults } from './CardFraudResults.js'; +import { ThreeDSecureResults } from './ThreeDSecureResults.js'; /** * Object containing the card payment method details. diff --git a/src/models/CartItemInput.ts b/src/models/CartItemInput.ts index 5bf096a..914026c 100644 --- a/src/models/CartItemInput.ts +++ b/src/models/CartItemInput.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { CartItemInvoiceData } from '../models/CartItemInvoiceData'; -import { OrderLineDetailsInput } from '../models/OrderLineDetailsInput'; +import { CartItemInvoiceData } from './CartItemInvoiceData.js'; +import { OrderLineDetailsInput } from './OrderLineDetailsInput.js'; /** * This object contains information of all items in the cart. If a cart item is provided, the productPrice and quantity is required. diff --git a/src/models/CartItemOrderStatus.ts b/src/models/CartItemOrderStatus.ts index e4e6b95..823f260 100644 --- a/src/models/CartItemOrderStatus.ts +++ b/src/models/CartItemOrderStatus.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { CartItemStatus } from './CartItemStatus'; +import { CartItemStatus } from './CartItemStatus.js'; /** * Detailed information regarding an occurred payment event. diff --git a/src/models/CartItemPatch.ts b/src/models/CartItemPatch.ts index 74ec3ed..d89b24e 100644 --- a/src/models/CartItemPatch.ts +++ b/src/models/CartItemPatch.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { CartItemInvoiceData } from './CartItemInvoiceData'; -import { OrderLineDetailsPatch } from './OrderLineDetailsPatch'; +import { CartItemInvoiceData } from './CartItemInvoiceData.js'; +import { OrderLineDetailsPatch } from './OrderLineDetailsPatch.js'; /** * This object contains information of all items in the cart. If a cart item is provided, the productPrice and quantity is required. diff --git a/src/models/CartItemResult.ts b/src/models/CartItemResult.ts index 41994ba..594c22e 100644 --- a/src/models/CartItemResult.ts +++ b/src/models/CartItemResult.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { CartItemInvoiceData } from '../models/CartItemInvoiceData'; -import { OrderLineDetailsResult } from '../models/OrderLineDetailsResult'; +import { CartItemInvoiceData } from './CartItemInvoiceData.js'; +import { OrderLineDetailsResult } from './OrderLineDetailsResult.js'; /** * This object contains information of all items in the cart. If a cart item is provided, the productPrice and quantity is required. diff --git a/src/models/CheckoutResponse.ts b/src/models/CheckoutResponse.ts index 86167d8..3930d37 100644 --- a/src/models/CheckoutResponse.ts +++ b/src/models/CheckoutResponse.ts @@ -10,15 +10,15 @@ * Do not edit the class manually. */ -import { AllowedPaymentActions } from '../models/AllowedPaymentActions'; -import { AmountOfMoney } from '../models/AmountOfMoney'; -import { CheckoutReferences } from '../models/CheckoutReferences'; -import { PaymentExecution } from '../models/PaymentExecution'; -import { PaymentInformationResponse } from '../models/PaymentInformationResponse'; -import { Shipping } from '../models/Shipping'; -import { ShoppingCartResult } from '../models/ShoppingCartResult'; -import { StatusCheckout } from '../models/StatusCheckout'; -import { StatusOutput } from '../models/StatusOutput'; +import { AllowedPaymentActions } from './AllowedPaymentActions.js'; +import { AmountOfMoney } from './AmountOfMoney.js'; +import { CheckoutReferences } from './CheckoutReferences.js'; +import { PaymentExecution } from './PaymentExecution.js'; +import { PaymentInformationResponse } from './PaymentInformationResponse.js'; +import { Shipping } from './Shipping.js'; +import { ShoppingCartResult } from './ShoppingCartResult.js'; +import { StatusCheckout } from './StatusCheckout.js'; +import { StatusOutput } from './StatusOutput.js'; /** * The Checkout corresponds to the order of the WL API. We do not take additionalInput from the WL API. We have no shipping and use deliveryAddress instead of address. diff --git a/src/models/CheckoutsResponse.ts b/src/models/CheckoutsResponse.ts index e0f589d..576ae0e 100644 --- a/src/models/CheckoutsResponse.ts +++ b/src/models/CheckoutsResponse.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { CheckoutResponse } from '../models/CheckoutResponse'; +import { CheckoutResponse } from './CheckoutResponse.js'; /** * Object that holds the number of found Checkouts and the requested page of Checkouts diff --git a/src/models/CommerceCaseResponse.ts b/src/models/CommerceCaseResponse.ts index 58cbd30..528e4ba 100644 --- a/src/models/CommerceCaseResponse.ts +++ b/src/models/CommerceCaseResponse.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { CheckoutResponse } from '../models/CheckoutResponse'; -import { Customer } from '../models/Customer'; +import { CheckoutResponse } from './CheckoutResponse.js'; +import { Customer } from './Customer.js'; export class CommerceCaseResponse { /** diff --git a/src/models/CompleteFinancingPaymentMethodSpecificInput.ts b/src/models/CompleteFinancingPaymentMethodSpecificInput.ts index ab67d59..53f5d43 100644 --- a/src/models/CompleteFinancingPaymentMethodSpecificInput.ts +++ b/src/models/CompleteFinancingPaymentMethodSpecificInput.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { PaymentProduct3391SpecificInput } from '../models/PaymentProduct3391SpecificInput'; +import { PaymentProduct3391SpecificInput } from './PaymentProduct3391SpecificInput.js'; /** * To complete the Payment the completeFinancingMethodSpecificInput has to be provided. At the moment it is only available for PAYONE Secured Installment (paymentProductId 3391). diff --git a/src/models/CompletePaymentMethodSpecificInput.ts b/src/models/CompletePaymentMethodSpecificInput.ts index 3f503c7..ebed830 100644 --- a/src/models/CompletePaymentMethodSpecificInput.ts +++ b/src/models/CompletePaymentMethodSpecificInput.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { PaymentProduct3391SpecificInput } from '../models/PaymentProduct3391SpecificInput'; +import { PaymentProduct3391SpecificInput } from './PaymentProduct3391SpecificInput.js'; /** * To complete the Order the completePaymentMethodSpecificInput has to be provided, containing the selected installmentOptionId as well as the the bankAccountInformation of the customer. diff --git a/src/models/CompletePaymentRequest.ts b/src/models/CompletePaymentRequest.ts index fdd988c..063e7af 100644 --- a/src/models/CompletePaymentRequest.ts +++ b/src/models/CompletePaymentRequest.ts @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -import { CompleteFinancingPaymentMethodSpecificInput } from '../models/CompleteFinancingPaymentMethodSpecificInput'; -import { CustomerDevice } from '../models/CustomerDevice'; -import { Order } from '../models/Order'; +import { CompleteFinancingPaymentMethodSpecificInput } from './CompleteFinancingPaymentMethodSpecificInput.js'; +import { CustomerDevice } from './CustomerDevice.js'; +import { Order } from './Order.js'; /** * The Complete request is the last step to finalize the initially created Payment. It requires the completeFinancingPaymentMethodSpecificInput. The data for the order object should not differ from the previously provided information in Commerce Case, Checkout and Payment, but will not be validated nor automatically loaded from the Commerce Platform. diff --git a/src/models/CompletePaymentResponse.ts b/src/models/CompletePaymentResponse.ts index 5b863ba..34fc1b8 100644 --- a/src/models/CompletePaymentResponse.ts +++ b/src/models/CompletePaymentResponse.ts @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -import { MerchantAction } from '../models/MerchantAction'; -import { PaymentCreationOutput } from '../models/PaymentCreationOutput'; -import { PaymentResponse } from '../models/PaymentResponse'; +import { MerchantAction } from './MerchantAction.js'; +import { PaymentCreationOutput } from './PaymentCreationOutput.js'; +import { PaymentResponse } from './PaymentResponse.js'; export class CompletePaymentResponse { 'creationOutput'?: PaymentCreationOutput; diff --git a/src/models/CreateCheckoutRequest.ts b/src/models/CreateCheckoutRequest.ts index e58922f..3a79524 100644 --- a/src/models/CreateCheckoutRequest.ts +++ b/src/models/CreateCheckoutRequest.ts @@ -10,11 +10,11 @@ * Do not edit the class manually. */ -import { AmountOfMoney } from '../models/AmountOfMoney'; -import { CheckoutReferences } from '../models/CheckoutReferences'; -import { OrderRequest } from '../models/OrderRequest'; -import { Shipping } from '../models/Shipping'; -import { ShoppingCartInput } from '../models/ShoppingCartInput'; +import { AmountOfMoney } from './AmountOfMoney.js'; +import { CheckoutReferences } from './CheckoutReferences.js'; +import { OrderRequest } from './OrderRequest.js'; +import { Shipping } from './Shipping.js'; +import { ShoppingCartInput } from './ShoppingCartInput.js'; /** * Request to create a Checkout for a Commerce Case. The payment for the Checkout can be directly executed if autoExecuteOrder = true. In this case, the paymentMethodSpecificInput must be provided and only a full order is possible. If no amountOfMoney is provided, the platform will calculate the respective Checkout amount based on the cartItem productPrice and quantity. In case of a payment error, the payment can be retried by providing the respective commerceCaseId and checkoutId to the the Order or Payment Execution endpoint. diff --git a/src/models/CreateCheckoutResponse.ts b/src/models/CreateCheckoutResponse.ts index 379a414..6e58ef6 100644 --- a/src/models/CreateCheckoutResponse.ts +++ b/src/models/CreateCheckoutResponse.ts @@ -10,16 +10,16 @@ * Do not edit the class manually. */ -import { AllowedPaymentActions } from '../models/AllowedPaymentActions'; -import { AmountOfMoney } from '../models/AmountOfMoney'; -import { CheckoutReferences } from '../models/CheckoutReferences'; -import { CreatePaymentResponse } from '../models/CreatePaymentResponse'; -import { ErrorResponse } from '../models/ErrorResponse'; -import { PaymentExecution } from '../models/PaymentExecution'; -import { Shipping } from '../models/Shipping'; -import { ShoppingCartResult } from '../models/ShoppingCartResult'; -import { StatusCheckout } from '../models/StatusCheckout'; -import { StatusOutput } from '../models/StatusOutput'; +import { AllowedPaymentActions } from './AllowedPaymentActions.js'; +import { AmountOfMoney } from './AmountOfMoney.js'; +import { CheckoutReferences } from './CheckoutReferences.js'; +import { CreatePaymentResponse } from './CreatePaymentResponse.js'; +import { ErrorResponse } from './ErrorResponse.js'; +import { PaymentExecution } from './PaymentExecution.js'; +import { Shipping } from './Shipping.js'; +import { ShoppingCartResult } from './ShoppingCartResult.js'; +import { StatusCheckout } from './StatusCheckout.js'; +import { StatusOutput } from './StatusOutput.js'; /** * Object containing the reference of the Checkout for following requests. diff --git a/src/models/CreateCommerceCaseRequest.ts b/src/models/CreateCommerceCaseRequest.ts index a65576e..29ae53c 100644 --- a/src/models/CreateCommerceCaseRequest.ts +++ b/src/models/CreateCommerceCaseRequest.ts @@ -10,53 +10,25 @@ * Do not edit the class manually. */ -import { CreateCheckoutRequest } from '../models/CreateCheckoutRequest'; -import { Customer } from '../models/Customer'; +import { CreateCheckoutRequest } from './CreateCheckoutRequest.js'; +import { Customer } from './Customer.js'; export class CreateCommerceCaseRequest { /** * Unique reference of the Commerce Case that is also returned for reporting and reconciliation purposes. */ - 'merchantReference'?: string; - 'customer'?: Customer; + merchantReference: string | null; + customer: Customer | null; /** * Creation date and time of the Checkout in RFC3339 format. It can either be provided in the request or otherwise will be automatically set to the time when the request CreateCommerceCase was received. Response values will always be in UTC time, but when providing this field in the requests, the time offset can have different formats. Accepted formats are: * YYYY-MM-DD\'T\'HH:mm:ss\'Z\' * YYYY-MM-DD\'T\'HH:mm:ss+XX:XX * YYYY-MM-DD\'T\'HH:mm:ss-XX:XX * YYYY-MM-DD\'T\'HH:mm\'Z\' * YYYY-MM-DD\'T\'HH:mm+XX:XX * YYYY-MM-DD\'T\'HH:mm-XX:XX All other formats may be ignored by the system. */ - 'creationDateTime'?: Date; - 'checkout'?: CreateCheckoutRequest; + creationDateTime: Date | null; + checkout: CreateCheckoutRequest | null; - static readonly discriminator: string | undefined = undefined; - - static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ - { - name: 'merchantReference', - baseName: 'merchantReference', - type: 'string', - format: '', - }, - { - name: 'customer', - baseName: 'customer', - type: 'Customer', - format: '', - }, - { - name: 'creationDateTime', - baseName: 'creationDateTime', - type: 'Date', - format: 'date-time', - }, - { - name: 'checkout', - baseName: 'checkout', - type: 'CreateCheckoutRequest', - format: '', - }, - ]; - - static getAttributeTypeMap() { - return CreateCommerceCaseRequest.attributeTypeMap; + public constructor() { + this.merchantReference = null; + this.customer = null; + this.creationDateTime = null; + this.checkout = null; } - - public constructor() {} } diff --git a/src/models/CreateCommerceCaseResponse.ts b/src/models/CreateCommerceCaseResponse.ts index f54fb98..54939be 100644 --- a/src/models/CreateCommerceCaseResponse.ts +++ b/src/models/CreateCommerceCaseResponse.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { CreateCheckoutResponse } from '../models/CreateCheckoutResponse'; -import { Customer } from '../models/Customer'; +import { CreateCheckoutResponse } from './CreateCheckoutResponse.js'; +import { Customer } from './Customer.js'; /** * The response contains references to the created Commerce case and the Checkout. It also contains the payment response if the flag \'autoExecuteOrder\' was set to true. diff --git a/src/models/CreatePaymentResponse.ts b/src/models/CreatePaymentResponse.ts index 0b85b67..28c449b 100644 --- a/src/models/CreatePaymentResponse.ts +++ b/src/models/CreatePaymentResponse.ts @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -import { MerchantAction } from '../models/MerchantAction'; -import { PaymentCreationOutput } from '../models/PaymentCreationOutput'; -import { PaymentResponse } from '../models/PaymentResponse'; +import { MerchantAction } from './MerchantAction.js'; +import { PaymentCreationOutput } from './PaymentCreationOutput.js'; +import { PaymentResponse } from './PaymentResponse.js'; /** * Object containing details on the created payment it has directly be executed. diff --git a/src/models/Customer.ts b/src/models/Customer.ts index ab379d0..3c02fcb 100644 --- a/src/models/Customer.ts +++ b/src/models/Customer.ts @@ -10,10 +10,10 @@ * Do not edit the class manually. */ -import { Address } from '../models/Address'; -import { CompanyInformation } from '../models/CompanyInformation'; -import { ContactDetails } from '../models/ContactDetails'; -import { PersonalInformation } from '../models/PersonalInformation'; +import { Address } from './Address.js'; +import { CompanyInformation } from './CompanyInformation.js'; +import { ContactDetails } from './ContactDetails.js'; +import { PersonalInformation } from './PersonalInformation.js'; /** * Object containing the details of a customer. diff --git a/src/models/DeliverRequest.ts b/src/models/DeliverRequest.ts index bcc8f06..16026a8 100644 --- a/src/models/DeliverRequest.ts +++ b/src/models/DeliverRequest.ts @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -import { CancellationReason } from '../models/CancellationReason'; -import { DeliverItem } from '../models/DeliverItem'; -import { DeliverType } from '../models/DeliverType'; +import { CancellationReason } from './CancellationReason.js'; +import { DeliverItem } from './DeliverItem.js'; +import { DeliverType } from './DeliverType.js'; /** * Request to mark items of the respective Checkout as delivered and to automatically execute a Capture. A Deliver can be created for a full or the partial ShoppingCart of the Checkout. The platform will automatically calculate the respective amount to trigger the Capture. For a partial Deliver a list of items must be provided. The item details for the Capture will be automatically loaded from the Checkout. The cancellationReason must be provided if deliverType is set to PARTIAL and isFinal is set to true for BNPL payment methods (paymentProductId 3390, 3391 and 3392). For other payment methods the cancellationReason is not mandatory in this case but can be used for reporting and reconciliation purposes. diff --git a/src/models/DeliverResponse.ts b/src/models/DeliverResponse.ts index 00666c8..d6bbaf4 100644 --- a/src/models/DeliverResponse.ts +++ b/src/models/DeliverResponse.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { CapturePaymentResponse } from '../models/CapturePaymentResponse'; -import { ShoppingCartResult } from '../models/ShoppingCartResult'; +import { CapturePaymentResponse } from './CapturePaymentResponse.js'; +import { ShoppingCartResult } from './ShoppingCartResult.js'; export class DeliverResponse { 'capturePaymentResponse'?: CapturePaymentResponse; diff --git a/src/models/DeliveryInformation.ts b/src/models/DeliveryInformation.ts index 16b1e26..cdc4a9a 100644 --- a/src/models/DeliveryInformation.ts +++ b/src/models/DeliveryInformation.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { CartItemInput } from '../models/CartItemInput'; +import { CartItemInput } from './CartItemInput.js'; /** * Delivery object contains additional information about the delivery/shipment, which is the basis for the Capture. The amountOfMoney in the cartItem will not be used in the request. diff --git a/src/models/ErrorResponse.ts b/src/models/ErrorResponse.ts index a62c533..d28b721 100644 --- a/src/models/ErrorResponse.ts +++ b/src/models/ErrorResponse.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { APIError } from '../models/APIError'; +import { APIError } from './APIError.js'; export class ErrorResponse { /** diff --git a/src/models/FinancingPaymentMethodSpecificInput.ts b/src/models/FinancingPaymentMethodSpecificInput.ts index 35440a4..f9eea67 100644 --- a/src/models/FinancingPaymentMethodSpecificInput.ts +++ b/src/models/FinancingPaymentMethodSpecificInput.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { PaymentProduct3392SpecificInput } from '../models/PaymentProduct3392SpecificInput'; +import { PaymentProduct3392SpecificInput } from './PaymentProduct3392SpecificInput.js'; /** * Object containing the specific input details for financing payment methods (Buy Now Pay Later) diff --git a/src/models/FinancingPaymentMethodSpecificOutput.ts b/src/models/FinancingPaymentMethodSpecificOutput.ts index 32e3480..c3b1fff 100644 --- a/src/models/FinancingPaymentMethodSpecificOutput.ts +++ b/src/models/FinancingPaymentMethodSpecificOutput.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { PaymentProduct3391SpecificOutput } from '../models/PaymentProduct3391SpecificOutput'; +import { PaymentProduct3391SpecificOutput } from './PaymentProduct3391SpecificOutput.js'; /** * Object containing the specific output details for financing payment methods (Buy Now Pay Later) diff --git a/src/models/InstallmentOption.ts b/src/models/InstallmentOption.ts index f3c4482..627d8b1 100644 --- a/src/models/InstallmentOption.ts +++ b/src/models/InstallmentOption.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { AmountOfMoney } from '../models/AmountOfMoney'; -import { LinkInformation } from '../models/LinkInformation'; +import { AmountOfMoney } from './AmountOfMoney.js'; +import { LinkInformation } from './LinkInformation.js'; export class InstallmentOption { /** diff --git a/src/models/MerchantAction.ts b/src/models/MerchantAction.ts index 3ffcea3..3f4ae17 100644 --- a/src/models/MerchantAction.ts +++ b/src/models/MerchantAction.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { RedirectData } from '../models/RedirectData'; +import { RedirectData } from './RedirectData.js'; /** * Object that contains the action, including the needed data, that you should perform next, like showing instructions, showing the transaction results or redirect to a third party to complete the payment diff --git a/src/models/MobilePaymentMethodSpecificInput.ts b/src/models/MobilePaymentMethodSpecificInput.ts index 6af408e..5251505 100644 --- a/src/models/MobilePaymentMethodSpecificInput.ts +++ b/src/models/MobilePaymentMethodSpecificInput.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { AuthorizationMode } from '../models/AuthorizationMode'; -import { PaymentProduct320SpecificInput } from '../models/PaymentProduct320SpecificInput'; +import { AuthorizationMode } from './AuthorizationMode.js'; +import { PaymentProduct320SpecificInput } from './PaymentProduct320SpecificInput.js'; /** * Object containing the specific input details for mobile payments. diff --git a/src/models/MobilePaymentMethodSpecificOutput.ts b/src/models/MobilePaymentMethodSpecificOutput.ts index 7a0332f..73d5da8 100644 --- a/src/models/MobilePaymentMethodSpecificOutput.ts +++ b/src/models/MobilePaymentMethodSpecificOutput.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { CardFraudResults } from '../models/CardFraudResults'; -import { ThreeDSecureResults } from '../models/ThreeDSecureResults'; +import { CardFraudResults } from './CardFraudResults.js'; +import { ThreeDSecureResults } from './ThreeDSecureResults.js'; /** * Object containing the mobile payment method details. diff --git a/src/models/Order.ts b/src/models/Order.ts index 482819a..b6aadf0 100644 --- a/src/models/Order.ts +++ b/src/models/Order.ts @@ -10,11 +10,11 @@ * Do not edit the class manually. */ -import { AmountOfMoney } from '../models/AmountOfMoney'; -import { Customer } from '../models/Customer'; -import { References } from '../models/References'; -import { Shipping } from '../models/Shipping'; -import { ShoppingCartInput } from '../models/ShoppingCartInput'; +import { AmountOfMoney } from './AmountOfMoney.js'; +import { Customer } from './Customer.js'; +import { References } from './References.js'; +import { Shipping } from './Shipping.js'; +import { ShoppingCartInput } from './ShoppingCartInput.js'; /** * Order object containing order related data Please note that this object is required to be able to submit the amount. diff --git a/src/models/OrderLineDetailsInput.ts b/src/models/OrderLineDetailsInput.ts index a56cff1..9f3384d 100644 --- a/src/models/OrderLineDetailsInput.ts +++ b/src/models/OrderLineDetailsInput.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { ProductType } from '../models/ProductType'; +import { ProductType } from './ProductType.js'; /** * Object containing additional information that when supplied can have a beneficial effect on the discountrates. diff --git a/src/models/OrderLineDetailsPatch.ts b/src/models/OrderLineDetailsPatch.ts index 9cf57fe..c2bab26 100644 --- a/src/models/OrderLineDetailsPatch.ts +++ b/src/models/OrderLineDetailsPatch.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { CartItemOrderStatus } from './CartItemOrderStatus'; -import { ProductType } from './ProductType'; +import { CartItemOrderStatus } from './CartItemOrderStatus.js'; +import { ProductType } from './ProductType.js'; /** * Object containing additional information that when supplied can have a beneficial effect on the discountrates. diff --git a/src/models/OrderLineDetailsResult.ts b/src/models/OrderLineDetailsResult.ts index c003b92..b3a6ae4 100644 --- a/src/models/OrderLineDetailsResult.ts +++ b/src/models/OrderLineDetailsResult.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { CartItemOrderStatus } from '../models/CartItemOrderStatus'; -import { ProductType } from '../models/ProductType'; +import { CartItemOrderStatus } from './CartItemOrderStatus.js'; +import { ProductType } from './ProductType.js'; /** * Object containing additional information that when supplied can have a beneficial effect on the discountrates. diff --git a/src/models/OrderRequest.ts b/src/models/OrderRequest.ts index 426dc90..51be08f 100644 --- a/src/models/OrderRequest.ts +++ b/src/models/OrderRequest.ts @@ -10,10 +10,10 @@ * Do not edit the class manually. */ -import { OrderItem } from '../models/OrderItem'; -import { OrderType } from '../models/OrderType'; -import { PaymentMethodSpecificInput } from '../models/PaymentMethodSpecificInput'; -import { References } from '../models/References'; +import { OrderItem } from './OrderItem.js'; +import { OrderType } from './OrderType.js'; +import { PaymentMethodSpecificInput } from './PaymentMethodSpecificInput.js'; +import { References } from './References.js'; /** * Request to execute an Order for the corresponding Checkout for a specific payment method. The provided data from the Commerce Case and the Checkout regarding customer, shipping, and ShoppingCart will be automatically loaded and used for the Payment Execution. In case the paymentMethodSpecificInput has already been provided when creating the Commerce Case or Checkout, this input will automatically be used. An Order can be created for a full or the partial ShoppingCart of the Checkout. For a partial Order a list of items must be provided. The platform will automatically calculate the respective amount to trigger the payment execution. diff --git a/src/models/OrderResponse.ts b/src/models/OrderResponse.ts index 6a50319..6d24f28 100644 --- a/src/models/OrderResponse.ts +++ b/src/models/OrderResponse.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { CreatePaymentResponse } from '../models/CreatePaymentResponse'; -import { ShoppingCartResult } from '../models/ShoppingCartResult'; +import { CreatePaymentResponse } from './CreatePaymentResponse.js'; +import { ShoppingCartResult } from './ShoppingCartResult.js'; /** * Object that contains details on the created payment in case one has been created. diff --git a/src/models/PatchCheckoutRequest.ts b/src/models/PatchCheckoutRequest.ts index 4b34a83..6fa3c14 100644 --- a/src/models/PatchCheckoutRequest.ts +++ b/src/models/PatchCheckoutRequest.ts @@ -10,12 +10,12 @@ * Do not edit the class manually. */ -import { AmountOfMoney } from '../models/AmountOfMoney'; -import { CheckoutReferences } from '../models/CheckoutReferences'; -import { PaymentMethodSpecificInput } from '../models/PaymentMethodSpecificInput'; -import { References } from '../models/References'; -import { Shipping } from '../models/Shipping'; -import { ShoppingCartPatch } from '../models/ShoppingCartPatch'; +import { AmountOfMoney } from './AmountOfMoney.js'; +import { CheckoutReferences } from './CheckoutReferences.js'; +import { PaymentMethodSpecificInput } from './PaymentMethodSpecificInput.js'; +import { References } from './References.js'; +import { Shipping } from './Shipping.js'; +import { ShoppingCartPatch } from './ShoppingCartPatch.js'; /** * An existing shopping cart of a Checkout will not be overwritten with the Patch request. New items can be added to the shoppingCart by providing them in the request. To change existing items (delete, modify or add), the respective itemId must be provided. An item can be completely removed if quantity = 0 is provided. The price of an item can be changed as long as no payment has happened for this item (i.e. as long as an item has no specific status). Items with a status can no longer be removed entirely, however the quantity can be increased or decreased (for items without payment) by using the itemId. If no amountOfMoney for the Checkout is provided, the platform will calculate the respective amount based on the cartItem productPrice and productQuantity. diff --git a/src/models/PatchCommerceCaseRequest.ts b/src/models/PatchCommerceCaseRequest.ts index fd58b3b..1639a17 100644 --- a/src/models/PatchCommerceCaseRequest.ts +++ b/src/models/PatchCommerceCaseRequest.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { Customer } from '../models/Customer'; +import { Customer } from './Customer.js'; /** * Update the customer data of the given Commerce Case diff --git a/src/models/PaymentEvent.ts b/src/models/PaymentEvent.ts index 788f79c..0d922d9 100644 --- a/src/models/PaymentEvent.ts +++ b/src/models/PaymentEvent.ts @@ -10,10 +10,10 @@ * Do not edit the class manually. */ -import { AmountOfMoney } from '../models/AmountOfMoney'; -import { CancellationReason } from '../models/CancellationReason'; -import { PaymentType } from '../models/PaymentType'; -import { StatusValue } from '../models/StatusValue'; +import { AmountOfMoney } from './AmountOfMoney.js'; +import { CancellationReason } from './CancellationReason.js'; +import { PaymentType } from './PaymentType.js'; +import { StatusValue } from './StatusValue.js'; /** * Detailed information regarding an occurred payment event. diff --git a/src/models/PaymentExecution.ts b/src/models/PaymentExecution.ts index 3344e4f..76ed3d4 100644 --- a/src/models/PaymentExecution.ts +++ b/src/models/PaymentExecution.ts @@ -10,14 +10,14 @@ * Do not edit the class manually. */ -import { CardPaymentMethodSpecificInput } from '../models/CardPaymentMethodSpecificInput'; -import { FinancingPaymentMethodSpecificInput } from '../models/FinancingPaymentMethodSpecificInput'; -import { MobilePaymentMethodSpecificInput } from '../models/MobilePaymentMethodSpecificInput'; -import { PaymentChannel } from '../models/PaymentChannel'; -import { PaymentEvent } from '../models/PaymentEvent'; -import { RedirectPaymentMethodSpecificInput } from '../models/RedirectPaymentMethodSpecificInput'; -import { References } from '../models/References'; -import { SepaDirectDebitPaymentMethodSpecificInput } from '../models/SepaDirectDebitPaymentMethodSpecificInput'; +import { CardPaymentMethodSpecificInput } from './CardPaymentMethodSpecificInput.js'; +import { FinancingPaymentMethodSpecificInput } from './FinancingPaymentMethodSpecificInput.js'; +import { MobilePaymentMethodSpecificInput } from './MobilePaymentMethodSpecificInput.js'; +import { PaymentChannel } from './PaymentChannel.js'; +import { PaymentEvent } from './PaymentEvent.js'; +import { RedirectPaymentMethodSpecificInput } from './RedirectPaymentMethodSpecificInput.js'; +import { References } from './References.js'; +import { SepaDirectDebitPaymentMethodSpecificInput } from './SepaDirectDebitPaymentMethodSpecificInput.js'; /** * Object contains information of the payment with a specific payment method. diff --git a/src/models/PaymentExecutionRequest.ts b/src/models/PaymentExecutionRequest.ts index ac5a59c..1fa934b 100644 --- a/src/models/PaymentExecutionRequest.ts +++ b/src/models/PaymentExecutionRequest.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { PaymentExecutionSpecificInput } from '../models/PaymentExecutionSpecificInput'; -import { PaymentMethodSpecificInput } from '../models/PaymentMethodSpecificInput'; +import { PaymentExecutionSpecificInput } from './PaymentExecutionSpecificInput.js'; +import { PaymentMethodSpecificInput } from './PaymentMethodSpecificInput.js'; /** * Request to trigger a payment for a respective Checkout providing the input for a specific payment method. The data from the Commerce case and the Checkout will not be loaded automatically and there is no validation between the data input in place. Depending on the payment method, information of the customer and / or the shopping cart might be required. For more details regarding payment method specific input please check the documentation. diff --git a/src/models/PaymentExecutionSpecificInput.ts b/src/models/PaymentExecutionSpecificInput.ts index 39e8641..061528e 100644 --- a/src/models/PaymentExecutionSpecificInput.ts +++ b/src/models/PaymentExecutionSpecificInput.ts @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -import { AmountOfMoney } from '../models/AmountOfMoney'; -import { References } from '../models/References'; -import { ShoppingCartInput } from '../models/ShoppingCartInput'; +import { AmountOfMoney } from './AmountOfMoney.js'; +import { References } from './References.js'; +import { ShoppingCartInput } from './ShoppingCartInput.js'; /** * The amount of the paymentSpecificInput might differ from the Checkout amount in case of partial payments but cannot be higher. Additionally, the total amount of the provided shopping cart cannot exceed the Checkout amount. If a different currency is provided than in the Checkout, the payment execution will be declined. Provided details of the customer and shipping from the Checkout will be automatically loaded and used in the Payment Execution request. The ShoppingCart might differ from the one provided in the Checkout (e.g., for partial payments) and might be required by the payment provider (e.g., BNPL). If the ShoppingCart elements differ from the data provided in the Checkout, the existing data will not be overwritten. diff --git a/src/models/PaymentInformationRequest.ts b/src/models/PaymentInformationRequest.ts index 1ad4f2d..156e2ab 100644 --- a/src/models/PaymentInformationRequest.ts +++ b/src/models/PaymentInformationRequest.ts @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -import { AmountOfMoney } from '../models/AmountOfMoney'; -import { PaymentChannel } from '../models/PaymentChannel'; -import { PaymentType } from '../models/PaymentType'; +import { AmountOfMoney } from './AmountOfMoney.js'; +import { PaymentChannel } from './PaymentChannel.js'; +import { PaymentType } from './PaymentType.js'; export class PaymentInformationRequest { 'amountOfMoney': AmountOfMoney; diff --git a/src/models/PaymentInformationResponse.ts b/src/models/PaymentInformationResponse.ts index 7691367..9d60c65 100644 --- a/src/models/PaymentInformationResponse.ts +++ b/src/models/PaymentInformationResponse.ts @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -import { CardPaymentDetails } from '../models/CardPaymentDetails'; -import { PaymentChannel } from '../models/PaymentChannel'; -import { PaymentEvent } from '../models/PaymentEvent'; +import { CardPaymentDetails } from './CardPaymentDetails.js'; +import { PaymentChannel } from './PaymentChannel.js'; +import { PaymentEvent } from './PaymentEvent.js'; /** * Object containing the related data of the created Payment Information. diff --git a/src/models/PaymentMethodSpecificInput.ts b/src/models/PaymentMethodSpecificInput.ts index aed5646..5745fa1 100644 --- a/src/models/PaymentMethodSpecificInput.ts +++ b/src/models/PaymentMethodSpecificInput.ts @@ -10,13 +10,13 @@ * Do not edit the class manually. */ -import { CardPaymentMethodSpecificInput } from '../models/CardPaymentMethodSpecificInput'; -import { CustomerDevice } from '../models/CustomerDevice'; -import { FinancingPaymentMethodSpecificInput } from '../models/FinancingPaymentMethodSpecificInput'; -import { MobilePaymentMethodSpecificInput } from '../models/MobilePaymentMethodSpecificInput'; -import { PaymentChannel } from '../models/PaymentChannel'; -import { RedirectPaymentMethodSpecificInput } from '../models/RedirectPaymentMethodSpecificInput'; -import { SepaDirectDebitPaymentMethodSpecificInput } from '../models/SepaDirectDebitPaymentMethodSpecificInput'; +import { CardPaymentMethodSpecificInput } from './CardPaymentMethodSpecificInput.js'; +import { CustomerDevice } from './CustomerDevice.js'; +import { FinancingPaymentMethodSpecificInput } from './FinancingPaymentMethodSpecificInput.js'; +import { MobilePaymentMethodSpecificInput } from './MobilePaymentMethodSpecificInput.js'; +import { PaymentChannel } from './PaymentChannel.js'; +import { RedirectPaymentMethodSpecificInput } from './RedirectPaymentMethodSpecificInput.js'; +import { SepaDirectDebitPaymentMethodSpecificInput } from './SepaDirectDebitPaymentMethodSpecificInput.js'; /** * Input for the payment for a respective payment method. In case the paymentMethodSpecificInput has already been provided when creating the Commerce Case or Checkout, it will automatically be used for the Payment Execution. If a new input will be provided, the existing input will be updated. diff --git a/src/models/PaymentOutput.ts b/src/models/PaymentOutput.ts index 95a301b..8892e07 100644 --- a/src/models/PaymentOutput.ts +++ b/src/models/PaymentOutput.ts @@ -10,13 +10,13 @@ * Do not edit the class manually. */ -import { AmountOfMoney } from '../models/AmountOfMoney'; -import { CardPaymentMethodSpecificOutput } from '../models/CardPaymentMethodSpecificOutput'; -import { FinancingPaymentMethodSpecificOutput } from '../models/FinancingPaymentMethodSpecificOutput'; -import { MobilePaymentMethodSpecificOutput } from '../models/MobilePaymentMethodSpecificOutput'; -import { PaymentReferences } from '../models/PaymentReferences'; -import { RedirectPaymentMethodSpecificOutput } from '../models/RedirectPaymentMethodSpecificOutput'; -import { SepaDirectDebitPaymentMethodSpecificOutput } from '../models/SepaDirectDebitPaymentMethodSpecificOutput'; +import { AmountOfMoney } from './AmountOfMoney.js'; +import { CardPaymentMethodSpecificOutput } from './CardPaymentMethodSpecificOutput.js'; +import { FinancingPaymentMethodSpecificOutput } from './FinancingPaymentMethodSpecificOutput.js'; +import { MobilePaymentMethodSpecificOutput } from './MobilePaymentMethodSpecificOutput.js'; +import { PaymentReferences } from './PaymentReferences.js'; +import { RedirectPaymentMethodSpecificOutput } from './RedirectPaymentMethodSpecificOutput.js'; +import { SepaDirectDebitPaymentMethodSpecificOutput } from './SepaDirectDebitPaymentMethodSpecificOutput.js'; /** * Object containing payment details. diff --git a/src/models/PaymentProduct320SpecificInput.ts b/src/models/PaymentProduct320SpecificInput.ts index b227473..5e79318 100644 --- a/src/models/PaymentProduct320SpecificInput.ts +++ b/src/models/PaymentProduct320SpecificInput.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { ApplePaymentDataTokenInformation } from '../models/ApplePaymentDataTokenInformation'; +import { ApplePaymentDataTokenInformation } from './ApplePaymentDataTokenInformation.js'; /** * Object containing additional Information needed for Apple Pay payment transactions. diff --git a/src/models/PaymentProduct3391SpecificInput.ts b/src/models/PaymentProduct3391SpecificInput.ts index f778fd4..8112cce 100644 --- a/src/models/PaymentProduct3391SpecificInput.ts +++ b/src/models/PaymentProduct3391SpecificInput.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { BankAccountInformation } from '../models/BankAccountInformation'; +import { BankAccountInformation } from './BankAccountInformation.js'; /** * Object containing specific information for PAYONE Secured Installment. diff --git a/src/models/PaymentProduct3391SpecificOutput.ts b/src/models/PaymentProduct3391SpecificOutput.ts index 47f990c..9019b05 100644 --- a/src/models/PaymentProduct3391SpecificOutput.ts +++ b/src/models/PaymentProduct3391SpecificOutput.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { InstallmentOption } from '../models/InstallmentOption'; +import { InstallmentOption } from './InstallmentOption.js'; /** * Object containing specific information for PAYONE Secured Installment. diff --git a/src/models/PaymentProduct3392SpecificInput.ts b/src/models/PaymentProduct3392SpecificInput.ts index 9556fb7..ac77a28 100644 --- a/src/models/PaymentProduct3392SpecificInput.ts +++ b/src/models/PaymentProduct3392SpecificInput.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { BankAccountInformation } from '../models/BankAccountInformation'; +import { BankAccountInformation } from './BankAccountInformation.js'; /** * Object containing specific information for PAYONE Secured Direct. Debit. diff --git a/src/models/PaymentProduct840SpecificOutput.ts b/src/models/PaymentProduct840SpecificOutput.ts index 16725c3..6e567b9 100644 --- a/src/models/PaymentProduct840SpecificOutput.ts +++ b/src/models/PaymentProduct840SpecificOutput.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { Address } from '../models/Address'; -import { PaymentProduct840CustomerAccount } from '../models/PaymentProduct840CustomerAccount'; +import { Address } from './Address.js'; +import { PaymentProduct840CustomerAccount } from './PaymentProduct840CustomerAccount.js'; /** * PayPal (payment product 840) specific details. diff --git a/src/models/PaymentResponse.ts b/src/models/PaymentResponse.ts index 9fe3db9..5289acd 100644 --- a/src/models/PaymentResponse.ts +++ b/src/models/PaymentResponse.ts @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -import { PaymentOutput } from '../models/PaymentOutput'; -import { PaymentStatusOutput } from '../models/PaymentStatusOutput'; -import { StatusValue } from '../models/StatusValue'; +import { PaymentOutput } from './PaymentOutput.js'; +import { PaymentStatusOutput } from './PaymentStatusOutput.js'; +import { StatusValue } from './StatusValue.js'; /** * Object that holds the payment related properties. diff --git a/src/models/PaymentStatusOutput.ts b/src/models/PaymentStatusOutput.ts index 2e19bf3..0f709b2 100644 --- a/src/models/PaymentStatusOutput.ts +++ b/src/models/PaymentStatusOutput.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { StatusCategoryValue } from '../models/StatusCategoryValue'; +import { StatusCategoryValue } from './StatusCategoryValue.js'; /** * This object has the numeric representation of the current payment status, timestamp of last status change and performable action on the current payment resource. In case of failed payments and negative scenarios, detailed error information is listed. diff --git a/src/models/PayoutOutput.ts b/src/models/PayoutOutput.ts index cc22fcb..f062247 100644 --- a/src/models/PayoutOutput.ts +++ b/src/models/PayoutOutput.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { AmountOfMoney } from '../models/AmountOfMoney'; -import { PaymentReferences } from '../models/PaymentReferences'; +import { AmountOfMoney } from './AmountOfMoney.js'; +import { PaymentReferences } from './PaymentReferences.js'; /** * Object containing details from the created payout. diff --git a/src/models/PayoutResponse.ts b/src/models/PayoutResponse.ts index 59e85e8..0b79582 100644 --- a/src/models/PayoutResponse.ts +++ b/src/models/PayoutResponse.ts @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -import { PayoutOutput } from '../models/PayoutOutput'; -import { StatusCategoryValue } from '../models/StatusCategoryValue'; -import { StatusValue } from '../models/StatusValue'; +import { PayoutOutput } from './PayoutOutput.js'; +import { StatusCategoryValue } from './StatusCategoryValue.js'; +import { StatusValue } from './StatusValue.js'; /** * Object that holds the payment related properties for the refund of a Payment Information. diff --git a/src/models/PersonalInformation.ts b/src/models/PersonalInformation.ts index 7b189c3..49f11be 100644 --- a/src/models/PersonalInformation.ts +++ b/src/models/PersonalInformation.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { PersonalName } from '../models/PersonalName'; +import { PersonalName } from './PersonalName.js'; /** * Object containing personal information like name, date of birth and gender. diff --git a/src/models/ProcessingMandateInformation.ts b/src/models/ProcessingMandateInformation.ts index 5bed6bf..b7104f3 100644 --- a/src/models/ProcessingMandateInformation.ts +++ b/src/models/ProcessingMandateInformation.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { BankAccountInformation } from '../models/BankAccountInformation'; -import { MandateRecurrenceType } from '../models/MandateRecurrenceType'; +import { BankAccountInformation } from './BankAccountInformation.js'; +import { MandateRecurrenceType } from './MandateRecurrenceType.js'; /** * Object containing the relevant information of a SEPA Direct Debit mandate for processing (mandatory fields in pain.008). Renamed from CreateMandateWithReturnUrl to ProcessingMandateInformation. diff --git a/src/models/RedirectPaymentMethodSpecificInput.ts b/src/models/RedirectPaymentMethodSpecificInput.ts index 3c5867d..04ffc58 100644 --- a/src/models/RedirectPaymentMethodSpecificInput.ts +++ b/src/models/RedirectPaymentMethodSpecificInput.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { RedirectPaymentProduct840SpecificInput } from '../models/RedirectPaymentProduct840SpecificInput'; -import { RedirectionData } from '../models/RedirectionData'; +import { RedirectPaymentProduct840SpecificInput } from './RedirectPaymentProduct840SpecificInput.js'; +import { RedirectionData } from './RedirectionData.js'; /** * Object containing the specific input details for payments that involve redirects to 3rd parties to complete, like iDeal and PayPal diff --git a/src/models/RedirectPaymentMethodSpecificOutput.ts b/src/models/RedirectPaymentMethodSpecificOutput.ts index 5890e2a..6e53c33 100644 --- a/src/models/RedirectPaymentMethodSpecificOutput.ts +++ b/src/models/RedirectPaymentMethodSpecificOutput.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { PaymentProduct840SpecificOutput } from '../models/PaymentProduct840SpecificOutput'; +import { PaymentProduct840SpecificOutput } from './PaymentProduct840SpecificOutput.js'; /** * Object containing the redirect payment product details. diff --git a/src/models/RefundErrorResponse.ts b/src/models/RefundErrorResponse.ts index ef84149..6956a24 100644 --- a/src/models/RefundErrorResponse.ts +++ b/src/models/RefundErrorResponse.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { APIError } from '../models/APIError'; +import { APIError } from './APIError.js'; export class RefundErrorResponse { /** diff --git a/src/models/RefundOutput.ts b/src/models/RefundOutput.ts index e8094c9..b6a5dc8 100644 --- a/src/models/RefundOutput.ts +++ b/src/models/RefundOutput.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { AmountOfMoney } from '../models/AmountOfMoney'; -import { PaymentReferences } from '../models/PaymentReferences'; +import { AmountOfMoney } from './AmountOfMoney.js'; +import { PaymentReferences } from './PaymentReferences.js'; /** * Object containing Refund details diff --git a/src/models/RefundPaymentResponse.ts b/src/models/RefundPaymentResponse.ts index af25e0c..ad99b00 100644 --- a/src/models/RefundPaymentResponse.ts +++ b/src/models/RefundPaymentResponse.ts @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -import { PaymentStatusOutput } from '../models/PaymentStatusOutput'; -import { RefundOutput } from '../models/RefundOutput'; -import { StatusValue } from '../models/StatusValue'; +import { PaymentStatusOutput } from './PaymentStatusOutput.js'; +import { RefundOutput } from './RefundOutput.js'; +import { StatusValue } from './StatusValue.js'; /** * This object has the numeric representation of the current Refund status, timestamp of last status change and performable action on the current Refund resource. In case of a rejected Refund, detailed error information is listed. diff --git a/src/models/RefundRequest.ts b/src/models/RefundRequest.ts index 67b863f..c8e68af 100644 --- a/src/models/RefundRequest.ts +++ b/src/models/RefundRequest.ts @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -import { PaymentReferences } from '../models/PaymentReferences'; -import { PositiveAmountOfMoney } from '../models/PositiveAmountOfMoney'; -import { ReturnInformation } from '../models/ReturnInformation'; +import { PaymentReferences } from './PaymentReferences.js'; +import { PositiveAmountOfMoney } from './PositiveAmountOfMoney.js'; +import { ReturnInformation } from './ReturnInformation.js'; /** * Request to refund a payment for a Checkout. It is possible to perform multiple partial refunds by providing an amount that is lower than the total captured amount. The returnReason can be provided for reporting and reconciliation purposes but is not mandatory. diff --git a/src/models/ReturnInformation.ts b/src/models/ReturnInformation.ts index fc03837..ef0a92f 100644 --- a/src/models/ReturnInformation.ts +++ b/src/models/ReturnInformation.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { CartItemInput } from '../models/CartItemInput'; +import { CartItemInput } from './CartItemInput.js'; /** * Return object contains additional information about the return/shipment, which is the basis for the Refund. The amountOfMoney in the cartItem will not be used in the request. diff --git a/src/models/ReturnRequest.ts b/src/models/ReturnRequest.ts index c7d0947..14babe6 100644 --- a/src/models/ReturnRequest.ts +++ b/src/models/ReturnRequest.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { ReturnItem } from '../models/ReturnItem'; -import { ReturnType } from '../models/ReturnType'; +import { ReturnItem } from './ReturnItem.js'; +import { ReturnType } from './ReturnType.js'; /** * Request to mark items of the respective Checkout as returned and to automatically refund a payment for those items. A Return can be created for a full or the partial ShoppingCart of the Checkout. The platform will automatically calculate the respective amount to trigger the Refund. For a partial Return a list of items must be provided. The item details for the Refund will be automatically loaded from the Checkout. The returnReason can be provided for reporting and reconciliation purposes but is not mandatory. diff --git a/src/models/ReturnResponse.ts b/src/models/ReturnResponse.ts index 74860a3..658ea34 100644 --- a/src/models/ReturnResponse.ts +++ b/src/models/ReturnResponse.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { RefundPaymentResponse } from '../models/RefundPaymentResponse'; -import { ShoppingCartResult } from '../models/ShoppingCartResult'; +import { RefundPaymentResponse } from './RefundPaymentResponse.js'; +import { ShoppingCartResult } from './ShoppingCartResult.js'; export class ReturnResponse { 'returnPaymentResponse'?: RefundPaymentResponse; diff --git a/src/models/SepaDirectDebitPaymentMethodSpecificInput.ts b/src/models/SepaDirectDebitPaymentMethodSpecificInput.ts index f7fa9ff..e384a49 100644 --- a/src/models/SepaDirectDebitPaymentMethodSpecificInput.ts +++ b/src/models/SepaDirectDebitPaymentMethodSpecificInput.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { SepaDirectDebitPaymentProduct771SpecificInput } from '../models/SepaDirectDebitPaymentProduct771SpecificInput'; +import { SepaDirectDebitPaymentProduct771SpecificInput } from './SepaDirectDebitPaymentProduct771SpecificInput.js'; /** * Object containing the specific input details for SEPA direct debit payments diff --git a/src/models/SepaDirectDebitPaymentMethodSpecificOutput.ts b/src/models/SepaDirectDebitPaymentMethodSpecificOutput.ts index 92334d1..b36e536 100644 --- a/src/models/SepaDirectDebitPaymentMethodSpecificOutput.ts +++ b/src/models/SepaDirectDebitPaymentMethodSpecificOutput.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { PaymentProduct771SpecificOutput } from '../models/PaymentProduct771SpecificOutput'; +import { PaymentProduct771SpecificOutput } from './PaymentProduct771SpecificOutput.js'; /** * Object containing the SEPA direct debit details. diff --git a/src/models/SepaDirectDebitPaymentProduct771SpecificInput.ts b/src/models/SepaDirectDebitPaymentProduct771SpecificInput.ts index 35b29c4..a1b8984 100644 --- a/src/models/SepaDirectDebitPaymentProduct771SpecificInput.ts +++ b/src/models/SepaDirectDebitPaymentProduct771SpecificInput.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { ProcessingMandateInformation } from '../models/ProcessingMandateInformation'; +import { ProcessingMandateInformation } from './ProcessingMandateInformation.js'; /** * Object containing information specific to SEPA Direct Debit diff --git a/src/models/Shipping.ts b/src/models/Shipping.ts index 26178d5..fc413e5 100644 --- a/src/models/Shipping.ts +++ b/src/models/Shipping.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { AddressPersonal } from '../models/AddressPersonal'; +import { AddressPersonal } from './AddressPersonal.js'; /** * Object containing information regarding shipping / delivery diff --git a/src/models/ShoppingCartInput.ts b/src/models/ShoppingCartInput.ts index 8ae41e1..4bb6001 100644 --- a/src/models/ShoppingCartInput.ts +++ b/src/models/ShoppingCartInput.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { CartItemInput } from '../models/CartItemInput'; +import { CartItemInput } from './CartItemInput.js'; /** * Shopping cart data, including items and specific amounts. diff --git a/src/models/ShoppingCartPatch.ts b/src/models/ShoppingCartPatch.ts index a8249db..9b31b42 100644 --- a/src/models/ShoppingCartPatch.ts +++ b/src/models/ShoppingCartPatch.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { CartItemPatch } from '../models/CartItemPatch'; +import { CartItemPatch } from './CartItemPatch.js'; /** * Shopping cart data, including items and specific amounts. diff --git a/src/models/ShoppingCartResult.ts b/src/models/ShoppingCartResult.ts index c5369df..0149d12 100644 --- a/src/models/ShoppingCartResult.ts +++ b/src/models/ShoppingCartResult.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import { CartItemResult } from '../models/CartItemResult'; +import { CartItemResult } from './CartItemResult.js'; /** * Shopping cart data, including items and specific amounts. diff --git a/src/models/index.ts b/src/models/index.ts index 55d7d34..e513f09 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -1,131 +1,131 @@ -export * from './APIError'; -export * from './Address'; -export * from './AddressPersonal'; -export * from './AllowedPaymentActions'; -export * from './AmountOfMoney'; -export * from './ApplePaymentDataTokenHeaderInformation'; -export * from './ApplePaymentDataTokenInformation'; -export * from './AuthorizationMode'; -export * from './BankAccountInformation'; -export * from './CancelItem'; -export * from './CancelPaymentRequest'; -export * from './CancelPaymentResponse'; -export * from './CancelRequest'; -export * from './CancelResponse'; -export * from './CancelType'; -export * from './CancellationReason'; -export * from './CaptureOutput'; -export * from './CapturePaymentRequest'; -export * from './CapturePaymentResponse'; -export * from './CardFraudResults'; -export * from './CardInfo'; -export * from './CardPaymentDetails'; -export * from './CardPaymentMethodSpecificInput'; -export * from './CardPaymentMethodSpecificOutput'; -export * from './CardRecurrenceDetails'; -export * from './CartItemInput'; -export * from './CartItemInvoiceData'; -export * from './CartItemOrderStatus'; -export * from './CartItemPatch'; -export * from './CartItemResult'; -export * from './CartItemStatus'; -export * from './CheckoutReferences'; -export * from './CheckoutResponse'; -export * from './CheckoutsResponse'; -export * from './CommerceCaseResponse'; -export * from './CompanyInformation'; -export * from './CompleteFinancingPaymentMethodSpecificInput'; -export * from './CompletePaymentMethodSpecificInput'; -export * from './CompletePaymentRequest'; -export * from './CompletePaymentResponse'; -export * from './ContactDetails'; -export * from './CreateCheckoutRequest'; -export * from './CreateCheckoutResponse'; -export * from './CreateCommerceCaseRequest'; -export * from './CreateCommerceCaseResponse'; -export * from './CreatePaymentResponse'; -export * from './Customer'; -export * from './CustomerDevice'; -export * from './DeliverItem'; -export * from './DeliverRequest'; -export * from './DeliverResponse'; -export * from './DeliverType'; -export * from './DeliveryInformation'; -export * from './ErrorResponse'; -export * from './ExtendedCheckoutStatus'; -export * from './FinancingPaymentMethodSpecificInput'; -export * from './FinancingPaymentMethodSpecificOutput'; -export * from './InstallmentOption'; -export * from './LinkInformation'; -export * from './MandateRecurrenceType'; -export * from './MerchantAction'; -export * from './MobilePaymentMethodSpecificInput'; -export * from './MobilePaymentMethodSpecificOutput'; -export * from './Order'; -export * from './OrderItem'; -export * from './OrderLineDetailsInput'; -export * from './OrderLineDetailsPatch'; -export * from './OrderLineDetailsResult'; -export * from './OrderRequest'; -export * from './OrderResponse'; -export * from './OrderType'; -export * from './PatchCheckoutRequest'; -export * from './PatchCommerceCaseRequest'; -export * from './PaymentChannel'; -export * from './PaymentCreationOutput'; -export * from './PaymentEvent'; -export * from './PaymentExecution'; -export * from './PaymentExecutionRequest'; -export * from './PaymentExecutionSpecificInput'; -export * from './PaymentInformationRequest'; -export * from './PaymentInformationResponse'; -export * from './PaymentMethodSpecificInput'; -export * from './PaymentOutput'; -export * from './PaymentProduct320SpecificInput'; -export * from './PaymentProduct3391SpecificInput'; -export * from './PaymentProduct3391SpecificOutput'; -export * from './PaymentProduct3392SpecificInput'; -export * from './PaymentProduct771SpecificOutput'; -export * from './PaymentProduct840CustomerAccount'; -export * from './PaymentProduct840SpecificOutput'; -export * from './PaymentReferences'; -export * from './PaymentResponse'; -export * from './PaymentStatusOutput'; -export * from './PaymentType'; -export * from './PayoutOutput'; -export * from './PayoutResponse'; -export * from './PersonalInformation'; -export * from './PersonalName'; -export * from './PositiveAmountOfMoney'; -export * from './ProcessingMandateInformation'; -export * from './ProductType'; -export * from './RedirectData'; -export * from './RedirectPaymentMethodSpecificInput'; -export * from './RedirectPaymentMethodSpecificOutput'; -export * from './RedirectPaymentProduct840SpecificInput'; -export * from './RedirectionData'; -export * from './References'; -export * from './RefundErrorResponse'; -export * from './RefundOutput'; -export * from './RefundPaymentResponse'; -export * from './RefundRequest'; -export * from './ReturnInformation'; -export * from './ReturnItem'; -export * from './ReturnRequest'; -export * from './ReturnResponse'; -export * from './ReturnType'; -export * from './SepaDirectDebitPaymentMethodSpecificInput'; -export * from './SepaDirectDebitPaymentMethodSpecificOutput'; -export * from './SepaDirectDebitPaymentProduct771SpecificInput'; -export * from './Shipping'; -export * from './ShoppingCartInput'; -export * from './ShoppingCartPatch'; -export * from './ShoppingCartResult'; -export * from './StatusCategoryValue'; -export * from './StatusCheckout'; -export * from './StatusOutput'; -export * from './StatusValue'; -export * from './ThreeDSecureResults'; -export * from './TransactionChannel'; -export * from './UnscheduledCardOnFileRequestor'; -export * from './UnscheduledCardOnFileSequenceIndicator'; +export * from './APIError.js'; +export * from './Address.js'; +export * from './AddressPersonal.js'; +export * from './AllowedPaymentActions.js'; +export * from './AmountOfMoney.js'; +export * from './ApplePaymentDataTokenHeaderInformation.js'; +export * from './ApplePaymentDataTokenInformation.js'; +export * from './AuthorizationMode.js'; +export * from './BankAccountInformation.js'; +export * from './CancelItem.js'; +export * from './CancelPaymentRequest.js'; +export * from './CancelPaymentResponse.js'; +export * from './CancelRequest.js'; +export * from './CancelResponse.js'; +export * from './CancelType.js'; +export * from './CancellationReason.js'; +export * from './CaptureOutput.js'; +export * from './CapturePaymentRequest.js'; +export * from './CapturePaymentResponse.js'; +export * from './CardFraudResults.js'; +export * from './CardInfo.js'; +export * from './CardPaymentDetails.js'; +export * from './CardPaymentMethodSpecificInput.js'; +export * from './CardPaymentMethodSpecificOutput.js'; +export * from './CardRecurrenceDetails.js'; +export * from './CartItemInput.js'; +export * from './CartItemInvoiceData.js'; +export * from './CartItemOrderStatus.js'; +export * from './CartItemPatch.js'; +export * from './CartItemResult.js'; +export * from './CartItemStatus.js'; +export * from './CheckoutReferences.js'; +export * from './CheckoutResponse.js'; +export * from './CheckoutsResponse.js'; +export * from './CommerceCaseResponse.js'; +export * from './CompanyInformation.js'; +export * from './CompleteFinancingPaymentMethodSpecificInput.js'; +export * from './CompletePaymentMethodSpecificInput.js'; +export * from './CompletePaymentRequest.js'; +export * from './CompletePaymentResponse.js'; +export * from './ContactDetails.js'; +export * from './CreateCheckoutRequest.js'; +export * from './CreateCheckoutResponse.js'; +export * from './CreateCommerceCaseRequest.js'; +export * from './CreateCommerceCaseResponse.js'; +export * from './CreatePaymentResponse.js'; +export * from './Customer.js'; +export * from './CustomerDevice.js'; +export * from './DeliverItem.js'; +export * from './DeliverRequest.js'; +export * from './DeliverResponse.js'; +export * from './DeliverType.js'; +export * from './DeliveryInformation.js'; +export * from './ErrorResponse.js'; +export * from './ExtendedCheckoutStatus.js'; +export * from './FinancingPaymentMethodSpecificInput.js'; +export * from './FinancingPaymentMethodSpecificOutput.js'; +export * from './InstallmentOption.js'; +export * from './LinkInformation.js'; +export * from './MandateRecurrenceType.js'; +export * from './MerchantAction.js'; +export * from './MobilePaymentMethodSpecificInput.js'; +export * from './MobilePaymentMethodSpecificOutput.js'; +export * from './Order.js'; +export * from './OrderItem.js'; +export * from './OrderLineDetailsInput.js'; +export * from './OrderLineDetailsPatch.js'; +export * from './OrderLineDetailsResult.js'; +export * from './OrderRequest.js'; +export * from './OrderResponse.js'; +export * from './OrderType.js'; +export * from './PatchCheckoutRequest.js'; +export * from './PatchCommerceCaseRequest.js'; +export * from './PaymentChannel.js'; +export * from './PaymentCreationOutput.js'; +export * from './PaymentEvent.js'; +export * from './PaymentExecution.js'; +export * from './PaymentExecutionRequest.js'; +export * from './PaymentExecutionSpecificInput.js'; +export * from './PaymentInformationRequest.js'; +export * from './PaymentInformationResponse.js'; +export * from './PaymentMethodSpecificInput.js'; +export * from './PaymentOutput.js'; +export * from './PaymentProduct320SpecificInput.js'; +export * from './PaymentProduct3391SpecificInput.js'; +export * from './PaymentProduct3391SpecificOutput.js'; +export * from './PaymentProduct3392SpecificInput.js'; +export * from './PaymentProduct771SpecificOutput.js'; +export * from './PaymentProduct840CustomerAccount.js'; +export * from './PaymentProduct840SpecificOutput.js'; +export * from './PaymentReferences.js'; +export * from './PaymentResponse.js'; +export * from './PaymentStatusOutput.js'; +export * from './PaymentType.js'; +export * from './PayoutOutput.js'; +export * from './PayoutResponse.js'; +export * from './PersonalInformation.js'; +export * from './PersonalName.js'; +export * from './PositiveAmountOfMoney.js'; +export * from './ProcessingMandateInformation.js'; +export * from './ProductType.js'; +export * from './RedirectData.js'; +export * from './RedirectPaymentMethodSpecificInput.js'; +export * from './RedirectPaymentMethodSpecificOutput.js'; +export * from './RedirectPaymentProduct840SpecificInput.js'; +export * from './RedirectionData.js'; +export * from './References.js'; +export * from './RefundErrorResponse.js'; +export * from './RefundOutput.js'; +export * from './RefundPaymentResponse.js'; +export * from './RefundRequest.js'; +export * from './ReturnInformation.js'; +export * from './ReturnItem.js'; +export * from './ReturnRequest.js'; +export * from './ReturnResponse.js'; +export * from './ReturnType.js'; +export * from './SepaDirectDebitPaymentMethodSpecificInput.js'; +export * from './SepaDirectDebitPaymentMethodSpecificOutput.js'; +export * from './SepaDirectDebitPaymentProduct771SpecificInput.js'; +export * from './Shipping.js'; +export * from './ShoppingCartInput.js'; +export * from './ShoppingCartPatch.js'; +export * from './ShoppingCartResult.js'; +export * from './StatusCategoryValue.js'; +export * from './StatusCheckout.js'; +export * from './StatusOutput.js'; +export * from './StatusValue.js'; +export * from './ThreeDSecureResults.js'; +export * from './TransactionChannel.js'; +export * from './UnscheduledCardOnFileRequestor.js'; +export * from './UnscheduledCardOnFileSequenceIndicator.js'; diff --git a/src/queries/GetCheckoutsQuery.ts b/src/queries/GetCheckoutsQuery.ts index 91ab322..7757fb3 100644 --- a/src/queries/GetCheckoutsQuery.ts +++ b/src/queries/GetCheckoutsQuery.ts @@ -1,5 +1,5 @@ -import { PaymentChannel, StatusCheckout, ExtendedCheckoutStatus } from '../models'; -import { QueryConfig } from '../utils/QueryConfig'; +import { PaymentChannel, StatusCheckout, ExtendedCheckoutStatus } from '../models/index.js'; +import { QueryConfig } from '../utils/QueryConfig.js'; export class GetCheckoutsQuery implements QueryConfig { private offset?: number; diff --git a/src/queries/GetCommerceCasesQuery.ts b/src/queries/GetCommerceCasesQuery.ts index 1ecbe7d..77499eb 100644 --- a/src/queries/GetCommerceCasesQuery.ts +++ b/src/queries/GetCommerceCasesQuery.ts @@ -1,5 +1,5 @@ -import { PaymentChannel, StatusCheckout } from '../models'; -import { QueryConfig } from '../utils/QueryConfig'; +import { PaymentChannel, StatusCheckout } from '../models/index.js'; +import { QueryConfig } from '../utils/QueryConfig.js'; export class GetCommerceCasesQuery implements QueryConfig { private offset?: number; diff --git a/src/queries/index.ts b/src/queries/index.ts index 4e15fc7..30be6e6 100644 --- a/src/queries/index.ts +++ b/src/queries/index.ts @@ -1,2 +1,2 @@ -export { GetCheckoutsQuery } from './GetCheckoutsQuery'; -export { GetCommerceCasesQuery } from './GetCommerceCasesQuery'; +export { GetCheckoutsQuery } from './GetCheckoutsQuery.js'; +export { GetCommerceCasesQuery } from './GetCommerceCasesQuery.js'; diff --git a/tsconfig.json b/tsconfig.json index 5a6dd4f..4ec2370 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,11 +1,17 @@ { "compilerOptions": { - "target": "es2016", - "module": "commonjs", + "target": "ES6", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["es6"], "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, "skipLibCheck": true, - "outDir": "dist" /* Skip type checking all .d.ts files. */ - } + "strictNullChecks": true, + "outDir": "dist", + "declaration": true + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules"] } diff --git a/yarn.lock b/yarn.lock index 447ae82..d65a080 100644 --- a/yarn.lock +++ b/yarn.lock @@ -732,7 +732,7 @@ node-domexception@^1.0.0: resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== -node-fetch@^3.3.2: +node-fetch@3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b" integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA== @@ -799,7 +799,7 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@^3.3.3: +prettier@3.3.3: version "3.3.3" resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105" integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==