diff --git a/eslint.config.mjs b/eslint.config.mjs index a5c640b..2bbcfac 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -7,7 +7,7 @@ export default [ files: ['**/*.{js,mjs,cjs,ts}'], }, { - languageOptions: { globals: globals.browser }, + languageOptions: { globals: globals.node }, }, pluginJs.configs.recommended, ...tseslint.configs.recommended, diff --git a/example-app/.gitkeep b/example-app/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/package.json b/package.json index 6bf4a0e..800dd24 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "pcp-server-nodejs-sdk", "version": "0.0.1", "description": "", - "main": "index.js", + "main": "dist/index.js", "scripts": { "build": "tsc", "dev": "ts-node src/index.ts", @@ -23,5 +23,8 @@ "ts-node": "10.9.2", "typescript": "5.5.4", "typescript-eslint": "7.17.0" + }, + "dependencies": { + "node-fetch": "^3.3.2" } } diff --git a/src/CommunicatorConfiguration.ts b/src/CommunicatorConfiguration.ts new file mode 100644 index 0000000..783da38 --- /dev/null +++ b/src/CommunicatorConfiguration.ts @@ -0,0 +1,23 @@ +export class CommunicatorConfiguration { + private readonly apiKey: string; + private readonly apiSecret: string; + private readonly host: string; + + constructor(apiKey: string, apiSecret: string, host: string) { + this.apiKey = apiKey; + this.apiSecret = apiSecret; + this.host = host; + } + + public getApiKey(): string { + return this.apiKey; + } + + public getApiSecret(): string { + return this.apiSecret; + } + + public getHost(): string { + return this.host; + } +} diff --git a/src/RequestHeaderGenerator.ts b/src/RequestHeaderGenerator.ts new file mode 100644 index 0000000..3fcc2fb --- /dev/null +++ b/src/RequestHeaderGenerator.ts @@ -0,0 +1,87 @@ +import * as crypto from 'crypto'; +import { Headers, RequestInit } from 'node-fetch'; +import { CommunicatorConfiguration } from './CommunicatorConfiguration'; +import { ServerMetaInfo } from './utils/ServerMetaInfo'; + +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 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 { + const headers = new Headers(request.headers); + + if (!headers.has(this.DATE_HEADER_NAME)) { + headers.set(this.DATE_HEADER_NAME, new Date().toUTCString()); + } + if (!headers.has(RequestHeaderGenerator.SERVER_META_INFO_HEADER_NAME)) { + headers.set(RequestHeaderGenerator.SERVER_META_INFO_HEADER_NAME, this.getServerMetaInfo()); + } + if (!headers.has(RequestHeaderGenerator.CLIENT_META_INFO_HEADER_NAME)) { + headers.set(RequestHeaderGenerator.CLIENT_META_INFO_HEADER_NAME, this.getClientMetaInfo()); + } + if (!headers.has(this.AUTHORIZATION_HEADER_NAME)) { + headers.set(this.AUTHORIZATION_HEADER_NAME, this.getAuthHeader(url, request, headers)); + } + + return { + ...request, + headers, + }; + } + + private getAuthHeader(url: string, request: RequestInit, headers: Headers): string { + // 1. method + let stringToSign = `${request.method}\n`; + // 2. Content-Type + if (headers.has('Content-Type')) { + stringToSign += `${headers.get('Content-Type')}\n`; + } + stringToSign += '\n'; + // 3. Date + stringToSign += `${headers.get(this.DATE_HEADER_NAME)}\n`; + // 4. Canonicalized Headers (starting with X-GCS, sorted by names) + if (headers.has(RequestHeaderGenerator.CLIENT_META_INFO_HEADER_NAME)) { + stringToSign += `${RequestHeaderGenerator.CLIENT_META_INFO_HEADER_NAME.toLowerCase()}:${headers.get(RequestHeaderGenerator.CLIENT_META_INFO_HEADER_NAME)!.replace(RequestHeaderGenerator.WHITESPACE_REGEX, ' ').trim()}\n`; + } + if (headers.has(RequestHeaderGenerator.SERVER_META_INFO_HEADER_NAME)) { + stringToSign += `${RequestHeaderGenerator.SERVER_META_INFO_HEADER_NAME.toLowerCase()}:${headers.get(RequestHeaderGenerator.SERVER_META_INFO_HEADER_NAME)!.replace(RequestHeaderGenerator.WHITESPACE_REGEX, ' ').trim()}\n`; + } + // 5. Canonicalized Resource (has to include query parameters) + const urlInternal = new URL(url); + stringToSign += urlInternal.pathname; + if (urlInternal.search) { + stringToSign += `${urlInternal.search}`; + } + stringToSign += '\n'; + const signature = this.sign(stringToSign); + return `GCS v1HMAC:${this.config.getApiKey()}:${signature}`; + } + + private sign(target: string): string { + const hash = this.hmac.update(target).digest(); + return hash.toString('base64'); + } + + private getServerMetaInfo(): string { + const meta = new ServerMetaInfo(); + const jsonString = JSON.stringify(meta); + return Buffer.from(jsonString, 'utf-8').toString('base64'); + } + + private getClientMetaInfo(): string { + const encodedBytes = Buffer.from('"[]"', 'utf-8').toString('base64'); + return encodedBytes; + } +} diff --git a/src/endpoints/BaseApiClient.ts b/src/endpoints/BaseApiClient.ts new file mode 100644 index 0000000..f5f85d3 --- /dev/null +++ b/src/endpoints/BaseApiClient.ts @@ -0,0 +1,43 @@ +import fetch, { RequestInit, Response } from 'node-fetch'; +import { CommunicatorConfiguration } from '../CommunicatorConfiguration'; +import { RequestHeaderGenerator } from '../RequestHeaderGenerator'; +import { ApiResponseRetrievalException } from '../errors'; +import { ErrorResponse } from '../models'; + +export class BaseApiClient { + private readonly JSON_PARSE_ERROR = 'Expected valid JSON response, but failed to parse'; + protected readonly requestHeaderGenerator: RequestHeaderGenerator; + protected readonly config: CommunicatorConfiguration; + + constructor(config: CommunicatorConfiguration) { + this.config = config; + this.requestHeaderGenerator = new RequestHeaderGenerator(config); + } + + protected getRequestHeaderGenerator(): RequestHeaderGenerator | undefined { + return this.requestHeaderGenerator; + } + + protected getConfig(): CommunicatorConfiguration { + return this.config; + } + + protected async makeApiCall(url: string, requestInit: RequestInit): Promise { + requestInit = this.requestHeaderGenerator.generateAdditionalRequestHeaders(url, requestInit); + + const response = await fetch(url, requestInit); + await this.handleError(response); + return response.json() as Promise; + } + + private async handleError(response: Response): Promise { + if (response.ok) { + return; + } + + const responseBody = (await response.json()) as Promise; + if (!responseBody) { + throw new ApiResponseRetrievalException(response.status, responseBody); + } + } +} diff --git a/src/endpoints/CheckoutApiClient.ts b/src/endpoints/CheckoutApiClient.ts new file mode 100644 index 0000000..d00f809 --- /dev/null +++ b/src/endpoints/CheckoutApiClient.ts @@ -0,0 +1,154 @@ +import { Headers, RequestInit } from 'node-fetch'; +import { URLSearchParams } from 'url'; +import { CommunicatorConfiguration } from '../CommunicatorConfiguration'; +import { + CheckoutResponse, + CheckoutsResponse, + CreateCheckoutRequest, + CreateCheckoutResponse, + PatchCheckoutRequest, +} from '../models'; + +import { GetCheckoutsQuery } from '../queries'; +import { BaseApiClient } from './BaseApiClient'; + +export class CheckoutApiClient extends BaseApiClient { + constructor(config: CommunicatorConfiguration) { + super(config); + } + + public async createCheckoutRequest( + merchantId: string, + commerceCaseId: string, + payload: CreateCheckoutRequest, + ): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + if (!commerceCaseId) { + throw new Error('Commerce Case ID is required'); + } + if (!payload) { + throw new Error('Payload is required'); + } + + const url = new URL(`/v1/${merchantId}/commerce-cases/${commerceCaseId}/checkouts`, this.getConfig().getHost()); + + const requestInit: RequestInit = { + method: 'POST', + headers: new Headers({ + 'Content-Type': 'application/json', + }), + body: JSON.stringify(payload), + }; + + return this.makeApiCall(url.toString(), requestInit); + } + + public async getCheckoutRequest( + merchantId: string, + commerceCaseId: string, + checkoutId: string, + ): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + if (!commerceCaseId) { + throw new Error('Commerce Case ID is required'); + } + if (!checkoutId) { + throw new Error('Checkout ID is required'); + } + + const url = new URL( + `/v1/${merchantId}/commerce-cases/${commerceCaseId}/checkouts/${checkoutId}`, + this.getConfig().getHost(), + ); + + const requestInit: RequestInit = { + method: 'GET', + headers: new Headers(), + }; + + return this.makeApiCall(url.toString(), requestInit); + } + + public async getCheckoutsRequest(merchantId: string, queryParams?: GetCheckoutsQuery): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + + const url = new URL(`/v1/${merchantId}/checkouts`, this.getConfig().getHost()); + + if (queryParams) { + const params = new URLSearchParams(queryParams.toQueryMap()); + url.search = params.toString(); + } + + const requestInit: RequestInit = { + method: 'GET', + headers: new Headers(), + }; + + return this.makeApiCall(url.toString(), requestInit); + } + + public async updateCheckoutRequest( + merchantId: string, + commerceCaseId: string, + checkoutId: string, + payload: PatchCheckoutRequest, + ): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + if (!commerceCaseId) { + throw new Error('Commerce Case ID is required'); + } + if (!checkoutId) { + throw new Error('Checkout ID is required'); + } + if (!payload) { + throw new Error('Payload is required'); + } + + const url = new URL( + `/v1/${merchantId}/commerce-cases/${commerceCaseId}/checkouts/${checkoutId}`, + this.getConfig().getHost(), + ); + + const requestInit: RequestInit = { + method: 'PATCH', + headers: new Headers({ + 'Content-Type': 'application/json', + }), + body: JSON.stringify(payload), + }; + + await this.makeApiCall(url.toString(), requestInit); + } + + public async removeCheckoutRequest(merchantId: string, commerceCaseId: string, checkoutId: string): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + if (!commerceCaseId) { + throw new Error('Commerce Case ID is required'); + } + if (!checkoutId) { + throw new Error('Checkout ID is required'); + } + + const url = new URL( + `/v1/${merchantId}/commerce-cases/${commerceCaseId}/checkouts/${checkoutId}`, + this.getConfig().getHost(), + ); + + const requestInit: RequestInit = { + method: 'DELETE', + headers: new Headers(), + }; + + await this.makeApiCall(url.toString(), requestInit); + } +} diff --git a/src/endpoints/CommerceCaseApiClient.ts b/src/endpoints/CommerceCaseApiClient.ts new file mode 100644 index 0000000..18155d0 --- /dev/null +++ b/src/endpoints/CommerceCaseApiClient.ts @@ -0,0 +1,101 @@ +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'; + +export class CommerceCaseApiClient extends BaseApiClient { + constructor(config: CommunicatorConfiguration) { + super(config); + } + + public async createCommerceCaseRequest( + merchantId: string, + payload: CreateCommerceCaseRequest, + ): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + if (!payload) { + throw new Error('Payload is required'); + } + + const url = new URL(`/v1/${merchantId}/commerce-cases`, this.getConfig()?.getHost()); + + const requestInit: RequestInit = { + method: 'POST', + headers: new Headers({ + 'Content-Type': 'application/json', + }), + body: JSON.stringify(payload), + }; + + return this.makeApiCall(url.toString(), requestInit); + } + + public async getCommerceCaseRequest(merchantId: string, commerceCaseId: string): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + if (!commerceCaseId) { + throw new Error('Commerce Case ID is required'); + } + + const url = new URL(`/v1/${merchantId}/commerce-cases/${commerceCaseId}`, this.getConfig()?.getHost()); + + const requestInit: RequestInit = { + method: 'GET', + headers: new Headers(), + }; + + return this.makeApiCall(url.toString(), requestInit); + } + + public async getCommerceCasesRequest( + merchantId: string, + queryParams?: GetCommerceCasesQuery, + ): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + + const url = new URL(`/v1/${merchantId}/commerce-cases`, this.getConfig()?.getHost()); + + if (queryParams) { + const params = new URLSearchParams(queryParams.toQueryMap()); + url.search = params.toString(); + } + + const requestInit: RequestInit = { + method: 'GET', + headers: new Headers(), + }; + + return this.makeApiCall(url.toString(), requestInit); + } + + public async updateCommerceCaseRequest(merchantId: string, commerceCaseId: string, payload: Customer): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + if (!commerceCaseId) { + throw new Error('Commerce Case ID is required'); + } + if (!payload) { + throw new Error('Payload is required'); + } + + const url = new URL(`/v1/${merchantId}/commerce-cases/${commerceCaseId}`, this.getConfig()?.getHost()); + + const requestInit: RequestInit = { + method: 'PATCH', + headers: new Headers({ + 'Content-Type': 'application/json', + }), + body: JSON.stringify({ customer: payload }), + }; + + await this.makeApiCall(url.toString(), requestInit); + } +} diff --git a/src/endpoints/OrderManagementCheckoutActionsApiClient.ts b/src/endpoints/OrderManagementCheckoutActionsApiClient.ts new file mode 100644 index 0000000..2cd4186 --- /dev/null +++ b/src/endpoints/OrderManagementCheckoutActionsApiClient.ts @@ -0,0 +1,159 @@ +import { Headers, RequestInit } from 'node-fetch'; +import { CommunicatorConfiguration } from '../CommunicatorConfiguration'; +import { + CancelRequest, + CancelResponse, + DeliverRequest, + DeliverResponse, + OrderRequest, + OrderResponse, + ReturnRequest, + ReturnResponse, +} from '../models'; +import { BaseApiClient } from './BaseApiClient'; + +export class OrderManagementCheckoutActionsApiClient extends BaseApiClient { + constructor(config: CommunicatorConfiguration) { + super(config); + } + + public async createOrder( + merchantId: string, + commerceCaseId: string, + checkoutId: string, + payload: OrderRequest, + ): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + if (!commerceCaseId) { + throw new Error('Commerce Case ID is required'); + } + if (!checkoutId) { + throw new Error('Checkout ID is required'); + } + if (!payload) { + throw new Error('Payload is required'); + } + + const url = new URL( + `/v1/${merchantId}/commerce-cases/${commerceCaseId}/checkouts/${checkoutId}/order`, + this.getConfig()?.getHost(), + ); + + const requestInit: RequestInit = { + method: 'POST', + headers: new Headers({ + 'Content-Type': 'application/json', + }), + body: JSON.stringify(payload), + }; + + return this.makeApiCall(url.toString(), requestInit); + } + + public async deliverOrder( + merchantId: string, + commerceCaseId: string, + checkoutId: string, + payload: DeliverRequest, + ): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + if (!commerceCaseId) { + throw new Error('Commerce Case ID is required'); + } + if (!checkoutId) { + throw new Error('Checkout ID is required'); + } + if (!payload) { + throw new Error('Payload is required'); + } + + const url = new URL( + `/v1/${merchantId}/commerce-cases/${commerceCaseId}/checkouts/${checkoutId}/deliver`, + this.getConfig()?.getHost(), + ); + + const requestInit: RequestInit = { + method: 'POST', + headers: new Headers({ + 'Content-Type': 'application/json', + }), + body: JSON.stringify(payload), + }; + + return this.makeApiCall(url.toString(), requestInit); + } + + public async returnOrder( + merchantId: string, + commerceCaseId: string, + checkoutId: string, + payload: ReturnRequest, + ): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + if (!commerceCaseId) { + throw new Error('Commerce Case ID is required'); + } + if (!checkoutId) { + throw new Error('Checkout ID is required'); + } + if (!payload) { + throw new Error('Payload is required'); + } + + const url = new URL( + `/v1/${merchantId}/commerce-cases/${commerceCaseId}/checkouts/${checkoutId}/return`, + this.getConfig()?.getHost(), + ); + + const requestInit: RequestInit = { + method: 'POST', + headers: new Headers({ + 'Content-Type': 'application/json', + }), + body: JSON.stringify(payload), + }; + + return this.makeApiCall(url.toString(), requestInit); + } + + public async cancelOrder( + merchantId: string, + commerceCaseId: string, + checkoutId: string, + payload: CancelRequest, + ): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + if (!commerceCaseId) { + throw new Error('Commerce Case ID is required'); + } + if (!checkoutId) { + throw new Error('Checkout ID is required'); + } + if (!payload) { + throw new Error('Payload is required'); + } + + const url = new URL( + `/v1/${merchantId}/commerce-cases/${commerceCaseId}/checkouts/${checkoutId}/cancel`, + this.getConfig()?.getHost(), + ); + + const requestInit: RequestInit = { + method: 'POST', + headers: new Headers({ + 'Content-Type': 'application/json', + }), + body: JSON.stringify(payload), + }; + + return this.makeApiCall(url.toString(), requestInit); + } +} diff --git a/src/endpoints/PaymentExecutionApiClient.ts b/src/endpoints/PaymentExecutionApiClient.ts new file mode 100644 index 0000000..c56dff7 --- /dev/null +++ b/src/endpoints/PaymentExecutionApiClient.ts @@ -0,0 +1,212 @@ +import { Headers, RequestInit } from 'node-fetch'; +import { CommunicatorConfiguration } from '../CommunicatorConfiguration'; +import { + CancelPaymentRequest, + CancelPaymentResponse, + CapturePaymentRequest, + CapturePaymentResponse, + CompletePaymentRequest, + CompletePaymentResponse, + CreatePaymentResponse, + PaymentExecutionRequest, + RefundPaymentResponse, + RefundRequest, +} from '../models'; +import { BaseApiClient } from './BaseApiClient'; + +export class PaymentExecutionApiClient extends BaseApiClient { + constructor(config: CommunicatorConfiguration) { + super(config); + } + + public async createPayment( + merchantId: string, + commerceCaseId: string, + checkoutId: string, + payload: PaymentExecutionRequest, + ): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + if (!commerceCaseId) { + throw new Error('Commerce Case ID is required'); + } + if (!checkoutId) { + throw new Error('Checkout ID is required'); + } + if (!payload) { + throw new Error('Payload is required'); + } + + const url = new URL( + `/v1/${merchantId}/commerce-cases/${commerceCaseId}/checkouts/${checkoutId}/payment-executions`, + this.getConfig()?.getHost(), + ); + + const requestInit: RequestInit = { + method: 'POST', + headers: new Headers({ + 'Content-Type': 'application/json', + }), + body: JSON.stringify(payload), + }; + + return this.makeApiCall(url.toString(), requestInit); + } + + public async capturePayment( + merchantId: string, + commerceCaseId: string, + checkoutId: string, + paymentExecutionId: string, + payload: CapturePaymentRequest, + ): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + if (!commerceCaseId) { + throw new Error('Commerce Case ID is required'); + } + if (!checkoutId) { + throw new Error('Checkout ID is required'); + } + if (!paymentExecutionId) { + throw new Error('Payment Execution ID is required'); + } + if (!payload) { + throw new Error('Payload is required'); + } + + const url = new URL( + `/v1/${merchantId}/commerce-cases/${commerceCaseId}/checkouts/${checkoutId}/payment-executions/${paymentExecutionId}/capture`, + this.getConfig()?.getHost(), + ); + + const requestInit: RequestInit = { + method: 'POST', + headers: new Headers({ + 'Content-Type': 'application/json', + }), + body: JSON.stringify(payload), + }; + + return this.makeApiCall(url.toString(), requestInit); + } + + public async cancelPayment( + merchantId: string, + commerceCaseId: string, + checkoutId: string, + paymentExecutionId: string, + payload: CancelPaymentRequest, + ): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + if (!commerceCaseId) { + throw new Error('Commerce Case ID is required'); + } + if (!checkoutId) { + throw new Error('Checkout ID is required'); + } + if (!paymentExecutionId) { + throw new Error('Payment Execution ID is required'); + } + if (!payload) { + throw new Error('Payload is required'); + } + + const url = new URL( + `/v1/${merchantId}/commerce-cases/${commerceCaseId}/checkouts/${checkoutId}/payment-executions/${paymentExecutionId}/cancel`, + this.getConfig()?.getHost(), + ); + + const requestInit: RequestInit = { + method: 'POST', + headers: new Headers({ + 'Content-Type': 'application/json', + }), + body: JSON.stringify(payload), + }; + + return this.makeApiCall(url.toString(), requestInit); + } + + public async refundPayment( + merchantId: string, + commerceCaseId: string, + checkoutId: string, + paymentExecutionId: string, + payload: RefundRequest, + ): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + if (!commerceCaseId) { + throw new Error('Commerce Case ID is required'); + } + if (!checkoutId) { + throw new Error('Checkout ID is required'); + } + if (!paymentExecutionId) { + throw new Error('Payment Execution ID is required'); + } + if (!payload) { + throw new Error('Payload is required'); + } + + const url = new URL( + `/v1/${merchantId}/commerce-cases/${commerceCaseId}/checkouts/${checkoutId}/payment-executions/${paymentExecutionId}/refund`, + this.getConfig()?.getHost(), + ); + + const requestInit: RequestInit = { + method: 'POST', + headers: new Headers({ + 'Content-Type': 'application/json', + }), + body: JSON.stringify(payload), + }; + + return this.makeApiCall(url.toString(), requestInit); + } + + public async completePayment( + merchantId: string, + commerceCaseId: string, + checkoutId: string, + paymentExecutionId: string, + payload: CompletePaymentRequest, + ): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + if (!commerceCaseId) { + throw new Error('Commerce Case ID is required'); + } + if (!checkoutId) { + throw new Error('Checkout ID is required'); + } + if (!paymentExecutionId) { + throw new Error('Payment Execution ID is required'); + } + if (!payload) { + throw new Error('Payload is required'); + } + + const url = new URL( + `/v1/${merchantId}/commerce-cases/${commerceCaseId}/checkouts/${checkoutId}/payment-executions/${paymentExecutionId}/complete`, + this.getConfig()?.getHost(), + ); + + const requestInit: RequestInit = { + method: 'POST', + headers: new Headers({ + 'Content-Type': 'application/json', + }), + body: JSON.stringify(payload), + }; + + return this.makeApiCall(url.toString(), requestInit); + } +} diff --git a/src/endpoints/PaymentInformationApiClient.ts b/src/endpoints/PaymentInformationApiClient.ts new file mode 100644 index 0000000..00582ec --- /dev/null +++ b/src/endpoints/PaymentInformationApiClient.ts @@ -0,0 +1,77 @@ +import { Headers, RequestInit } from 'node-fetch'; +import { CommunicatorConfiguration } from '../CommunicatorConfiguration'; +import { PaymentInformationRequest, PaymentInformationResponse } from '../models'; +import { BaseApiClient } from './BaseApiClient'; + +export class PaymentInformationApiClient extends BaseApiClient { + constructor(config: CommunicatorConfiguration) { + super(config); + } + + public async createPaymentInformation( + merchantId: string, + commerceCaseId: string, + checkoutId: string, + payload: PaymentInformationRequest, + ): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + if (!commerceCaseId) { + throw new Error('Commerce Case ID is required'); + } + if (!checkoutId) { + throw new Error('Checkout ID is required'); + } + if (!payload) { + throw new Error('Payload is required'); + } + + const url = new URL( + `/v1/${merchantId}/commerce-cases/${commerceCaseId}/checkouts/${checkoutId}/payment-informations`, + this.getConfig()?.getHost(), + ); + + const requestInit: RequestInit = { + method: 'POST', + headers: new Headers({ + 'Content-Type': 'application/json', + }), + body: JSON.stringify(payload), + }; + + return this.makeApiCall(url.toString(), requestInit); + } + + public async getPaymentInformation( + merchantId: string, + commerceCaseId: string, + checkoutId: string, + paymentInformationId: string, + ): Promise { + if (!merchantId) { + throw new Error('Merchant ID is required'); + } + if (!commerceCaseId) { + throw new Error('Commerce Case ID is required'); + } + if (!checkoutId) { + throw new Error('Checkout ID is required'); + } + if (!paymentInformationId) { + throw new Error('Payment Information ID is required'); + } + + const url = new URL( + `/v1/${merchantId}/commerce-cases/${commerceCaseId}/checkouts/${checkoutId}/payment-informations/${paymentInformationId}`, + this.getConfig()?.getHost(), + ); + + const requestInit: RequestInit = { + method: 'GET', + headers: new Headers(), + }; + + return this.makeApiCall(url.toString(), requestInit); + } +} diff --git a/src/endpoints/index.ts b/src/endpoints/index.ts new file mode 100644 index 0000000..7dba859 --- /dev/null +++ b/src/endpoints/index.ts @@ -0,0 +1 @@ +export { CheckoutApiClient } from './CheckoutApiClient'; diff --git a/src/errors/ApiErrorResponseException.ts b/src/errors/ApiErrorResponseException.ts new file mode 100644 index 0000000..34b2956 --- /dev/null +++ b/src/errors/ApiErrorResponseException.ts @@ -0,0 +1,15 @@ +import { APIError } from '../models/APIError'; +import { ApiException } from './ApiException'; + +export class ApiErrorResponseException extends ApiException { + private readonly errors: APIError[]; + + constructor(statusCode: number, responseBody: string, errors: APIError[] = [], cause?: Error) { + super(statusCode, responseBody, cause); + this.errors = errors.length ? errors : []; + } + + public getErrors(): APIError[] { + return this.errors; + } +} diff --git a/src/errors/ApiException.ts b/src/errors/ApiException.ts new file mode 100644 index 0000000..efc72fe --- /dev/null +++ b/src/errors/ApiException.ts @@ -0,0 +1,21 @@ +export class ApiException extends Error { + private readonly statusCode: number; + private readonly responseBody: string; + + constructor(statusCode: number, responseBody: string, cause?: Error) { + super(responseBody); + this.statusCode = statusCode; + this.responseBody = responseBody; + if (cause) { + this.stack = cause.stack; + } + } + + public getStatusCode(): number { + return this.statusCode; + } + + public getResponseBody(): string { + return this.responseBody; + } +} diff --git a/src/errors/ApiResponseRetrievalException.ts b/src/errors/ApiResponseRetrievalException.ts new file mode 100644 index 0000000..f58c301 --- /dev/null +++ b/src/errors/ApiResponseRetrievalException.ts @@ -0,0 +1,7 @@ +import { ApiException } from './ApiException'; + +export class ApiResponseRetrievalException extends ApiException { + constructor(statusCode: number, responseBody: string, cause?: Error) { + super(statusCode, responseBody, cause); + } +} diff --git a/src/errors/index.ts b/src/errors/index.ts new file mode 100644 index 0000000..d271684 --- /dev/null +++ b/src/errors/index.ts @@ -0,0 +1,3 @@ +export { ApiErrorResponseException } from './ApiErrorResponseException'; +export { ApiException } from './ApiException'; +export { ApiResponseRetrievalException } from './ApiResponseRetrievalException'; diff --git a/src/index.ts b/src/index.ts index 8bda553..2055404 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,4 @@ -console.log('Hello, World!'); - -const a = 4; - -console.log({ a }); +export * from './endpoints'; +export * from './errors'; +export * from './queries'; +export { CommunicatorConfiguration } from './CommunicatorConfiguration'; diff --git a/src/models/APIError.ts b/src/models/APIError.ts new file mode 100644 index 0000000..8e39fe2 --- /dev/null +++ b/src/models/APIError.ts @@ -0,0 +1,88 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Contains detailed information on one single error. + */ +export class APIError { + /** + * Error code + */ + 'errorCode': string; + /** + * Category the error belongs to. The category should give an indication of the type of error you are dealing with. Possible values: * DIRECT_PLATFORM_ERROR - indicating that a functional error has occurred in the platform. * PAYMENT_PLATFORM_ERROR - indicating that a functional error has occurred in the payment platform. * IO_ERROR - indicating that a technical error has occurred within the payment platform or between the payment platform and third party systems. * COMMERCE_PLATFORM_ERROR - indicating an error originating from the Commerce Platform. * COMMERCE_PORTAL_BACKEND_ERROR - indicating an error originating from the Commerce Portal Backend. + */ + 'category'?: string; + /** + * HTTP status code for this error that can be used to determine the type of error + */ + 'httpStatusCode'?: number; + /** + * ID of the error. This is a short human-readable message that briefly describes the error. + */ + 'id'?: string; + /** + * Human-readable error message that is not meant to be relayed to customer as it might tip off people who are trying to commit fraud + */ + 'message'?: string; + /** + * Returned only if the error relates to a value that was missing or incorrect. Contains a location path to the value as a JSonata query. Some common examples: * a.b selects the value of property b of root property a, * a[1] selects the first element of the array in root property a, * a[b=\'some value\'] selects all elements of the array in root property a that have a property b with value \'some value\'. + */ + 'propertyName'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'errorCode', + baseName: 'errorCode', + type: 'string', + format: '', + }, + { + name: 'category', + baseName: 'category', + type: 'string', + format: '', + }, + { + name: 'httpStatusCode', + baseName: 'httpStatusCode', + type: 'number', + format: 'int32', + }, + { + name: 'id', + baseName: 'id', + type: 'string', + format: '', + }, + { + name: 'message', + baseName: 'message', + type: 'string', + format: '', + }, + { + name: 'propertyName', + baseName: 'propertyName', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return APIError.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/Address.ts b/src/models/Address.ts new file mode 100644 index 0000000..ec14541 --- /dev/null +++ b/src/models/Address.ts @@ -0,0 +1,98 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object containing billing address details + */ +export class Address { + /** + * Second line of street or additional address information such as apartments and suits + */ + 'additionalInfo'?: string; + /** + * City + */ + 'city'?: string; + /** + * ISO 3166-1 alpha-2 country code + */ + 'countryCode'?: string; + /** + * House number + */ + 'houseNumber'?: string; + /** + * State (ISO 3166-2 subdivisions), only if country=US, CA, CN, JP, MX, BR, AR, ID, TH, IN. + */ + 'state'?: string; + /** + * Street name + */ + 'street'?: string; + /** + * Zip code + */ + 'zip'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'additionalInfo', + baseName: 'additionalInfo', + type: 'string', + format: '', + }, + { + name: 'city', + baseName: 'city', + type: 'string', + format: '', + }, + { + name: 'countryCode', + baseName: 'countryCode', + type: 'string', + format: '', + }, + { + name: 'houseNumber', + baseName: 'houseNumber', + type: 'string', + format: '', + }, + { + name: 'state', + baseName: 'state', + type: 'string', + format: '', + }, + { + name: 'street', + baseName: 'street', + type: 'string', + format: '', + }, + { + name: 'zip', + baseName: 'zip', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return Address.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/AddressPersonal.ts b/src/models/AddressPersonal.ts new file mode 100644 index 0000000..9882098 --- /dev/null +++ b/src/models/AddressPersonal.ts @@ -0,0 +1,107 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { PersonalName } from '../models/PersonalName'; + +/** + * Object containing personal or shipping address information. + */ +export class AddressPersonal { + /** + * Second line of street or additional address information such as apartments and suits + */ + 'additionalInfo'?: string; + /** + * City + */ + 'city'?: string; + /** + * ISO 3166-1 alpha-2 country code + */ + 'countryCode'?: string; + /** + * House number + */ + 'houseNumber'?: string; + /** + * State (ISO 3166-2 subdivisions), only if country=US, CA, CN, JP, MX, BR, AR, ID, TH, IN. + */ + 'state'?: string; + /** + * Street name + */ + 'street'?: string; + /** + * Zip code + */ + 'zip'?: string; + 'name'?: PersonalName; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'additionalInfo', + baseName: 'additionalInfo', + type: 'string', + format: '', + }, + { + name: 'city', + baseName: 'city', + type: 'string', + format: '', + }, + { + name: 'countryCode', + baseName: 'countryCode', + type: 'string', + format: '', + }, + { + name: 'houseNumber', + baseName: 'houseNumber', + type: 'string', + format: '', + }, + { + name: 'state', + baseName: 'state', + type: 'string', + format: '', + }, + { + name: 'street', + baseName: 'street', + type: 'string', + format: '', + }, + { + name: 'zip', + baseName: 'zip', + type: 'string', + format: '', + }, + { + name: 'name', + baseName: 'name', + type: 'PersonalName', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return AddressPersonal.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/AllowedPaymentActions.ts b/src/models/AllowedPaymentActions.ts new file mode 100644 index 0000000..f94f364 --- /dev/null +++ b/src/models/AllowedPaymentActions.ts @@ -0,0 +1,19 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Indicates which payment endpoints can be used for the respective Checkout. The systems offers two alternatives to trigger a payment and consecutive events: OrderManagementCheckoutActions or the Payment Execution resource. Both alternatives can be used simultaneously but once one of the Payment Execution endpoints is used the Order Management endpoints can no longer be used for that Checkout since it is no longer possible to match payment events to items of the Checkout. + */ +export enum AllowedPaymentActions { + OrderManagement = 'ORDER_MANAGEMENT', + PaymentExecution = 'PAYMENT_EXECUTION', +} diff --git a/src/models/AmountOfMoney.ts b/src/models/AmountOfMoney.ts new file mode 100644 index 0000000..1cb64ba --- /dev/null +++ b/src/models/AmountOfMoney.ts @@ -0,0 +1,48 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object containing amount and ISO currency code attributes + */ +export class AmountOfMoney { + /** + * Amount in cents and always having 2 decimals + */ + 'amount': number; + /** + * Three-letter ISO currency code representing the currency for the amount + */ + 'currencyCode': string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'amount', + baseName: 'amount', + type: 'number', + format: 'int64', + }, + { + name: 'currencyCode', + baseName: 'currencyCode', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return AmountOfMoney.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/ApplePaymentDataTokenHeaderInformation.ts b/src/models/ApplePaymentDataTokenHeaderInformation.ts new file mode 100644 index 0000000..a4d5897 --- /dev/null +++ b/src/models/ApplePaymentDataTokenHeaderInformation.ts @@ -0,0 +1,48 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Additional information about the Apple payment data token header. + */ +export class ApplePaymentDataTokenHeaderInformation { + /** + * A hexadecimal Transaction identifier identifier as a string. + */ + 'transactionId'?: string; + /** + * SHA–256 hash, hex encoded as a string. Hash of the applicationData property of the original PKPaymentRequest object. + */ + 'applicationData'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'transactionId', + baseName: 'transactionId', + type: 'string', + format: '', + }, + { + name: 'applicationData', + baseName: 'applicationData', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return ApplePaymentDataTokenHeaderInformation.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/ApplePaymentDataTokenInformation.ts b/src/models/ApplePaymentDataTokenInformation.ts new file mode 100644 index 0000000..8613ed0 --- /dev/null +++ b/src/models/ApplePaymentDataTokenInformation.ts @@ -0,0 +1,61 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ApplePaymentDataTokenHeaderInformation } from '../models/ApplePaymentDataTokenHeaderInformation'; + +/** + * Additional information about the Apple payment data token. This information are needed for checking the validity of the payment data token before decryption. + */ +export class ApplePaymentDataTokenInformation { + /** + * Version information about the payment token. Currently only EC_v1 for ECC-encrypted data is supported. + */ + 'version'?: ApplePaymentDataTokenInformationVersionEnum; + /** + * Detached PKCS #7 signature, Base64 encoded as string. Signature of the payment and header data. The signature includes the signing certificate, its intermediate CA certificate, and information about the signing algorithm. + */ + 'signature'?: string; + 'header'?: ApplePaymentDataTokenHeaderInformation; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'version', + baseName: 'version', + type: 'ApplePaymentDataTokenInformationVersionEnum', + format: '', + }, + { + name: 'signature', + baseName: 'signature', + type: 'string', + format: '', + }, + { + name: 'header', + baseName: 'header', + type: 'ApplePaymentDataTokenHeaderInformation', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return ApplePaymentDataTokenInformation.attributeTypeMap; + } + + public constructor() {} +} + +export enum ApplePaymentDataTokenInformationVersionEnum { + EcV1 = 'EC_V1', +} diff --git a/src/models/AuthorizationMode.ts b/src/models/AuthorizationMode.ts new file mode 100644 index 0000000..047b95d --- /dev/null +++ b/src/models/AuthorizationMode.ts @@ -0,0 +1,19 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Determines the type of the authorization that will be used. Allowed values: * PRE_AUTHORIZATION - The payment creation results in a pre-authorization that is ready for Capture. Pre- authortizations can be reversed and can be captured within 30 days. The capture amount can be lower than the authorized amount. * SALE - The payment creation results in an authorization that is already captured at the moment of approval. If the parameter is not provided in the request, the default value will be PRE_AUTHORIZATION + */ +export enum AuthorizationMode { + PreAuthorization = 'PRE_AUTHORIZATION', + Sale = 'SALE', +} diff --git a/src/models/BankAccountInformation.ts b/src/models/BankAccountInformation.ts new file mode 100644 index 0000000..26776ec --- /dev/null +++ b/src/models/BankAccountInformation.ts @@ -0,0 +1,48 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object containing information about the end customer\'s bank account. + */ +export class BankAccountInformation { + /** + * IBAN of the end customer\'s bank account. The IBAN is the International Bank Account Number. It is an internationally agreed format for the BBAN and includes the ISO country code and two check digits. + */ + 'iban': string; + /** + * Account holder of the bank account with the given IBAN. Does not necessarily have to be the end customer (e.g. joint accounts). + */ + 'accountHolder': string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'iban', + baseName: 'iban', + type: 'string', + format: '', + }, + { + name: 'accountHolder', + baseName: 'accountHolder', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return BankAccountInformation.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CancelItem.ts b/src/models/CancelItem.ts new file mode 100644 index 0000000..61682e7 --- /dev/null +++ b/src/models/CancelItem.ts @@ -0,0 +1,45 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export class CancelItem { + /** + * Id of the item to cancel. + */ + 'id': string; + /** + * Quantity of the units being cancelled, should be greater than zero Note: Must not be all spaces or all zeros + */ + 'quantity': number; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'id', + baseName: 'id', + type: 'string', + format: 'UUID', + }, + { + name: 'quantity', + baseName: 'quantity', + type: 'number', + format: 'int64', + }, + ]; + + static getAttributeTypeMap() { + return CancelItem.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CancelPaymentRequest.ts b/src/models/CancelPaymentRequest.ts new file mode 100644 index 0000000..22dab42 --- /dev/null +++ b/src/models/CancelPaymentRequest.ts @@ -0,0 +1,34 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CancellationReason } from '../models/CancellationReason'; + +export class CancelPaymentRequest { + 'cancellationReason'?: CancellationReason; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'cancellationReason', + baseName: 'cancellationReason', + type: 'CancellationReason', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CancelPaymentRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CancelPaymentResponse.ts b/src/models/CancelPaymentResponse.ts new file mode 100644 index 0000000..c8614a5 --- /dev/null +++ b/src/models/CancelPaymentResponse.ts @@ -0,0 +1,34 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { PaymentResponse } from '../models/PaymentResponse'; + +export class CancelPaymentResponse { + 'payment'?: PaymentResponse; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'payment', + baseName: 'payment', + type: 'PaymentResponse', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CancelPaymentResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CancelRequest.ts b/src/models/CancelRequest.ts new file mode 100644 index 0000000..197d3f7 --- /dev/null +++ b/src/models/CancelRequest.ts @@ -0,0 +1,53 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CancelItem } from '../models/CancelItem'; +import { CancelType } from '../models/CancelType'; +import { CancellationReason } from '../models/CancellationReason'; + +/** + * 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. + */ +export class CancelRequest { + 'cancelType'?: CancelType; + 'cancellationReason'?: CancellationReason; + 'cancelItems'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'cancelType', + baseName: 'cancelType', + type: 'CancelType', + format: '', + }, + { + name: 'cancellationReason', + baseName: 'cancellationReason', + type: 'CancellationReason', + format: '', + }, + { + name: 'cancelItems', + baseName: 'cancelItems', + type: 'Array', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CancelRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CancelResponse.ts b/src/models/CancelResponse.ts new file mode 100644 index 0000000..326173f --- /dev/null +++ b/src/models/CancelResponse.ts @@ -0,0 +1,42 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CancelPaymentResponse } from '../models/CancelPaymentResponse'; +import { ShoppingCartResult } from '../models/ShoppingCartResult'; + +export class CancelResponse { + 'cancelPaymentResponse'?: CancelPaymentResponse; + 'shoppingCart'?: ShoppingCartResult; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'cancelPaymentResponse', + baseName: 'cancelPaymentResponse', + type: 'CancelPaymentResponse', + format: '', + }, + { + name: 'shoppingCart', + baseName: 'shoppingCart', + type: 'ShoppingCartResult', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CancelResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CancelType.ts b/src/models/CancelType.ts new file mode 100644 index 0000000..3829beb --- /dev/null +++ b/src/models/CancelType.ts @@ -0,0 +1,19 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * The cancelType refers to the ShoppingCart items of the Checkout. cancelType = FULL should be provided if all items should be marked as cancelled and the payment for the entire ShoppingCart should be reversed. cancelType = PARTIAL should be provided if only certain items should be marked as cancelled and the Cancel should not be made for the entire ShoppingCart. For this type the list of items has to be provided. Please note that a reversal for a partial payment will not reverse the respective amount from the authorization but only reduces the openAmount that is ready for collecting. Following conditions apply to the Cancel request: * items must be in status ORDERED * there was no Capture, Refund or Cancel triggered over the Payment Execution resource * for the cancelType FULL no items are provided in the request Note: If a DISCOUNT productType is among the ShoppingCart items, only cancelType FULL is possible. + */ +export enum CancelType { + Full = 'FULL', + Partial = 'PARTIAL', +} diff --git a/src/models/CancellationReason.ts b/src/models/CancellationReason.ts new file mode 100644 index 0000000..af28fe2 --- /dev/null +++ b/src/models/CancellationReason.ts @@ -0,0 +1,23 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Reason why an order was cancelled. Possible values: * CONSUMER_REQUEST - The consumer requested a cancellation of the Order * UNDELIVERABLE - The merchant cannot fulfill the Order * DUPLICATE - The Order was created twice accidentally * FRAUDULENT- Consumer turned out to be a fraudster * ORDER_SHIPPED_IN_FULL - The merchant shipped everything and wants to cancel the remaining authorized amount of the Order * AUTOMATED_SHIPMENT_FAILED - A technical error was thrown during an automated shipment API call rendering the Order impossible to complete Mandatory for PAYONE Buy Now, Pay Later (BNPL): * 3390 - PAYONE Secured Invoice * 3391 - PAYONE Secured Installment * 3392 - PAYONE Secured Direct Debit + */ +export enum CancellationReason { + ConsumerRequest = 'CONSUMER_REQUEST', + Undeliverable = 'UNDELIVERABLE', + Duplicate = 'DUPLICATE', + Fraudulent = 'FRAUDULENT', + OrderShippedInFull = 'ORDER_SHIPPED_IN_FULL', + AutomatedShipmentFailed = 'AUTOMATED_SHIPMENT_FAILED', +} diff --git a/src/models/CaptureOutput.ts b/src/models/CaptureOutput.ts new file mode 100644 index 0000000..a45bae9 --- /dev/null +++ b/src/models/CaptureOutput.ts @@ -0,0 +1,65 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AmountOfMoney } from '../models/AmountOfMoney'; +import { PaymentReferences } from '../models/PaymentReferences'; + +/** + * Object containing Capture details. + */ +export class CaptureOutput { + 'amountOfMoney'?: AmountOfMoney; + /** + * It allows you to store additional parameters for the transaction in JSON format. This field must not contain any personal data. + */ + 'merchantParameters'?: string; + 'references'?: PaymentReferences; + /** + * Payment method identifier used by our payment engine. + */ + 'paymentMethod'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'amountOfMoney', + baseName: 'amountOfMoney', + type: 'AmountOfMoney', + format: '', + }, + { + name: 'merchantParameters', + baseName: 'merchantParameters', + type: 'string', + format: '', + }, + { + name: 'references', + baseName: 'references', + type: 'PaymentReferences', + format: '', + }, + { + name: 'paymentMethod', + baseName: 'paymentMethod', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CaptureOutput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CapturePaymentRequest.ts b/src/models/CapturePaymentRequest.ts new file mode 100644 index 0000000..d22a0c0 --- /dev/null +++ b/src/models/CapturePaymentRequest.ts @@ -0,0 +1,73 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CancellationReason } from '../models/CancellationReason'; +import { DeliveryInformation } from '../models/DeliveryInformation'; +import { PaymentReferences } from '../models/PaymentReferences'; + +/** + * If the shopping cart is specified, a Capture is made with the amount of the shopping cart for the items that are specified. + */ +export class CapturePaymentRequest { + /** + * Here you can specify the amount that you want to capture (specified in cents, where single digit currencies are presumed to have 2 digits). The amount can be lower than the amount that was authorized, but not higher. If left empty, the full amount will be captured and the request will be final. If the full amount is captured, the request will also be final. + */ + 'amount'?: number; + /** + * This property indicates whether this will be the final operation. If the full amount should not captured but the property is set to true, the remaining amount will automatically be cancelled. + */ + 'isFinal'?: boolean; + 'cancellationReason'?: CancellationReason; + 'references'?: PaymentReferences; + 'delivery'?: DeliveryInformation; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'amount', + baseName: 'amount', + type: 'number', + format: 'int64', + }, + { + name: 'isFinal', + baseName: 'isFinal', + type: 'boolean', + format: '', + }, + { + name: 'cancellationReason', + baseName: 'cancellationReason', + type: 'CancellationReason', + format: '', + }, + { + name: 'references', + baseName: 'references', + type: 'PaymentReferences', + format: '', + }, + { + name: 'delivery', + baseName: 'delivery', + type: 'DeliveryInformation', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CapturePaymentRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CapturePaymentResponse.ts b/src/models/CapturePaymentResponse.ts new file mode 100644 index 0000000..69c153b --- /dev/null +++ b/src/models/CapturePaymentResponse.ts @@ -0,0 +1,60 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CaptureOutput } from '../models/CaptureOutput'; +import { PaymentStatusOutput } from '../models/PaymentStatusOutput'; +import { StatusValue } from '../models/StatusValue'; + +export class CapturePaymentResponse { + 'captureOutput'?: CaptureOutput; + 'status'?: StatusValue; + 'statusOutput'?: PaymentStatusOutput; + /** + * Unique payment transaction identifier of the payment gateway. + */ + 'id'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'captureOutput', + baseName: 'captureOutput', + type: 'CaptureOutput', + format: '', + }, + { + name: 'status', + baseName: 'status', + type: 'StatusValue', + format: '', + }, + { + name: 'statusOutput', + baseName: 'statusOutput', + type: 'PaymentStatusOutput', + format: '', + }, + { + name: 'id', + baseName: 'id', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CapturePaymentResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CardFraudResults.ts b/src/models/CardFraudResults.ts new file mode 100644 index 0000000..0f9b952 --- /dev/null +++ b/src/models/CardFraudResults.ts @@ -0,0 +1,38 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Fraud results contained in the CardFraudResults object. + */ +export class CardFraudResults { + /** + * Result of the Address Verification Service checks. Possible values are: * A - Address (Street) matches, Zip does not * B - Street address match for international transactions—Postal code not verified due to incompatible formats * C - Street address and postal code not verified for international transaction due to incompatible formats * D - Street address and postal code match for international transaction, cardholder name is incorrect * E - AVS error * F - Address does match and five digit ZIP code does match (UK only) * G - Address information is unavailable; international transaction; non-AVS participant * H - Billing address and postal code match, cardholder name is incorrect (Amex) * I - Address information not verified for international transaction * K - Cardholder name matches (Amex) * L - Cardholder name and postal code match (Amex) * M - Cardholder name, street address, and postal code match for international transaction * N - No Match on Address (Street) or Zip * O - Cardholder name and address match (Amex) * P - Postal codes match for international transaction—Street address not verified due to incompatible formats * Q - Billing address matches, cardholder is incorrect (Amex) * R - Retry, System unavailable or Timed out * S - Service not supported by issuer * U - Address information is unavailable * W - 9 digit Zip matches, Address (Street) does not * X - Exact AVS Match * Y - Address (Street) and 5 digit Zip match * Z - 5 digit Zip matches, Address (Street) does not * 0 - No service available + */ + 'avsResult'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'avsResult', + baseName: 'avsResult', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CardFraudResults.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CardInfo.ts b/src/models/CardInfo.ts new file mode 100644 index 0000000..e2058fa --- /dev/null +++ b/src/models/CardInfo.ts @@ -0,0 +1,38 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object containing additional non PCI DSS relevant card information. used instead of card (missing fields: cardNumber, expiryDate, cvv) + */ +export class CardInfo { + /** + * The card holder\'s name on the card. + */ + 'cardholderName'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'cardholderName', + baseName: 'cardholderName', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CardInfo.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CardPaymentDetails.ts b/src/models/CardPaymentDetails.ts new file mode 100644 index 0000000..e173b9b --- /dev/null +++ b/src/models/CardPaymentDetails.ts @@ -0,0 +1,68 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Information for card payments realized at a POS. + */ +export class CardPaymentDetails { + /** + * Reference to the card of the transaction. + */ + 'maskedCardNumber'?: string; + /** + * ID of the token. This property is populated when the payment was done with a token. + */ + 'paymentProcessingToken'?: string; + /** + * Token to identify the card in the reporting. + */ + 'reportingToken'?: string; + /** + * Identifier for a successful authorization, reversal or refund. Usually provided by the issuer system. Only provided for card payments. + */ + 'cardAuthorizationId'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'maskedCardNumber', + baseName: 'maskedCardNumber', + type: 'string', + format: '', + }, + { + name: 'paymentProcessingToken', + baseName: 'paymentProcessingToken', + type: 'string', + format: '', + }, + { + name: 'reportingToken', + baseName: 'reportingToken', + type: 'string', + format: '', + }, + { + name: 'cardAuthorizationId', + baseName: 'cardAuthorizationId', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CardPaymentDetails.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CardPaymentMethodSpecificInput.ts b/src/models/CardPaymentMethodSpecificInput.ts new file mode 100644 index 0000000..0c5a0c6 --- /dev/null +++ b/src/models/CardPaymentMethodSpecificInput.ts @@ -0,0 +1,145 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * 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'; + +/** + * Object containing the specific input details for card payments. + */ +export class CardPaymentMethodSpecificInput { + 'authorizationMode'?: AuthorizationMode; + 'recurring'?: CardRecurrenceDetails; + /** + * ID of the token to use to create the payment. + */ + 'paymentProcessingToken'?: string; + /** + * Token to identify the card in the reporting. + */ + 'reportingToken'?: string; + 'transactionChannel'?: TransactionChannel; + 'unscheduledCardOnFileRequestor'?: UnscheduledCardOnFileRequestor; + 'unscheduledCardOnFileSequenceIndicator'?: UnscheduledCardOnFileSequenceIndicator; + /** + * Payment product identifier - please check product documentation for a full overview of possible values. + */ + 'paymentProductId'?: number; + 'card'?: CardInfo; + /** + * The URL that the customer is redirect to after the payment flow has finished. You can add any number of key value pairs in the query string that, for instance help you to identify the customer when they return to your site. Please note that we will also append some additional key value pairs that will also help you with this identification process. Note: The provided URL should be absolute and contain the protocol to use, e.g. http:// or https://. For use on mobile devices a custom protocol can be used in the form of protocol://. This protocol must be registered on the device first. URLs without a protocol will be rejected. + */ + 'returnUrl'?: string; + /** + * Period of payment occurrence for recurring and installment payments. Allowed values: * Yearly * Quarterly * Monthly * Weekly * Daily Supported soon + */ + 'cardOnFileRecurringFrequency'?: CardPaymentMethodSpecificInputCardOnFileRecurringFrequencyEnum; + /** + * The end date of the last scheduled payment in a series of transactions. Format YYYYMMDD Supported soon + */ + 'cardOnFileRecurringExpiration'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'authorizationMode', + baseName: 'authorizationMode', + type: 'AuthorizationMode', + format: '', + }, + { + name: 'recurring', + baseName: 'recurring', + type: 'CardRecurrenceDetails', + format: '', + }, + { + name: 'paymentProcessingToken', + baseName: 'paymentProcessingToken', + type: 'string', + format: '', + }, + { + name: 'reportingToken', + baseName: 'reportingToken', + type: 'string', + format: '', + }, + { + name: 'transactionChannel', + baseName: 'transactionChannel', + type: 'TransactionChannel', + format: '', + }, + { + name: 'unscheduledCardOnFileRequestor', + baseName: 'unscheduledCardOnFileRequestor', + type: 'UnscheduledCardOnFileRequestor', + format: '', + }, + { + name: 'unscheduledCardOnFileSequenceIndicator', + baseName: 'unscheduledCardOnFileSequenceIndicator', + type: 'UnscheduledCardOnFileSequenceIndicator', + format: '', + }, + { + name: 'paymentProductId', + baseName: 'paymentProductId', + type: 'number', + format: 'int32', + }, + { + name: 'card', + baseName: 'card', + type: 'CardInfo', + format: '', + }, + { + name: 'returnUrl', + baseName: 'returnUrl', + type: 'string', + format: '', + }, + { + name: 'cardOnFileRecurringFrequency', + baseName: 'cardOnFileRecurringFrequency', + type: 'CardPaymentMethodSpecificInputCardOnFileRecurringFrequencyEnum', + format: '', + }, + { + name: 'cardOnFileRecurringExpiration', + baseName: 'cardOnFileRecurringExpiration', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CardPaymentMethodSpecificInput.attributeTypeMap; + } + + public constructor() {} +} + +export enum CardPaymentMethodSpecificInputCardOnFileRecurringFrequencyEnum { + Yearly = 'Yearly', + Quarterly = 'Quarterly', + Monthly = 'Monthly', + Weekly = 'Weekly', + Daily = 'Daily', +} diff --git a/src/models/CardPaymentMethodSpecificOutput.ts b/src/models/CardPaymentMethodSpecificOutput.ts new file mode 100644 index 0000000..8b575e4 --- /dev/null +++ b/src/models/CardPaymentMethodSpecificOutput.ts @@ -0,0 +1,65 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CardFraudResults } from '../models/CardFraudResults'; +import { ThreeDSecureResults } from '../models/ThreeDSecureResults'; + +/** + * Object containing the card payment method details. + */ +export class CardPaymentMethodSpecificOutput { + /** + * Payment product identifier - please check product documentation for a full overview of possible values. + */ + 'paymentProductId'?: number; + /** + * Card Authorization code as returned by the acquirer + */ + 'authorisationCode'?: string; + 'fraudResults'?: CardFraudResults; + 'threeDSecureResults'?: ThreeDSecureResults; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'paymentProductId', + baseName: 'paymentProductId', + type: 'number', + format: 'int32', + }, + { + name: 'authorisationCode', + baseName: 'authorisationCode', + type: 'string', + format: '', + }, + { + name: 'fraudResults', + baseName: 'fraudResults', + type: 'CardFraudResults', + format: '', + }, + { + name: 'threeDSecureResults', + baseName: 'threeDSecureResults', + type: 'ThreeDSecureResults', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CardPaymentMethodSpecificOutput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CardRecurrenceDetails.ts b/src/models/CardRecurrenceDetails.ts new file mode 100644 index 0000000..87d9591 --- /dev/null +++ b/src/models/CardRecurrenceDetails.ts @@ -0,0 +1,38 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object containing data related to recurring. + */ +export class CardRecurrenceDetails { + /** + * * first = This transaction is the first of a series of recurring transactions * recurring = This transaction is a subsequent transaction in a series of recurring transactions Note: For any first of a recurring the system will automatically create a token as you will need to use a token for any subsequent recurring transactions. In case a token already exists this is indicated in the response with a value of False for the isNewToken property in the response. + */ + 'recurringPaymentSequenceIndicator'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'recurringPaymentSequenceIndicator', + baseName: 'recurringPaymentSequenceIndicator', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CardRecurrenceDetails.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CartItemInput.ts b/src/models/CartItemInput.ts new file mode 100644 index 0000000..5bf096a --- /dev/null +++ b/src/models/CartItemInput.ts @@ -0,0 +1,45 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CartItemInvoiceData } from '../models/CartItemInvoiceData'; +import { OrderLineDetailsInput } from '../models/OrderLineDetailsInput'; + +/** + * This object contains information of all items in the cart. If a cart item is provided, the productPrice and quantity is required. + */ +export class CartItemInput { + 'invoiceData'?: CartItemInvoiceData; + 'orderLineDetails'?: OrderLineDetailsInput; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'invoiceData', + baseName: 'invoiceData', + type: 'CartItemInvoiceData', + format: '', + }, + { + name: 'orderLineDetails', + baseName: 'orderLineDetails', + type: 'OrderLineDetailsInput', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CartItemInput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CartItemInvoiceData.ts b/src/models/CartItemInvoiceData.ts new file mode 100644 index 0000000..bd8a03e --- /dev/null +++ b/src/models/CartItemInvoiceData.ts @@ -0,0 +1,38 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object containing the line items of the invoice or shopping cart. + */ +export class CartItemInvoiceData { + /** + * Shopping cart item description. The description will also be displayed in the portal as the product name. + */ + 'description'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'description', + baseName: 'description', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CartItemInvoiceData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CartItemOrderStatus.ts b/src/models/CartItemOrderStatus.ts new file mode 100644 index 0000000..e4e6b95 --- /dev/null +++ b/src/models/CartItemOrderStatus.ts @@ -0,0 +1,47 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CartItemStatus } from './CartItemStatus'; + +/** + * Detailed information regarding an occurred payment event. + */ +export class CartItemOrderStatus { + 'cartItemStatus'?: CartItemStatus; + /** + * Amount of units for which this status is applicable, should be greater than zero + */ + 'quantity'?: number; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'cartItemStatus', + baseName: 'cartItemStatus', + type: 'CartItemStatus', + format: '', + }, + { + name: 'quantity', + baseName: 'quantity', + type: 'number', + format: 'int64', + }, + ]; + + static getAttributeTypeMap() { + return CartItemOrderStatus.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CartItemPatch.ts b/src/models/CartItemPatch.ts new file mode 100644 index 0000000..74ec3ed --- /dev/null +++ b/src/models/CartItemPatch.ts @@ -0,0 +1,45 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CartItemInvoiceData } from './CartItemInvoiceData'; +import { OrderLineDetailsPatch } from './OrderLineDetailsPatch'; + +/** + * This object contains information of all items in the cart. If a cart item is provided, the productPrice and quantity is required. + */ +export class CartItemPatch { + 'invoiceData'?: CartItemInvoiceData; + 'orderLineDetails'?: OrderLineDetailsPatch; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'invoiceData', + baseName: 'invoiceData', + type: 'CartItemInvoiceData', + format: '', + }, + { + name: 'orderLineDetails', + baseName: 'orderLineDetails', + type: 'OrderLineDetailsPatch', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CartItemPatch.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CartItemResult.ts b/src/models/CartItemResult.ts new file mode 100644 index 0000000..41994ba --- /dev/null +++ b/src/models/CartItemResult.ts @@ -0,0 +1,45 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CartItemInvoiceData } from '../models/CartItemInvoiceData'; +import { OrderLineDetailsResult } from '../models/OrderLineDetailsResult'; + +/** + * This object contains information of all items in the cart. If a cart item is provided, the productPrice and quantity is required. + */ +export class CartItemResult { + 'invoiceData'?: CartItemInvoiceData; + 'orderLineDetails'?: OrderLineDetailsResult; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'invoiceData', + baseName: 'invoiceData', + type: 'CartItemInvoiceData', + format: '', + }, + { + name: 'orderLineDetails', + baseName: 'orderLineDetails', + type: 'OrderLineDetailsResult', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CartItemResult.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CartItemStatus.ts b/src/models/CartItemStatus.ts new file mode 100644 index 0000000..0a5a7c3 --- /dev/null +++ b/src/models/CartItemStatus.ts @@ -0,0 +1,22 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Indicates in which status the line item is + */ +export enum CartItemStatus { + Ordered = 'ORDERED', + Delivered = 'DELIVERED', + Cancelled = 'CANCELLED', + Returned = 'RETURNED', + WaitingForPayment = 'WAITING_FOR_PAYMENT', +} diff --git a/src/models/CheckoutReferences.ts b/src/models/CheckoutReferences.ts new file mode 100644 index 0000000..1380492 --- /dev/null +++ b/src/models/CheckoutReferences.ts @@ -0,0 +1,48 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object containing all details that are linked to the Checkout. + */ +export class CheckoutReferences { + /** + * Unique reference of the Checkout that is also returned for reporting and reconciliation purposes. + */ + 'merchantReference'?: string; + /** + * Optional parameter to define the shop or touchpoint where a sale has been realized (e.g. different stores). + */ + 'merchantShopReference'?: string; + + 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: 'merchantShopReference', + baseName: 'merchantShopReference', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CheckoutReferences.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CheckoutResponse.ts b/src/models/CheckoutResponse.ts new file mode 100644 index 0000000..86167d8 --- /dev/null +++ b/src/models/CheckoutResponse.ts @@ -0,0 +1,141 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * 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'; + +/** + * 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. + */ +export class CheckoutResponse { + /** + * reference to the Commerce Case. + */ + 'commerceCaseId'?: string; + /** + * reference to the Checkout. + */ + 'checkoutId'?: string; + /** + * Unique identifier for the customer. + */ + 'merchantCustomerId'?: string; + 'amountOfMoney'?: AmountOfMoney; + 'references'?: CheckoutReferences; + 'shipping'?: Shipping; + 'shoppingCart'?: ShoppingCartResult; + 'paymentExecutions'?: Array; + 'checkoutStatus'?: StatusCheckout; + 'statusOutput'?: StatusOutput; + 'paymentInformation'?: Array; + /** + * 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; + 'allowedPaymentActions'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'commerceCaseId', + baseName: 'commerceCaseId', + type: 'string', + format: 'UUID', + }, + { + name: 'checkoutId', + baseName: 'checkoutId', + type: 'string', + format: 'UUID', + }, + { + name: 'merchantCustomerId', + baseName: 'merchantCustomerId', + type: 'string', + format: '', + }, + { + name: 'amountOfMoney', + baseName: 'amountOfMoney', + type: 'AmountOfMoney', + format: '', + }, + { + name: 'references', + baseName: 'references', + type: 'CheckoutReferences', + format: '', + }, + { + name: 'shipping', + baseName: 'shipping', + type: 'Shipping', + format: '', + }, + { + name: 'shoppingCart', + baseName: 'shoppingCart', + type: 'ShoppingCartResult', + format: '', + }, + { + name: 'paymentExecutions', + baseName: 'paymentExecutions', + type: 'Array', + format: '', + }, + { + name: 'checkoutStatus', + baseName: 'checkoutStatus', + type: 'StatusCheckout', + format: '', + }, + { + name: 'statusOutput', + baseName: 'statusOutput', + type: 'StatusOutput', + format: '', + }, + { + name: 'paymentInformation', + baseName: 'paymentInformation', + type: 'Array', + format: '', + }, + { + name: 'creationDateTime', + baseName: 'creationDateTime', + type: 'Date', + format: 'date-time', + }, + { + name: 'allowedPaymentActions', + baseName: 'allowedPaymentActions', + type: 'Array', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CheckoutResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CheckoutsResponse.ts b/src/models/CheckoutsResponse.ts new file mode 100644 index 0000000..e0f589d --- /dev/null +++ b/src/models/CheckoutsResponse.ts @@ -0,0 +1,50 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CheckoutResponse } from '../models/CheckoutResponse'; + +/** + * Object that holds the number of found Checkouts and the requested page of Checkouts + */ +export class CheckoutsResponse { + /** + * Number of found Checkouts + */ + 'numberOfCheckouts'?: number; + /** + * List of Checkouts + */ + 'checkouts'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'numberOfCheckouts', + baseName: 'numberOfCheckouts', + type: 'number', + format: 'int64', + }, + { + name: 'checkouts', + baseName: 'checkouts', + type: 'Array', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CheckoutsResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CommerceCaseResponse.ts b/src/models/CommerceCaseResponse.ts new file mode 100644 index 0000000..58cbd30 --- /dev/null +++ b/src/models/CommerceCaseResponse.ts @@ -0,0 +1,72 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CheckoutResponse } from '../models/CheckoutResponse'; +import { Customer } from '../models/Customer'; + +export class CommerceCaseResponse { + /** + * Unique reference of the Commerce Case that is also returned for reporting and reconciliation purposes. + */ + 'merchantReference'?: string; + /** + * Unique ID reference of the Commerce Case. It can be used to add additional Checkouts to the Commerce Case. + */ + 'commerceCaseId'?: string; + 'customer'?: Customer; + 'checkouts'?: Array; + /** + * 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; + + 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: 'commerceCaseId', + baseName: 'commerceCaseId', + type: 'string', + format: 'UUID', + }, + { + name: 'customer', + baseName: 'customer', + type: 'Customer', + format: '', + }, + { + name: 'checkouts', + baseName: 'checkouts', + type: 'Array', + format: '', + }, + { + name: 'creationDateTime', + baseName: 'creationDateTime', + type: 'Date', + format: 'date-time', + }, + ]; + + static getAttributeTypeMap() { + return CommerceCaseResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CompanyInformation.ts b/src/models/CompanyInformation.ts new file mode 100644 index 0000000..4a7a616 --- /dev/null +++ b/src/models/CompanyInformation.ts @@ -0,0 +1,38 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object containing details of the company. + */ +export class CompanyInformation { + /** + * Name of company from a customer perspective + */ + 'name'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'name', + baseName: 'name', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CompanyInformation.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CompleteFinancingPaymentMethodSpecificInput.ts b/src/models/CompleteFinancingPaymentMethodSpecificInput.ts new file mode 100644 index 0000000..ab67d59 --- /dev/null +++ b/src/models/CompleteFinancingPaymentMethodSpecificInput.ts @@ -0,0 +1,57 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { PaymentProduct3391SpecificInput } from '../models/PaymentProduct3391SpecificInput'; + +/** + * To complete the Payment the completeFinancingMethodSpecificInput has to be provided. At the moment it is only available for PAYONE Secured Installment (paymentProductId 3391). + */ +export class CompleteFinancingPaymentMethodSpecificInput { + /** + * Payment product identifier. Currently supported payment methods: * 3391 - PAYONE Secured Installment + */ + 'paymentProductId'?: number; + /** + * * true = the payment requires approval before the funds will be captured using the Approve payment or Capture payment API * false = the payment does not require approval, and the funds will be captured automatically If the parameter is not provided in the request, the default value will be true + */ + 'requiresApproval'?: boolean; + 'paymentProduct3391SpecificInput'?: PaymentProduct3391SpecificInput; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'paymentProductId', + baseName: 'paymentProductId', + type: 'number', + format: 'int32', + }, + { + name: 'requiresApproval', + baseName: 'requiresApproval', + type: 'boolean', + format: '', + }, + { + name: 'paymentProduct3391SpecificInput', + baseName: 'paymentProduct3391SpecificInput', + type: 'PaymentProduct3391SpecificInput', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CompleteFinancingPaymentMethodSpecificInput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CompletePaymentMethodSpecificInput.ts b/src/models/CompletePaymentMethodSpecificInput.ts new file mode 100644 index 0000000..3f503c7 --- /dev/null +++ b/src/models/CompletePaymentMethodSpecificInput.ts @@ -0,0 +1,37 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { PaymentProduct3391SpecificInput } from '../models/PaymentProduct3391SpecificInput'; + +/** + * To complete the Order the completePaymentMethodSpecificInput has to be provided, containing the selected installmentOptionId as well as the the bankAccountInformation of the customer. + */ +export class CompletePaymentMethodSpecificInput { + 'paymentProduct3391SpecificInput'?: PaymentProduct3391SpecificInput; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'paymentProduct3391SpecificInput', + baseName: 'paymentProduct3391SpecificInput', + type: 'PaymentProduct3391SpecificInput', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CompletePaymentMethodSpecificInput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CompletePaymentRequest.ts b/src/models/CompletePaymentRequest.ts new file mode 100644 index 0000000..fdd988c --- /dev/null +++ b/src/models/CompletePaymentRequest.ts @@ -0,0 +1,53 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CompleteFinancingPaymentMethodSpecificInput } from '../models/CompleteFinancingPaymentMethodSpecificInput'; +import { CustomerDevice } from '../models/CustomerDevice'; +import { Order } from '../models/Order'; + +/** + * 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. + */ +export class CompletePaymentRequest { + 'financingPaymentMethodSpecificInput'?: CompleteFinancingPaymentMethodSpecificInput; + 'order'?: Order; + 'device'?: CustomerDevice; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'financingPaymentMethodSpecificInput', + baseName: 'financingPaymentMethodSpecificInput', + type: 'CompleteFinancingPaymentMethodSpecificInput', + format: '', + }, + { + name: 'order', + baseName: 'order', + type: 'Order', + format: '', + }, + { + name: 'device', + baseName: 'device', + type: 'CustomerDevice', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CompletePaymentRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CompletePaymentResponse.ts b/src/models/CompletePaymentResponse.ts new file mode 100644 index 0000000..5b863ba --- /dev/null +++ b/src/models/CompletePaymentResponse.ts @@ -0,0 +1,50 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { MerchantAction } from '../models/MerchantAction'; +import { PaymentCreationOutput } from '../models/PaymentCreationOutput'; +import { PaymentResponse } from '../models/PaymentResponse'; + +export class CompletePaymentResponse { + 'creationOutput'?: PaymentCreationOutput; + 'merchantAction'?: MerchantAction; + 'payment'?: PaymentResponse; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'creationOutput', + baseName: 'creationOutput', + type: 'PaymentCreationOutput', + format: '', + }, + { + name: 'merchantAction', + baseName: 'merchantAction', + type: 'MerchantAction', + format: '', + }, + { + name: 'payment', + baseName: 'payment', + type: 'PaymentResponse', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CompletePaymentResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/ContactDetails.ts b/src/models/ContactDetails.ts new file mode 100644 index 0000000..578b124 --- /dev/null +++ b/src/models/ContactDetails.ts @@ -0,0 +1,48 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object containing contact details like email address and phone number. + */ +export class ContactDetails { + /** + * Email address of the customer + */ + 'emailAddress'?: string; + /** + * Phone number of the customer + */ + 'phoneNumber'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'emailAddress', + baseName: 'emailAddress', + type: 'string', + format: '', + }, + { + name: 'phoneNumber', + baseName: 'phoneNumber', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return ContactDetails.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CreateCheckoutRequest.ts b/src/models/CreateCheckoutRequest.ts new file mode 100644 index 0000000..e58922f --- /dev/null +++ b/src/models/CreateCheckoutRequest.ts @@ -0,0 +1,89 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * 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'; + +/** + * 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. + */ +export class CreateCheckoutRequest { + 'amountOfMoney'?: AmountOfMoney; + 'references'?: CheckoutReferences; + 'shipping'?: Shipping; + 'shoppingCart'?: ShoppingCartInput; + 'orderRequest'?: OrderRequest; + /** + * 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; + /** + * Set this flag to directly execute a payment when creating a Commerce Case or Checkout. If the value for autoExecuteOrder is set to true, the paymentMethodSpecificInput for the order is mandatory and has to be provided. The autoExecuteOrder can only be used for orderType = full. If no shoppingCart information has been provided, a Payment Execution will be created instead of an Order. As a consequence, only Payment Execution endpoints can be used. + */ + 'autoExecuteOrder'?: boolean; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'amountOfMoney', + baseName: 'amountOfMoney', + type: 'AmountOfMoney', + format: '', + }, + { + name: 'references', + baseName: 'references', + type: 'CheckoutReferences', + format: '', + }, + { + name: 'shipping', + baseName: 'shipping', + type: 'Shipping', + format: '', + }, + { + name: 'shoppingCart', + baseName: 'shoppingCart', + type: 'ShoppingCartInput', + format: '', + }, + { + name: 'orderRequest', + baseName: 'orderRequest', + type: 'OrderRequest', + format: '', + }, + { + name: 'creationDateTime', + baseName: 'creationDateTime', + type: 'Date', + format: 'date-time', + }, + { + name: 'autoExecuteOrder', + baseName: 'autoExecuteOrder', + type: 'boolean', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CreateCheckoutRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CreateCheckoutResponse.ts b/src/models/CreateCheckoutResponse.ts new file mode 100644 index 0000000..379a414 --- /dev/null +++ b/src/models/CreateCheckoutResponse.ts @@ -0,0 +1,129 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * 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'; + +/** + * Object containing the reference of the Checkout for following requests. + */ +export class CreateCheckoutResponse { + /** + * Reference to the Checkout. Can be used for following requests to get and update the Checkout and execute the payment. + */ + 'checkoutId'?: string; + 'shoppingCart'?: ShoppingCartResult; + 'paymentResponse'?: CreatePaymentResponse; + 'errorResponse'?: ErrorResponse; + 'amountOfMoney'?: AmountOfMoney; + 'references'?: CheckoutReferences; + 'shipping'?: Shipping; + 'paymentExecution'?: PaymentExecution; + 'checkoutStatus'?: StatusCheckout; + 'statusOutput'?: StatusOutput; + /** + * 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; + 'allowedPaymentActions'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'checkoutId', + baseName: 'checkoutId', + type: 'string', + format: 'UUID', + }, + { + name: 'shoppingCart', + baseName: 'shoppingCart', + type: 'ShoppingCartResult', + format: '', + }, + { + name: 'paymentResponse', + baseName: 'paymentResponse', + type: 'CreatePaymentResponse', + format: '', + }, + { + name: 'errorResponse', + baseName: 'errorResponse', + type: 'ErrorResponse', + format: '', + }, + { + name: 'amountOfMoney', + baseName: 'amountOfMoney', + type: 'AmountOfMoney', + format: '', + }, + { + name: 'references', + baseName: 'references', + type: 'CheckoutReferences', + format: '', + }, + { + name: 'shipping', + baseName: 'shipping', + type: 'Shipping', + format: '', + }, + { + name: 'paymentExecution', + baseName: 'paymentExecution', + type: 'PaymentExecution', + format: '', + }, + { + name: 'checkoutStatus', + baseName: 'checkoutStatus', + type: 'StatusCheckout', + format: '', + }, + { + name: 'statusOutput', + baseName: 'statusOutput', + type: 'StatusOutput', + format: '', + }, + { + name: 'creationDateTime', + baseName: 'creationDateTime', + type: 'Date', + format: 'date-time', + }, + { + name: 'allowedPaymentActions', + baseName: 'allowedPaymentActions', + type: 'Array', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CreateCheckoutResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CreateCommerceCaseRequest.ts b/src/models/CreateCommerceCaseRequest.ts new file mode 100644 index 0000000..a65576e --- /dev/null +++ b/src/models/CreateCommerceCaseRequest.ts @@ -0,0 +1,62 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CreateCheckoutRequest } from '../models/CreateCheckoutRequest'; +import { Customer } from '../models/Customer'; + +export class CreateCommerceCaseRequest { + /** + * Unique reference of the Commerce Case that is also returned for reporting and reconciliation purposes. + */ + 'merchantReference'?: string; + 'customer'?: Customer; + /** + * 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; + + 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() {} +} diff --git a/src/models/CreateCommerceCaseResponse.ts b/src/models/CreateCommerceCaseResponse.ts new file mode 100644 index 0000000..f54fb98 --- /dev/null +++ b/src/models/CreateCommerceCaseResponse.ts @@ -0,0 +1,75 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CreateCheckoutResponse } from '../models/CreateCheckoutResponse'; +import { Customer } from '../models/Customer'; + +/** + * 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. + */ +export class CreateCommerceCaseResponse { + /** + * Unique ID of the Commerce Case. It can used to add additional Checkouts to the Commerce Case. + */ + 'commerceCaseId'?: string; + /** + * Unique reference of the Commerce Case that is also returned for reporting and reconciliation purposes. + */ + 'merchantReference'?: string; + 'customer'?: Customer; + 'checkout'?: CreateCheckoutResponse; + /** + * 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; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'commerceCaseId', + baseName: 'commerceCaseId', + type: 'string', + format: 'UUID', + }, + { + name: 'merchantReference', + baseName: 'merchantReference', + type: 'string', + format: '', + }, + { + name: 'customer', + baseName: 'customer', + type: 'Customer', + format: '', + }, + { + name: 'checkout', + baseName: 'checkout', + type: 'CreateCheckoutResponse', + format: '', + }, + { + name: 'creationDateTime', + baseName: 'creationDateTime', + type: 'Date', + format: 'date-time', + }, + ]; + + static getAttributeTypeMap() { + return CreateCommerceCaseResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CreatePaymentResponse.ts b/src/models/CreatePaymentResponse.ts new file mode 100644 index 0000000..0b85b67 --- /dev/null +++ b/src/models/CreatePaymentResponse.ts @@ -0,0 +1,63 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { MerchantAction } from '../models/MerchantAction'; +import { PaymentCreationOutput } from '../models/PaymentCreationOutput'; +import { PaymentResponse } from '../models/PaymentResponse'; + +/** + * Object containing details on the created payment it has directly be executed. + */ +export class CreatePaymentResponse { + 'creationOutput'?: PaymentCreationOutput; + 'merchantAction'?: MerchantAction; + 'payment'?: PaymentResponse; + /** + * reference to the paymentExecution. + */ + 'paymentExecutionId'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'creationOutput', + baseName: 'creationOutput', + type: 'PaymentCreationOutput', + format: '', + }, + { + name: 'merchantAction', + baseName: 'merchantAction', + type: 'MerchantAction', + format: '', + }, + { + name: 'payment', + baseName: 'payment', + type: 'PaymentResponse', + format: '', + }, + { + name: 'paymentExecutionId', + baseName: 'paymentExecutionId', + type: 'string', + format: 'UUID', + }, + ]; + + static getAttributeTypeMap() { + return CreatePaymentResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/Customer.ts b/src/models/Customer.ts new file mode 100644 index 0000000..ab379d0 --- /dev/null +++ b/src/models/Customer.ts @@ -0,0 +1,101 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * 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'; + +/** + * Object containing the details of a customer. + */ +export class Customer { + 'companyInformation'?: CompanyInformation; + /** + * Unique identifier for the customer. + */ + 'merchantCustomerId'?: string; + 'billingAddress'?: Address; + 'contactDetails'?: ContactDetails; + /** + * Fiscal registration number of the customer or the tax registration number of the company for a business customer. Please find below specifics per country: * Brazil - Consumer (CPF) with a length of 11 digits * Brazil - Company (CNPJ) with a length of 14 digits * Denmark - Consumer (CPR-nummer or personnummer) with a length of 10 digits * Finland - Consumer (Finnish: henkilötunnus (abbreviated as HETU), Swedish: personbeteckning) with a length of 11 characters * Norway - Consumer (fødselsnummer) with a length of 11 digits * Sweden - Consumer (personnummer) with a length of 10 or 12 digits + */ + 'fiscalNumber'?: string; + /** + * Business relation to the customer. Possible values: * B2C - Indicates business to consumer * B2B - Indicates business to business Mandatory for the the following payment methods: * 3390 - PAYONE Secured Invoice * 3391 - PAYONE Secured Installment * 3392 - PAYONE Secured Direct Debit + */ + 'businessRelation'?: string; + /** + * The locale that the customer should be addressed in (for 3rd parties). Note: Only the language code is supported. + */ + 'locale'?: string; + 'personalInformation'?: PersonalInformation; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'companyInformation', + baseName: 'companyInformation', + type: 'CompanyInformation', + format: '', + }, + { + name: 'merchantCustomerId', + baseName: 'merchantCustomerId', + type: 'string', + format: '', + }, + { + name: 'billingAddress', + baseName: 'billingAddress', + type: 'Address', + format: '', + }, + { + name: 'contactDetails', + baseName: 'contactDetails', + type: 'ContactDetails', + format: '', + }, + { + name: 'fiscalNumber', + baseName: 'fiscalNumber', + type: 'string', + format: '', + }, + { + name: 'businessRelation', + baseName: 'businessRelation', + type: 'string', + format: '', + }, + { + name: 'locale', + baseName: 'locale', + type: 'string', + format: '', + }, + { + name: 'personalInformation', + baseName: 'personalInformation', + type: 'PersonalInformation', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return Customer.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/CustomerDevice.ts b/src/models/CustomerDevice.ts new file mode 100644 index 0000000..262b51b --- /dev/null +++ b/src/models/CustomerDevice.ts @@ -0,0 +1,48 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object containing information about the device of the end customer. + */ +export class CustomerDevice { + /** + * The IP address of the customer client from the HTTP Headers. + */ + 'ipAddress'?: string; + /** + * Tokenized representation of the end customers device. For example used for PAYONE Buy Now, Pay Later (BNPL). + */ + 'deviceToken'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'ipAddress', + baseName: 'ipAddress', + type: 'string', + format: '', + }, + { + name: 'deviceToken', + baseName: 'deviceToken', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return CustomerDevice.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/DeliverItem.ts b/src/models/DeliverItem.ts new file mode 100644 index 0000000..e302e30 --- /dev/null +++ b/src/models/DeliverItem.ts @@ -0,0 +1,45 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export class DeliverItem { + /** + * Id of the item to deliver. + */ + 'id': string; + /** + * Quantity of the units being delivered, should be greater than zero Note: Must not be all spaces or all zeros + */ + 'quantity': number; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'id', + baseName: 'id', + type: 'string', + format: 'UUID', + }, + { + name: 'quantity', + baseName: 'quantity', + type: 'number', + format: 'int64', + }, + ]; + + static getAttributeTypeMap() { + return DeliverItem.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/DeliverRequest.ts b/src/models/DeliverRequest.ts new file mode 100644 index 0000000..bcc8f06 --- /dev/null +++ b/src/models/DeliverRequest.ts @@ -0,0 +1,63 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CancellationReason } from '../models/CancellationReason'; +import { DeliverItem } from '../models/DeliverItem'; +import { DeliverType } from '../models/DeliverType'; + +/** + * 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. + */ +export class DeliverRequest { + 'deliverType'?: DeliverType; + /** + * This property indicates whether this will be the final operation. For deliverType FULL, it is always the final operation. If deliverType PARTIAL is provided and the property is set to true, the remaining amount of the items will be cancelled and the items are marked as CANCELLED. + */ + 'isFinal'?: boolean; + 'cancellationReason'?: CancellationReason; + 'deliverItems'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'deliverType', + baseName: 'deliverType', + type: 'DeliverType', + format: '', + }, + { + name: 'isFinal', + baseName: 'isFinal', + type: 'boolean', + format: '', + }, + { + name: 'cancellationReason', + baseName: 'cancellationReason', + type: 'CancellationReason', + format: '', + }, + { + name: 'deliverItems', + baseName: 'deliverItems', + type: 'Array', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return DeliverRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/DeliverResponse.ts b/src/models/DeliverResponse.ts new file mode 100644 index 0000000..00666c8 --- /dev/null +++ b/src/models/DeliverResponse.ts @@ -0,0 +1,42 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CapturePaymentResponse } from '../models/CapturePaymentResponse'; +import { ShoppingCartResult } from '../models/ShoppingCartResult'; + +export class DeliverResponse { + 'capturePaymentResponse'?: CapturePaymentResponse; + 'shoppingCart'?: ShoppingCartResult; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'capturePaymentResponse', + baseName: 'capturePaymentResponse', + type: 'CapturePaymentResponse', + format: '', + }, + { + name: 'shoppingCart', + baseName: 'shoppingCart', + type: 'ShoppingCartResult', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return DeliverResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/DeliverType.ts b/src/models/DeliverType.ts new file mode 100644 index 0000000..24f40bc --- /dev/null +++ b/src/models/DeliverType.ts @@ -0,0 +1,19 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * The deliverType refers to the ShoppingCart items of the Checkout. deliverType = FULL should be provided if all items should be marked as delivered and the payment for the entire ShoppingCart should be captured. deliverType = PARTIAL should be provided if only certain items should be marked as delivered and the Capture should not be made for the entire ShoppingCart. For this type the list of items has to be provided. Following conditions apply to the Deliver request: * items must be in status ORDERED * there was no Capture, Refund or Cancel triggered over the Payment Execution resource * for the deliverType FULL no items are provided in the request Note: If a DISCOUNT productType is among the ShoppingCart items, only deliverType FULL is possible. + */ +export enum DeliverType { + Full = 'FULL', + Partial = 'PARTIAL', +} diff --git a/src/models/DeliveryInformation.ts b/src/models/DeliveryInformation.ts new file mode 100644 index 0000000..16b1e26 --- /dev/null +++ b/src/models/DeliveryInformation.ts @@ -0,0 +1,40 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CartItemInput } from '../models/CartItemInput'; + +/** + * 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. + */ +export class DeliveryInformation { + /** + * Items delivered. + */ + 'items'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'items', + baseName: 'items', + type: 'Array', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return DeliveryInformation.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/ErrorResponse.ts b/src/models/ErrorResponse.ts new file mode 100644 index 0000000..a62c533 --- /dev/null +++ b/src/models/ErrorResponse.ts @@ -0,0 +1,44 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { APIError } from '../models/APIError'; + +export class ErrorResponse { + /** + * Unique reference of this error response for debugging purposes + */ + 'errorId'?: string; + 'errors'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'errorId', + baseName: 'errorId', + type: 'string', + format: '', + }, + { + name: 'errors', + baseName: 'errors', + type: 'Array', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return ErrorResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/ExtendedCheckoutStatus.ts b/src/models/ExtendedCheckoutStatus.ts new file mode 100644 index 0000000..3bbbdd6 --- /dev/null +++ b/src/models/ExtendedCheckoutStatus.ts @@ -0,0 +1,26 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * The extendedCheckoutStatus provides a more granular status of the Checkout based on the respective amounts. The extendedCheckoutStatus include the regular Checkout status OPEN, DELETED, PENDING_COMPLETION, COMPLETED, BILLED, and CHARGEBACKED as well as three additional status: 1. PARTIALLY_BILLED: Checkout amount has been partially collected. Overall the Checkout status is BILLED and one of the following conditions is true: (1) the openAmount is greater than zero or (2) the openAmount is zero, the refundAmount is zero and the checkoutAmount is not equal to collectedAmount plus the cancelledAmount. 2. PARTIALLY_REFUNDED: The entire Checkout amount has been captured and an amount has been partially refunded to customer. Overall the Checkout status is BILLED, the openAmount is zero and the refundAmount and collectedAmount are greater than zero. 3. REFUNDED: The entire Checkout amount has been refunded to the customer. Overall the Checkout status is BILLED, the openAmount and collectedAmount are zero but the refundAmount is greater than zero. + */ +export enum ExtendedCheckoutStatus { + Open = 'OPEN', + Deleted = 'DELETED', + PendingCompletion = 'PENDING_COMPLETION', + Completed = 'COMPLETED', + PartiallyBilled = 'PARTIALLY_BILLED', + Billed = 'BILLED', + Chargebacked = 'CHARGEBACKED', + PartiallyRefunded = 'PARTIALLY_REFUNDED', + Refunded = 'REFUNDED', +} diff --git a/src/models/FinancingPaymentMethodSpecificInput.ts b/src/models/FinancingPaymentMethodSpecificInput.ts new file mode 100644 index 0000000..35440a4 --- /dev/null +++ b/src/models/FinancingPaymentMethodSpecificInput.ts @@ -0,0 +1,57 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { PaymentProduct3392SpecificInput } from '../models/PaymentProduct3392SpecificInput'; + +/** + * Object containing the specific input details for financing payment methods (Buy Now Pay Later) + */ +export class FinancingPaymentMethodSpecificInput { + /** + * Payment product identifier - please check product documentation for a full overview of possible values. Currently supported payment methods * 3390 - PAYONE Secured Invoice * 3391 - PAYONE Secured Installment * 3392 - PAYONE Secured Direct Debit + */ + 'paymentProductId'?: number; + /** + * * true = the payment requires approval before the funds will be captured using the Approve payment or Capture payment API * false = the payment does not require approval, and the funds will be captured automatically If the parameter is not provided in the request, the default value will be true + */ + 'requiresApproval'?: boolean; + 'paymentProduct3392SpecificInput'?: PaymentProduct3392SpecificInput; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'paymentProductId', + baseName: 'paymentProductId', + type: 'number', + format: 'int32', + }, + { + name: 'requiresApproval', + baseName: 'requiresApproval', + type: 'boolean', + format: '', + }, + { + name: 'paymentProduct3392SpecificInput', + baseName: 'paymentProduct3392SpecificInput', + type: 'PaymentProduct3392SpecificInput', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return FinancingPaymentMethodSpecificInput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/FinancingPaymentMethodSpecificOutput.ts b/src/models/FinancingPaymentMethodSpecificOutput.ts new file mode 100644 index 0000000..32e3480 --- /dev/null +++ b/src/models/FinancingPaymentMethodSpecificOutput.ts @@ -0,0 +1,47 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { PaymentProduct3391SpecificOutput } from '../models/PaymentProduct3391SpecificOutput'; + +/** + * Object containing the specific output details for financing payment methods (Buy Now Pay Later) + */ +export class FinancingPaymentMethodSpecificOutput { + /** + * Payment product identifier - please check product documentation for a full overview of possible values. Currently supported payment methods * 3390 - PAYONE Secured Invoice * 3391 - PAYONE Secured Installment * 3392 - PAYONE Secured Direct Debit + */ + 'paymentProductId'?: number; + 'paymentProduct3391SpecificOutput'?: PaymentProduct3391SpecificOutput; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'paymentProductId', + baseName: 'paymentProductId', + type: 'number', + format: 'int32', + }, + { + name: 'paymentProduct3391SpecificOutput', + baseName: 'paymentProduct3391SpecificOutput', + type: 'PaymentProduct3391SpecificOutput', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return FinancingPaymentMethodSpecificOutput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/InstallmentOption.ts b/src/models/InstallmentOption.ts new file mode 100644 index 0000000..f3c4482 --- /dev/null +++ b/src/models/InstallmentOption.ts @@ -0,0 +1,118 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AmountOfMoney } from '../models/AmountOfMoney'; +import { LinkInformation } from '../models/LinkInformation'; + +export class InstallmentOption { + /** + * Installment option Identifier. Use this in the Complete Payment for the selected installment option. + */ + 'installmentOptionId': string; + /** + * The number of monthly payments for this installment. + */ + 'numberOfPayments': number; + /** + * Monthly rate amount. + */ + 'monthlyAmount': AmountOfMoney; + /** + * Last rate amount. + */ + 'lastRateAmount': AmountOfMoney; + /** + * Effective interest amount in percent with two decimals. + */ + 'effectiveInterestRate': number; + /** + * Nominal interest amount in percent with two decimals. + */ + 'nominalInterestRate': number; + /** + * Total rate amount. + */ + 'totalAmount': AmountOfMoney; + /** + * Due date of first rate. Format: YYYYMMDD + */ + 'firstRateDate': string; + /** + * Link with credit information. + */ + 'creditInformation': LinkInformation; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'installmentOptionId', + baseName: 'installmentOptionId', + type: 'string', + format: '', + }, + { + name: 'numberOfPayments', + baseName: 'numberOfPayments', + type: 'number', + format: 'int32', + }, + { + name: 'monthlyAmount', + baseName: 'monthlyAmount', + type: 'AmountOfMoney', + format: '', + }, + { + name: 'lastRateAmount', + baseName: 'lastRateAmount', + type: 'AmountOfMoney', + format: '', + }, + { + name: 'effectiveInterestRate', + baseName: 'effectiveInterestRate', + type: 'number', + format: 'int32', + }, + { + name: 'nominalInterestRate', + baseName: 'nominalInterestRate', + type: 'number', + format: 'int32', + }, + { + name: 'totalAmount', + baseName: 'totalAmount', + type: 'AmountOfMoney', + format: '', + }, + { + name: 'firstRateDate', + baseName: 'firstRateDate', + type: 'string', + format: '', + }, + { + name: 'creditInformation', + baseName: 'creditInformation', + type: 'LinkInformation', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return InstallmentOption.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/LinkInformation.ts b/src/models/LinkInformation.ts new file mode 100644 index 0000000..5bb6def --- /dev/null +++ b/src/models/LinkInformation.ts @@ -0,0 +1,48 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * URL and content type information for an web resource. + */ +export class LinkInformation { + /** + * URL of link. + */ + 'href': string; + /** + * Content type of linked data. + */ + 'type': string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'href', + baseName: 'href', + type: 'string', + format: '', + }, + { + name: 'type', + baseName: 'type', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return LinkInformation.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/MandateRecurrenceType.ts b/src/models/MandateRecurrenceType.ts new file mode 100644 index 0000000..361bff8 --- /dev/null +++ b/src/models/MandateRecurrenceType.ts @@ -0,0 +1,19 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Specifies whether the mandate is for one-off or recurring payments. Possible values are: * UNIQUE * RECURRING + */ +export enum MandateRecurrenceType { + Unique = 'UNIQUE', + Recurring = 'RECURRING', +} diff --git a/src/models/MerchantAction.ts b/src/models/MerchantAction.ts new file mode 100644 index 0000000..3ffcea3 --- /dev/null +++ b/src/models/MerchantAction.ts @@ -0,0 +1,47 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RedirectData } from '../models/RedirectData'; + +/** + * 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 + */ +export class MerchantAction { + /** + * Action merchants needs to take in the online payment process. Possible values are: * REDIRECT - The customer needs to be redirected using the details found in redirectData * SHOW_FORM - The customer needs to be shown a form with the fields found in formFields. You can submit the data entered by the user in a Complete payment request. * SHOW_INSTRUCTIONS - The customer needs to be shown payment instruction using the details found in showData. Alternatively the instructions can be rendered by us using the instructionsRenderingData * SHOW_TRANSACTION_RESULTS - The customer needs to be shown the transaction results using the details found in showData. Alternatively the instructions can be rendered by us using the instructionsRenderingData * MOBILE_THREEDS_CHALLENGE - The customer needs to complete a challenge as part of the 3D Secure authentication inside your mobile app. The details contained in mobileThreeDSecureChallengeParameters need to be provided to the EMVco certified Mobile SDK as a challengeParameters object. * CALL_THIRD_PARTY - The merchant needs to call a third party using the data found in thirdPartyData + */ + 'actionType'?: string; + 'redirectData'?: RedirectData; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'actionType', + baseName: 'actionType', + type: 'string', + format: '', + }, + { + name: 'redirectData', + baseName: 'redirectData', + type: 'RedirectData', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return MerchantAction.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/MobilePaymentMethodSpecificInput.ts b/src/models/MobilePaymentMethodSpecificInput.ts new file mode 100644 index 0000000..6af408e --- /dev/null +++ b/src/models/MobilePaymentMethodSpecificInput.ts @@ -0,0 +1,85 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AuthorizationMode } from '../models/AuthorizationMode'; +import { PaymentProduct320SpecificInput } from '../models/PaymentProduct320SpecificInput'; + +/** + * Object containing the specific input details for mobile payments. + */ +export class MobilePaymentMethodSpecificInput { + /** + * Payment product identifier - please check product documentation for a full overview of possible values. + */ + 'paymentProductId'?: number; + 'authorizationMode'?: AuthorizationMode; + /** + * The payment data if we will do the decryption of the encrypted payment data. Typically you\'d use encryptedCustomerInput in the root of the create payment request to provide the encrypted payment data instead. + */ + 'encryptedPaymentData'?: string; + /** + * Public Key Hash A unique identifier to retrieve key used by Apple to encrypt information. + */ + 'publicKeyHash'?: string; + /** + * Ephemeral Key A unique generated key used by Apple to encrypt data. + */ + 'ephemeralKey'?: string; + 'paymentProduct302SpecificInput'?: PaymentProduct320SpecificInput; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'paymentProductId', + baseName: 'paymentProductId', + type: 'number', + format: 'int32', + }, + { + name: 'authorizationMode', + baseName: 'authorizationMode', + type: 'AuthorizationMode', + format: '', + }, + { + name: 'encryptedPaymentData', + baseName: 'encryptedPaymentData', + type: 'string', + format: '', + }, + { + name: 'publicKeyHash', + baseName: 'publicKeyHash', + type: 'string', + format: '', + }, + { + name: 'ephemeralKey', + baseName: 'ephemeralKey', + type: 'string', + format: '', + }, + { + name: 'paymentProduct302SpecificInput', + baseName: 'paymentProduct302SpecificInput', + type: 'PaymentProduct320SpecificInput', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return MobilePaymentMethodSpecificInput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/MobilePaymentMethodSpecificOutput.ts b/src/models/MobilePaymentMethodSpecificOutput.ts new file mode 100644 index 0000000..7a0332f --- /dev/null +++ b/src/models/MobilePaymentMethodSpecificOutput.ts @@ -0,0 +1,75 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CardFraudResults } from '../models/CardFraudResults'; +import { ThreeDSecureResults } from '../models/ThreeDSecureResults'; + +/** + * Object containing the mobile payment method details. + */ +export class MobilePaymentMethodSpecificOutput { + /** + * Payment product identifier - please check product documentation for a full overview of possible values. + */ + 'paymentProductId'?: number; + /** + * Card Authorization code as returned by the acquirer + */ + 'authorisationCode'?: string; + 'fraudResults'?: CardFraudResults; + 'threeDSecureResults'?: ThreeDSecureResults; + /** + * The card network that was used for a mobile payment method operation + */ + 'network'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'paymentProductId', + baseName: 'paymentProductId', + type: 'number', + format: 'int32', + }, + { + name: 'authorisationCode', + baseName: 'authorisationCode', + type: 'string', + format: '', + }, + { + name: 'fraudResults', + baseName: 'fraudResults', + type: 'CardFraudResults', + format: '', + }, + { + name: 'threeDSecureResults', + baseName: 'threeDSecureResults', + type: 'ThreeDSecureResults', + format: '', + }, + { + name: 'network', + baseName: 'network', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return MobilePaymentMethodSpecificOutput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/Order.ts b/src/models/Order.ts new file mode 100644 index 0000000..482819a --- /dev/null +++ b/src/models/Order.ts @@ -0,0 +1,69 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * 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'; + +/** + * Order object containing order related data Please note that this object is required to be able to submit the amount. + */ +export class Order { + 'amountOfMoney'?: AmountOfMoney; + 'customer'?: Customer; + 'references': References; + 'shipping'?: Shipping; + 'shoppingCart'?: ShoppingCartInput; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'amountOfMoney', + baseName: 'amountOfMoney', + type: 'AmountOfMoney', + format: '', + }, + { + name: 'customer', + baseName: 'customer', + type: 'Customer', + format: '', + }, + { + name: 'references', + baseName: 'references', + type: 'References', + format: '', + }, + { + name: 'shipping', + baseName: 'shipping', + type: 'Shipping', + format: '', + }, + { + name: 'shoppingCart', + baseName: 'shoppingCart', + type: 'ShoppingCartInput', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return Order.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/OrderItem.ts b/src/models/OrderItem.ts new file mode 100644 index 0000000..80dd092 --- /dev/null +++ b/src/models/OrderItem.ts @@ -0,0 +1,48 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Items should only be provided for orderType = PARTIAL + */ +export class OrderItem { + /** + * Id of the item from the ShoppingCart. The id will be returned in the response from create Checkout request. + */ + 'id': string; + /** + * Quantity of the specific item. Must be greater than zero. Note: Must not be all spaces or all zeros + */ + 'quantity': number; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'id', + baseName: 'id', + type: 'string', + format: 'UUID', + }, + { + name: 'quantity', + baseName: 'quantity', + type: 'number', + format: 'int64', + }, + ]; + + static getAttributeTypeMap() { + return OrderItem.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/OrderLineDetailsInput.ts b/src/models/OrderLineDetailsInput.ts new file mode 100644 index 0000000..a56cff1 --- /dev/null +++ b/src/models/OrderLineDetailsInput.ts @@ -0,0 +1,117 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductType } from '../models/ProductType'; + +/** + * Object containing additional information that when supplied can have a beneficial effect on the discountrates. + */ +export class OrderLineDetailsInput { + /** + * Product or UPC Code + */ + 'productCode'?: string; + /** + * The price of one unit of the product, the value should be zero or greater. + */ + 'productPrice': number; + 'productType'?: ProductType; + /** + * Quantity of the units being purchased, should be greater than zero Note: Must not be all spaces or all zeros + */ + 'quantity': number; + /** + * Tax on the line item, with the last two digits implied as decimal places + */ + 'taxAmount'?: number; + /** + * URL of the product in shop. Used for PAYONE Buy Now, Pay Later (BNPL). + */ + 'productUrl'?: string; + /** + * URL of a product image. Used for PAYONE Buy Now, Pay Later (BNPL). + */ + 'productImageUrl'?: string; + /** + * Category path of the item. Used for PAYONE Buy Now, Pay Later (BNPL). + */ + 'productCategoryPath'?: string; + /** + * Optional parameter to define the delivery shop or touchpoint where an item has been collected (e.g. for Click & Collect or Click & Reserve). + */ + 'merchantShopDeliveryReference'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'productCode', + baseName: 'productCode', + type: 'string', + format: '', + }, + { + name: 'productPrice', + baseName: 'productPrice', + type: 'number', + format: 'int64', + }, + { + name: 'productType', + baseName: 'productType', + type: 'ProductType', + format: '', + }, + { + name: 'quantity', + baseName: 'quantity', + type: 'number', + format: 'int64', + }, + { + name: 'taxAmount', + baseName: 'taxAmount', + type: 'number', + format: 'int64', + }, + { + name: 'productUrl', + baseName: 'productUrl', + type: 'string', + format: 'uri', + }, + { + name: 'productImageUrl', + baseName: 'productImageUrl', + type: 'string', + format: 'uri', + }, + { + name: 'productCategoryPath', + baseName: 'productCategoryPath', + type: 'string', + format: '', + }, + { + name: 'merchantShopDeliveryReference', + baseName: 'merchantShopDeliveryReference', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return OrderLineDetailsInput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/OrderLineDetailsPatch.ts b/src/models/OrderLineDetailsPatch.ts new file mode 100644 index 0000000..9cf57fe --- /dev/null +++ b/src/models/OrderLineDetailsPatch.ts @@ -0,0 +1,135 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CartItemOrderStatus } from './CartItemOrderStatus'; +import { ProductType } from './ProductType'; + +/** + * Object containing additional information that when supplied can have a beneficial effect on the discountrates. + */ +export class OrderLineDetailsPatch { + /** + * Unique identifier of a cart item + */ + 'id'?: string; + 'status'?: Array; + /** + * Product or UPC Code + */ + 'productCode'?: string; + /** + * The price of one unit of the product, the value should be zero or greater. + */ + 'productPrice': number; + 'productType'?: ProductType; + /** + * Quantity of the units being purchased, should be greater than zero Note: Must not be all spaces or all zeros + */ + 'quantity': number; + /** + * Tax on the line item, with the last two digits implied as decimal places + */ + 'taxAmount'?: number; + /** + * URL of the product in shop. Used for PAYONE Buy Now, Pay Later (BNPL). + */ + 'productUrl'?: string; + /** + * URL of a product image. Used for PAYONE Buy Now, Pay Later (BNPL). + */ + 'productImageUrl'?: string; + /** + * Category path of the item. Used for PAYONE Buy Now, Pay Later (BNPL). + */ + 'productCategoryPath'?: string; + /** + * Optional parameter to define the delivery shop or touchpoint where an item has been collected (e.g. for Click & Collect or Click & Reserve). + */ + 'merchantShopDeliveryReference'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'id', + baseName: 'id', + type: 'string', + format: 'UUID', + }, + { + name: 'status', + baseName: 'status', + type: 'Array', + format: '', + }, + { + name: 'productCode', + baseName: 'productCode', + type: 'string', + format: '', + }, + { + name: 'productPrice', + baseName: 'productPrice', + type: 'number', + format: 'int64', + }, + { + name: 'productType', + baseName: 'productType', + type: 'ProductType', + format: '', + }, + { + name: 'quantity', + baseName: 'quantity', + type: 'number', + format: 'int64', + }, + { + name: 'taxAmount', + baseName: 'taxAmount', + type: 'number', + format: 'int64', + }, + { + name: 'productUrl', + baseName: 'productUrl', + type: 'string', + format: 'uri', + }, + { + name: 'productImageUrl', + baseName: 'productImageUrl', + type: 'string', + format: 'uri', + }, + { + name: 'productCategoryPath', + baseName: 'productCategoryPath', + type: 'string', + format: '', + }, + { + name: 'merchantShopDeliveryReference', + baseName: 'merchantShopDeliveryReference', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return OrderLineDetailsPatch.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/OrderLineDetailsResult.ts b/src/models/OrderLineDetailsResult.ts new file mode 100644 index 0000000..c003b92 --- /dev/null +++ b/src/models/OrderLineDetailsResult.ts @@ -0,0 +1,135 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CartItemOrderStatus } from '../models/CartItemOrderStatus'; +import { ProductType } from '../models/ProductType'; + +/** + * Object containing additional information that when supplied can have a beneficial effect on the discountrates. + */ +export class OrderLineDetailsResult { + /** + * Unique identifier of a cart item + */ + 'id'?: string; + 'status'?: Array; + /** + * Product or UPC Code + */ + 'productCode'?: string; + /** + * The price of one unit of the product, the value should be zero or greater. + */ + 'productPrice': number; + 'productType'?: ProductType; + /** + * Quantity of the units being purchased, should be greater than zero Note: Must not be all spaces or all zeros + */ + 'quantity': number; + /** + * Tax on the line item, with the last two digits implied as decimal places + */ + 'taxAmount'?: number; + /** + * URL of the product in shop. Used for PAYONE Buy Now, Pay Later (BNPL). + */ + 'productUrl'?: string; + /** + * URL of a product image. Used for PAYONE Buy Now, Pay Later (BNPL). + */ + 'productImageUrl'?: string; + /** + * Category path of the item. Used for PAYONE Buy Now, Pay Later (BNPL). + */ + 'productCategoryPath'?: string; + /** + * Optional parameter to define the delivery shop or touchpoint where an item has been collected (e.g. for Click & Collect or Click & Reserve). + */ + 'merchantShopDeliveryReference'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'id', + baseName: 'id', + type: 'string', + format: 'UUID', + }, + { + name: 'status', + baseName: 'status', + type: 'Array', + format: '', + }, + { + name: 'productCode', + baseName: 'productCode', + type: 'string', + format: '', + }, + { + name: 'productPrice', + baseName: 'productPrice', + type: 'number', + format: 'int64', + }, + { + name: 'productType', + baseName: 'productType', + type: 'ProductType', + format: '', + }, + { + name: 'quantity', + baseName: 'quantity', + type: 'number', + format: 'int64', + }, + { + name: 'taxAmount', + baseName: 'taxAmount', + type: 'number', + format: 'int64', + }, + { + name: 'productUrl', + baseName: 'productUrl', + type: 'string', + format: 'uri', + }, + { + name: 'productImageUrl', + baseName: 'productImageUrl', + type: 'string', + format: 'uri', + }, + { + name: 'productCategoryPath', + baseName: 'productCategoryPath', + type: 'string', + format: '', + }, + { + name: 'merchantShopDeliveryReference', + baseName: 'merchantShopDeliveryReference', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return OrderLineDetailsResult.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/OrderRequest.ts b/src/models/OrderRequest.ts new file mode 100644 index 0000000..426dc90 --- /dev/null +++ b/src/models/OrderRequest.ts @@ -0,0 +1,61 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * 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'; + +/** + * 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. + */ +export class OrderRequest { + 'orderType'?: OrderType; + 'orderReferences'?: References; + 'items'?: Array; + 'paymentMethodSpecificInput'?: PaymentMethodSpecificInput; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'orderType', + baseName: 'orderType', + type: 'OrderType', + format: '', + }, + { + name: 'orderReferences', + baseName: 'orderReferences', + type: 'References', + format: '', + }, + { + name: 'items', + baseName: 'items', + type: 'Array', + format: '', + }, + { + name: 'paymentMethodSpecificInput', + baseName: 'paymentMethodSpecificInput', + type: 'PaymentMethodSpecificInput', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return OrderRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/OrderResponse.ts b/src/models/OrderResponse.ts new file mode 100644 index 0000000..6a50319 --- /dev/null +++ b/src/models/OrderResponse.ts @@ -0,0 +1,45 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CreatePaymentResponse } from '../models/CreatePaymentResponse'; +import { ShoppingCartResult } from '../models/ShoppingCartResult'; + +/** + * Object that contains details on the created payment in case one has been created. + */ +export class OrderResponse { + 'createPaymentResponse'?: CreatePaymentResponse; + 'shoppingCart'?: ShoppingCartResult; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'createPaymentResponse', + baseName: 'createPaymentResponse', + type: 'CreatePaymentResponse', + format: '', + }, + { + name: 'shoppingCart', + baseName: 'shoppingCart', + type: 'ShoppingCartResult', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return OrderResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/OrderType.ts b/src/models/OrderType.ts new file mode 100644 index 0000000..1af3831 --- /dev/null +++ b/src/models/OrderType.ts @@ -0,0 +1,19 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * The orderType refers to the ShoppingCart of the Checkout. orderType = FULL should be provided if a payment for the entire ShoppingCart should be created. orderType = PARTIAL should be provided if the payment should be created only for certain items of the ShoppingCart. For this type the list of items has to be provided. Following conditions apply to the Order request: * amount of the Checkout can not be zero * the ShoppingCart cannot be empty * for orderType = FULL the Checkout status is OPEN, there is no other order and/or Payment Execution and no items should be provided in the body * if no paymentMethodSpecificInput has been provided in the creation of the Commerce Case or Checkout it has to be provided in this request + */ +export enum OrderType { + Full = 'FULL', + Partial = 'PARTIAL', +} diff --git a/src/models/PatchCheckoutRequest.ts b/src/models/PatchCheckoutRequest.ts new file mode 100644 index 0000000..4b34a83 --- /dev/null +++ b/src/models/PatchCheckoutRequest.ts @@ -0,0 +1,77 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * 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'; + +/** + * 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. + */ +export class PatchCheckoutRequest { + 'amountOfMoney'?: AmountOfMoney; + 'references'?: CheckoutReferences; + 'shipping'?: Shipping; + 'shoppingCart'?: ShoppingCartPatch; + 'paymentMethodSpecificInput'?: PaymentMethodSpecificInput; + 'paymentReferences'?: References; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'amountOfMoney', + baseName: 'amountOfMoney', + type: 'AmountOfMoney', + format: '', + }, + { + name: 'references', + baseName: 'references', + type: 'CheckoutReferences', + format: '', + }, + { + name: 'shipping', + baseName: 'shipping', + type: 'Shipping', + format: '', + }, + { + name: 'shoppingCart', + baseName: 'shoppingCart', + type: 'ShoppingCartPatch', + format: '', + }, + { + name: 'paymentMethodSpecificInput', + baseName: 'paymentMethodSpecificInput', + type: 'PaymentMethodSpecificInput', + format: '', + }, + { + name: 'paymentReferences', + baseName: 'paymentReferences', + type: 'References', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PatchCheckoutRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PatchCommerceCaseRequest.ts b/src/models/PatchCommerceCaseRequest.ts new file mode 100644 index 0000000..fd58b3b --- /dev/null +++ b/src/models/PatchCommerceCaseRequest.ts @@ -0,0 +1,37 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { Customer } from '../models/Customer'; + +/** + * Update the customer data of the given Commerce Case + */ +export class PatchCommerceCaseRequest { + 'customer'?: Customer; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'customer', + baseName: 'customer', + type: 'Customer', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PatchCommerceCaseRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentChannel.ts b/src/models/PaymentChannel.ts new file mode 100644 index 0000000..f21fdcd --- /dev/null +++ b/src/models/PaymentChannel.ts @@ -0,0 +1,16 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export enum PaymentChannel { + Ecommerce = 'ECOMMERCE', + Pos = 'POS', +} diff --git a/src/models/PaymentCreationOutput.ts b/src/models/PaymentCreationOutput.ts new file mode 100644 index 0000000..0cb25dd --- /dev/null +++ b/src/models/PaymentCreationOutput.ts @@ -0,0 +1,38 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object containing the details of the created payment. + */ +export class PaymentCreationOutput { + /** + * The external reference is an identifier for this transaction and can be used for reconciliation purposes. + */ + 'externalReference'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'externalReference', + baseName: 'externalReference', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentCreationOutput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentEvent.ts b/src/models/PaymentEvent.ts new file mode 100644 index 0000000..788f79c --- /dev/null +++ b/src/models/PaymentEvent.ts @@ -0,0 +1,71 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * 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'; + +/** + * Detailed information regarding an occurred payment event. + */ +export class PaymentEvent { + 'type'?: PaymentType; + 'amountOfMoney'?: AmountOfMoney; + 'paymentStatus'?: StatusValue; + 'cancellationReason'?: CancellationReason; + /** + * Reason of the Refund (e.g. communicated by or to the costumer). + */ + 'returnReason'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'type', + baseName: 'type', + type: 'PaymentType', + format: '', + }, + { + name: 'amountOfMoney', + baseName: 'amountOfMoney', + type: 'AmountOfMoney', + format: '', + }, + { + name: 'paymentStatus', + baseName: 'paymentStatus', + type: 'StatusValue', + format: '', + }, + { + name: 'cancellationReason', + baseName: 'cancellationReason', + type: 'CancellationReason', + format: '', + }, + { + name: 'returnReason', + baseName: 'returnReason', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentEvent.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentExecution.ts b/src/models/PaymentExecution.ts new file mode 100644 index 0000000..3344e4f --- /dev/null +++ b/src/models/PaymentExecution.ts @@ -0,0 +1,113 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * 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'; + +/** + * Object contains information of the payment with a specific payment method. + */ +export class PaymentExecution { + /** + * Unique ID of paymentExecution. + */ + 'paymentExecutionId'?: string; + /** + * Unique payment transaction identifier of the payment gateway. + */ + 'paymentId'?: string; + 'cardPaymentMethodSpecificInput'?: CardPaymentMethodSpecificInput; + 'mobilePaymentMethodSpecificInput'?: MobilePaymentMethodSpecificInput; + 'redirectPaymentMethodSpecificInput'?: RedirectPaymentMethodSpecificInput; + 'sepaDirectDebitPaymentMethodSpecificInput'?: SepaDirectDebitPaymentMethodSpecificInput; + 'financingPaymentMethodSpecificInput'?: FinancingPaymentMethodSpecificInput; + 'paymentChannel'?: PaymentChannel; + 'references'?: References; + 'events'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'paymentExecutionId', + baseName: 'paymentExecutionId', + type: 'string', + format: 'UUID', + }, + { + name: 'paymentId', + baseName: 'paymentId', + type: 'string', + format: '', + }, + { + name: 'cardPaymentMethodSpecificInput', + baseName: 'cardPaymentMethodSpecificInput', + type: 'CardPaymentMethodSpecificInput', + format: '', + }, + { + name: 'mobilePaymentMethodSpecificInput', + baseName: 'mobilePaymentMethodSpecificInput', + type: 'MobilePaymentMethodSpecificInput', + format: '', + }, + { + name: 'redirectPaymentMethodSpecificInput', + baseName: 'redirectPaymentMethodSpecificInput', + type: 'RedirectPaymentMethodSpecificInput', + format: '', + }, + { + name: 'sepaDirectDebitPaymentMethodSpecificInput', + baseName: 'sepaDirectDebitPaymentMethodSpecificInput', + type: 'SepaDirectDebitPaymentMethodSpecificInput', + format: '', + }, + { + name: 'financingPaymentMethodSpecificInput', + baseName: 'financingPaymentMethodSpecificInput', + type: 'FinancingPaymentMethodSpecificInput', + format: '', + }, + { + name: 'paymentChannel', + baseName: 'paymentChannel', + type: 'PaymentChannel', + format: '', + }, + { + name: 'references', + baseName: 'references', + type: 'References', + format: '', + }, + { + name: 'events', + baseName: 'events', + type: 'Array', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentExecution.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentExecutionRequest.ts b/src/models/PaymentExecutionRequest.ts new file mode 100644 index 0000000..ac5a59c --- /dev/null +++ b/src/models/PaymentExecutionRequest.ts @@ -0,0 +1,45 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { PaymentExecutionSpecificInput } from '../models/PaymentExecutionSpecificInput'; +import { PaymentMethodSpecificInput } from '../models/PaymentMethodSpecificInput'; + +/** + * 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. + */ +export class PaymentExecutionRequest { + 'paymentMethodSpecificInput'?: PaymentMethodSpecificInput; + 'paymentExecutionSpecificInput'?: PaymentExecutionSpecificInput; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'paymentMethodSpecificInput', + baseName: 'paymentMethodSpecificInput', + type: 'PaymentMethodSpecificInput', + format: '', + }, + { + name: 'paymentExecutionSpecificInput', + baseName: 'paymentExecutionSpecificInput', + type: 'PaymentExecutionSpecificInput', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentExecutionRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentExecutionSpecificInput.ts b/src/models/PaymentExecutionSpecificInput.ts new file mode 100644 index 0000000..39e8641 --- /dev/null +++ b/src/models/PaymentExecutionSpecificInput.ts @@ -0,0 +1,53 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AmountOfMoney } from '../models/AmountOfMoney'; +import { References } from '../models/References'; +import { ShoppingCartInput } from '../models/ShoppingCartInput'; + +/** + * 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. + */ +export class PaymentExecutionSpecificInput { + 'amountOfMoney'?: AmountOfMoney; + 'shoppingCart'?: ShoppingCartInput; + 'paymentReferences': References; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'amountOfMoney', + baseName: 'amountOfMoney', + type: 'AmountOfMoney', + format: '', + }, + { + name: 'shoppingCart', + baseName: 'shoppingCart', + type: 'ShoppingCartInput', + format: '', + }, + { + name: 'paymentReferences', + baseName: 'paymentReferences', + type: 'References', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentExecutionSpecificInput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentInformationRequest.ts b/src/models/PaymentInformationRequest.ts new file mode 100644 index 0000000..1ad4f2d --- /dev/null +++ b/src/models/PaymentInformationRequest.ts @@ -0,0 +1,70 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AmountOfMoney } from '../models/AmountOfMoney'; +import { PaymentChannel } from '../models/PaymentChannel'; +import { PaymentType } from '../models/PaymentType'; + +export class PaymentInformationRequest { + 'amountOfMoney': AmountOfMoney; + 'type': PaymentType; + 'paymentChannel': PaymentChannel; + /** + * Payment method identifier - please check the product documentation for a full overview of possible values. + */ + 'paymentProductId': number; + /** + * Unique reference of the PaymentInformation. In case of card present transactions, the reference from the ECR or terminal will be used. It is always the reference for external transactions. (e.g. card present payments, cash payments or payments processed by other payment providers). + */ + 'merchantReference'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'amountOfMoney', + baseName: 'amountOfMoney', + type: 'AmountOfMoney', + format: '', + }, + { + name: 'type', + baseName: 'type', + type: 'PaymentType', + format: '', + }, + { + name: 'paymentChannel', + baseName: 'paymentChannel', + type: 'PaymentChannel', + format: '', + }, + { + name: 'paymentProductId', + baseName: 'paymentProductId', + type: 'number', + format: 'int32', + }, + { + name: 'merchantReference', + baseName: 'merchantReference', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentInformationRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentInformationResponse.ts b/src/models/PaymentInformationResponse.ts new file mode 100644 index 0000000..7691367 --- /dev/null +++ b/src/models/PaymentInformationResponse.ts @@ -0,0 +1,133 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CardPaymentDetails } from '../models/CardPaymentDetails'; +import { PaymentChannel } from '../models/PaymentChannel'; +import { PaymentEvent } from '../models/PaymentEvent'; + +/** + * Object containing the related data of the created Payment Information. + */ +export class PaymentInformationResponse { + /** + * Unique ID of the Commerce Case. + */ + 'commerceCaseId'?: string; + /** + * Unique ID of the Commerce Case. + */ + 'checkoutId'?: string; + /** + * Unique identifier of the customer. + */ + 'merchantCustomerId'?: string; + /** + * Unique ID of the Payment Information. + */ + 'paymentInformationId'?: string; + 'paymentChannel'?: PaymentChannel; + /** + * Payment product identifier - please check see product documentation for a full overview of possible values. + */ + 'paymentProductId'?: number; + /** + * Unique identifier of the POS terminal of the payment transaction. + */ + 'terminalId'?: string; + /** + * Unique ID that identifies a store location or transaction point and which refers to the contract number of the merchant accepting the card. + */ + 'cardAcceptorId'?: string; + /** + * Unique reference of the PaymentInformation. In case of card present transactions, the reference from the ECR or terminal will be used. It is always the reference for external transactions. (e.g. card present payments, cash payments or payments processed by other payment providers). + */ + 'merchantReference'?: string; + 'cardPaymentDetails'?: CardPaymentDetails; + 'events'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'commerceCaseId', + baseName: 'commerceCaseId', + type: 'string', + format: 'UUID', + }, + { + name: 'checkoutId', + baseName: 'checkoutId', + type: 'string', + format: 'UUID', + }, + { + name: 'merchantCustomerId', + baseName: 'merchantCustomerId', + type: 'string', + format: '', + }, + { + name: 'paymentInformationId', + baseName: 'paymentInformationId', + type: 'string', + format: 'UUID', + }, + { + name: 'paymentChannel', + baseName: 'paymentChannel', + type: 'PaymentChannel', + format: '', + }, + { + name: 'paymentProductId', + baseName: 'paymentProductId', + type: 'number', + format: 'int32', + }, + { + name: 'terminalId', + baseName: 'terminalId', + type: 'string', + format: '', + }, + { + name: 'cardAcceptorId', + baseName: 'cardAcceptorId', + type: 'string', + format: '', + }, + { + name: 'merchantReference', + baseName: 'merchantReference', + type: 'string', + format: '', + }, + { + name: 'cardPaymentDetails', + baseName: 'cardPaymentDetails', + type: 'CardPaymentDetails', + format: '', + }, + { + name: 'events', + baseName: 'events', + type: 'Array', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentInformationResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentMethodSpecificInput.ts b/src/models/PaymentMethodSpecificInput.ts new file mode 100644 index 0000000..aed5646 --- /dev/null +++ b/src/models/PaymentMethodSpecificInput.ts @@ -0,0 +1,85 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * 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'; + +/** + * 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. + */ +export class PaymentMethodSpecificInput { + 'cardPaymentMethodSpecificInput'?: CardPaymentMethodSpecificInput; + 'mobilePaymentMethodSpecificInput'?: MobilePaymentMethodSpecificInput; + 'redirectPaymentMethodSpecificInput'?: RedirectPaymentMethodSpecificInput; + 'sepaDirectDebitPaymentMethodSpecificInput'?: SepaDirectDebitPaymentMethodSpecificInput; + 'financingPaymentMethodSpecificInput'?: FinancingPaymentMethodSpecificInput; + 'customerDevice'?: CustomerDevice; + 'paymentChannel'?: PaymentChannel; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'cardPaymentMethodSpecificInput', + baseName: 'cardPaymentMethodSpecificInput', + type: 'CardPaymentMethodSpecificInput', + format: '', + }, + { + name: 'mobilePaymentMethodSpecificInput', + baseName: 'mobilePaymentMethodSpecificInput', + type: 'MobilePaymentMethodSpecificInput', + format: '', + }, + { + name: 'redirectPaymentMethodSpecificInput', + baseName: 'redirectPaymentMethodSpecificInput', + type: 'RedirectPaymentMethodSpecificInput', + format: '', + }, + { + name: 'sepaDirectDebitPaymentMethodSpecificInput', + baseName: 'sepaDirectDebitPaymentMethodSpecificInput', + type: 'SepaDirectDebitPaymentMethodSpecificInput', + format: '', + }, + { + name: 'financingPaymentMethodSpecificInput', + baseName: 'financingPaymentMethodSpecificInput', + type: 'FinancingPaymentMethodSpecificInput', + format: '', + }, + { + name: 'customerDevice', + baseName: 'customerDevice', + type: 'CustomerDevice', + format: '', + }, + { + name: 'paymentChannel', + baseName: 'paymentChannel', + type: 'PaymentChannel', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentMethodSpecificInput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentOutput.ts b/src/models/PaymentOutput.ts new file mode 100644 index 0000000..95a301b --- /dev/null +++ b/src/models/PaymentOutput.ts @@ -0,0 +1,105 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * 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'; + +/** + * Object containing payment details. + */ +export class PaymentOutput { + 'amountOfMoney'?: AmountOfMoney; + /** + * It allows you to store additional parameters for the transaction in JSON format. This field should not contain any personal data. + */ + 'merchantParameters'?: string; + 'references'?: PaymentReferences; + 'cardPaymentMethodSpecificOutput'?: CardPaymentMethodSpecificOutput; + 'mobilePaymentMethodSpecificOutput'?: MobilePaymentMethodSpecificOutput; + /** + * Payment method identifier based on the paymentProductId. + */ + 'paymentMethod'?: string; + 'redirectPaymentMethodSpecificOutput'?: RedirectPaymentMethodSpecificOutput; + 'sepaDirectDebitPaymentMethodSpecificOutput'?: SepaDirectDebitPaymentMethodSpecificOutput; + 'financingPaymentMethodSpecificOutput'?: FinancingPaymentMethodSpecificOutput; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'amountOfMoney', + baseName: 'amountOfMoney', + type: 'AmountOfMoney', + format: '', + }, + { + name: 'merchantParameters', + baseName: 'merchantParameters', + type: 'string', + format: '', + }, + { + name: 'references', + baseName: 'references', + type: 'PaymentReferences', + format: '', + }, + { + name: 'cardPaymentMethodSpecificOutput', + baseName: 'cardPaymentMethodSpecificOutput', + type: 'CardPaymentMethodSpecificOutput', + format: '', + }, + { + name: 'mobilePaymentMethodSpecificOutput', + baseName: 'mobilePaymentMethodSpecificOutput', + type: 'MobilePaymentMethodSpecificOutput', + format: '', + }, + { + name: 'paymentMethod', + baseName: 'paymentMethod', + type: 'string', + format: '', + }, + { + name: 'redirectPaymentMethodSpecificOutput', + baseName: 'redirectPaymentMethodSpecificOutput', + type: 'RedirectPaymentMethodSpecificOutput', + format: '', + }, + { + name: 'sepaDirectDebitPaymentMethodSpecificOutput', + baseName: 'sepaDirectDebitPaymentMethodSpecificOutput', + type: 'SepaDirectDebitPaymentMethodSpecificOutput', + format: '', + }, + { + name: 'financingPaymentMethodSpecificOutput', + baseName: 'financingPaymentMethodSpecificOutput', + type: 'FinancingPaymentMethodSpecificOutput', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentOutput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentProduct320SpecificInput.ts b/src/models/PaymentProduct320SpecificInput.ts new file mode 100644 index 0000000..b227473 --- /dev/null +++ b/src/models/PaymentProduct320SpecificInput.ts @@ -0,0 +1,53 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ApplePaymentDataTokenInformation } from '../models/ApplePaymentDataTokenInformation'; + +/** + * Object containing additional Information needed for Apple Pay payment transactions. + */ +export class PaymentProduct320SpecificInput { + 'network'?: PaymentProduct320SpecificInputNetworkEnum; + 'token'?: ApplePaymentDataTokenInformation; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'network', + baseName: 'network', + type: 'PaymentProduct320SpecificInputNetworkEnum', + format: '', + }, + { + name: 'token', + baseName: 'token', + type: 'ApplePaymentDataTokenInformation', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentProduct320SpecificInput.attributeTypeMap; + } + + public constructor() {} +} + +export enum PaymentProduct320SpecificInputNetworkEnum { + Mastercard = 'MASTERCARD', + Visa = 'VISA', + Amex = 'AMEX', + Girocard = 'GIROCARD', + Discover = 'DISCOVER', + Jcb = 'JCB', +} diff --git a/src/models/PaymentProduct3391SpecificInput.ts b/src/models/PaymentProduct3391SpecificInput.ts new file mode 100644 index 0000000..f778fd4 --- /dev/null +++ b/src/models/PaymentProduct3391SpecificInput.ts @@ -0,0 +1,47 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BankAccountInformation } from '../models/BankAccountInformation'; + +/** + * Object containing specific information for PAYONE Secured Installment. + */ +export class PaymentProduct3391SpecificInput { + /** + * ID of the selected installment option. Will be provided in the response of the Order / Payment Execution request. + */ + 'installmentOptionId': string; + 'bankAccountInformation': BankAccountInformation; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'installmentOptionId', + baseName: 'installmentOptionId', + type: 'string', + format: '', + }, + { + name: 'bankAccountInformation', + baseName: 'bankAccountInformation', + type: 'BankAccountInformation', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentProduct3391SpecificInput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentProduct3391SpecificOutput.ts b/src/models/PaymentProduct3391SpecificOutput.ts new file mode 100644 index 0000000..47f990c --- /dev/null +++ b/src/models/PaymentProduct3391SpecificOutput.ts @@ -0,0 +1,40 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { InstallmentOption } from '../models/InstallmentOption'; + +/** + * Object containing specific information for PAYONE Secured Installment. + */ +export class PaymentProduct3391SpecificOutput { + /** + * List of installment options. + */ + 'installmentOptions'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'installmentOptions', + baseName: 'installmentOptions', + type: 'Array', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentProduct3391SpecificOutput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentProduct3392SpecificInput.ts b/src/models/PaymentProduct3392SpecificInput.ts new file mode 100644 index 0000000..9556fb7 --- /dev/null +++ b/src/models/PaymentProduct3392SpecificInput.ts @@ -0,0 +1,37 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BankAccountInformation } from '../models/BankAccountInformation'; + +/** + * Object containing specific information for PAYONE Secured Direct. Debit. + */ +export class PaymentProduct3392SpecificInput { + 'bankAccountInformation': BankAccountInformation; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'bankAccountInformation', + baseName: 'bankAccountInformation', + type: 'BankAccountInformation', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentProduct3392SpecificInput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentProduct771SpecificOutput.ts b/src/models/PaymentProduct771SpecificOutput.ts new file mode 100644 index 0000000..95b1d28 --- /dev/null +++ b/src/models/PaymentProduct771SpecificOutput.ts @@ -0,0 +1,38 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Output that is SEPA Direct Debit specific (i.e. the used mandate). + */ +export class PaymentProduct771SpecificOutput { + /** + * Unique reference fo a SEPA Mandate + */ + 'mandateReference'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'mandateReference', + baseName: 'mandateReference', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentProduct771SpecificOutput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentProduct840CustomerAccount.ts b/src/models/PaymentProduct840CustomerAccount.ts new file mode 100644 index 0000000..7affa5b --- /dev/null +++ b/src/models/PaymentProduct840CustomerAccount.ts @@ -0,0 +1,68 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object containing the details of the PayPal account. + */ +export class PaymentProduct840CustomerAccount { + /** + * Name of the company in case the PayPal account is owned by a business + */ + 'companyName'?: string; + /** + * First name of the PayPal account holder + */ + 'firstName'?: string; + /** + * The unique identifier of a PayPal account and will never change in the life cycle of a PayPal account. + */ + 'payerId'?: string; + /** + * Surname of the PayPal account holder + */ + 'surname'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'companyName', + baseName: 'companyName', + type: 'string', + format: '', + }, + { + name: 'firstName', + baseName: 'firstName', + type: 'string', + format: '', + }, + { + name: 'payerId', + baseName: 'payerId', + type: 'string', + format: '', + }, + { + name: 'surname', + baseName: 'surname', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentProduct840CustomerAccount.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentProduct840SpecificOutput.ts b/src/models/PaymentProduct840SpecificOutput.ts new file mode 100644 index 0000000..16725c3 --- /dev/null +++ b/src/models/PaymentProduct840SpecificOutput.ts @@ -0,0 +1,52 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { Address } from '../models/Address'; +import { PaymentProduct840CustomerAccount } from '../models/PaymentProduct840CustomerAccount'; + +/** + * PayPal (payment product 840) specific details. + */ +export class PaymentProduct840SpecificOutput { + 'billingAddress'?: Address; + 'customerAccount'?: PaymentProduct840CustomerAccount; + 'shippingAddress'?: Address; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'billingAddress', + baseName: 'billingAddress', + type: 'Address', + format: '', + }, + { + name: 'customerAccount', + baseName: 'customerAccount', + type: 'PaymentProduct840CustomerAccount', + format: '', + }, + { + name: 'shippingAddress', + baseName: 'shippingAddress', + type: 'Address', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentProduct840SpecificOutput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentReferences.ts b/src/models/PaymentReferences.ts new file mode 100644 index 0000000..d52ff0f --- /dev/null +++ b/src/models/PaymentReferences.ts @@ -0,0 +1,38 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object that holds all reference properties that are linked to this transaction. + */ +export class PaymentReferences { + /** + * Unique reference of the Commerce Case that is also returned for reporting and reconciliation purposes. + */ + 'merchantReference'?: string; + + 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: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentReferences.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentResponse.ts b/src/models/PaymentResponse.ts new file mode 100644 index 0000000..9fe3db9 --- /dev/null +++ b/src/models/PaymentResponse.ts @@ -0,0 +1,63 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { PaymentOutput } from '../models/PaymentOutput'; +import { PaymentStatusOutput } from '../models/PaymentStatusOutput'; +import { StatusValue } from '../models/StatusValue'; + +/** + * Object that holds the payment related properties. + */ +export class PaymentResponse { + 'paymentOutput'?: PaymentOutput; + 'status'?: StatusValue; + 'statusOutput'?: PaymentStatusOutput; + /** + * Unique payment transaction identifier of the payment gateway. + */ + 'id'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'paymentOutput', + baseName: 'paymentOutput', + type: 'PaymentOutput', + format: '', + }, + { + name: 'status', + baseName: 'status', + type: 'StatusValue', + format: '', + }, + { + name: 'statusOutput', + baseName: 'statusOutput', + type: 'PaymentStatusOutput', + format: '', + }, + { + name: 'id', + baseName: 'id', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentStatusOutput.ts b/src/models/PaymentStatusOutput.ts new file mode 100644 index 0000000..2e19bf3 --- /dev/null +++ b/src/models/PaymentStatusOutput.ts @@ -0,0 +1,67 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { StatusCategoryValue } from '../models/StatusCategoryValue'; + +/** + * 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. + */ +export class PaymentStatusOutput { + /** + * Flag indicating if the payment can be cancelled + */ + 'isCancellable'?: boolean; + 'statusCategory'?: StatusCategoryValue; + /** + * Indicates if the transaction has been authorized + */ + 'isAuthorized'?: boolean; + /** + * Flag indicating if the payment can be refunded + */ + 'isRefundable'?: boolean; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'isCancellable', + baseName: 'isCancellable', + type: 'boolean', + format: '', + }, + { + name: 'statusCategory', + baseName: 'statusCategory', + type: 'StatusCategoryValue', + format: '', + }, + { + name: 'isAuthorized', + baseName: 'isAuthorized', + type: 'boolean', + format: '', + }, + { + name: 'isRefundable', + baseName: 'isRefundable', + type: 'boolean', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PaymentStatusOutput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PaymentType.ts b/src/models/PaymentType.ts new file mode 100644 index 0000000..1cf15f7 --- /dev/null +++ b/src/models/PaymentType.ts @@ -0,0 +1,25 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Defines the respective payment type. + */ +export enum PaymentType { + Sale = 'SALE', + Reservation = 'RESERVATION', + Capture = 'CAPTURE', + Refund = 'REFUND', + Reversal = 'REVERSAL', + ChargebackReversal = 'CHARGEBACK_REVERSAL', + CreditNote = 'CREDIT_NOTE', + DebitNote = 'DEBIT_NOTE', +} diff --git a/src/models/PayoutOutput.ts b/src/models/PayoutOutput.ts new file mode 100644 index 0000000..cc22fcb --- /dev/null +++ b/src/models/PayoutOutput.ts @@ -0,0 +1,55 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AmountOfMoney } from '../models/AmountOfMoney'; +import { PaymentReferences } from '../models/PaymentReferences'; + +/** + * Object containing details from the created payout. + */ +export class PayoutOutput { + 'amountOfMoney'?: AmountOfMoney; + 'references'?: PaymentReferences; + /** + * Payment method identifier based on the paymentProductId. + */ + 'paymentMethod'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'amountOfMoney', + baseName: 'amountOfMoney', + type: 'AmountOfMoney', + format: '', + }, + { + name: 'references', + baseName: 'references', + type: 'PaymentReferences', + format: '', + }, + { + name: 'paymentMethod', + baseName: 'paymentMethod', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PayoutOutput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PayoutResponse.ts b/src/models/PayoutResponse.ts new file mode 100644 index 0000000..59e85e8 --- /dev/null +++ b/src/models/PayoutResponse.ts @@ -0,0 +1,63 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { PayoutOutput } from '../models/PayoutOutput'; +import { StatusCategoryValue } from '../models/StatusCategoryValue'; +import { StatusValue } from '../models/StatusValue'; + +/** + * Object that holds the payment related properties for the refund of a Payment Information. + */ +export class PayoutResponse { + 'payoutOutput'?: PayoutOutput; + 'status'?: StatusValue; + 'statusCategory'?: StatusCategoryValue; + /** + * Unique payment transaction identifier of the payment gateway. + */ + 'id'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'payoutOutput', + baseName: 'payoutOutput', + type: 'PayoutOutput', + format: '', + }, + { + name: 'status', + baseName: 'status', + type: 'StatusValue', + format: '', + }, + { + name: 'statusCategory', + baseName: 'statusCategory', + type: 'StatusCategoryValue', + format: '', + }, + { + name: 'id', + baseName: 'id', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PayoutResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PersonalInformation.ts b/src/models/PersonalInformation.ts new file mode 100644 index 0000000..7b189c3 --- /dev/null +++ b/src/models/PersonalInformation.ts @@ -0,0 +1,63 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { PersonalName } from '../models/PersonalName'; + +/** + * Object containing personal information like name, date of birth and gender. + */ +export class PersonalInformation { + /** + * The date of birth of the customer of the recipient of the loan. Format YYYYMMDD + */ + 'dateOfBirth'?: string; + /** + * The gender of the customer, possible values are: * MALE * FEMALE * UNKNOWN + */ + 'gender'?: PersonalInformationGenderEnum; + 'name'?: PersonalName; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'dateOfBirth', + baseName: 'dateOfBirth', + type: 'string', + format: '', + }, + { + name: 'gender', + baseName: 'gender', + type: 'PersonalInformationGenderEnum', + format: '', + }, + { + name: 'name', + baseName: 'name', + type: 'PersonalName', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PersonalInformation.attributeTypeMap; + } + + public constructor() {} +} + +export enum PersonalInformationGenderEnum { + Male = 'MALE', + Female = 'FEMALE', + Unknown = 'UNKNOWN', +} diff --git a/src/models/PersonalName.ts b/src/models/PersonalName.ts new file mode 100644 index 0000000..060e70e --- /dev/null +++ b/src/models/PersonalName.ts @@ -0,0 +1,58 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object containing the name details of the customer + */ +export class PersonalName { + /** + * Given name(s) or first name(s) of the customer + */ + 'firstName'?: string; + /** + * Surname(s) or last name(s) of the customer + */ + 'surname'?: string; + /** + * Title of customer + */ + 'title'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'firstName', + baseName: 'firstName', + type: 'string', + format: '', + }, + { + name: 'surname', + baseName: 'surname', + type: 'string', + format: '', + }, + { + name: 'title', + baseName: 'title', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PersonalName.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/PositiveAmountOfMoney.ts b/src/models/PositiveAmountOfMoney.ts new file mode 100644 index 0000000..ddfe9bf --- /dev/null +++ b/src/models/PositiveAmountOfMoney.ts @@ -0,0 +1,48 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object containing amount and ISO currency code attributes + */ +export class PositiveAmountOfMoney { + /** + * Amount in cents and always having 2 decimals + */ + 'amount': number; + /** + * Three-letter ISO currency code representing the currency for the amount + */ + 'currencyCode': string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'amount', + baseName: 'amount', + type: 'number', + format: 'int64', + }, + { + name: 'currencyCode', + baseName: 'currencyCode', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return PositiveAmountOfMoney.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/ProcessingMandateInformation.ts b/src/models/ProcessingMandateInformation.ts new file mode 100644 index 0000000..5bed6bf --- /dev/null +++ b/src/models/ProcessingMandateInformation.ts @@ -0,0 +1,75 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BankAccountInformation } from '../models/BankAccountInformation'; +import { MandateRecurrenceType } from '../models/MandateRecurrenceType'; + +/** + * Object containing the relevant information of a SEPA Direct Debit mandate for processing (mandatory fields in pain.008). Renamed from CreateMandateWithReturnUrl to ProcessingMandateInformation. + */ +export class ProcessingMandateInformation { + 'bankAccountIban': BankAccountInformation; + 'recurrenceType': MandateRecurrenceType; + /** + * The unique identifier of the mandate + */ + 'uniqueMandateReference': string; + /** + * The date of signature of the mandate. Format YYYYMMDD + */ + 'dateOfSignature': string; + /** + * Your unique creditor identifier. + */ + 'creditorId': string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'bankAccountIban', + baseName: 'bankAccountIban', + type: 'BankAccountInformation', + format: '', + }, + { + name: 'recurrenceType', + baseName: 'recurrenceType', + type: 'MandateRecurrenceType', + format: '', + }, + { + name: 'uniqueMandateReference', + baseName: 'uniqueMandateReference', + type: 'string', + format: '', + }, + { + name: 'dateOfSignature', + baseName: 'dateOfSignature', + type: 'string', + format: '', + }, + { + name: 'creditorId', + baseName: 'creditorId', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return ProcessingMandateInformation.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/ProductType.ts b/src/models/ProductType.ts new file mode 100644 index 0000000..91b28c0 --- /dev/null +++ b/src/models/ProductType.ts @@ -0,0 +1,21 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Enum to classify items that are purchased * GOODS - Goods * SHIPMENT - Shipping charges * HANDLING_FEE - Handling fee * DISCOUNT - Voucher / discount + */ +export enum ProductType { + Goods = 'GOODS', + Shipment = 'SHIPMENT', + HandlingFee = 'HANDLING_FEE', + Discount = 'DISCOUNT', +} diff --git a/src/models/RedirectData.ts b/src/models/RedirectData.ts new file mode 100644 index 0000000..5a7a0a4 --- /dev/null +++ b/src/models/RedirectData.ts @@ -0,0 +1,38 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object containing all data needed to redirect the customer. + */ +export class RedirectData { + /** + * The URL that the customer should be redirected to. Be sure to redirect using the GET method + */ + 'redirectURL'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'redirectURL', + baseName: 'redirectURL', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return RedirectData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/RedirectPaymentMethodSpecificInput.ts b/src/models/RedirectPaymentMethodSpecificInput.ts new file mode 100644 index 0000000..3c5867d --- /dev/null +++ b/src/models/RedirectPaymentMethodSpecificInput.ts @@ -0,0 +1,95 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RedirectPaymentProduct840SpecificInput } from '../models/RedirectPaymentProduct840SpecificInput'; +import { RedirectionData } from '../models/RedirectionData'; + +/** + * Object containing the specific input details for payments that involve redirects to 3rd parties to complete, like iDeal and PayPal + */ +export class RedirectPaymentMethodSpecificInput { + /** + * * true = the payment requires approval before the funds will be captured using the Approve payment or Capture payment API * false = the payment does not require approval, and the funds will be captured automatically If the parameter is not provided in the request, the default value will be true + */ + 'requiresApproval'?: boolean; + /** + * ID of the token to use to create the payment. + */ + 'paymentProcessingToken'?: string; + /** + * Token to identify the card in the reporting. + */ + 'reportingToken'?: string; + /** + * Indicates if this transaction should be tokenized * true - Tokenize the transaction. * false - Do not tokenize the transaction, unless it would be tokenized by other means such as auto- tokenization of recurring payments. example: false + */ + 'tokenize'?: boolean; + /** + * Payment product identifier - please check product documentation for a full overview of possible values. + */ + 'paymentProductId'?: number; + 'paymentProduct840SpecificInput'?: RedirectPaymentProduct840SpecificInput; + 'redirectionData'?: RedirectionData; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'requiresApproval', + baseName: 'requiresApproval', + type: 'boolean', + format: '', + }, + { + name: 'paymentProcessingToken', + baseName: 'paymentProcessingToken', + type: 'string', + format: '', + }, + { + name: 'reportingToken', + baseName: 'reportingToken', + type: 'string', + format: '', + }, + { + name: 'tokenize', + baseName: 'tokenize', + type: 'boolean', + format: '', + }, + { + name: 'paymentProductId', + baseName: 'paymentProductId', + type: 'number', + format: 'int32', + }, + { + name: 'paymentProduct840SpecificInput', + baseName: 'paymentProduct840SpecificInput', + type: 'RedirectPaymentProduct840SpecificInput', + format: '', + }, + { + name: 'redirectionData', + baseName: 'redirectionData', + type: 'RedirectionData', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return RedirectPaymentMethodSpecificInput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/RedirectPaymentMethodSpecificOutput.ts b/src/models/RedirectPaymentMethodSpecificOutput.ts new file mode 100644 index 0000000..5890e2a --- /dev/null +++ b/src/models/RedirectPaymentMethodSpecificOutput.ts @@ -0,0 +1,67 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { PaymentProduct840SpecificOutput } from '../models/PaymentProduct840SpecificOutput'; + +/** + * Object containing the redirect payment product details. + */ +export class RedirectPaymentMethodSpecificOutput { + /** + * <- Payment product identifier - please check product documentation for a full overview of possible values. + */ + 'paymentProductId'?: number; + 'paymentProduct840SpecificOutput'?: PaymentProduct840SpecificOutput; + /** + * ID of the token. This property is populated when the payment was done with a token. + */ + 'paymentProcessingToken'?: string; + /** + * Token to identify the card in the reporting. + */ + 'reportingToken'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'paymentProductId', + baseName: 'paymentProductId', + type: 'number', + format: 'int32', + }, + { + name: 'paymentProduct840SpecificOutput', + baseName: 'paymentProduct840SpecificOutput', + type: 'PaymentProduct840SpecificOutput', + format: '', + }, + { + name: 'paymentProcessingToken', + baseName: 'paymentProcessingToken', + type: 'string', + format: '', + }, + { + name: 'reportingToken', + baseName: 'reportingToken', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return RedirectPaymentMethodSpecificOutput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/RedirectPaymentProduct840SpecificInput.ts b/src/models/RedirectPaymentProduct840SpecificInput.ts new file mode 100644 index 0000000..753e865 --- /dev/null +++ b/src/models/RedirectPaymentProduct840SpecificInput.ts @@ -0,0 +1,38 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object containing specific input required for PayPal payments (Payment product ID 840) + */ +export class RedirectPaymentProduct840SpecificInput { + /** + * Indicates whether to use PayPal Express Checkout Shortcut. * true = When shortcut is enabled, the consumer can select a shipping address during PayPal checkout. * false = When shortcut is disabled, the consumer cannot change the shipping address. Default value is false. Please note that this field is ignored when order.additionalInput.typeInformation.purchaseType is set to \"digital\" + */ + 'addressSelectionAtPayPal'?: boolean; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'addressSelectionAtPayPal', + baseName: 'addressSelectionAtPayPal', + type: 'boolean', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return RedirectPaymentProduct840SpecificInput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/RedirectionData.ts b/src/models/RedirectionData.ts new file mode 100644 index 0000000..f987400 --- /dev/null +++ b/src/models/RedirectionData.ts @@ -0,0 +1,38 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object containing browser specific redirection related data. + */ +export class RedirectionData { + /** + * The URL that the customer is redirected to after the payment flow has finished. You can add any number of key value pairs in the query string that, for instance help you to identify the customer when they return to your site. Please note that we will also append some additional key value pairs that will also help you with this identification process. Note: The provided URL should be absolute and contain the protocol to use, e.g. http:// or https://. For use on mobile devices a custom protocol can be used in the form of protocol://. This protocol must be registered on the device first. URLs without a protocol will be rejected. + */ + 'returnUrl': string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'returnUrl', + baseName: 'returnUrl', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return RedirectionData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/References.ts b/src/models/References.ts new file mode 100644 index 0000000..624af1d --- /dev/null +++ b/src/models/References.ts @@ -0,0 +1,58 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Object that holds all reference properties that are linked to this transaction. + */ +export class References { + /** + * Descriptive text that is used towards to customer, either during an online Checkout at a third party and/or on the statement of the customer. For card transactions this is usually referred to as a Soft Descriptor. The maximum allowed length varies per card acquirer: * AIB - 22 characters * American Express - 25 characters * Atos Origin BNP - 15 characters * Barclays - 25 characters * Catella - 22 characters * CBA - 20 characters * Elavon - 25 characters * First Data - 25 characters * INICIS (INIPAY) - 22-30 characters * JCB - 25 characters * Merchant Solutions - 22-25 characters * Payvision (EU & HK) - 25 characters * SEB Euroline - 22 characters * Sub1 Argentina - 15 characters * Wells Fargo - 25 characters Note that we advise you to use 22 characters as the max length as beyond this our experience is that issuers will start to truncate. We currently also only allow per API call overrides for AIB and Barclays For alternative payment products the maximum allowed length varies per payment product: * 402 e-Przelewy - 30 characters * 404 INICIS - 80 characters * 802 Nordea ePayment Finland - 234 characters * 809 iDeal - 32 characters * 836 SOFORT - 42 characters * 840 PayPal - 127 characters * 841 WebMoney - 175 characters * 849 Yandex - 64 characters * 861 Alipay - 256 characters * 863 WeChat Pay - 32 characters * 880 BOKU - 20 characters * 8580 Qiwi - 255 characters * 1504 Konbini - 80 characters All other payment products don\'t support a descriptor. + */ + 'descriptor'?: string; + /** + * The merchantReference is a unique identifier for a payment and can be used for reporting purposes. The merchantReference is required for the execution of a payment and has to be unique. In case a payment has failed the same merchantReference can be used again. Once a successful payment has been made the same merchantReference can no longer be used and will be rejected. + */ + 'merchantReference': string; + /** + * It allows you to store additional parameters for the transaction in JSON format. This field must not contain any personal data. + */ + 'merchantParameters'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'descriptor', + baseName: 'descriptor', + type: 'string', + format: '', + }, + { + name: 'merchantReference', + baseName: 'merchantReference', + type: 'string', + format: '', + }, + { + name: 'merchantParameters', + baseName: 'merchantParameters', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return References.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/RefundErrorResponse.ts b/src/models/RefundErrorResponse.ts new file mode 100644 index 0000000..ef84149 --- /dev/null +++ b/src/models/RefundErrorResponse.ts @@ -0,0 +1,44 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { APIError } from '../models/APIError'; + +export class RefundErrorResponse { + /** + * Unique reference, for debugging purposes, of this error response + */ + 'errorId'?: string; + 'errors'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'errorId', + baseName: 'errorId', + type: 'string', + format: '', + }, + { + name: 'errors', + baseName: 'errors', + type: 'Array', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return RefundErrorResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/RefundOutput.ts b/src/models/RefundOutput.ts new file mode 100644 index 0000000..e8094c9 --- /dev/null +++ b/src/models/RefundOutput.ts @@ -0,0 +1,65 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AmountOfMoney } from '../models/AmountOfMoney'; +import { PaymentReferences } from '../models/PaymentReferences'; + +/** + * Object containing Refund details + */ +export class RefundOutput { + 'amountOfMoney'?: AmountOfMoney; + /** + * It allows you to store additional parameters for the transaction in JSON format. This field must not contain any personal data. + */ + 'merchantParameters'?: string; + 'references'?: PaymentReferences; + /** + * Payment method identifier used by the our payment engine. + */ + 'paymentMethod'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'amountOfMoney', + baseName: 'amountOfMoney', + type: 'AmountOfMoney', + format: '', + }, + { + name: 'merchantParameters', + baseName: 'merchantParameters', + type: 'string', + format: '', + }, + { + name: 'references', + baseName: 'references', + type: 'PaymentReferences', + format: '', + }, + { + name: 'paymentMethod', + baseName: 'paymentMethod', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return RefundOutput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/RefundPaymentResponse.ts b/src/models/RefundPaymentResponse.ts new file mode 100644 index 0000000..af25e0c --- /dev/null +++ b/src/models/RefundPaymentResponse.ts @@ -0,0 +1,63 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { PaymentStatusOutput } from '../models/PaymentStatusOutput'; +import { RefundOutput } from '../models/RefundOutput'; +import { StatusValue } from '../models/StatusValue'; + +/** + * 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. + */ +export class RefundPaymentResponse { + 'refundOutput'?: RefundOutput; + 'status'?: StatusValue; + 'statusOutput'?: PaymentStatusOutput; + /** + * Unique payment transaction identifier of the payment gateway. + */ + 'id'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'refundOutput', + baseName: 'refundOutput', + type: 'RefundOutput', + format: '', + }, + { + name: 'status', + baseName: 'status', + type: 'StatusValue', + format: '', + }, + { + name: 'statusOutput', + baseName: 'statusOutput', + type: 'PaymentStatusOutput', + format: '', + }, + { + name: 'id', + baseName: 'id', + type: 'string', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return RefundPaymentResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/RefundRequest.ts b/src/models/RefundRequest.ts new file mode 100644 index 0000000..67b863f --- /dev/null +++ b/src/models/RefundRequest.ts @@ -0,0 +1,53 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { PaymentReferences } from '../models/PaymentReferences'; +import { PositiveAmountOfMoney } from '../models/PositiveAmountOfMoney'; +import { ReturnInformation } from '../models/ReturnInformation'; + +/** + * 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. + */ +export class RefundRequest { + 'amountOfMoney'?: PositiveAmountOfMoney; + 'references'?: PaymentReferences; + '_return'?: ReturnInformation; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'amountOfMoney', + baseName: 'amountOfMoney', + type: 'PositiveAmountOfMoney', + format: '', + }, + { + name: 'references', + baseName: 'references', + type: 'PaymentReferences', + format: '', + }, + { + name: '_return', + baseName: 'return', + type: 'ReturnInformation', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return RefundRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/ReturnInformation.ts b/src/models/ReturnInformation.ts new file mode 100644 index 0000000..fc03837 --- /dev/null +++ b/src/models/ReturnInformation.ts @@ -0,0 +1,50 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CartItemInput } from '../models/CartItemInput'; + +/** + * 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. + */ +export class ReturnInformation { + /** + * Reason of the Refund (e.g. communicated by or to the consumer). + */ + 'returnReason'?: string; + /** + * Items returned. + */ + 'items'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'returnReason', + baseName: 'returnReason', + type: 'string', + format: '', + }, + { + name: 'items', + baseName: 'items', + type: 'Array', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return ReturnInformation.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/ReturnItem.ts b/src/models/ReturnItem.ts new file mode 100644 index 0000000..8477ae0 --- /dev/null +++ b/src/models/ReturnItem.ts @@ -0,0 +1,45 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export class ReturnItem { + /** + * Id of the item to return. + */ + 'id': string; + /** + * Quantity of the units being returned, should be greater than zero Note: Must not be all spaces or all zeros + */ + 'quantity': number; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'id', + baseName: 'id', + type: 'string', + format: 'UUID', + }, + { + name: 'quantity', + baseName: 'quantity', + type: 'number', + format: 'int64', + }, + ]; + + static getAttributeTypeMap() { + return ReturnItem.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/ReturnRequest.ts b/src/models/ReturnRequest.ts new file mode 100644 index 0000000..c7d0947 --- /dev/null +++ b/src/models/ReturnRequest.ts @@ -0,0 +1,55 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ReturnItem } from '../models/ReturnItem'; +import { ReturnType } from '../models/ReturnType'; + +/** + * 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. + */ +export class ReturnRequest { + 'returnType'?: ReturnType; + /** + * Reason of the Refund (e.g. communicated by or to the consumer). + */ + 'returnReason'?: string; + 'returnItems'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'returnType', + baseName: 'returnType', + type: 'ReturnType', + format: '', + }, + { + name: 'returnReason', + baseName: 'returnReason', + type: 'string', + format: '', + }, + { + name: 'returnItems', + baseName: 'returnItems', + type: 'Array', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return ReturnRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/ReturnResponse.ts b/src/models/ReturnResponse.ts new file mode 100644 index 0000000..74860a3 --- /dev/null +++ b/src/models/ReturnResponse.ts @@ -0,0 +1,42 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RefundPaymentResponse } from '../models/RefundPaymentResponse'; +import { ShoppingCartResult } from '../models/ShoppingCartResult'; + +export class ReturnResponse { + 'returnPaymentResponse'?: RefundPaymentResponse; + 'shoppingCart'?: ShoppingCartResult; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'returnPaymentResponse', + baseName: 'returnPaymentResponse', + type: 'RefundPaymentResponse', + format: '', + }, + { + name: 'shoppingCart', + baseName: 'shoppingCart', + type: 'ShoppingCartResult', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return ReturnResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/ReturnType.ts b/src/models/ReturnType.ts new file mode 100644 index 0000000..a8f64cc --- /dev/null +++ b/src/models/ReturnType.ts @@ -0,0 +1,19 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * The returnType refers to the ShoppingCart items of the Checkout. returnType = FULL should be provided if all items should be marked as returned and the payment for the entire ShoppingCart should be refunded. returnType = PARTIAL should be provided if only certain items should be marked as returned and the Refund should not be made for the entire ShoppingCart. For this type the list of items has to be provided. Following conditions apply to the Return request: * items must be in status DELIVERED * there was no Capture, Refund or Cancel triggered over the Payment Execution resource * for the deliverType FULL no items are provided in the request Note: If a DISCOUNT productType is among the ShoppingCart items, only returnType FULL is possible. + */ +export enum ReturnType { + Full = 'FULL', + Partial = 'PARTIAL', +} diff --git a/src/models/SepaDirectDebitPaymentMethodSpecificInput.ts b/src/models/SepaDirectDebitPaymentMethodSpecificInput.ts new file mode 100644 index 0000000..f7fa9ff --- /dev/null +++ b/src/models/SepaDirectDebitPaymentMethodSpecificInput.ts @@ -0,0 +1,47 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { SepaDirectDebitPaymentProduct771SpecificInput } from '../models/SepaDirectDebitPaymentProduct771SpecificInput'; + +/** + * Object containing the specific input details for SEPA direct debit payments + */ +export class SepaDirectDebitPaymentMethodSpecificInput { + 'paymentProduct771SpecificInput'?: SepaDirectDebitPaymentProduct771SpecificInput; + /** + * Payment product identifier - please check product documentation for a full overview of possible values. + */ + 'paymentProductId'?: number; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'paymentProduct771SpecificInput', + baseName: 'paymentProduct771SpecificInput', + type: 'SepaDirectDebitPaymentProduct771SpecificInput', + format: '', + }, + { + name: 'paymentProductId', + baseName: 'paymentProductId', + type: 'number', + format: 'int32', + }, + ]; + + static getAttributeTypeMap() { + return SepaDirectDebitPaymentMethodSpecificInput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/SepaDirectDebitPaymentMethodSpecificOutput.ts b/src/models/SepaDirectDebitPaymentMethodSpecificOutput.ts new file mode 100644 index 0000000..92334d1 --- /dev/null +++ b/src/models/SepaDirectDebitPaymentMethodSpecificOutput.ts @@ -0,0 +1,47 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { PaymentProduct771SpecificOutput } from '../models/PaymentProduct771SpecificOutput'; + +/** + * Object containing the SEPA direct debit details. + */ +export class SepaDirectDebitPaymentMethodSpecificOutput { + /** + * Payment product identifier - please check product documentation for a full overview of possible values. + */ + 'paymentProductId'?: number; + 'paymentProduct771SpecificOutput'?: PaymentProduct771SpecificOutput; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'paymentProductId', + baseName: 'paymentProductId', + type: 'number', + format: 'int32', + }, + { + name: 'paymentProduct771SpecificOutput', + baseName: 'paymentProduct771SpecificOutput', + type: 'PaymentProduct771SpecificOutput', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return SepaDirectDebitPaymentMethodSpecificOutput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/SepaDirectDebitPaymentProduct771SpecificInput.ts b/src/models/SepaDirectDebitPaymentProduct771SpecificInput.ts new file mode 100644 index 0000000..35b29c4 --- /dev/null +++ b/src/models/SepaDirectDebitPaymentProduct771SpecificInput.ts @@ -0,0 +1,47 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProcessingMandateInformation } from '../models/ProcessingMandateInformation'; + +/** + * Object containing information specific to SEPA Direct Debit + */ +export class SepaDirectDebitPaymentProduct771SpecificInput { + /** + * The unique reference of the existing mandate to use in this payment. + */ + 'existingUniqueMandateReference'?: string; + 'mandate'?: ProcessingMandateInformation; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'existingUniqueMandateReference', + baseName: 'existingUniqueMandateReference', + type: 'string', + format: '', + }, + { + name: 'mandate', + baseName: 'mandate', + type: 'ProcessingMandateInformation', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return SepaDirectDebitPaymentProduct771SpecificInput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/Shipping.ts b/src/models/Shipping.ts new file mode 100644 index 0000000..26178d5 --- /dev/null +++ b/src/models/Shipping.ts @@ -0,0 +1,37 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AddressPersonal } from '../models/AddressPersonal'; + +/** + * Object containing information regarding shipping / delivery + */ +export class Shipping { + 'address'?: AddressPersonal; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'address', + baseName: 'address', + type: 'AddressPersonal', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return Shipping.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/ShoppingCartInput.ts b/src/models/ShoppingCartInput.ts new file mode 100644 index 0000000..8ae41e1 --- /dev/null +++ b/src/models/ShoppingCartInput.ts @@ -0,0 +1,37 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CartItemInput } from '../models/CartItemInput'; + +/** + * Shopping cart data, including items and specific amounts. + */ +export class ShoppingCartInput { + 'items'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'items', + baseName: 'items', + type: 'Array', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return ShoppingCartInput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/ShoppingCartPatch.ts b/src/models/ShoppingCartPatch.ts new file mode 100644 index 0000000..a8249db --- /dev/null +++ b/src/models/ShoppingCartPatch.ts @@ -0,0 +1,37 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CartItemPatch } from '../models/CartItemPatch'; + +/** + * Shopping cart data, including items and specific amounts. + */ +export class ShoppingCartPatch { + 'items'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'items', + baseName: 'items', + type: 'Array', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return ShoppingCartPatch.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/ShoppingCartResult.ts b/src/models/ShoppingCartResult.ts new file mode 100644 index 0000000..c5369df --- /dev/null +++ b/src/models/ShoppingCartResult.ts @@ -0,0 +1,37 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CartItemResult } from '../models/CartItemResult'; + +/** + * Shopping cart data, including items and specific amounts. + */ +export class ShoppingCartResult { + 'items'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'items', + baseName: 'items', + type: 'Array', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return ShoppingCartResult.attributeTypeMap; + } + + public constructor() {} +} diff --git a/src/models/StatusCategoryValue.ts b/src/models/StatusCategoryValue.ts new file mode 100644 index 0000000..b57d9e5 --- /dev/null +++ b/src/models/StatusCategoryValue.ts @@ -0,0 +1,25 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Highlevel status of the payment, payout or Refund. + */ +export enum StatusCategoryValue { + Created = 'CREATED', + Unsuccessful = 'UNSUCCESSFUL', + PendingPayment = 'PENDING_PAYMENT', + PendingMerchant = 'PENDING_MERCHANT', + PendingConnectOr3RdParty = 'PENDING_CONNECT_OR_3RD_PARTY', + Completed = 'COMPLETED', + Reversed = 'REVERSED', + Refunded = 'REFUNDED', +} diff --git a/src/models/StatusCheckout.ts b/src/models/StatusCheckout.ts new file mode 100644 index 0000000..69aab10 --- /dev/null +++ b/src/models/StatusCheckout.ts @@ -0,0 +1,23 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Current high-level status of the Checkout + */ +export enum StatusCheckout { + Open = 'OPEN', + PendingCompletion = 'PENDING_COMPLETION', + Completed = 'COMPLETED', + Billed = 'BILLED', + Chargebacked = 'CHARGEBACKED', + Deleted = 'DELETED', +} diff --git a/src/models/StatusOutput.ts b/src/models/StatusOutput.ts new file mode 100644 index 0000000..1f3bd7c --- /dev/null +++ b/src/models/StatusOutput.ts @@ -0,0 +1,105 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Contains information about whether the payment of the Checkout has already been completed and how much of the total sum has been collected already. + */ +export class StatusOutput { + /** + * * WAITING_FOR_PAYMENT - There does not yet exist a PaymentExecution nor a PaymentInformation for this Checkout. * PAYMENT_NOT_COMPLETED - There exists a PaymentExecution or a PaymentInformation for this Checkout, but all or some part of the total amount is still unpaid. * PAYMENT_COMPLETED - There exists a PaymentExecution or a PaymentInformation for this Checkout and the total amount is fully paid. * NO_PAYMENT - Checkout was created and deleted. No Payment Execution and no other actions can be triggered on the Checkout. + */ + 'paymentStatus'?: StatusOutputPaymentStatusEnum; + /** + * Indicates whether the Checkout can still be modified. False if any payment is already in progress, true otherwise. + */ + 'isModifiable'?: boolean; + /** + * Amount in cents always having 2 decimals. The amount yet to be paid. + */ + 'openAmount'?: number; + /** + * Amount in cents always having 2 decimals. The amount that has already been collected. + */ + 'collectedAmount'?: number; + /** + * Amount in cents always having 2 decimals. The amount that has already been cancelled. + */ + 'cancelledAmount'?: number; + /** + * Amount in cents always having 2 decimals. Amount that has been collected but was refunded to the customer. + */ + 'refundedAmount'?: number; + /** + * Amount in cents always having 2 decimals. Amount that has been collected but was charged back by the customer. + */ + 'chargebackAmount'?: number; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'paymentStatus', + baseName: 'paymentStatus', + type: 'StatusOutputPaymentStatusEnum', + format: '', + }, + { + name: 'isModifiable', + baseName: 'isModifiable', + type: 'boolean', + format: '', + }, + { + name: 'openAmount', + baseName: 'openAmount', + type: 'number', + format: 'int64', + }, + { + name: 'collectedAmount', + baseName: 'collectedAmount', + type: 'number', + format: 'int64', + }, + { + name: 'cancelledAmount', + baseName: 'cancelledAmount', + type: 'number', + format: 'int64', + }, + { + name: 'refundedAmount', + baseName: 'refundedAmount', + type: 'number', + format: 'int64', + }, + { + name: 'chargebackAmount', + baseName: 'chargebackAmount', + type: 'number', + format: 'int64', + }, + ]; + + static getAttributeTypeMap() { + return StatusOutput.attributeTypeMap; + } + + public constructor() {} +} + +export enum StatusOutputPaymentStatusEnum { + WaitingForPayment = 'WAITING_FOR_PAYMENT', + PaymentNotCompleted = 'PAYMENT_NOT_COMPLETED', + PaymentCompleted = 'PAYMENT_COMPLETED', + NoPayment = 'NO_PAYMENT', +} diff --git a/src/models/StatusValue.ts b/src/models/StatusValue.ts new file mode 100644 index 0000000..f6142c9 --- /dev/null +++ b/src/models/StatusValue.ts @@ -0,0 +1,40 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Current high-level status of the payment in a human-readable form. + */ +export enum StatusValue { + Created = 'CREATED', + Cancelled = 'CANCELLED', + Rejected = 'REJECTED', + RejectedCapture = 'REJECTED_CAPTURE', + Redirected = 'REDIRECTED', + PendingPayment = 'PENDING_PAYMENT', + PendingCompletion = 'PENDING_COMPLETION', + PendingCapture = 'PENDING_CAPTURE', + AuthorizationRequested = 'AUTHORIZATION_REQUESTED', + CaptureRequested = 'CAPTURE_REQUESTED', + Captured = 'CAPTURED', + Reversed = 'REVERSED', + RefundRequested = 'REFUND_REQUESTED', + Refunded = 'REFUNDED', + RejectedRefund = 'REJECTED_REFUND', + CancellationRequested = 'CANCELLATION_REQUESTED', + Paused = 'PAUSED', + Chargebacked = 'CHARGEBACKED', + ChargebackReversed = 'CHARGEBACK_REVERSED', + AccountCredited = 'ACCOUNT_CREDITED', + AccountDebited = 'ACCOUNT_DEBITED', + PayoutRequested = 'PAYOUT_REQUESTED', + RejectedCredit = 'REJECTED_CREDIT', +} diff --git a/src/models/ThreeDSecureResults.ts b/src/models/ThreeDSecureResults.ts new file mode 100644 index 0000000..0c0fd42 --- /dev/null +++ b/src/models/ThreeDSecureResults.ts @@ -0,0 +1,63 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * 3D Secure results object + */ +export class ThreeDSecureResults { + /** + * 3D Secure Protocol version used during this transaction. + */ + 'version'?: string; + /** + * 3D Secure ECI (Electronic Commerce Indicator) depending on the Scheme. Returned by DS. + */ + 'schemeEci'?: string; + /** + * Exemption requested and applied in the authorization. + */ + 'appliedExemption'?: ThreeDSecureResultsAppliedExemptionEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{ name: string; baseName: string; type: string; format: string }> = [ + { + name: 'version', + baseName: 'version', + type: 'string', + format: '', + }, + { + name: 'schemeEci', + baseName: 'schemeEci', + type: 'string', + format: '', + }, + { + name: 'appliedExemption', + baseName: 'appliedExemption', + type: 'ThreeDSecureResultsAppliedExemptionEnum', + format: '', + }, + ]; + + static getAttributeTypeMap() { + return ThreeDSecureResults.attributeTypeMap; + } + + public constructor() {} +} + +export enum ThreeDSecureResultsAppliedExemptionEnum { + LowValue = 'low-value', + MerchantAcquirerTransactionRiskAnalysis = 'merchant-acquirer-transaction-risk-analysis', +} diff --git a/src/models/TransactionChannel.ts b/src/models/TransactionChannel.ts new file mode 100644 index 0000000..f624da8 --- /dev/null +++ b/src/models/TransactionChannel.ts @@ -0,0 +1,19 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Indicates the channel via which the payment is created. Allowed values: * ECOMMERCE - The transaction is a regular E-Commerce transaction. * MOTO - The transaction is a Mail Order/Telephone Order. Defaults to ECOMMERCE. + */ +export enum TransactionChannel { + Ecommerce = 'ECOMMERCE', + Moto = 'MOTO', +} diff --git a/src/models/UnscheduledCardOnFileRequestor.ts b/src/models/UnscheduledCardOnFileRequestor.ts new file mode 100644 index 0000000..3294824 --- /dev/null +++ b/src/models/UnscheduledCardOnFileRequestor.ts @@ -0,0 +1,19 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Indicates which party initiated the unscheduled recurring transaction. Allowed values: * merchantInitiated - Merchant Initiated Transaction. * cardholderInitiated - Cardholder Initiated Transaction. Note: * When a customer has chosen to use a token on a hosted Checkout this property is set to \"cardholderInitiated\". + */ +export enum UnscheduledCardOnFileRequestor { + MerchantInitiated = 'merchantInitiated', + CardholderInitiated = 'cardholderInitiated', +} diff --git a/src/models/UnscheduledCardOnFileSequenceIndicator.ts b/src/models/UnscheduledCardOnFileSequenceIndicator.ts new file mode 100644 index 0000000..0ac1ce7 --- /dev/null +++ b/src/models/UnscheduledCardOnFileSequenceIndicator.ts @@ -0,0 +1,19 @@ +/** + * Commerce Platform API + * RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. + * + * OpenAPI spec version: 1.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * * first = This transaction is the first of a series of unscheduled recurring transactions * subsequent = This transaction is a subsequent transaction in a series of unscheduled recurring transactions Note: this property is not allowed if isRecurring is true. + */ +export enum UnscheduledCardOnFileSequenceIndicator { + First = 'first', + Subsequent = 'subsequent', +} diff --git a/src/models/index.ts b/src/models/index.ts new file mode 100644 index 0000000..55d7d34 --- /dev/null +++ b/src/models/index.ts @@ -0,0 +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'; diff --git a/src/queries/GetCheckoutsQuery.ts b/src/queries/GetCheckoutsQuery.ts new file mode 100644 index 0000000..91ab322 --- /dev/null +++ b/src/queries/GetCheckoutsQuery.ts @@ -0,0 +1,417 @@ +import { PaymentChannel, StatusCheckout, ExtendedCheckoutStatus } from '../models'; +import { QueryConfig } from '../utils/QueryConfig'; + +export class GetCheckoutsQuery implements QueryConfig { + private offset?: number; + private size?: number; + private fromDate?: string; + private toDate?: string; + private fromCheckoutAmount?: number; + private toCheckoutAmount?: number; + private fromOpenAmount?: number; + private toOpenAmount?: number; + private fromCollectedAmount?: number; + private toCollectedAmount?: number; + private fromCancelledAmount?: number; + private toCancelledAmount?: number; + private fromRefundAmount?: number; + private toRefundAmount?: number; + private fromChargebackAmount?: number; + private toChargebackAmount?: number; + private checkoutId?: string; + private merchantReference?: string; + private merchantCustomerId?: string; + private includePaymentProductId?: number[]; + private includeCheckoutStatus?: StatusCheckout[]; + private includeExtendedCheckoutStatus?: ExtendedCheckoutStatus[]; + private includePaymentChannel?: PaymentChannel[]; + private paymentReference?: string; + private paymentId?: string; + private firstName?: string; + private surname?: string; + private email?: string; + private phoneNumber?: string; + private dateOfBirth?: string; + private companyInformation?: string; + + constructor() {} + + public setOffset(offset: number): this { + this.offset = offset; + return this; + } + + public setSize(size: number): this { + this.size = size; + return this; + } + + public setFromDate(fromDate: string): this { + this.fromDate = fromDate; + return this; + } + + public setToDate(toDate: string): this { + this.toDate = toDate; + return this; + } + + public setFromCheckoutAmount(fromCheckoutAmount: number): this { + this.fromCheckoutAmount = fromCheckoutAmount; + return this; + } + + public setToCheckoutAmount(toCheckoutAmount: number): this { + this.toCheckoutAmount = toCheckoutAmount; + return this; + } + + public setFromOpenAmount(fromOpenAmount: number): this { + this.fromOpenAmount = fromOpenAmount; + return this; + } + + public setToOpenAmount(toOpenAmount: number): this { + this.toOpenAmount = toOpenAmount; + return this; + } + + public setFromCollectedAmount(fromCollectedAmount: number): this { + this.fromCollectedAmount = fromCollectedAmount; + return this; + } + + public setToCollectedAmount(toCollectedAmount: number): this { + this.toCollectedAmount = toCollectedAmount; + return this; + } + + public setFromCancelledAmount(fromCancelledAmount: number): this { + this.fromCancelledAmount = fromCancelledAmount; + return this; + } + + public setToCancelledAmount(toCancelledAmount: number): this { + this.toCancelledAmount = toCancelledAmount; + return this; + } + + public setFromRefundAmount(fromRefundAmount: number): this { + this.fromRefundAmount = fromRefundAmount; + return this; + } + + public setToRefundAmount(toRefundAmount: number): this { + this.toRefundAmount = toRefundAmount; + return this; + } + + public setFromChargebackAmount(fromChargebackAmount: number): this { + this.fromChargebackAmount = fromChargebackAmount; + return this; + } + + public setToChargebackAmount(toChargebackAmount: number): this { + this.toChargebackAmount = toChargebackAmount; + return this; + } + + public setCheckoutId(checkoutId: string): this { + this.checkoutId = checkoutId; + return this; + } + + public setMerchantReference(merchantReference: string): this { + this.merchantReference = merchantReference; + return this; + } + + public setMerchantCustomerId(merchantCustomerId: string): this { + this.merchantCustomerId = merchantCustomerId; + return this; + } + + public setIncludePaymentProductId(includePaymentProductId: number[]): this { + this.includePaymentProductId = includePaymentProductId; + return this; + } + + public setIncludeCheckoutStatus(includeCheckoutStatus: StatusCheckout[]): this { + this.includeCheckoutStatus = includeCheckoutStatus; + return this; + } + + public setIncludeExtendedCheckoutStatus(includeExtendedCheckoutStatus: ExtendedCheckoutStatus[]): this { + this.includeExtendedCheckoutStatus = includeExtendedCheckoutStatus; + return this; + } + + public setIncludePaymentChannel(includePaymentChannel: PaymentChannel[]): this { + this.includePaymentChannel = includePaymentChannel; + return this; + } + + public setPaymentReference(paymentReference: string): this { + this.paymentReference = paymentReference; + return this; + } + + public setPaymentId(paymentId: string): this { + this.paymentId = paymentId; + return this; + } + + public setFirstName(firstName: string): this { + this.firstName = firstName; + return this; + } + + public setSurname(surname: string): this { + this.surname = surname; + return this; + } + + public setEmail(email: string): this { + this.email = email; + return this; + } + + public setPhoneNumber(phoneNumber: string): this { + this.phoneNumber = phoneNumber; + return this; + } + + public setDateOfBirth(dateOfBirth: string): this { + this.dateOfBirth = dateOfBirth; + return this; + } + + public setCompanyInformation(companyInformation: string): this { + this.companyInformation = companyInformation; + return this; + } + + public getOffset(): number | undefined { + return this.offset; + } + + public getSize(): number | undefined { + return this.size; + } + + public getFromDate(): string | undefined { + return this.fromDate; + } + + public getToDate(): string | undefined { + return this.toDate; + } + + public getFromCheckoutAmount(): number | undefined { + return this.fromCheckoutAmount; + } + + public getToCheckoutAmount(): number | undefined { + return this.toCheckoutAmount; + } + + public getFromOpenAmount(): number | undefined { + return this.fromOpenAmount; + } + + public getToOpenAmount(): number | undefined { + return this.toOpenAmount; + } + + public getFromCollectedAmount(): number | undefined { + return this.fromCollectedAmount; + } + + public getToCollectedAmount(): number | undefined { + return this.toCollectedAmount; + } + + public getFromCancelledAmount(): number | undefined { + return this.fromCancelledAmount; + } + + public getToCancelledAmount(): number | undefined { + return this.toCancelledAmount; + } + + public getFromRefundAmount(): number | undefined { + return this.fromRefundAmount; + } + + public getToRefundAmount(): number | undefined { + return this.toRefundAmount; + } + + public getFromChargebackAmount(): number | undefined { + return this.fromChargebackAmount; + } + + public getToChargebackAmount(): number | undefined { + return this.toChargebackAmount; + } + + public getCheckoutId(): string | undefined { + return this.checkoutId; + } + + public getMerchantReference(): string | undefined { + return this.merchantReference; + } + + public getMerchantCustomerId(): string | undefined { + return this.merchantCustomerId; + } + + public getIncludePaymentProductId(): number[] | undefined { + return this.includePaymentProductId; + } + + public getIncludeCheckoutStatus(): StatusCheckout[] | undefined { + return this.includeCheckoutStatus; + } + + public getIncludeExtendedCheckoutStatus(): ExtendedCheckoutStatus[] | undefined { + return this.includeExtendedCheckoutStatus; + } + + public getIncludePaymentChannel(): PaymentChannel[] | undefined { + return this.includePaymentChannel; + } + + public getPaymentReference(): string | undefined { + return this.paymentReference; + } + + public getPaymentId(): string | undefined { + return this.paymentId; + } + + public getFirstName(): string | undefined { + return this.firstName; + } + + public getSurname(): string | undefined { + return this.surname; + } + + public getEmail(): string | undefined { + return this.email; + } + + public getPhoneNumber(): string | undefined { + return this.phoneNumber; + } + + public getDateOfBirth(): string | undefined { + return this.dateOfBirth; + } + + public getCompanyInformation(): string | undefined { + return this.companyInformation; + } + + public toQueryMap(): Map { + const query = new Map(); + + if (this.offset !== undefined) { + query.set('offset', this.offset.toString()); + } + if (this.size !== undefined) { + query.set('size', this.size.toString()); + } + if (this.fromDate !== undefined) { + query.set('fromDate', this.fromDate); + } + if (this.toDate !== undefined) { + query.set('toDate', this.toDate); + } + if (this.fromCheckoutAmount !== undefined) { + query.set('fromCheckoutAmount', this.fromCheckoutAmount.toString()); + } + if (this.toCheckoutAmount !== undefined) { + query.set('toCheckoutAmount', this.toCheckoutAmount.toString()); + } + if (this.fromOpenAmount !== undefined) { + query.set('fromOpenAmount', this.fromOpenAmount.toString()); + } + if (this.toOpenAmount !== undefined) { + query.set('toOpenAmount', this.toOpenAmount.toString()); + } + if (this.fromCollectedAmount !== undefined) { + query.set('fromCollectedAmount', this.fromCollectedAmount.toString()); + } + if (this.toCollectedAmount !== undefined) { + query.set('toCollectedAmount', this.toCollectedAmount.toString()); + } + if (this.fromCancelledAmount !== undefined) { + query.set('fromCancelledAmount', this.fromCancelledAmount.toString()); + } + if (this.toCancelledAmount !== undefined) { + query.set('toCancelledAmount', this.toCancelledAmount.toString()); + } + if (this.fromRefundAmount !== undefined) { + query.set('fromRefundAmount', this.fromRefundAmount.toString()); + } + if (this.toRefundAmount !== undefined) { + query.set('toRefundAmount', this.toRefundAmount.toString()); + } + if (this.fromChargebackAmount !== undefined) { + query.set('fromChargebackAmount', this.fromChargebackAmount.toString()); + } + if (this.toChargebackAmount !== undefined) { + query.set('toChargebackAmount', this.toChargebackAmount.toString()); + } + if (this.checkoutId !== undefined) { + query.set('checkoutId', this.checkoutId); + } + if (this.merchantReference !== undefined) { + query.set('merchantReference', this.merchantReference); + } + if (this.merchantCustomerId !== undefined) { + query.set('merchantCustomerId', this.merchantCustomerId); + } + if (this.includePaymentProductId !== undefined) { + const productIdList = this.includePaymentProductId.map(productId => productId.toString()); + query.set('includePaymentProductId', productIdList.join(',')); + } + if (this.includeCheckoutStatus !== undefined) { + query.set('includeCheckoutStatus', this.includeCheckoutStatus.join(',')); + } + if (this.includeExtendedCheckoutStatus !== undefined) { + query.set('includeExtendedCheckoutStatus', this.includeExtendedCheckoutStatus.join(',')); + } + if (this.includePaymentChannel !== undefined) { + query.set('includePaymentChannel', this.includePaymentChannel.join(',')); + } + if (this.paymentReference !== undefined) { + query.set('paymentReference', this.paymentReference); + } + if (this.paymentId !== undefined) { + query.set('paymentId', this.paymentId); + } + if (this.firstName !== undefined) { + query.set('firstName', this.firstName); + } + if (this.surname !== undefined) { + query.set('surname', this.surname); + } + if (this.email !== undefined) { + query.set('email', this.email); + } + if (this.phoneNumber !== undefined) { + query.set('phoneNumber', this.phoneNumber); + } + if (this.dateOfBirth !== undefined) { + query.set('dateOfBirth', this.dateOfBirth); + } + if (this.companyInformation !== undefined) { + query.set('companyInformation', this.companyInformation); + } + return query; + } +} diff --git a/src/queries/GetCommerceCasesQuery.ts b/src/queries/GetCommerceCasesQuery.ts new file mode 100644 index 0000000..1ecbe7d --- /dev/null +++ b/src/queries/GetCommerceCasesQuery.ts @@ -0,0 +1,130 @@ +import { PaymentChannel, StatusCheckout } from '../models'; +import { QueryConfig } from '../utils/QueryConfig'; + +export class GetCommerceCasesQuery implements QueryConfig { + private offset?: number; + private size?: number; + private fromDate?: string; + private toDate?: string; + private commerceCaseId?: string; + private merchantReference?: string; + private merchantCustomerId?: string; + private includeCheckoutStatus?: StatusCheckout[]; + private includePaymentChannel?: PaymentChannel[]; + + constructor() {} + + public setOffset(offset: number): this { + this.offset = offset; + return this; + } + + public setSize(size: number): this { + this.size = size; + return this; + } + + public setFromDate(fromDate: string): this { + this.fromDate = fromDate; + return this; + } + + public setToDate(toDate: string): this { + this.toDate = toDate; + return this; + } + + public setCommerceCaseId(commerceCaseId: string): this { + this.commerceCaseId = commerceCaseId; + return this; + } + + public setMerchantReference(merchantReference: string): this { + this.merchantReference = merchantReference; + return this; + } + + public setMerchantCustomerId(merchantCustomerId: string): this { + this.merchantCustomerId = merchantCustomerId; + return this; + } + + public setIncludeCheckoutStatus(includeCheckoutStatus: StatusCheckout[]): this { + this.includeCheckoutStatus = includeCheckoutStatus; + return this; + } + + public setIncludePaymentChannel(includePaymentChannel: PaymentChannel[]): this { + this.includePaymentChannel = includePaymentChannel; + return this; + } + + public getOffset(): number | undefined { + return this.offset; + } + + public getSize(): number | undefined { + return this.size; + } + + public getFromDate(): string | undefined { + return this.fromDate; + } + + public getToDate(): string | undefined { + return this.toDate; + } + + public getCommerceCaseId(): string | undefined { + return this.commerceCaseId; + } + + public getMerchantReference(): string | undefined { + return this.merchantReference; + } + + public getMerchantCustomerId(): string | undefined { + return this.merchantCustomerId; + } + + public getIncludeCheckoutStatus(): StatusCheckout[] | undefined { + return this.includeCheckoutStatus; + } + + public getIncludePaymentChannel(): PaymentChannel[] | undefined { + return this.includePaymentChannel; + } + + public toQueryMap(): Map { + const query = new Map(); + + if (this.offset !== undefined) { + query.set('offset', this.offset.toString()); + } + if (this.size !== undefined) { + query.set('size', this.size.toString()); + } + if (this.fromDate !== undefined) { + query.set('fromDate', this.fromDate); + } + if (this.toDate !== undefined) { + query.set('toDate', this.toDate); + } + if (this.commerceCaseId !== undefined) { + query.set('commerceCaseId', this.commerceCaseId); + } + if (this.merchantReference !== undefined) { + query.set('merchantReference', this.merchantReference); + } + if (this.merchantCustomerId !== undefined) { + query.set('merchantCustomerId', this.merchantCustomerId); + } + if (this.includeCheckoutStatus !== undefined) { + query.set('includeCheckoutStatus', this.includeCheckoutStatus.join(',')); + } + if (this.includePaymentChannel !== undefined) { + query.set('includePaymentChannel', this.includePaymentChannel.join(',')); + } + return query; + } +} diff --git a/src/queries/index.ts b/src/queries/index.ts new file mode 100644 index 0000000..4e15fc7 --- /dev/null +++ b/src/queries/index.ts @@ -0,0 +1,2 @@ +export { GetCheckoutsQuery } from './GetCheckoutsQuery'; +export { GetCommerceCasesQuery } from './GetCommerceCasesQuery'; diff --git a/src/utils/QueryConfig.ts b/src/utils/QueryConfig.ts new file mode 100644 index 0000000..b483800 --- /dev/null +++ b/src/utils/QueryConfig.ts @@ -0,0 +1,3 @@ +export interface QueryConfig { + toQueryMap: () => Map; +} diff --git a/src/utils/ServerMetaInfo.ts b/src/utils/ServerMetaInfo.ts new file mode 100644 index 0000000..61293ea --- /dev/null +++ b/src/utils/ServerMetaInfo.ts @@ -0,0 +1,41 @@ +import * as os from 'os'; + +export class ServerMetaInfo { + public platformIdentifier: string; + public sdkIdentifier: string; + public sdkCreator: string; + + constructor() { + this.platformIdentifier = `${os.platform()}, node version is: ${process.version}`; + this.sdkIdentifier = 'JavaServerSDK/v0.0.2'; // version gets updated with the prepare-release.sh script + this.sdkCreator = 'PAYONE GmbH'; + + // TODO: what about integrator? + } + + public equals(other: ServerMetaInfo): boolean { + if (this === other) { + return true; + } + if (!other || this.constructor !== other.constructor) { + return false; + } + const that: ServerMetaInfo = other as ServerMetaInfo; + return ( + this.platformIdentifier === that.platformIdentifier && + this.sdkIdentifier === that.sdkIdentifier && + this.sdkCreator === that.sdkCreator + ); + } + + public hashCode(): number { + let hash = 0; + const str = `${this.platformIdentifier}${this.sdkIdentifier}${this.sdkCreator}`; + for (let i = 0; i < str.length; i++) { + const char = str.charCodeAt(i); + hash = (hash << 5) - hash + char; + hash |= 0; // Convert to 32bit integer + } + return hash; + } +} diff --git a/yarn.lock b/yarn.lock index 5c355aa..447ae82 100644 --- a/yarn.lock +++ b/yarn.lock @@ -337,6 +337,11 @@ cross-spawn@^7.0.2: shebang-command "^2.0.0" which "^2.0.1" +data-uri-to-buffer@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e" + integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== + debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: version "4.3.5" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e" @@ -490,6 +495,14 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" +fetch-blob@^3.1.2, fetch-blob@^3.1.4: + version "3.2.0" + resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9" + integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ== + dependencies: + node-domexception "^1.0.0" + web-streams-polyfill "^3.0.3" + file-entry-cache@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f" @@ -525,6 +538,13 @@ flatted@^3.2.9: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a" integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw== +formdata-polyfill@^4.0.10: + version "4.0.10" + resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" + integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== + dependencies: + fetch-blob "^3.1.2" + glob-parent@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" @@ -707,6 +727,20 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== +node-domexception@^1.0.0: + version "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: + version "3.3.2" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b" + integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA== + dependencies: + data-uri-to-buffer "^4.0.0" + fetch-blob "^3.1.4" + formdata-polyfill "^4.0.10" + optionator@^0.9.3: version "0.9.4" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.4.tgz#7ea1c1a5d91d764fb282139c88fe11e182a3a734" @@ -912,6 +946,11 @@ v8-compile-cache-lib@^3.0.1: resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== +web-streams-polyfill@^3.0.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz#2073b91a2fdb1fbfbd401e7de0ac9f8214cecb4b" + integrity sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw== + which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"