diff --git a/.github/workflows/models.yml b/.github/workflows/models.yml index a8c4b17..b47a972 100644 --- a/.github/workflows/models.yml +++ b/.github/workflows/models.yml @@ -1,6 +1,6 @@ name: Node.js Models -on: [ workflow_dispatch, pull_request ] +on: [ workflow_dispatch ] jobs: generate: diff --git a/src/__mocks__/base.ts b/src/__mocks__/base.ts index 7098239..7a2e207 100644 --- a/src/__mocks__/base.ts +++ b/src/__mocks__/base.ts @@ -44,7 +44,7 @@ export const createClient = (apiKey = process.env.ADYEN_API_KEY): Client => { config.checkoutEndpoint = Client.CHECKOUT_ENDPOINT_TEST; config.marketPayEndpoint = Client.MARKETPAY_ENDPOINT_TEST; config.apiKey = apiKey; - config.marketPayEndpoint = Client.MARKETPAY_ENDPOINT_TEST; + config.paymentEndpoint = Client.PAYMENT_API_ENDPOINT_TEST; return new Client({ config }); }; diff --git a/src/__tests__/binLookup.spec.ts b/src/__tests__/binLookup.spec.ts index aa970ee..e9c6835 100644 --- a/src/__tests__/binLookup.spec.ts +++ b/src/__tests__/binLookup.spec.ts @@ -1,21 +1,3 @@ -/* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ - * Adyen NodeJS API Library - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. - */ import nock from "nock"; import { createClient } from "../__mocks__/base"; import BinLookup from "../services/binLookup"; @@ -49,8 +31,7 @@ afterEach((): void => { }); describe("Bin Lookup", function (): void { - test.each([false, true])("should succeed on get 3ds availability. isMock: %p", async function (isMock): Promise { - !isMock && nock.restore(); + test("should succeed on get 3ds availability", async function (): Promise { const threeDSAvailabilityRequest: IBinLookup.ThreeDSAvailabilityRequest = { merchantAccount: process.env.ADYEN_MERCHANT!, brands: ["randomBrand"], diff --git a/src/__tests__/checkout.spec.ts b/src/__tests__/checkout.spec.ts index 6039df1..87cf9d6 100644 --- a/src/__tests__/checkout.spec.ts +++ b/src/__tests__/checkout.spec.ts @@ -48,7 +48,9 @@ import { PaymentSetupRequest, PaymentVerificationRequest, CreateCheckoutSessionRequest, - CreateCheckoutSessionResponse + CreateCheckoutSessionResponse, + CardDetailsRequest, + CardDetailsResponse } from "../typings/checkout/models"; const merchantAccount = process.env.ADYEN_MERCHANT!; @@ -411,4 +413,23 @@ describe("Checkout", (): void => { const sessionsResponse: CreateCheckoutSessionResponse = await checkout.sessions(sessionsRequest); expect(sessionsResponse.sessionData).toBeTruthy(); }); + + test("Should get card details", async (): Promise => { + scope.post("/cardDetails") + .reply(200, { + "brands": [ + { + "supported": true, + "type": "visa" + } + ] + }); + + const cardDetailsRequest: CardDetailsRequest = { + "merchantAccount": "YOUR_MERCHANT_ACCOUNT", + "cardNumber": "411111" + }; + const cardDetailsReponse: CardDetailsResponse = await checkout.cardDetails(cardDetailsRequest); + expect(cardDetailsReponse?.brands?.length).toBe(1); + }); }); diff --git a/src/__tests__/classicIntegration.spec.ts b/src/__tests__/classicIntegration.spec.ts new file mode 100644 index 0000000..d471d51 --- /dev/null +++ b/src/__tests__/classicIntegration.spec.ts @@ -0,0 +1,309 @@ +import nock from "nock"; +import {createClient} from "../__mocks__/base"; +import Client from "../client"; +import ClassicIntegration from "../services/classicIntegration"; +import { PaymentRequest } from "../typings/payments/paymentRequest"; +import { PaymentResult } from "../typings/payments/paymentResult"; +import { PaymentRequest3d } from "../typings/payments/paymentRequest3d"; +import { PaymentRequest3ds2 } from "../typings/payments/paymentRequest3ds2"; +import { AuthenticationResultRequest } from "../typings/payments/authenticationResultRequest"; +import { AuthenticationResultResponse } from "../typings/payments/authenticationResultResponse"; +import { ThreeDS2ResultRequest } from "../typings/payments/threeDS2ResultRequest"; +import { ThreeDS2ResultResponse } from "../typings/payments/threeDS2ResultResponse"; +import { ModificationResult } from "../typings/payments/modificationResult"; +import { CaptureRequest } from "../typings/payments/captureRequest"; +import { CancelRequest } from "../typings/payments/cancelRequest"; +import { RefundRequest } from "../typings/payments/refundRequest"; +import { CancelOrRefundRequest } from "../typings/payments/cancelOrRefundRequest"; +import { TechnicalCancelRequest } from "../typings/payments/technicalCancelRequest"; +import { AdjustAuthorisationRequest } from "../typings/payments/adjustAuthorisationRequest"; +import { DonationRequest } from "../typings/payments/donationRequest"; +import { VoidPendingRefundRequest } from "../typings/payments/voidPendingRefundRequest"; + +let client: Client; +let classicIntegration: ClassicIntegration; +let scope: nock.Scope; + +beforeEach((): void => { + if (!nock.isActive()) { + nock.activate(); + } + client = createClient(); + scope = nock(`${client.config.paymentEndpoint}/${Client.PAYMENT_API_VERSION}`); + classicIntegration = new ClassicIntegration(client); +}); + +afterEach(() => { + nock.cleanAll(); +}); + +describe("Classic Integration", (): void => { + test("Should authorise payment", async (): Promise => { + scope.post("/authorise") + .reply(200, { + "additionalData": { + "scaExemptionRequested": "transactionRiskAnalysis", + "checkout.cardAddedBrand": "visa" + }, + "pspReference": "JVBXGSDM53RZNN82", + "resultCode": "Authorised", + "authCode": "011381" + } + ); + const paymentRequest: PaymentRequest = { + "card": { + "number": "4111111111111111", + "expiryMonth": "03", + "expiryYear": "2030", + "cvc": "737", + "holderName": "John Smith" + }, + "amount": { + "value": 1500, + "currency": "EUR" + }, + "reference": "YOUR_REFERENCE", + "merchantAccount": "YOUR_MERCHANT_ACCOUNT" + }; + + const paymentResult: PaymentResult = await classicIntegration.authorise(paymentRequest); + expect(paymentResult.pspReference).toEqual("JVBXGSDM53RZNN82"); + }); + + test("Should complete 3DS authorisation", async (): Promise => { + scope.post("/authorise3d") + .reply(200, { + "additionalData": { + "scaExemptionRequested": "transactionRiskAnalysis", + "checkout.cardAddedBrand": "visa" + }, + "pspReference": "JVBXGSDM53RZNN82", + "resultCode": "Authorised", + "authCode": "011381" + } + ); + const paymentRequest: PaymentRequest3d = { + "md": "31h..........vOXek7w", + "paResponse": "eNqtmF........wGVA4Ch", + "shopperIP": "61.294.12.12", + "merchantAccount": "YOUR_MERCHANT_ACCOUNT" + }; + + const paymentResult: PaymentResult = await classicIntegration.authorise3d(paymentRequest); + expect(paymentResult.pspReference).toEqual("JVBXGSDM53RZNN82"); + }); + + test("Should complete 3DS2 authorisation", async (): Promise => { + scope.post("/authorise3ds2") + .reply(200, { + "additionalData": { + "scaExemptionRequested": "transactionRiskAnalysis", + "checkout.cardAddedBrand": "visa" + }, + "pspReference": "JVBXGSDM53RZNN82", + "resultCode": "Authorised", + "authCode": "011381" + } + ); + const paymentRequest: PaymentRequest3ds2 = { + "merchantAccount": "YOUR_MERCHANT_ACCOUNT", + "amount": { + "value": 1500, + "currency": "EUR" + }, + "reference": "YOUR_REFERENCE", + "threeDS2RequestData": { + "threeDSCompInd": "Y", + "deviceChannel": "testDeviceChannel" + }, + "threeDS2Token": "— - BINARY DATA - -" + }; + + const paymentResult: PaymentResult = await classicIntegration.authorise3ds2(paymentRequest); + expect(paymentResult.pspReference).toEqual("JVBXGSDM53RZNN82"); + }); + + test("Should get auth result after 3DS authentication", async (): Promise => { + scope.post("/getAuthenticationResult").reply(200, { + "threeDS2Result": { "authenticationValue": "THREEDS2RESULT"} + }); + + const getAuthenticationResultrequest: AuthenticationResultRequest = { + "merchantAccount": "YOUR_MERCHANT_ACCOUNT", + "pspReference": "9935272408535455" + }; + + const getAuthenticationResultResponse: AuthenticationResultResponse = await classicIntegration.getAuthenticationResult(getAuthenticationResultrequest); + expect(getAuthenticationResultResponse?.threeDS2Result?.authenticationValue).toEqual("THREEDS2RESULT"); + }); + + test("Should retrieve 3DS2 result", async (): Promise => { + scope.post("/retrieve3ds2Result").reply(200, { + "threeDS2Result": { "authenticationValue": "THREEDS2RESULT"} + }); + const retrieve3ds2ResultRequest: ThreeDS2ResultRequest = { + "merchantAccount": "YOUR_MERCHANT_ACCOUNT", + "pspReference": "9935272408535455" + }; + + const retrieve3ds2ResultResponse: ThreeDS2ResultResponse = await classicIntegration.retrieve3ds2Result(retrieve3ds2ResultRequest); + expect(retrieve3ds2ResultResponse?.threeDS2Result?.authenticationValue).toEqual("THREEDS2RESULT"); + }); + + test("Should succesfully send Capture request", async (): Promise => { + scope.post("/capture") + .reply(200, { + "pspReference": "YOUR_REFERENCE", + "response": "[capture-received]" + }); + + const modificationRequest: CaptureRequest = { + "originalReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE", + "modificationAmount": { + "value": 500, + "currency": "EUR" + }, + "reference": "YourModificationReference", + "merchantAccount": "YOUR_MERCHANT_ACCOUNT" + }; + + const modificationResult: ModificationResult = await classicIntegration.capture(modificationRequest); + expect(modificationResult.response).toEqual(ModificationResult.ResponseEnum.CaptureReceived); + }); + + test("Should succesfully send Cancel request", async (): Promise => { + scope.post("/cancel") + .reply(200, { + "pspReference": "YOUR_REFERENCE", + "response": "[cancel-received]" + }); + + const modificationRequest: CancelRequest = { + "originalReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE", + "reference": "YourModificationReference", + "merchantAccount": "YOUR_MERCHANT_ACCOUNT" + }; + + const modificationResult: ModificationResult = await classicIntegration.cancel(modificationRequest); + expect(modificationResult.response).toEqual(ModificationResult.ResponseEnum.CancelReceived); + }); + + test("Should succesfully send Refund request", async (): Promise => { + scope.post("/refund") + .reply(200, { + "pspReference": "YOUR_REFERENCE", + "response": "[refund-received]" + }); + + const modificationRequest: RefundRequest = { + "originalReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE", + "modificationAmount": { + "value": 500, + "currency": "EUR" + }, + "reference": "YourModificationReference", + "merchantAccount": "YOUR_MERCHANT_ACCOUNT" + }; + + const modificationResult: ModificationResult = await classicIntegration.refund(modificationRequest); + expect(modificationResult.response).toEqual(ModificationResult.ResponseEnum.RefundReceived); + }); + + test("Should succesfully send CancelOrRefund request", async (): Promise => { + scope.post("/cancelOrRefund") + .reply(200, { + "pspReference": "YOUR_REFERENCE", + "response": "[cancelOrRefund-received]" + }); + + const modificationRequest: CancelOrRefundRequest = { + "originalReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE", + "reference": "YourModificationReference", + "merchantAccount": "YOUR_MERCHANT_ACCOUNT" + }; + + const modificationResult: ModificationResult = await classicIntegration.cancelOrRefund(modificationRequest); + expect(modificationResult.response).toEqual(ModificationResult.ResponseEnum.CancelOrRefundReceived); + }); + + test("Should succesfully send TechnicalCancel request", async (): Promise => { + scope.post("/technicalCancel") + .reply(200, { + "pspReference": "YOUR_REFERENCE", + "response": "[technical-cancel-received]" + }); + + const modificationRequest: TechnicalCancelRequest = { + "originalMerchantReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE", + "modificationAmount": { + "value": 500, + "currency": "EUR" + }, + "reference": "YourModificationReference", + "merchantAccount": "YOUR_MERCHANT_ACCOUNT" + }; + + const modificationResult: ModificationResult = await classicIntegration.technicalCancel(modificationRequest); + expect(modificationResult.response).toEqual(ModificationResult.ResponseEnum.TechnicalCancelReceived); + }); + + test("Should succesfully send AdjustAuthorisation request", async (): Promise => { + scope.post("/adjustAuthorisation") + .reply(200, { + "pspReference": "YOUR_REFERENCE", + "response": "[adjustAuthorisation-received]" + }); + + const modificationRequest: AdjustAuthorisationRequest = { + "originalReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE", + "modificationAmount": { + "value": 500, + "currency": "EUR" + }, + "reference": "YourModificationReference", + "merchantAccount": "YOUR_MERCHANT_ACCOUNT" + }; + + const modificationResult: ModificationResult = await classicIntegration.adjustAuthorisation(modificationRequest); + expect(modificationResult.response).toEqual(ModificationResult.ResponseEnum.AdjustAuthorisationReceived); + }); + + test("Should succesfully send Donate request", async (): Promise => { + scope.post("/donate") + .reply(200, { + "pspReference": "YOUR_REFERENCE", + "response": "[donation-received]" + }); + + const modificationRequest: DonationRequest = { + "originalReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE", + "modificationAmount": { + "value": 500, + "currency": "EUR" + }, + "reference": "YOUR_DONATION_REFERENCE", + "donationAccount": "AdyenGivingDemo", + "merchantAccount": "YOUR_MERCHANT_ACCOUNT" + }; + + const modificationResult: ModificationResult = await classicIntegration.donate(modificationRequest); + expect(modificationResult.response).toEqual(ModificationResult.ResponseEnum.DonationReceived); + }); + + test("Should succesfully send VoidPendingRefund request", async (): Promise => { + scope.post("/voidPendingRefund") + .reply(200, { + "pspReference": "YOUR_REFERENCE", + "response": "[voidPendingRefund-received]" + }); + + const modificationRequest: VoidPendingRefundRequest = { + "merchantAccount": "YOUR_MERCHANT_ACCOUNT", + "tenderReference": "5Iw8001176969533005", + "uniqueTerminalId": "VX820-123456789" + }; + + const modificationResult: ModificationResult = await classicIntegration.voidPendingRefund(modificationRequest); + expect(modificationResult.response).toEqual(ModificationResult.ResponseEnum.VoidPendingRefundReceived); + }); +}); \ No newline at end of file diff --git a/src/__tests__/modification.spec.ts b/src/__tests__/modification.spec.ts index 02b7b2e..ace5f48 100644 --- a/src/__tests__/modification.spec.ts +++ b/src/__tests__/modification.spec.ts @@ -1,25 +1,6 @@ -/* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ - * Adyen NodeJS API Library - * Copyright (c) 2021 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. - */ - import nock from "nock"; import {createClient} from "../__mocks__/base"; -import Modification from "../services/modification"; +import Checkout from "../services/checkout"; import Client from "../client"; import { CreatePaymentAmountUpdateRequest, @@ -168,7 +149,7 @@ const createReversalsResponse = (): PaymentReversalResource => { let client: Client; -let modification: Modification; +let checkout: Checkout; let scope: nock.Scope; const paymentPspReference = "863620292981235A"; const invalidPaymentPspReference = "invalid_psp_reference"; @@ -179,7 +160,7 @@ beforeEach((): void => { nock.activate(); } client = createClient(); - modification = new Modification(client); + checkout = new Checkout(client); scope = nock(`${client.config.checkoutEndpoint}/${Client.CHECKOUT_API_VERSION}`); }); @@ -194,7 +175,7 @@ describe("Modification", (): void => { scope.post(`/payments/${paymentPspReference}/amountUpdates`) .reply(200, createAmountUpdateResponse()); try { - const result = await modification.amountUpdates(paymentPspReference, request); + const result = await checkout.amountUpdates(paymentPspReference, request); expect(result).toBeTruthy(); } catch (e: any) { if(e.message) fail(e.message); @@ -209,7 +190,7 @@ describe("Modification", (): void => { .reply(422, invalidModificationResult); try { - await modification.amountUpdates(invalidPaymentPspReference, request); + await checkout.amountUpdates(invalidPaymentPspReference, request); } catch (e: any) { expect(e.statusCode).toBe(422); expect(e.message).toContain("Original pspReference required for this operation"); @@ -222,7 +203,7 @@ describe("Modification", (): void => { scope.post(`/payments/${paymentPspReference}/cancels`) .reply(200, createCancelsResponse()); try { - const result = await modification.cancels(paymentPspReference, request); + const result = await checkout.cancels(paymentPspReference, request); expect(result).toBeTruthy(); } catch (e: any) { fail(e.message); @@ -236,7 +217,7 @@ describe("Modification", (): void => { scope.post(`/payments/${invalidPaymentPspReference}/cancels`) .reply(422, invalidModificationResult); try { - await modification.cancels(invalidPaymentPspReference, request); + await checkout.cancels(invalidPaymentPspReference, request); } catch (e: any) { expect(e.statusCode).toBe(422); expect(e.message).toContain("Original pspReference required for this operation"); @@ -249,7 +230,7 @@ describe("Modification", (): void => { scope.post("/cancels") .reply(200, createStandaloneCancelsResponse()); try { - const result = await modification.cancelsStandalone(request); + const result = await checkout.cancelsStandalone(request); expect(result).toBeTruthy(); } catch (e: any) { fail(e.message); @@ -262,7 +243,7 @@ describe("Modification", (): void => { scope.post(`/payments/${paymentPspReference}/captures`) .reply(200, createCapturesResponse()); try { - const result = await modification.captures(paymentPspReference, request); + const result = await checkout.captures(paymentPspReference, request); expect(result).toBeTruthy(); } catch (e: any) { fail(e.message); @@ -276,7 +257,7 @@ describe("Modification", (): void => { scope.post(`/payments/${invalidPaymentPspReference}/captures`) .reply(422, invalidModificationResult); try { - await modification.captures(invalidPaymentPspReference, request); + await checkout.captures(invalidPaymentPspReference, request); } catch (e: any) { if(e.statusCode) expect(e.statusCode).toBe(422); if(e.message) expect(e.message).toContain("Original pspReference required for this operation"); @@ -289,7 +270,7 @@ describe("Modification", (): void => { scope.post(`/payments/${paymentPspReference}/refunds`) .reply(200, createRefundsResponse()); try { - const result = await modification.refunds(paymentPspReference, request); + const result = await checkout.refunds(paymentPspReference, request); expect(result).toBeTruthy(); } catch (e: any) { if(e.message) fail(e.message); @@ -303,7 +284,7 @@ describe("Modification", (): void => { scope.post(`/payments/${invalidPaymentPspReference}/refunds`) .reply(422, invalidModificationResult); try { - await modification.refunds(invalidPaymentPspReference, request); + await checkout.refunds(invalidPaymentPspReference, request); } catch (e: any) { if(e.statusCode) expect(e.statusCode).toBe(422); expect(e.message).toContain("Original pspReference required for this operation"); @@ -316,7 +297,7 @@ describe("Modification", (): void => { scope.post(`/payments/${paymentPspReference}/reversals`) .reply(200, createReversalsResponse()); try { - const result = await modification.reversals(paymentPspReference, request); + const result = await checkout.reversals(paymentPspReference, request); expect(result).toBeTruthy(); } catch (e: any) { fail(e.message); @@ -330,7 +311,7 @@ describe("Modification", (): void => { scope.post(`/payments/${invalidPaymentPspReference}/reversals`) .reply(422, invalidModificationResult); try { - await modification.reversals(invalidPaymentPspReference, request); + await checkout.reversals(invalidPaymentPspReference, request); } catch (e: any) { if(e.statusCode) expect(e.statusCode).toBe(422); expect(e.message).toContain("Original pspReference required for this operation"); diff --git a/src/__tests__/recurring.spec.ts b/src/__tests__/recurring.spec.ts index e00827d..70dbf7c 100644 --- a/src/__tests__/recurring.spec.ts +++ b/src/__tests__/recurring.spec.ts @@ -74,7 +74,7 @@ describe("Recurring", (): void => { const result = await recurring.listRecurringDetails(request); expect(result).toBeTruthy(); - expect(result.details?.[0].RecurringDetail.recurringDetailReference).toBe('recurringReference'); + expect(result.details?.[0].RecurringDetail.recurringDetailReference).toBe("recurringReference"); }); test.each([isCI, true])("should disable, isMock: %p", async (isMock): Promise => { diff --git a/src/client.ts b/src/client.ts index a210d00..a8537b5 100644 --- a/src/client.ts +++ b/src/client.ts @@ -60,6 +60,7 @@ class Client { public static MARKETPAY_HOP_API_VERSION = "v6"; public static MARKETPAY_NOTIFICATION_API_VERSION = "v5"; public static MARKETPAY_NOTIFICATION_CONFIGURATION_API_VERSION = "v6"; + public static PAYMENT_API_VERSION = "v68"; public static LIB_NAME = "adyen-node-api-library"; public static LIB_VERSION: string = version; public static CHECKOUT_ENDPOINT_TEST = "https://checkout-test.adyen.com/checkout"; @@ -69,6 +70,9 @@ class Client { public static TERMINAL_API_ENDPOINT_TEST = "https://terminal-api-test.adyen.com"; public static TERMINAL_API_ENDPOINT_LIVE = "https://terminal-api-live.adyen.com"; public static ENDPOINT_PROTOCOL = "https://"; + public static PAYMENT_API_ENDPOINT_TEST = "https://pal-test.adyen.com/pal/servlet/Payment"; + public static PAYMENT_API_ENDPOINT_LIVE = "https://pal-live.adyen.com/pal/servlet/Payment"; + private _httpClient!: ClientInterface; public config: Config; @@ -107,11 +111,13 @@ class Client { this.config.hppEndpoint = Client.HPP_TEST; this.config.checkoutEndpoint = Client.CHECKOUT_ENDPOINT_TEST; this.config.terminalApiCloudEndpoint = Client.TERMINAL_API_ENDPOINT_TEST; + this.config.paymentEndpoint = Client.PAYMENT_API_ENDPOINT_TEST; } else if (environment === "LIVE") { this.config.endpoint = Client.ENDPOINT_LIVE; this.config.marketPayEndpoint = Client.MARKETPAY_ENDPOINT_LIVE; this.config.hppEndpoint = Client.HPP_LIVE; this.config.terminalApiCloudEndpoint = Client.TERMINAL_API_ENDPOINT_LIVE; + this.config.paymentEndpoint = Client.PAYMENT_API_ENDPOINT_LIVE; if (liveEndpointUrlPrefix) { this.config.endpoint = `${Client.ENDPOINT_PROTOCOL}${liveEndpointUrlPrefix}${Client.ENDPOINT_LIVE_SUFFIX}`; diff --git a/src/config.ts b/src/config.ts index f8ceb40..5707983 100644 --- a/src/config.ts +++ b/src/config.ts @@ -34,6 +34,7 @@ interface ConfigConstructor { checkoutEndpoint?: string; terminalApiCloudEndpoint?: string; terminalApiLocalEndpoint?: string; + paymentEndpoint?: string; } class Config { @@ -58,6 +59,8 @@ class Config { public terminalApiCloudEndpoint?: string; public terminalApiLocalEndpoint?: string; + public paymentEndpoint?: string; + public constructor(options: ConfigConstructor = {}) { if (options.username) this.username = options.username; if (options.password) this.password = options.password; @@ -76,6 +79,7 @@ class Config { if (options.checkoutEndpoint) this._checkoutEndpoint = options.checkoutEndpoint; if (options.terminalApiCloudEndpoint) this.terminalApiCloudEndpoint = options.terminalApiCloudEndpoint; if (options.terminalApiLocalEndpoint) this.terminalApiLocalEndpoint = options.terminalApiLocalEndpoint; + if (options.paymentEndpoint) this.paymentEndpoint = options.paymentEndpoint; } public set checkoutEndpoint(checkoutEndpoint: string | undefined) { diff --git a/src/services/checkout.ts b/src/services/checkout.ts index 90a2834..d25ef5c 100644 --- a/src/services/checkout.ts +++ b/src/services/checkout.ts @@ -1,22 +1,3 @@ -/* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ - * Adyen NodeJS API Library - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. - */ - import ApiKeyAuthenticatedService from "../apiKeyAuthenticatedService"; import Client from "../client"; import getJsonResponse from "../helpers/getJsonResponse"; @@ -28,6 +9,12 @@ import PaymentsResult from "./resource/checkout/paymentsResult"; import PaymentLinks from "./resource/checkout/paymentLinks"; import OriginKeys from "./resource/checkout/originKeys"; import setApplicationInfo from "../helpers/setApplicationInfo"; +import AmountUpdates from "./resource/checkout/amountUpdates"; +import Cancels from "./resource/checkout/cancels"; +import Captures from "./resource/checkout/captures"; +import Refunds from "./resource/checkout/refunds"; +import Reversals from "./resource/checkout/reversals"; +import CancelsStandalone from "./resource/checkout/cancelsStandalone"; import { IRequest } from "../typings/requestOptions"; import { PaymentRequest, @@ -52,7 +39,21 @@ import { CreateCheckoutSessionRequest, CreateCheckoutSessionResponse, PaymentDonationRequest, - DonationResponse + DonationResponse, + CardDetailsRequest, + CardDetailsResponse, + CreatePaymentAmountUpdateRequest, + CreatePaymentCancelRequest, + CreatePaymentCaptureRequest, + CreatePaymentRefundRequest, + CreatePaymentReversalRequest, + CreateStandalonePaymentCancelRequest, + PaymentAmountUpdateResource, + PaymentCancelResource, + PaymentCaptureResource, + PaymentRefundResource, + PaymentReversalResource, + StandalonePaymentCancelResource, } from "../typings/checkout/models"; import PaymentLinksId from "./resource/checkout/paymentLinksId"; @@ -61,6 +62,7 @@ import Orders from "./resource/checkout/orders"; import OrdersCancel from "./resource/checkout/ordersCancel"; import Sessions from "./resource/checkout/sessions"; import Donations from "./resource/checkout/donations"; +import CardDetails from "./resource/checkout/cardDetails"; class Checkout extends ApiKeyAuthenticatedService { private readonly _payments: Payments; @@ -76,6 +78,7 @@ class Checkout extends ApiKeyAuthenticatedService { private readonly _ordersCancel: OrdersCancel; private readonly _sessions: Sessions; private readonly _donations: Donations; + private readonly _cardDetails: CardDetails; public constructor(client: Client) { super(client); @@ -92,6 +95,23 @@ class Checkout extends ApiKeyAuthenticatedService { this._ordersCancel = new OrdersCancel(this); this._sessions = new Sessions(this); this._donations = new Donations(this); + this._cardDetails = new CardDetails(this); + } + + // Payments + + public sessions(checkoutSessionRequest: CreateCheckoutSessionRequest): Promise { + return getJsonResponse( + this._sessions, + checkoutSessionRequest, + ); + } + + public paymentMethods(paymentMethodsRequest: PaymentMethodsRequest): Promise { + return getJsonResponse( + this._paymentMethods, + paymentMethodsRequest, + ); } public payments(paymentsRequest: PaymentRequest, requestOptions?: IRequest.Options): Promise { @@ -102,13 +122,30 @@ class Checkout extends ApiKeyAuthenticatedService { ); } - public paymentMethods(paymentMethodsRequest: PaymentMethodsRequest): Promise { - return getJsonResponse( - this._paymentMethods, - paymentMethodsRequest, + public paymentsDetails(paymentsDetailsRequest: DetailsRequest, requestOptions?: IRequest.Options): Promise { + return getJsonResponse( + this._paymentsDetails, + paymentsDetailsRequest, + requestOptions ); } + public donations(donationRequest: PaymentDonationRequest): Promise { + return getJsonResponse( + this._donations, + donationRequest, + ); + } + + public cardDetails(cardDetailsRequest: CardDetailsRequest): Promise { + return getJsonResponse( + this._cardDetails, + cardDetailsRequest, + ); + } + + // Payment Links + public paymentLinks(paymentLinkRequest: CreatePaymentLinkRequest): Promise { return getJsonResponse( this._paymentLinks, @@ -134,39 +171,87 @@ class Checkout extends ApiKeyAuthenticatedService { ); } - public paymentsDetails(paymentsDetailsRequest: DetailsRequest, requestOptions?: IRequest.Options): Promise { - return getJsonResponse( - this._paymentsDetails, - paymentsDetailsRequest, + // Modifications + + public amountUpdates( + paymentPspReference: string, + amountUpdatesRequest: CreatePaymentAmountUpdateRequest, + requestOptions?: IRequest.Options, + ): Promise { + const amountUpdates = new AmountUpdates(this, paymentPspReference); + return getJsonResponse( + amountUpdates, + amountUpdatesRequest, requestOptions ); } - public paymentSession( - paymentSessionRequest: PaymentSetupRequest, + public cancelsStandalone( + cancelsStandaloneRequest: CreateStandalonePaymentCancelRequest, + requestOptions?: IRequest.Options + ): Promise { + const cancelsStandalone = new CancelsStandalone(this); + return getJsonResponse( + cancelsStandalone, + cancelsStandaloneRequest, + requestOptions + ); + } + + public cancels( + paymentPspReference: string, + cancelsRequest: CreatePaymentCancelRequest, requestOptions?: IRequest.Options, - ): Promise { - return getJsonResponse( - this._paymentSession, - paymentSessionRequest, - requestOptions, + ): Promise { + const cancels = new Cancels(this, paymentPspReference); + return getJsonResponse( + cancels, + cancelsRequest, + requestOptions ); } - public paymentResult(paymentResultRequest: PaymentVerificationRequest): Promise { - return getJsonResponse( - this._paymentsResult, - paymentResultRequest, + public captures( + paymentPspReference: string, + capturesRequest: CreatePaymentCaptureRequest, + requestOptions?: IRequest.Options + ): Promise { + const captures = new Captures(this, paymentPspReference); + return getJsonResponse( + captures, + capturesRequest, + requestOptions ); } - public originKeys(originKeysRequest: CheckoutUtilityRequest): Promise { - return getJsonResponse( - this._originKeys, - originKeysRequest, + public refunds( + paymentPspReference: string, + refundsRequest: CreatePaymentRefundRequest, + requestOptions?: IRequest.Options + ): Promise { + const refunds = new Refunds(this, paymentPspReference); + return getJsonResponse( + refunds, + refundsRequest, + requestOptions ); } + public reversals( + paymentPspReference: string, + reversalsRequest: CreatePaymentReversalRequest, + requestOptions?: IRequest.Options + ): Promise { + const refunds = new Reversals(this, paymentPspReference); + return getJsonResponse( + refunds, + reversalsRequest, + requestOptions + ); + } + + // Orders + public paymentMethodsBalance(paymentMethodsBalanceRequest: CheckoutBalanceCheckRequest): Promise { return getJsonResponse( this._paymentMethodsBalance, @@ -188,17 +273,32 @@ class Checkout extends ApiKeyAuthenticatedService { ); } - public sessions(checkoutSessionRequest: CreateCheckoutSessionRequest): Promise { - return getJsonResponse( - this._sessions, - checkoutSessionRequest, + // Classic Checkout SDK + + public paymentSession( + paymentSessionRequest: PaymentSetupRequest, + requestOptions?: IRequest.Options, + ): Promise { + return getJsonResponse( + this._paymentSession, + paymentSessionRequest, + requestOptions, ); } - public donations(donationRequest: PaymentDonationRequest): Promise { - return getJsonResponse( - this._donations, - donationRequest, + public paymentResult(paymentResultRequest: PaymentVerificationRequest): Promise { + return getJsonResponse( + this._paymentsResult, + paymentResultRequest, + ); + } + + //Utility + + public originKeys(originKeysRequest: CheckoutUtilityRequest): Promise { + return getJsonResponse( + this._originKeys, + originKeysRequest, ); } } diff --git a/src/services/classicIntegration.ts b/src/services/classicIntegration.ts new file mode 100644 index 0000000..7ac29a9 --- /dev/null +++ b/src/services/classicIntegration.ts @@ -0,0 +1,171 @@ +import ApiKeyAuthenticatedService from "../apiKeyAuthenticatedService"; +import Client from "../client"; +import getJsonResponse from "../helpers/getJsonResponse"; +import Authorise from "./resource/payment/authorise"; +import Authorise3d from "./resource/payment/authorise3d"; +import Authorise3ds2 from "./resource/payment/authorise3ds2"; +import GetAuthenticationResult from "./resource/payment/getAuthenticationResult"; +import Retrieve3ds2Result from "./resource/payment/retrieve3ds2Result"; +import Capture from "./resource/payment/capture"; +import Cancel from "./resource/payment/cancel"; +import Refund from "./resource/payment/refund"; +import CancelOrRefund from "./resource/payment/cancelOrRefund"; +import TechnicalCancel from "./resource/payment/technicalCancel"; +import AdjustAuthorisation from "./resource/payment/adjustAuthorisation"; +import Donate from "./resource/payment/donate"; +import VoidPendingRefund from "./resource/payment/voidPendingRefund"; + +import { + AdjustAuthorisationRequest, + AuthenticationResultRequest, + AuthenticationResultResponse, + CancelOrRefundRequest, + CancelRequest, + CaptureRequest, + DonationRequest, + ModificationResult, + PaymentRequest, + PaymentRequest3d, + PaymentRequest3ds2, + PaymentResult, + RefundRequest, + TechnicalCancelRequest, + ThreeDS2ResultRequest, + ThreeDS2ResultResponse, + VoidPendingRefundRequest, +} from "../typings/payments/models"; + + +class ClassicIntegration extends ApiKeyAuthenticatedService { + private readonly _authorise; + private readonly _authorise3d; + private readonly _authorise3ds2; + private readonly _getAuthenticationResult; + private readonly _retrieve3ds2Result; + private readonly _capture; + private readonly _cancel; + private readonly _refund; + private readonly _cancelOrRefund; + private readonly _technicalCancel; + private readonly _adjustAuthorisation; + private readonly _donate; + private readonly _voidPendingRefund; + + + + public constructor(client: Client) { + super(client); + this._authorise = new Authorise(this); + this._authorise3d = new Authorise3d(this); + this._authorise3ds2 = new Authorise3ds2(this); + this._getAuthenticationResult = new GetAuthenticationResult(this); + this._retrieve3ds2Result = new Retrieve3ds2Result(this); + this._capture = new Capture(this); + this._cancel = new Cancel(this); + this._refund = new Refund(this); + this._cancelOrRefund = new CancelOrRefund(this); + this._technicalCancel = new TechnicalCancel(this); + this._adjustAuthorisation = new AdjustAuthorisation(this); + this._donate = new Donate(this); + this._voidPendingRefund = new VoidPendingRefund(this); + + } + + // General + + public authorise(paymentRequest: PaymentRequest): Promise { + return getJsonResponse( + this._authorise, + paymentRequest, + ); + } + + public authorise3d(paymentRequest3d: PaymentRequest3d): Promise { + return getJsonResponse( + this._authorise3d, + paymentRequest3d, + ); + } + + public authorise3ds2(paymentRequest3ds2: PaymentRequest3ds2): Promise { + return getJsonResponse( + this._authorise3ds2, + paymentRequest3ds2, + ); + } + + public getAuthenticationResult(authenticationResultRequest: AuthenticationResultRequest): Promise { + return getJsonResponse( + this._getAuthenticationResult, + authenticationResultRequest, + ); + } + + public retrieve3ds2Result(threeDs2ResultRequest: ThreeDS2ResultRequest): Promise { + return getJsonResponse( + this._retrieve3ds2Result, + threeDs2ResultRequest, + ); + } + + // Modifications + + public capture(captureRequest: CaptureRequest): Promise { + return getJsonResponse( + this._capture, + captureRequest, + ); + } + + public cancel(cancelRequest: CancelRequest): Promise { + return getJsonResponse( + this._cancel, + cancelRequest, + ); + } + + public refund(refundRequest: RefundRequest): Promise { + return getJsonResponse( + this._refund, + refundRequest, + ); + } + + public cancelOrRefund(cancelOrRefundRequest: CancelOrRefundRequest): Promise { + return getJsonResponse( + this._cancelOrRefund, + cancelOrRefundRequest, + ); + } + + public technicalCancel(technicalCancelRequest: TechnicalCancelRequest): Promise { + return getJsonResponse( + this._technicalCancel, + technicalCancelRequest, + ); + } + + public adjustAuthorisation(adjustAuthorisationRequest: AdjustAuthorisationRequest): Promise { + return getJsonResponse( + this._adjustAuthorisation, + adjustAuthorisationRequest, + ); + } + + public donate(donationRequest: DonationRequest): Promise { + return getJsonResponse( + this._donate, + donationRequest, + ); + } + + public voidPendingRefund(voidPendingRefundRequest: VoidPendingRefundRequest): Promise { + return getJsonResponse( + this._voidPendingRefund, + voidPendingRefundRequest, + ); + } +} + +export default ClassicIntegration; + diff --git a/src/services/index.ts b/src/services/index.ts index 808ae33..1e90e78 100644 --- a/src/services/index.ts +++ b/src/services/index.ts @@ -1,27 +1,8 @@ -/* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ - * Adyen NodeJS API Library - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. - */ - export { default as TerminalLocalAPI } from "./terminalLocalAPI"; export { default as TerminalCloudAPI } from "./terminalCloudAPI"; export { default as CheckoutAPI } from "./checkout"; +export { default as ClassicIntegrationAPI } from "./classicIntegration"; export { default as Recurring } from "./recurring"; -export { default as Modification } from "./modification"; export { default as BinLookup } from "./binLookup"; export { default as Payout } from "./payout"; export { default as Platforms } from "./platforms"; diff --git a/src/services/modification.ts b/src/services/modification.ts deleted file mode 100644 index 78b5522..0000000 --- a/src/services/modification.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ - * Adyen NodeJS API Library - * Copyright (c) 2021 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. - */ -import Client from "../client"; -import getJsonResponse from "../helpers/getJsonResponse"; -import Service from "../service"; -import { ApplicationInfo } from "../typings/applicationInfo"; -import { IRequest } from "../typings/requestOptions"; -import AmountUpdates from "./resource/modification/amountUpdates"; -import Cancels from "./resource/modification/cancels"; -import Captures from "./resource/modification/captures"; -import Refunds from "./resource/modification/refunds"; -import Reversals from "./resource/modification/reversals"; -import CancelsStandalone from "./resource/modification/cancelsStandalone"; -import { - CreatePaymentAmountUpdateRequest, - CreatePaymentCancelRequest, - CreatePaymentCaptureRequest, - CreatePaymentRefundRequest, CreatePaymentReversalRequest, - CreateStandalonePaymentCancelRequest, - PaymentAmountUpdateResource, - PaymentCancelResource, - PaymentCaptureResource, PaymentRefundResource, PaymentReversalResource, - StandalonePaymentCancelResource -} from "../typings/checkout/models"; - -interface AppInfo { applicationInfo?: ApplicationInfo } -type GenericRequest = T & AppInfo; - -class Modification extends Service { - public constructor(client: Client) { - super(client); - } - - public amountUpdates( - paymentPspReference: string, - amountUpdatesRequest: GenericRequest, - requestOptions?: IRequest.Options, - ): Promise { - const amountUpdates = new AmountUpdates(this, paymentPspReference); - return getJsonResponse( - amountUpdates, - amountUpdatesRequest, - requestOptions - ); - } - - public cancelsStandalone( - cancelsStandaloneRequest: GenericRequest, - requestOptions?: IRequest.Options - ): Promise { - const cancelsStandalone = new CancelsStandalone(this); - return getJsonResponse( - cancelsStandalone, - cancelsStandaloneRequest, - requestOptions - ); - } - - public cancels( - paymentPspReference: string, - cancelsRequest: GenericRequest, - requestOptions?: IRequest.Options, - ): Promise { - const cancels = new Cancels(this, paymentPspReference); - return getJsonResponse( - cancels, - cancelsRequest, - requestOptions - ); - } - - public captures( - paymentPspReference: string, - capturesRequest: GenericRequest, - requestOptions?: IRequest.Options - ): Promise { - const captures = new Captures(this, paymentPspReference); - return getJsonResponse( - captures, - capturesRequest, - requestOptions - ); - } - - public refunds( - paymentPspReference: string, - refundsRequest: GenericRequest, - requestOptions?: IRequest.Options - ): Promise { - const refunds = new Refunds(this, paymentPspReference); - return getJsonResponse( - refunds, - refundsRequest, - requestOptions - ); - } - - public reversals( - paymentPspReference: string, - reversalsRequest: GenericRequest, - requestOptions?: IRequest.Options - ): Promise { - const refunds = new Reversals(this, paymentPspReference); - return getJsonResponse( - refunds, - reversalsRequest, - requestOptions - ); - } -} - -export default Modification; diff --git a/src/services/resource/modification/amountUpdates.ts b/src/services/resource/checkout/amountUpdates.ts similarity index 100% rename from src/services/resource/modification/amountUpdates.ts rename to src/services/resource/checkout/amountUpdates.ts diff --git a/src/services/resource/modification/cancels.ts b/src/services/resource/checkout/cancels.ts similarity index 100% rename from src/services/resource/modification/cancels.ts rename to src/services/resource/checkout/cancels.ts diff --git a/src/services/resource/modification/cancelsStandalone.ts b/src/services/resource/checkout/cancelsStandalone.ts similarity index 100% rename from src/services/resource/modification/cancelsStandalone.ts rename to src/services/resource/checkout/cancelsStandalone.ts diff --git a/src/services/resource/modification/captures.ts b/src/services/resource/checkout/captures.ts similarity index 100% rename from src/services/resource/modification/captures.ts rename to src/services/resource/checkout/captures.ts diff --git a/src/services/resource/checkout/cardDetails.ts b/src/services/resource/checkout/cardDetails.ts new file mode 100644 index 0000000..02d1e77 --- /dev/null +++ b/src/services/resource/checkout/cardDetails.ts @@ -0,0 +1,14 @@ +import Client from "../../../client"; +import Service from "../../../service"; +import Resource from "../../resource"; + +class CardDetails extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.checkoutEndpoint}/${Client.CHECKOUT_API_VERSION}/cardDetails`, + ); + } +} + +export default CardDetails; diff --git a/src/services/resource/modification/refunds.ts b/src/services/resource/checkout/refunds.ts similarity index 100% rename from src/services/resource/modification/refunds.ts rename to src/services/resource/checkout/refunds.ts diff --git a/src/services/resource/modification/reversals.ts b/src/services/resource/checkout/reversals.ts similarity index 100% rename from src/services/resource/modification/reversals.ts rename to src/services/resource/checkout/reversals.ts diff --git a/src/services/resource/payment/adjustAuthorisation.ts b/src/services/resource/payment/adjustAuthorisation.ts new file mode 100644 index 0000000..6302eff --- /dev/null +++ b/src/services/resource/payment/adjustAuthorisation.ts @@ -0,0 +1,14 @@ +import Client from "../../../client"; +import Service from "../../../service"; +import Resource from "../../resource"; + +class AdjustAuthorisation extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.paymentEndpoint}/${Client.PAYMENT_API_VERSION}/adjustAuthorisation`, + ); + } +} + +export default AdjustAuthorisation; \ No newline at end of file diff --git a/src/services/resource/payment/authorise.ts b/src/services/resource/payment/authorise.ts new file mode 100644 index 0000000..42574f8 --- /dev/null +++ b/src/services/resource/payment/authorise.ts @@ -0,0 +1,14 @@ +import Client from "../../../client"; +import Service from "../../../service"; +import Resource from "../../resource"; + +class Authorise extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.paymentEndpoint}/${Client.PAYMENT_API_VERSION}/authorise`, + ); + } +} + +export default Authorise; \ No newline at end of file diff --git a/src/services/resource/payment/authorise3d.ts b/src/services/resource/payment/authorise3d.ts new file mode 100644 index 0000000..ee7047c --- /dev/null +++ b/src/services/resource/payment/authorise3d.ts @@ -0,0 +1,14 @@ +import Client from "../../../client"; +import Service from "../../../service"; +import Resource from "../../resource"; + +class Authorise3d extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.paymentEndpoint}/${Client.PAYMENT_API_VERSION}/authorise3d`, + ); + } +} + +export default Authorise3d; \ No newline at end of file diff --git a/src/services/resource/payment/authorise3ds2.ts b/src/services/resource/payment/authorise3ds2.ts new file mode 100644 index 0000000..6ff5e0b --- /dev/null +++ b/src/services/resource/payment/authorise3ds2.ts @@ -0,0 +1,14 @@ +import Client from "../../../client"; +import Service from "../../../service"; +import Resource from "../../resource"; + +class Authorise3ds2 extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.paymentEndpoint}/${Client.PAYMENT_API_VERSION}/authorise3ds2`, + ); + } +} + +export default Authorise3ds2; \ No newline at end of file diff --git a/src/services/resource/payment/cancel.ts b/src/services/resource/payment/cancel.ts new file mode 100644 index 0000000..976cfce --- /dev/null +++ b/src/services/resource/payment/cancel.ts @@ -0,0 +1,14 @@ +import Client from "../../../client"; +import Service from "../../../service"; +import Resource from "../../resource"; + +class Cancel extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.paymentEndpoint}/${Client.PAYMENT_API_VERSION}/cancel`, + ); + } +} + +export default Cancel; \ No newline at end of file diff --git a/src/services/resource/payment/cancelOrRefund.ts b/src/services/resource/payment/cancelOrRefund.ts new file mode 100644 index 0000000..9a29088 --- /dev/null +++ b/src/services/resource/payment/cancelOrRefund.ts @@ -0,0 +1,14 @@ +import Client from "../../../client"; +import Service from "../../../service"; +import Resource from "../../resource"; + +class CancelOrRefund extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.paymentEndpoint}/${Client.PAYMENT_API_VERSION}/cancelOrRefund`, + ); + } +} + +export default CancelOrRefund; \ No newline at end of file diff --git a/src/services/resource/payment/capture.ts b/src/services/resource/payment/capture.ts new file mode 100644 index 0000000..e99ee44 --- /dev/null +++ b/src/services/resource/payment/capture.ts @@ -0,0 +1,14 @@ +import Client from "../../../client"; +import Service from "../../../service"; +import Resource from "../../resource"; + +class Capture extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.paymentEndpoint}/${Client.PAYMENT_API_VERSION}/capture`, + ); + } +} + +export default Capture; \ No newline at end of file diff --git a/src/services/resource/payment/donate.ts b/src/services/resource/payment/donate.ts new file mode 100644 index 0000000..529c7e0 --- /dev/null +++ b/src/services/resource/payment/donate.ts @@ -0,0 +1,14 @@ +import Client from "../../../client"; +import Service from "../../../service"; +import Resource from "../../resource"; + +class Donate extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.paymentEndpoint}/${Client.PAYMENT_API_VERSION}/donate`, + ); + } +} + +export default Donate; \ No newline at end of file diff --git a/src/services/resource/payment/getAuthenticationResult.ts b/src/services/resource/payment/getAuthenticationResult.ts new file mode 100644 index 0000000..6edb6e3 --- /dev/null +++ b/src/services/resource/payment/getAuthenticationResult.ts @@ -0,0 +1,14 @@ +import Client from "../../../client"; +import Service from "../../../service"; +import Resource from "../../resource"; + +class GetAuthenticationResult extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.paymentEndpoint}/${Client.PAYMENT_API_VERSION}/getAuthenticationResult`, + ); + } +} + +export default GetAuthenticationResult; \ No newline at end of file diff --git a/src/services/resource/payment/refund.ts b/src/services/resource/payment/refund.ts new file mode 100644 index 0000000..ae3e8c1 --- /dev/null +++ b/src/services/resource/payment/refund.ts @@ -0,0 +1,14 @@ +import Client from "../../../client"; +import Service from "../../../service"; +import Resource from "../../resource"; + +class Refund extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.paymentEndpoint}/${Client.PAYMENT_API_VERSION}/refund`, + ); + } +} + +export default Refund; \ No newline at end of file diff --git a/src/services/resource/payment/retrieve3ds2Result.ts b/src/services/resource/payment/retrieve3ds2Result.ts new file mode 100644 index 0000000..d758e56 --- /dev/null +++ b/src/services/resource/payment/retrieve3ds2Result.ts @@ -0,0 +1,14 @@ +import Client from "../../../client"; +import Service from "../../../service"; +import Resource from "../../resource"; + +class Retrieve3ds2Result extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.paymentEndpoint}/${Client.PAYMENT_API_VERSION}/retrieve3ds2Result`, + ); + } +} + +export default Retrieve3ds2Result; \ No newline at end of file diff --git a/src/services/resource/payment/technicalCancel.ts b/src/services/resource/payment/technicalCancel.ts new file mode 100644 index 0000000..ea124bb --- /dev/null +++ b/src/services/resource/payment/technicalCancel.ts @@ -0,0 +1,14 @@ +import Client from "../../../client"; +import Service from "../../../service"; +import Resource from "../../resource"; + +class TechnicalCancel extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.paymentEndpoint}/${Client.PAYMENT_API_VERSION}/technicalCancel`, + ); + } +} + +export default TechnicalCancel; \ No newline at end of file diff --git a/src/services/resource/payment/voidPendingRefund.ts b/src/services/resource/payment/voidPendingRefund.ts new file mode 100644 index 0000000..c432451 --- /dev/null +++ b/src/services/resource/payment/voidPendingRefund.ts @@ -0,0 +1,14 @@ +import Client from "../../../client"; +import Service from "../../../service"; +import Resource from "../../resource"; + +class VoidPendingRefund extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.paymentEndpoint}/${Client.PAYMENT_API_VERSION}/voidPendingRefund`, + ); + } +} + +export default VoidPendingRefund; \ No newline at end of file diff --git a/src/typings/payments/accountInfo.ts b/src/typings/payments/accountInfo.ts new file mode 100644 index 0000000..8575603 --- /dev/null +++ b/src/typings/payments/accountInfo.ts @@ -0,0 +1,154 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AccountInfo { + + /** + * Indicator for the length of time since this shopper account was created in the merchant\'s environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + */ + 'accountAgeIndicator'?: AccountInfo.AccountAgeIndicatorEnum; + + /** + * Date when the shopper\'s account was last changed. + */ + 'accountChangeDate'?: Date; + + /** + * Indicator for the length of time since the shopper\'s account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + */ + 'accountChangeIndicator'?: AccountInfo.AccountChangeIndicatorEnum; + + /** + * Date when the shopper\'s account was created. + */ + 'accountCreationDate'?: Date; + + /** + * Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit + */ + 'accountType'?: AccountInfo.AccountTypeEnum; + + /** + * Number of attempts the shopper tried to add a card to their account in the last day. + */ + 'addCardAttemptsDay'?: number; + + /** + * Date the selected delivery address was first used. + */ + 'deliveryAddressUsageDate'?: Date; + + /** + * Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + */ + 'deliveryAddressUsageIndicator'?: AccountInfo.DeliveryAddressUsageIndicatorEnum; + + /** + * Shopper\'s home phone number (including the country code). + * + * @deprecated + */ + 'homePhone'?: string; + + /** + * Shopper\'s mobile phone number (including the country code). + * + * @deprecated + */ + 'mobilePhone'?: string; + + /** + * Date when the shopper last changed their password. + */ + 'passwordChangeDate'?: Date; + + /** + * Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + */ + 'passwordChangeIndicator'?: AccountInfo.PasswordChangeIndicatorEnum; + + /** + * Number of all transactions (successful and abandoned) from this shopper in the past 24 hours. + */ + 'pastTransactionsDay'?: number; + + /** + * Number of all transactions (successful and abandoned) from this shopper in the past year. + */ + 'pastTransactionsYear'?: number; + + /** + * Date this payment method was added to the shopper\'s account. + */ + 'paymentAccountAge'?: Date; + + /** + * Indicator for the length of time since this payment method was added to this shopper\'s account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + */ + 'paymentAccountIndicator'?: AccountInfo.PaymentAccountIndicatorEnum; + + /** + * Number of successful purchases in the last six months. + */ + 'purchasesLast6Months'?: number; + + /** + * Whether suspicious activity was recorded on this account. + */ + 'suspiciousActivity'?: boolean; + + /** + * Shopper\'s work phone number (including the country code). + * + * @deprecated + */ + 'workPhone'?: string; +} + +export namespace AccountInfo { + export enum AccountAgeIndicatorEnum { + NotApplicable = 'notApplicable', + ThisTransaction = 'thisTransaction', + LessThan30Days = 'lessThan30Days', + From30To60Days = 'from30To60Days', + MoreThan60Days = 'moreThan60Days' + } + export enum AccountChangeIndicatorEnum { + ThisTransaction = 'thisTransaction', + LessThan30Days = 'lessThan30Days', + From30To60Days = 'from30To60Days', + MoreThan60Days = 'moreThan60Days' + } + export enum AccountTypeEnum { + NotApplicable = 'notApplicable', + Credit = 'credit', + Debit = 'debit' + } + export enum DeliveryAddressUsageIndicatorEnum { + ThisTransaction = 'thisTransaction', + LessThan30Days = 'lessThan30Days', + From30To60Days = 'from30To60Days', + MoreThan60Days = 'moreThan60Days' + } + export enum PasswordChangeIndicatorEnum { + NotApplicable = 'notApplicable', + ThisTransaction = 'thisTransaction', + LessThan30Days = 'lessThan30Days', + From30To60Days = 'from30To60Days', + MoreThan60Days = 'moreThan60Days' + } + export enum PaymentAccountIndicatorEnum { + NotApplicable = 'notApplicable', + ThisTransaction = 'thisTransaction', + LessThan30Days = 'lessThan30Days', + From30To60Days = 'from30To60Days', + MoreThan60Days = 'moreThan60Days' + } +} diff --git a/src/typings/payments/acctInfo.ts b/src/typings/payments/acctInfo.ts new file mode 100644 index 0000000..0624d58 --- /dev/null +++ b/src/typings/payments/acctInfo.ts @@ -0,0 +1,136 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AcctInfo { + + /** + * Length of time that the cardholder has had the account with the 3DS Requestor. Allowed values: * **01** — No account * **02** — Created during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days + */ + 'chAccAgeInd'?: AcctInfo.ChAccAgeIndEnum; + + /** + * Date that the cardholder’s account with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Format: **YYYYMMDD** + */ + 'chAccChange'?: string; + + /** + * Length of time since the cardholder’s account information with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Allowed values: * **01** — Changed during this transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days + */ + 'chAccChangeInd'?: AcctInfo.ChAccChangeIndEnum; + + /** + * Date that cardholder’s account with the 3DS Requestor had a password change or account reset. Format: **YYYYMMDD** + */ + 'chAccPwChange'?: string; + + /** + * Indicates the length of time since the cardholder’s account with the 3DS Requestor had a password change or account reset. Allowed values: * **01** — No change * **02** — Changed during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days + */ + 'chAccPwChangeInd'?: AcctInfo.ChAccPwChangeIndEnum; + + /** + * Date that the cardholder opened the account with the 3DS Requestor. Format: **YYYYMMDD** + */ + 'chAccString'?: string; + + /** + * Number of purchases with this cardholder account during the previous six months. Max length: 4 characters. + */ + 'nbPurchaseAccount'?: string; + + /** + * String that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Format: **YYYYMMDD** + */ + 'paymentAccAge'?: string; + + /** + * Indicates the length of time that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Allowed values: * **01** — No account (guest checkout) * **02** — During this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days + */ + 'paymentAccInd'?: AcctInfo.PaymentAccIndEnum; + + /** + * Number of Add Card attempts in the last 24 hours. Max length: 3 characters. + */ + 'provisionAttemptsDay'?: string; + + /** + * String when the shipping address used for this transaction was first used with the 3DS Requestor. Format: **YYYYMMDD** + */ + 'shipAddressUsage'?: string; + + /** + * Indicates when the shipping address used for this transaction was first used with the 3DS Requestor. Allowed values: * **01** — This transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days + */ + 'shipAddressUsageInd'?: AcctInfo.ShipAddressUsageIndEnum; + + /** + * Indicates if the Cardholder Name on the account is identical to the shipping Name used for this transaction. Allowed values: * **01** — Account Name identical to shipping Name * **02** — Account Name different to shipping Name + */ + 'shipNameIndicator'?: AcctInfo.ShipNameIndicatorEnum; + + /** + * Indicates whether the 3DS Requestor has experienced suspicious activity (including previous fraud) on the cardholder account. Allowed values: * **01** — No suspicious activity has been observed * **02** — Suspicious activity has been observed + */ + 'suspiciousAccActivity'?: AcctInfo.SuspiciousAccActivityEnum; + + /** + * Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous 24 hours. Max length: 3 characters. + */ + 'txnActivityDay'?: string; + + /** + * Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous year. Max length: 3 characters. + */ + 'txnActivityYear'?: string; +} + +export namespace AcctInfo { + export enum ChAccAgeIndEnum { + _01 = '01', + _02 = '02', + _03 = '03', + _04 = '04', + _05 = '05' + } + export enum ChAccChangeIndEnum { + _01 = '01', + _02 = '02', + _03 = '03', + _04 = '04' + } + export enum ChAccPwChangeIndEnum { + _01 = '01', + _02 = '02', + _03 = '03', + _04 = '04', + _05 = '05' + } + export enum PaymentAccIndEnum { + _01 = '01', + _02 = '02', + _03 = '03', + _04 = '04', + _05 = '05' + } + export enum ShipAddressUsageIndEnum { + _01 = '01', + _02 = '02', + _03 = '03', + _04 = '04' + } + export enum ShipNameIndicatorEnum { + _01 = '01', + _02 = '02' + } + export enum SuspiciousAccActivityEnum { + _01 = '01', + _02 = '02' + } +} diff --git a/src/typings/payments/additionalData3DSecure.ts b/src/typings/payments/additionalData3DSecure.ts new file mode 100644 index 0000000..12e77c6 --- /dev/null +++ b/src/typings/payments/additionalData3DSecure.ts @@ -0,0 +1,38 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AdditionalData3DSecure { + + /** + * Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen still selects the version of 3D Secure based on configuration to optimize authorisation rates and improve the shopper\'s experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen will not offer 3D Secure 2 to your shopper regardless of your configuration. + */ + 'allow3DS2'?: string; + + /** + * Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don\'t perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. + */ + 'executeThreeD'?: string; + + /** + * In case of Secure+, this field must be set to **CUPSecurePlus**. + */ + 'mpiImplementationType'?: string; + + /** + * Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** + */ + 'scaExemption'?: string; + + /** + * Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen\'s Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **1.0.2**: Apply 3D Secure version 1.0.2. * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. For example, if the configuration is to fall back to 3D Secure 1, we will apply version 1.0.2. * If you prefer 2.1.0 or 2.2.0 but the BIN is not enrolled, you will receive an error. + */ + 'threeDSVersion'?: string; +} + diff --git a/src/typings/payments/additionalDataAirline.ts b/src/typings/payments/additionalDataAirline.ts new file mode 100644 index 0000000..aae3848 --- /dev/null +++ b/src/typings/payments/additionalDataAirline.ts @@ -0,0 +1,153 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AdditionalDataAirline { + + /** + * Reference number for the invoice, issued by the agency. * minLength: 1 * maxLength: 6 + */ + 'airlineAgencyInvoiceNumber'?: string; + + /** + * 2-letter agency plan identifier; alphabetical. * minLength: 2 * maxLength: 2 + */ + 'airlineAgencyPlanName'?: string; + + /** + * [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX); numeric. It identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 * maxLength: 3 + */ + 'airlineAirlineCode'?: string; + + /** + * [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX); alphabetical. It identifies the carrier. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter airline code * Example: KLM = KL * minLength: 2 * maxLength: 2 + */ + 'airlineAirlineDesignatorCode'?: string; + + /** + * Chargeable amount for boarding the plane. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). * minLength: 1 * maxLength: 18 + */ + 'airlineBoardingFee'?: string; + + /** + * The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Format: alphanumeric. * minLength: 4 * maxLength: 4 + */ + 'airlineComputerizedReservationSystem'?: string; + + /** + * Reference number; alphanumeric. * minLength: 0 * maxLength: 20 + */ + 'airlineCustomerReferenceNumber'?: string; + + /** + * Optional 2-digit code; alphanumeric. It identifies the type of product of the transaction. The description of the code may appear on credit card statements. * Format: 2-digit code * Example: Passenger ticket = 01 * minLength: 2 * maxLength: 2 + */ + 'airlineDocumentType'?: string; + + /** + * Flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 * maxLength: 16 + */ + 'airlineFlightDate'?: string; + + /** + * [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX); alphabetical. It identifies the carrier. This field is required/mandatory if the airline data includes leg details. * Format: IATA 2-letter airline code * Example: KLM = KL * minLength: 2 * maxLength: 2 + */ + 'airlineLegCarrierCode'?: string; + + /** + * 1-letter travel class identifier; alphabetical. There is no standard; however, the following codes are used rather consistently: * F: first class * J: business class * Y: economy class * W: premium economy Limitations: * minLength: 1 * maxLength: 1 + */ + 'airlineLegClassOfTravel'?: string; + + /** + * Date and time of travel. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)-compliant. * Format: `yyyy-MM-dd HH:mm` * minLength: 16 * maxLength: 16 + */ + 'airlineLegDateOfTravel'?: string; + + /** + * Alphabetical identifier of the departure airport. This field is required if the airline data includes leg details. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code. * Example: Amsterdam = AMS * minLength: 3 * maxLength: 3 + */ + 'airlineLegDepartAirport'?: string; + + /** + * [Departure tax](https://en.wikipedia.org/wiki/Departure_tax). Amount charged by a country to an individual upon their leaving. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). * minLength: 1 * maxLength: 12 + */ + 'airlineLegDepartTax'?: string; + + /** + * Alphabetical identifier of the destination/arrival airport. This field is required/mandatory if the airline data includes leg details. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code. * Example: Amsterdam = AMS * minLength: 3 * maxLength: 3 + */ + 'airlineLegDestinationCode'?: string; + + /** + * [Fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code); alphanumeric. * minLength: 1 * maxLength: 7 + */ + 'airlineLegFareBaseCode'?: string; + + /** + * The flight identifier. * minLength: 1 * maxLength: 5 + */ + 'airlineLegFlightNumber'?: string; + + /** + * 1-letter code that indicates whether the passenger is entitled to make a stopover. Only two types of characters are allowed: * O: Stopover allowed * X: Stopover not allowed Limitations: * minLength: 1 * maxLength: 1 + */ + 'airlineLegStopOverCode'?: string; + + /** + * Date of birth of the passenger. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 + */ + 'airlinePassengerDateOfBirth'?: string; + + /** + * Passenger first name/given name. > This field is required/mandatory if the airline data includes passenger details or leg details. + */ + 'airlinePassengerFirstName'?: string; + + /** + * Passenger last name/family name. > This field is required/mandatory if the airline data includes passenger details or leg details. + */ + 'airlinePassengerLastName'?: string; + + /** + * Telephone number of the passenger, including country code. This is an alphanumeric field that can include the \'+\' and \'-\' signs. * minLength: 3 * maxLength: 30 + */ + 'airlinePassengerTelephoneNumber'?: string; + + /** + * Passenger type code (PTC). IATA PTC values are 3-letter alphabetical. Example: ADT, SRC, CNN, INS. However, several carriers use non-standard codes that can be up to 5 alphanumeric characters. * minLength: 3 * maxLength: 6 + */ + 'airlinePassengerTravellerType'?: string; + + /** + * Passenger name, initials, and a title. * Format: last name + first name or initials + title. * Example: *FLYER / MARY MS*. * minLength: 1 * maxLength: 49 + */ + 'airlinePassengerName': string; + + /** + * Address of the place/agency that issued the ticket. * minLength: 0 * maxLength: 16 + */ + 'airlineTicketIssueAddress'?: string; + + /** + * The ticket\'s unique identifier. * minLength: 1 * maxLength: 150 + */ + 'airlineTicketNumber'?: string; + + /** + * IATA number, also ARC number or ARC/IATA number. Unique identifier number for travel agencies. * minLength: 1 * maxLength: 8 + */ + 'airlineTravelAgencyCode'?: string; + + /** + * The name of the travel agency. * minLength: 1 * maxLength: 25 + */ + 'airlineTravelAgencyName'?: string; +} + diff --git a/src/typings/payments/additionalDataCarRental.ts b/src/typings/payments/additionalDataCarRental.ts new file mode 100644 index 0000000..2af1550 --- /dev/null +++ b/src/typings/payments/additionalDataCarRental.ts @@ -0,0 +1,128 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AdditionalDataCarRental { + + /** + * Pick-up date. * Date format: `yyyyMMdd` + */ + 'carRentalCheckOutDate'?: string; + + /** + * The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 + */ + 'carRentalCustomerServiceTollFreeNumber'?: string; + + /** + * Number of days for which the car is being rented. * Format: Numeric * maxLength: 19 + */ + 'carRentalDaysRented'?: string; + + /** + * Any fuel charges associated with the rental. * Format: Numeric * maxLength: 12 + */ + 'carRentalFuelCharges'?: string; + + /** + * Any insurance charges associated with the rental. * Format: Numeric * maxLength: 12 + */ + 'carRentalInsuranceCharges'?: string; + + /** + * The city from which the car is rented. * Format: Alphanumeric * maxLength: 18 + */ + 'carRentalLocationCity'?: string; + + /** + * The country from which the car is rented. * Format: Alphanumeric * maxLength: 2 + */ + 'carRentalLocationCountry'?: string; + + /** + * The state or province from where the car is rented. * Format: Alphanumeric * maxLength: 3 + */ + 'carRentalLocationStateProvince'?: string; + + /** + * Indicates if the customer was a \"no-show\" (neither keeps nor cancels their booking). * Y - Customer was a no show. * N - Not applicable. + */ + 'carRentalNoShowIndicator'?: string; + + /** + * Charge associated with not returning a vehicle to the original rental location. + */ + 'carRentalOneWayDropOffCharges'?: string; + + /** + * Daily rental rate. * Format: Alphanumeric * maxLength: 12 + */ + 'carRentalRate'?: string; + + /** + * Specifies whether the given rate is applied daily or weekly. * D - Daily rate. * W - Weekly rate. + */ + 'carRentalRateIndicator'?: string; + + /** + * The rental agreement number associated with this car rental. * Format: Alphanumeric * maxLength: 9 + */ + 'carRentalRentalAgreementNumber'?: string; + + /** + * Daily rental rate. * Format: Alphanumeric * maxLength: 12 + */ + 'carRentalRentalClassId'?: string; + + /** + * The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 + */ + 'carRentalRenterName'?: string; + + /** + * The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 + */ + 'carRentalReturnCity'?: string; + + /** + * The country where the car must be returned. * Format: Alphanumeric * maxLength: 2 + */ + 'carRentalReturnCountry'?: string; + + /** + * The last date to return the car by. * Date format: `yyyyMMdd` + */ + 'carRentalReturnDate'?: string; + + /** + * Agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 + */ + 'carRentalReturnLocationId'?: string; + + /** + * The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 + */ + 'carRentalReturnStateProvince'?: string; + + /** + * Indicates whether the goods or services were tax-exempt, or tax was not collected. Values: * Y - Goods or services were tax exempt * N - Tax was not collected + */ + 'carRentalTaxExemptIndicator'?: string; + + /** + * Number of nights. This should be included in the auth message. * Format: Numeric * maxLength: 2 + */ + 'travelEntertainmentAuthDataDuration'?: string; + + /** + * Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"A\" for Car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 + */ + 'travelEntertainmentAuthDataMarket'?: string; +} + diff --git a/src/typings/payments/additionalDataCommon.ts b/src/typings/payments/additionalDataCommon.ts new file mode 100644 index 0000000..8a6a9d9 --- /dev/null +++ b/src/typings/payments/additionalDataCommon.ts @@ -0,0 +1,89 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AdditionalDataCommon { + + /** + * Triggers test scenarios that allow to replicate certain communication errors. Allowed values: * **NO_CONNECTION_AVAILABLE** – There wasn\'t a connection available to service the outgoing communication. This is a transient, retriable error since no messaging could be initiated to an issuing system (or third-party acquiring system). Therefore, the header Transient-Error: true is returned in the response. A subsequent request using the same idempotency key will be processed as if it was the first request. * **IOEXCEPTION_RECEIVED** – Something went wrong during transmission of the message or receiving the response. This is a classified as non-transient because the message could have been received by the issuing party and been acted upon. No transient error header is returned. If using idempotency, the (error) response is stored as the final result for the idempotency key. Subsequent messages with the same idempotency key not be processed beyond returning the stored response. + */ + 'requestedTestErrorResponseCode'?: string; + + /** + * Flags a card payment request for either pre-authorisation or final authorisation. For more information, refer to [Authorisation types](https://docs.adyen.com/online-payments/adjust-authorisation#authorisation-types). Allowed values: * **PreAuth** – flags the payment request to be handled as a pre-authorisation. * **FinalAuth** – flags the payment request to be handled as a final authorisation. + */ + 'authorisationType'?: string; + + /** + * Allows you to determine or override the acquirer account that should be used for the transaction. If you need to process a payment with an acquirer different from a default one, you can set up a corresponding configuration on the Adyen payments platform. Then you can pass a custom routing flag in a payment request\'s additional data to target a specific acquirer. To enable this functionality, contact [Support](https://support.adyen.com/hc/en-us/requests/new). + */ + 'customRoutingFlag'?: string; + + /** + * In case of [asynchronous authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#adjust-authorisation), this field denotes why the additional payment is made. Possible values: * **NoShow**: An incremental charge is carried out because of a no-show for a guaranteed reservation. * **DelayedCharge**: An incremental charge is carried out to process an additional payment after the original services have been rendered and the respective payment has been processed. + */ + 'industryUsage'?: AdditionalDataCommon.IndustryUsageEnum; + + /** + * Allows you to link the transaction to the original or previous one in a subscription/card-on-file chain. This field is required for token-based transactions where Adyen does not tokenize the card. Transaction identifier from card schemes, for example, Mastercard Trace ID or the Visa Transaction ID. Submit the original transaction ID of the contract in your payment request if you are not tokenizing card details with Adyen and are making a merchant-initiated transaction (MIT) for subsequent charges. Make sure you are sending `shopperInteraction` **ContAuth** and `recurringProcessingModel` **Subscription** or **UnscheduledCardOnFile** to ensure that the transaction is classified as MIT. + */ + 'networkTxReference'?: string; + + /** + * Boolean indicator that can be optionally used for performing debit transactions on combo cards (for example, combo cards in Brazil). This is not mandatory but we recommend that you set this to true if you want to use the `selectedBrand` value to specify how to process the transaction. + */ + 'overwriteBrand'?: string; + + /** + * This field is required if the transaction is performed by a registered payment facilitator. This field must contain the city of the actual merchant\'s address. * Format: alpha-numeric. * Maximum length: 13 characters. + */ + 'subMerchantCity'?: string; + + /** + * This field is required if the transaction is performed by a registered payment facilitator. This field must contain the three-letter country code of the actual merchant\'s address. * Format: alpha-numeric. * Fixed length: 3 characters. + */ + 'subMerchantCountry'?: string; + + /** + * This field contains an identifier of the actual merchant when a transaction is submitted via a payment facilitator. The payment facilitator must send in this unique ID. A unique identifier per submerchant that is required if the transaction is performed by a registered payment facilitator. * Format: alpha-numeric. * Fixed length: 15 characters. + */ + 'subMerchantID'?: string; + + /** + * This field is required if the transaction is performed by a registered payment facilitator. This field must contain the name of the actual merchant. * Format: alpha-numeric. * Maximum length: 22 characters. + */ + 'subMerchantName'?: string; + + /** + * This field is required if the transaction is performed by a registered payment facilitator. This field must contain the postal code of the actual merchant\'s address. * Format: alpha-numeric. * Maximum length: 10 characters. + */ + 'subMerchantPostalCode'?: string; + + /** + * This field is required if the transaction is performed by a registered payment facilitator, and if applicable to the country. This field must contain the state code of the actual merchant\'s address. * Format: alpha-numeric. * Maximum length: 3 characters. + */ + 'subMerchantState'?: string; + + /** + * This field is required if the transaction is performed by a registered payment facilitator. This field must contain the street of the actual merchant\'s address. * Format: alpha-numeric. * Maximum length: 60 characters. + */ + 'subMerchantStreet'?: string; + + /** + * This field is required if the transaction is performed by a registered payment facilitator. This field must contain the tax ID of the actual merchant. * Format: alpha-numeric. * Fixed length: 11 or 14 characters. + */ + 'subMerchantTaxId'?: string; +} + +export namespace AdditionalDataCommon { + export enum IndustryUsageEnum { + NoShow = 'NoShow', + DelayedCharge = 'DelayedCharge' + } +} diff --git a/src/typings/payments/additionalDataLevel23.ts b/src/typings/payments/additionalDataLevel23.ts new file mode 100644 index 0000000..6961795 --- /dev/null +++ b/src/typings/payments/additionalDataLevel23.ts @@ -0,0 +1,98 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AdditionalDataLevel23 { + + /** + * Customer code, if supplied by a customer. Encoding: ASCII. Max length: 25 characters. > Required for Level 2 and Level 3 data. + */ + 'enhancedSchemeDataCustomerReference'?: string; + + /** + * Destination country code. Encoding: ASCII. Max length: 3 characters. + */ + 'enhancedSchemeDataDestinationCountryCode'?: string; + + /** + * The postal code of a destination address. Encoding: ASCII. Max length: 10 characters. > Required for American Express. + */ + 'enhancedSchemeDataDestinationPostalCode'?: string; + + /** + * Destination state or province code. Encoding: ASCII.Max length: 3 characters. + */ + 'enhancedSchemeDataDestinationStateProvinceCode'?: string; + + /** + * Duty amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + */ + 'enhancedSchemeDataDutyAmount'?: string; + + /** + * Shipping amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + */ + 'enhancedSchemeDataFreightAmount'?: string; + + /** + * Item commodity code. Encoding: ASCII. Max length: 12 characters. + */ + 'enhancedSchemeDataItemDetailLineItemNrCommodityCode'?: string; + + /** + * Item description. Encoding: ASCII. Max length: 26 characters. + */ + 'enhancedSchemeDataItemDetailLineItemNrDescription'?: string; + + /** + * Discount amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + */ + 'enhancedSchemeDataItemDetailLineItemNrDiscountAmount'?: string; + + /** + * Product code. Encoding: ASCII. Max length: 12 characters. + */ + 'enhancedSchemeDataItemDetailLineItemNrProductCode'?: string; + + /** + * Quantity, specified as an integer value. Value must be greater than 0. Max length: 12 characters. + */ + 'enhancedSchemeDataItemDetailLineItemNrQuantity'?: string; + + /** + * Total amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + */ + 'enhancedSchemeDataItemDetailLineItemNrTotalAmount'?: string; + + /** + * Item unit of measurement. Encoding: ASCII. Max length: 3 characters. + */ + 'enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure'?: string; + + /** + * Unit price, specified in [minor units](https://docs.adyen.com/development-resources/currency-codes). Max length: 12 characters. + */ + 'enhancedSchemeDataItemDetailLineItemNrUnitPrice'?: string; + + /** + * Order date. * Format: `ddMMyy` Encoding: ASCII. Max length: 6 characters. + */ + 'enhancedSchemeDataOrderDate'?: string; + + /** + * The postal code of a \"ship-from\" address. Encoding: ASCII. Max length: 10 characters. + */ + 'enhancedSchemeDataShipFromPostalCode'?: string; + + /** + * Total tax amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. > Required for Level 2 and Level 3 data. + */ + 'enhancedSchemeDataTotalTaxAmount'?: string; +} + diff --git a/src/typings/payments/additionalDataLodging.ts b/src/typings/payments/additionalDataLodging.ts new file mode 100644 index 0000000..743bd0b --- /dev/null +++ b/src/typings/payments/additionalDataLodging.ts @@ -0,0 +1,98 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AdditionalDataLodging { + + /** + * The arrival date. * Date format: `yyyyMMdd` + */ + 'lodgingCheckInDate'?: string; + + /** + * The departure date. * Date format: `yyyyMMdd` + */ + 'lodgingCheckOutDate'?: string; + + /** + * The toll free phone number for the hotel/lodgings. * Format: Alphanumeric * maxLength: 17 + */ + 'lodgingCustomerServiceTollFreeNumber'?: string; + + /** + * Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Values can be: \'Y\' or \'N\'. * Format: Alphabetic * maxLength: 1 + */ + 'lodgingFireSafetyActIndicator'?: string; + + /** + * The folio cash advances. * Format: Numeric * maxLength: 12 + */ + 'lodgingFolioCashAdvances'?: string; + + /** + * Card acceptor’s internal invoice or billing ID reference number. * Format: Alphanumeric * maxLength: 25 + */ + 'lodgingFolioNumber'?: string; + + /** + * Any charges for food and beverages associated with the booking. * Format: Numeric * maxLength: 12 + */ + 'lodgingFoodBeverageCharges'?: string; + + /** + * Indicates if the customer was a \"no-show\" (neither keeps nor cancels their booking). Value should be Y or N. * Format: Numeric * maxLength: 1 + */ + 'lodgingNoShowIndicator'?: string; + + /** + * Prepaid expenses for the booking. * Format: Numeric * maxLength: 12 + */ + 'lodgingPrepaidExpenses'?: string; + + /** + * Identifies specific lodging property location by its local phone number. * Format: Alphanumeric * maxLength: 17 + */ + 'lodgingPropertyPhoneNumber'?: string; + + /** + * Total number of nights the room will be rented. * Format: Numeric * maxLength: 4 + */ + 'lodgingRoom1NumberOfNights'?: string; + + /** + * The rate of the room. * Format: Numeric * maxLength: 12 + */ + 'lodgingRoom1Rate'?: string; + + /** + * The total amount of tax to be paid. * Format: Numeric * maxLength: 12 + */ + 'lodgingRoom1Tax'?: string; + + /** + * Total room tax amount. * Format: Numeric * maxLength: 12 + */ + 'lodgingTotalRoomTax'?: string; + + /** + * Total tax amount. * Format: Numeric * maxLength: 12 + */ + 'lodgingTotalTax'?: string; + + /** + * Number of nights. This should be included in the auth message. * Format: Numeric * maxLength: 2 + */ + 'travelEntertainmentAuthDataDuration'?: string; + + /** + * Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"H\" for Hotel. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 + */ + 'travelEntertainmentAuthDataMarket'?: string; +} + diff --git a/src/typings/payments/additionalDataModifications.ts b/src/typings/payments/additionalDataModifications.ts new file mode 100644 index 0000000..549c8b0 --- /dev/null +++ b/src/typings/payments/additionalDataModifications.ts @@ -0,0 +1,18 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AdditionalDataModifications { + + /** + * This is the installment option selected by the shopper. It is required only if specified by the user. + */ + 'installmentPaymentDataSelectedInstallmentOption'?: string; +} + diff --git a/src/typings/payments/additionalDataOpenInvoice.ts b/src/typings/payments/additionalDataOpenInvoice.ts new file mode 100644 index 0000000..eed2f83 --- /dev/null +++ b/src/typings/payments/additionalDataOpenInvoice.ts @@ -0,0 +1,93 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AdditionalDataOpenInvoice { + + /** + * Holds different merchant data points like product, purchase, customer, and so on. It takes data in a Base64 encoded string. The `merchantData` parameter needs to be added to the `openinvoicedata` signature at the end. Since the field is optional, if it\'s not included it does not impact computing the merchant signature. Applies only to Klarna. You can contact Klarna for the format and structure of the string. + */ + 'openinvoicedataMerchantData'?: string; + + /** + * The number of invoice lines included in `openinvoicedata`. There needs to be at least one line, so `numberOfLines` needs to be at least 1. + */ + 'openinvoicedataNumberOfLines'?: string; + + /** + * The three-character ISO currency code. + */ + 'openinvoicedataLineItemNrCurrencyCode'?: string; + + /** + * A text description of the product the invoice line refers to. + */ + 'openinvoicedataLineItemNrDescription'?: string; + + /** + * The price for one item in the invoice line, represented in minor units. The due amount for the item, VAT excluded. + */ + 'openinvoicedataLineItemNrItemAmount'?: string; + + /** + * A unique id for this item. Required for RatePay if the description of each item is not unique. + */ + 'openinvoicedataLineItemNrItemId'?: string; + + /** + * The VAT due for one item in the invoice line, represented in minor units. + */ + 'openinvoicedataLineItemNrItemVatAmount'?: string; + + /** + * The VAT percentage for one item in the invoice line, represented in minor units. For example, 19% VAT is specified as 1900. + */ + 'openinvoicedataLineItemNrItemVatPercentage'?: string; + + /** + * The number of units purchased of a specific product. + */ + 'openinvoicedataLineItemNrNumberOfItems'?: string; + + /** + * Name of the shipping company handling the the return shipment. + */ + 'openinvoicedataLineItemNrReturnShippingCompany'?: string; + + /** + * The tracking number for the return of the shipment. + */ + 'openinvoicedataLineItemNrReturnTrackingNumber'?: string; + + /** + * URI where the customer can track the return of their shipment. + */ + 'openinvoicedataLineItemNrReturnTrackingUri'?: string; + + /** + * Name of the shipping company handling the delivery. + */ + 'openinvoicedataLineItemNrShippingCompany'?: string; + + /** + * Shipping method. + */ + 'openinvoicedataLineItemNrShippingMethod'?: string; + + /** + * The tracking number for the shipment. + */ + 'openinvoicedataLineItemNrTrackingNumber'?: string; + + /** + * URI where the customer can track their shipment. + */ + 'openinvoicedataLineItemNrTrackingUri'?: string; +} + diff --git a/src/typings/payments/additionalDataOpi.ts b/src/typings/payments/additionalDataOpi.ts new file mode 100644 index 0000000..2504ca2 --- /dev/null +++ b/src/typings/payments/additionalDataOpi.ts @@ -0,0 +1,18 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AdditionalDataOpi { + + /** + * Optional boolean indicator. Set to **true** if you want an ecommerce transaction to return an `opi.transToken` as additional data in the response. You can store this Oracle Payment Interface token in your Oracle Opera database. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce). + */ + 'opiIncludeTransToken'?: string; +} + diff --git a/src/typings/payments/additionalDataRatepay.ts b/src/typings/payments/additionalDataRatepay.ts new file mode 100644 index 0000000..901f52c --- /dev/null +++ b/src/typings/payments/additionalDataRatepay.ts @@ -0,0 +1,53 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AdditionalDataRatepay { + + /** + * Amount the customer has to pay each month. + */ + 'ratepayInstallmentAmount'?: string; + + /** + * Interest rate of this installment. + */ + 'ratepayInterestRate'?: string; + + /** + * Amount of the last installment. + */ + 'ratepayLastInstallmentAmount'?: string; + + /** + * Calendar day of the first payment. + */ + 'ratepayPaymentFirstday'?: string; + + /** + * Date the merchant delivered the goods to the customer. + */ + 'ratepaydataDeliveryDate'?: string; + + /** + * Date by which the customer must settle the payment. + */ + 'ratepaydataDueDate'?: string; + + /** + * Invoice date, defined by the merchant. If not included, the invoice date is set to the delivery date. + */ + 'ratepaydataInvoiceDate'?: string; + + /** + * Identification name or number for the invoice, defined by the merchant. + */ + 'ratepaydataInvoiceId'?: string; +} + diff --git a/src/typings/payments/additionalDataRetry.ts b/src/typings/payments/additionalDataRetry.ts new file mode 100644 index 0000000..f111ef4 --- /dev/null +++ b/src/typings/payments/additionalDataRetry.ts @@ -0,0 +1,28 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AdditionalDataRetry { + + /** + * The number of times the transaction (not order) has been retried between different payment service providers. For instance, the `chainAttemptNumber` set to 2 means that this transaction has been recently tried on another provider before being sent to Adyen. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. + */ + 'retryChainAttemptNumber'?: string; + + /** + * The index of the attempt to bill a particular order, which is identified by the `merchantOrderReference` field. For example, if a recurring transaction fails and is retried one day later, then the order number for these attempts would be 1 and 2, respectively. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. + */ + 'retryOrderAttemptNumber'?: string; + + /** + * The Boolean value indicating whether Adyen should skip or retry this transaction, if possible. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. + */ + 'retrySkipRetry'?: string; +} + diff --git a/src/typings/payments/additionalDataRisk.ts b/src/typings/payments/additionalDataRisk.ts new file mode 100644 index 0000000..a0634c3 --- /dev/null +++ b/src/typings/payments/additionalDataRisk.ts @@ -0,0 +1,118 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AdditionalDataRisk { + + /** + * The data for your custom risk field. For more information, refer to [Create custom risk fields](https://docs.adyen.com/risk-management/configure-custom-risk-rules#step-1-create-custom-risk-fields). + */ + 'riskdataCustomFieldName'?: string; + + /** + * The price of item in the basket, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes). + */ + 'riskdataBasketItemItemNrAmountPerItem'?: string; + + /** + * Brand of the item. + */ + 'riskdataBasketItemItemNrBrand'?: string; + + /** + * Category of the item. + */ + 'riskdataBasketItemItemNrCategory'?: string; + + /** + * Color of the item. + */ + 'riskdataBasketItemItemNrColor'?: string; + + /** + * The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). + */ + 'riskdataBasketItemItemNrCurrency'?: string; + + /** + * ID of the item. + */ + 'riskdataBasketItemItemNrItemID'?: string; + + /** + * Manufacturer of the item. + */ + 'riskdataBasketItemItemNrManufacturer'?: string; + + /** + * A text description of the product the invoice line refers to. + */ + 'riskdataBasketItemItemNrProductTitle'?: string; + + /** + * Quantity of the item purchased. + */ + 'riskdataBasketItemItemNrQuantity'?: string; + + /** + * Email associated with the given product in the basket (usually in electronic gift cards). + */ + 'riskdataBasketItemItemNrReceiverEmail'?: string; + + /** + * Size of the item. + */ + 'riskdataBasketItemItemNrSize'?: string; + + /** + * [Stock keeping unit](https://en.wikipedia.org/wiki/Stock_keeping_unit). + */ + 'riskdataBasketItemItemNrSku'?: string; + + /** + * [Universal Product Code](https://en.wikipedia.org/wiki/Universal_Product_Code). + */ + 'riskdataBasketItemItemNrUpc'?: string; + + /** + * Code of the promotion. + */ + 'riskdataPromotionsPromotionItemNrPromotionCode'?: string; + + /** + * The discount amount of the promotion, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes). + */ + 'riskdataPromotionsPromotionItemNrPromotionDiscountAmount'?: string; + + /** + * The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). + */ + 'riskdataPromotionsPromotionItemNrPromotionDiscountCurrency'?: string; + + /** + * Promotion\'s percentage discount. It is represented in percentage value and there is no need to include the \'%\' sign. e.g. for a promotion discount of 30%, the value of the field should be 30. + */ + 'riskdataPromotionsPromotionItemNrPromotionDiscountPercentage'?: string; + + /** + * Name of the promotion. + */ + 'riskdataPromotionsPromotionItemNrPromotionName'?: string; + + /** + * Reference number of the risk profile that you want to apply to the payment. If not provided or left blank, the merchant-level account\'s default risk profile will be applied to the payment. For more information, see [dynamically assign a risk profile to a payment](https://docs.adyen.com/risk-management/create-and-use-risk-profiles#dynamically-assign-a-risk-profile-to-a-payment). + */ + 'riskdataRiskProfileReference'?: string; + + /** + * If this parameter is provided with the value **true**, risk checks for the payment request are skipped and the transaction will not get a risk score. + */ + 'riskdataSkipRisk'?: string; +} + diff --git a/src/typings/payments/additionalDataRiskStandalone.ts b/src/typings/payments/additionalDataRiskStandalone.ts new file mode 100644 index 0000000..c8c2827 --- /dev/null +++ b/src/typings/payments/additionalDataRiskStandalone.ts @@ -0,0 +1,88 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AdditionalDataRiskStandalone { + + /** + * Shopper\'s country of residence in the form of ISO standard 3166 2-character country codes. + */ + 'payPalCountryCode'?: string; + + /** + * Shopper\'s email. + */ + 'payPalEmailId'?: string; + + /** + * Shopper\'s first name. + */ + 'payPalFirstName'?: string; + + /** + * Shopper\'s last name. + */ + 'payPalLastName'?: string; + + /** + * Unique PayPal Customer Account identification number. Character length and limitations: 13 single-byte alphanumeric characters. + */ + 'payPalPayerId'?: string; + + /** + * Shopper\'s phone number. + */ + 'payPalPhone'?: string; + + /** + * Allowed values: * **Eligible** — Merchant is protected by PayPal\'s Seller Protection Policy for Unauthorized Payments and Item Not Received. * **PartiallyEligible** — Merchant is protected by PayPal\'s Seller Protection Policy for Item Not Received. * **Ineligible** — Merchant is not protected under the Seller Protection Policy. + */ + 'payPalProtectionEligibility'?: string; + + /** + * Unique transaction ID of the payment. + */ + 'payPalTransactionId'?: string; + + /** + * Raw AVS result received from the acquirer, where available. Example: D + */ + 'avsResultRaw'?: string; + + /** + * The Bank Identification Number of a credit card, which is the first six digits of a card number. Required for [tokenized card request](https://docs.adyen.com/risk-management/standalone-risk#tokenised-pan-request). + */ + 'bin'?: string; + + /** + * Raw CVC result received from the acquirer, where available. Example: 1 + */ + 'cvcResultRaw'?: string; + + /** + * Unique identifier or token for the shopper\'s card details. + */ + 'riskToken'?: string; + + /** + * A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true + */ + 'threeDAuthenticated'?: string; + + /** + * A Boolean value indicating whether 3DS was offered for this payment. Example: true + */ + 'threeDOffered'?: string; + + /** + * Required for PayPal payments only. The only supported value is: **paypal**. + */ + 'tokenDataType'?: string; +} + diff --git a/src/typings/payments/additionalDataSubMerchant.ts b/src/typings/payments/additionalDataSubMerchant.ts new file mode 100644 index 0000000..bd16e10 --- /dev/null +++ b/src/typings/payments/additionalDataSubMerchant.ts @@ -0,0 +1,63 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AdditionalDataSubMerchant { + + /** + * Required for transactions performed by registered payment facilitators. Indicates the number of sub-merchants contained in the request. For example, **3**. + */ + 'subMerchantNumberOfSubSellers'?: string; + + /** + * Required for transactions performed by registered payment facilitators. The city of the sub-merchant\'s address. * Format: Alphanumeric * Maximum length: 13 characters + */ + 'subMerchantSubSellerSubSellerNrCity'?: string; + + /** + * Required for transactions performed by registered payment facilitators. The three-letter country code of the sub-merchant\'s address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters + */ + 'subMerchantSubSellerSubSellerNrCountry'?: string; + + /** + * Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters + */ + 'subMerchantSubSellerSubSellerNrId'?: string; + + /** + * Required for transactions performed by registered payment facilitators. The sub-merchant\'s 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits + */ + 'subMerchantSubSellerSubSellerNrMcc'?: string; + + /** + * Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters + */ + 'subMerchantSubSellerSubSellerNrName'?: string; + + /** + * Required for transactions performed by registered payment facilitators. The postal code of the sub-merchant\'s address, without dashes. * Format: Numeric * Fixed length: 8 digits + */ + 'subMerchantSubSellerSubSellerNrPostalCode'?: string; + + /** + * Required for transactions performed by registered payment facilitators. The state code of the sub-merchant\'s address, if applicable to the country. * Format: Alphanumeric * Maximum length: 2 characters + */ + 'subMerchantSubSellerSubSellerNrState'?: string; + + /** + * Required for transactions performed by registered payment facilitators. The street name and house number of the sub-merchant\'s address. * Format: Alphanumeric * Maximum length: 60 characters + */ + 'subMerchantSubSellerSubSellerNrStreet'?: string; + + /** + * Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ + */ + 'subMerchantSubSellerSubSellerNrTaxId'?: string; +} + diff --git a/src/typings/payments/additionalDataTemporaryServices.ts b/src/typings/payments/additionalDataTemporaryServices.ts new file mode 100644 index 0000000..5bba760 --- /dev/null +++ b/src/typings/payments/additionalDataTemporaryServices.ts @@ -0,0 +1,58 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AdditionalDataTemporaryServices { + + /** + * Customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 + */ + 'enhancedSchemeDataCustomerReference'?: string; + + /** + * Name or ID associated with the individual working in a temporary capacity. * maxLength: 40 + */ + 'enhancedSchemeDataEmployeeName'?: string; + + /** + * Description of the job or task of the individual working in a temporary capacity. * maxLength: 40 + */ + 'enhancedSchemeDataJobDescription'?: string; + + /** + * Amount paid per regular hours worked, minor units. * maxLength: 7 + */ + 'enhancedSchemeDataRegularHoursRate'?: string; + + /** + * Amount of time worked during a normal operation for the task or job. * maxLength: 7 + */ + 'enhancedSchemeDataRegularHoursWorked'?: string; + + /** + * Name of the individual requesting temporary services. * maxLength: 40 + */ + 'enhancedSchemeDataRequestName'?: string; + + /** + * Date for the beginning of the pay period. * Format: ddMMyy * maxLength: 6 + */ + 'enhancedSchemeDataTempStartDate'?: string; + + /** + * Date of the end of the billing cycle. * Format: ddMMyy * maxLength: 6 + */ + 'enhancedSchemeDataTempWeekEnding'?: string; + + /** + * Total tax amount, in minor units. For example, 2000 means USD 20.00 * maxLength: 12 + */ + 'enhancedSchemeDataTotalTaxAmount'?: string; +} + diff --git a/src/typings/payments/additionalDataWallets.ts b/src/typings/payments/additionalDataWallets.ts new file mode 100644 index 0000000..2ce6d19 --- /dev/null +++ b/src/typings/payments/additionalDataWallets.ts @@ -0,0 +1,43 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AdditionalDataWallets { + + /** + * The Android Pay token retrieved from the SDK. + */ + 'androidpayToken'?: string; + + /** + * The Mastercard Masterpass Transaction ID retrieved from the SDK. + */ + 'masterpassTransactionId'?: string; + + /** + * The Apple Pay token retrieved from the SDK. + */ + 'paymentToken'?: string; + + /** + * The Google Pay token retrieved from the SDK. + */ + 'paywithgoogleToken'?: string; + + /** + * The Samsung Pay token retrieved from the SDK. + */ + 'samsungpayToken'?: string; + + /** + * The Visa Checkout Call ID retrieved from the SDK. + */ + 'visacheckoutCallId'?: string; +} + diff --git a/src/typings/payments/address.ts b/src/typings/payments/address.ts new file mode 100644 index 0000000..2d407ba --- /dev/null +++ b/src/typings/payments/address.ts @@ -0,0 +1,43 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Address { + + /** + * The name of the city. Maximum length: 3000 characters. + */ + 'city': string; + + /** + * The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don\'t know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + */ + 'country': string; + + /** + * The number or name of the house. Maximum length: 3000 characters. + */ + 'houseNumberOrName': string; + + /** + * A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + */ + 'postalCode': string; + + /** + * The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + */ + 'stateOrProvince'?: string; + + /** + * The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + */ + 'street': string; +} + diff --git a/src/typings/payments/adjustAuthorisationRequest.ts b/src/typings/payments/adjustAuthorisationRequest.ts new file mode 100644 index 0000000..5e83196 --- /dev/null +++ b/src/typings/payments/adjustAuthorisationRequest.ts @@ -0,0 +1,64 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Amount } from './amount'; +import { Split } from './split'; +import { ThreeDSecureData } from './threeDSecureData'; + +export class AdjustAuthorisationRequest { + + /** + * This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. + */ + 'additionalData'?: { [key: string]: string; }; + + /** + * The merchant account that is used to process the payment. + */ + 'merchantAccount': string; + + /** + */ + 'modificationAmount': Amount; + + /** + */ + 'mpiData'?: ThreeDSecureData; + + /** + * The original merchant reference to cancel. + */ + 'originalMerchantReference'?: string; + + /** + * The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + */ + 'originalReference': string; + + /** + * Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. + */ + 'reference'?: string; + + /** + * An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/platforms/processing-payments#providing-split-information). + */ + 'splits'?: Array; + + /** + * The transaction reference provided by the PED. For point-of-sale integrations only. + */ + 'tenderReference'?: string; + + /** + * Unique terminal ID for the PED that originally processed the request. For point-of-sale integrations only. + */ + 'uniqueTerminalId'?: string; +} + diff --git a/src/typings/payments/amount.ts b/src/typings/payments/amount.ts new file mode 100644 index 0000000..d2ac8df --- /dev/null +++ b/src/typings/payments/amount.ts @@ -0,0 +1,23 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Amount { + + /** + * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + */ + 'currency': string; + + /** + * The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + */ + 'value': number; +} + diff --git a/src/typings/payments/applicationInfo.ts b/src/typings/payments/applicationInfo.ts new file mode 100644 index 0000000..7b5958f --- /dev/null +++ b/src/typings/payments/applicationInfo.ts @@ -0,0 +1,41 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { CommonField } from './commonField'; +import { ExternalPlatform } from './externalPlatform'; +import { MerchantDevice } from './merchantDevice'; +import { ShopperInteractionDevice } from './shopperInteractionDevice'; + +export class ApplicationInfo { + + /** + */ + 'adyenLibrary'?: CommonField; + + /** + */ + 'adyenPaymentSource'?: CommonField; + + /** + */ + 'externalPlatform'?: ExternalPlatform; + + /** + */ + 'merchantApplication'?: CommonField; + + /** + */ + 'merchantDevice'?: MerchantDevice; + + /** + */ + 'shopperInteractionDevice'?: ShopperInteractionDevice; +} + diff --git a/src/typings/payments/authenticationResultRequest.ts b/src/typings/payments/authenticationResultRequest.ts new file mode 100644 index 0000000..3d3aa16 --- /dev/null +++ b/src/typings/payments/authenticationResultRequest.ts @@ -0,0 +1,23 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class AuthenticationResultRequest { + + /** + * The merchant account identifier, with which the authentication was processed. + */ + 'merchantAccount': string; + + /** + * The pspReference identifier for the transaction. + */ + 'pspReference': string; +} + diff --git a/src/typings/payments/authenticationResultResponse.ts b/src/typings/payments/authenticationResultResponse.ts new file mode 100644 index 0000000..65e9433 --- /dev/null +++ b/src/typings/payments/authenticationResultResponse.ts @@ -0,0 +1,23 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { ThreeDS1Result } from './threeDS1Result'; +import { ThreeDS2Result } from './threeDS2Result'; + +export class AuthenticationResultResponse { + + /** + */ + 'threeDS1Result'?: ThreeDS1Result; + + /** + */ + 'threeDS2Result'?: ThreeDS2Result; +} + diff --git a/src/typings/payments/bankAccount.ts b/src/typings/payments/bankAccount.ts new file mode 100644 index 0000000..fd30e37 --- /dev/null +++ b/src/typings/payments/bankAccount.ts @@ -0,0 +1,58 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class BankAccount { + + /** + * The bank account number (without separators). + */ + 'bankAccountNumber'?: string; + + /** + * The bank city. + */ + 'bankCity'?: string; + + /** + * The location id of the bank. The field value is `nil` in most cases. + */ + 'bankLocationId'?: string; + + /** + * The name of the bank. + */ + 'bankName'?: string; + + /** + * The [Business Identifier Code](https://en.wikipedia.org/wiki/ISO_9362) (BIC) is the SWIFT address assigned to a bank. The field value is `nil` in most cases. + */ + 'bic'?: string; + + /** + * Country code where the bank is located. A valid value is an ISO two-character country code (e.g. \'NL\'). + */ + 'countryCode'?: string; + + /** + * The [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN). + */ + 'iban'?: string; + + /** + * The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don\'t accept \'ø\'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don\'t match the required format, the response returns the error message: 203 \'Invalid bank account holder name\'. + */ + 'ownerName'?: string; + + /** + * The bank account holder\'s tax ID. + */ + 'taxId'?: string; +} + diff --git a/src/typings/payments/browserInfo.ts b/src/typings/payments/browserInfo.ts new file mode 100644 index 0000000..555f40d --- /dev/null +++ b/src/typings/payments/browserInfo.ts @@ -0,0 +1,58 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class BrowserInfo { + + /** + * The accept header value of the shopper\'s browser. + */ + 'acceptHeader': string; + + /** + * The color depth of the shopper\'s browser in bits per pixel. This should be obtained by using the browser\'s `screen.colorDepth` property. Accepted values: 1, 4, 8, 15, 16, 24, 30, 32 or 48 bit color depth. + */ + 'colorDepth': number; + + /** + * Boolean value indicating if the shopper\'s browser is able to execute Java. + */ + 'javaEnabled': boolean; + + /** + * Boolean value indicating if the shopper\'s browser is able to execute JavaScript. A default \'true\' value is assumed if the field is not present. + */ + 'javaScriptEnabled'?: boolean; + + /** + * The `navigator.language` value of the shopper\'s browser (as defined in IETF BCP 47). + */ + 'language': string; + + /** + * The total height of the shopper\'s device screen in pixels. + */ + 'screenHeight': number; + + /** + * The total width of the shopper\'s device screen in pixels. + */ + 'screenWidth': number; + + /** + * Time difference between UTC time and the shopper\'s browser local time, in minutes. + */ + 'timeZoneOffset': number; + + /** + * The user agent value of the shopper\'s browser. + */ + 'userAgent': string; +} + diff --git a/src/typings/payments/cancelOrRefundRequest.ts b/src/typings/payments/cancelOrRefundRequest.ts new file mode 100644 index 0000000..5638df2 --- /dev/null +++ b/src/typings/payments/cancelOrRefundRequest.ts @@ -0,0 +1,53 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { ThreeDSecureData } from './threeDSecureData'; + +export class CancelOrRefundRequest { + + /** + * This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. + */ + 'additionalData'?: { [key: string]: string; }; + + /** + * The merchant account that is used to process the payment. + */ + 'merchantAccount': string; + + /** + */ + 'mpiData'?: ThreeDSecureData; + + /** + * The original merchant reference to cancel. + */ + 'originalMerchantReference'?: string; + + /** + * The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + */ + 'originalReference': string; + + /** + * Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. + */ + 'reference'?: string; + + /** + * The transaction reference provided by the PED. For point-of-sale integrations only. + */ + 'tenderReference'?: string; + + /** + * Unique terminal ID for the PED that originally processed the request. For point-of-sale integrations only. + */ + 'uniqueTerminalId'?: string; +} + diff --git a/src/typings/payments/cancelRequest.ts b/src/typings/payments/cancelRequest.ts new file mode 100644 index 0000000..cacc6bb --- /dev/null +++ b/src/typings/payments/cancelRequest.ts @@ -0,0 +1,59 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Split } from './split'; +import { ThreeDSecureData } from './threeDSecureData'; + +export class CancelRequest { + + /** + * This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. + */ + 'additionalData'?: { [key: string]: string; }; + + /** + * The merchant account that is used to process the payment. + */ + 'merchantAccount': string; + + /** + */ + 'mpiData'?: ThreeDSecureData; + + /** + * The original merchant reference to cancel. + */ + 'originalMerchantReference'?: string; + + /** + * The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + */ + 'originalReference': string; + + /** + * Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. + */ + 'reference'?: string; + + /** + * An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/platforms/processing-payments#providing-split-information). + */ + 'splits'?: Array; + + /** + * The transaction reference provided by the PED. For point-of-sale integrations only. + */ + 'tenderReference'?: string; + + /** + * Unique terminal ID for the PED that originally processed the request. For point-of-sale integrations only. + */ + 'uniqueTerminalId'?: string; +} + diff --git a/src/typings/payments/captureRequest.ts b/src/typings/payments/captureRequest.ts new file mode 100644 index 0000000..e068512 --- /dev/null +++ b/src/typings/payments/captureRequest.ts @@ -0,0 +1,64 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Amount } from './amount'; +import { Split } from './split'; +import { ThreeDSecureData } from './threeDSecureData'; + +export class CaptureRequest { + + /** + * This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. + */ + 'additionalData'?: { [key: string]: string; }; + + /** + * The merchant account that is used to process the payment. + */ + 'merchantAccount': string; + + /** + */ + 'modificationAmount': Amount; + + /** + */ + 'mpiData'?: ThreeDSecureData; + + /** + * The original merchant reference to cancel. + */ + 'originalMerchantReference'?: string; + + /** + * The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + */ + 'originalReference': string; + + /** + * Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. + */ + 'reference'?: string; + + /** + * An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/platforms/processing-payments#providing-split-information). + */ + 'splits'?: Array; + + /** + * The transaction reference provided by the PED. For point-of-sale integrations only. + */ + 'tenderReference'?: string; + + /** + * Unique terminal ID for the PED that originally processed the request. For point-of-sale integrations only. + */ + 'uniqueTerminalId'?: string; +} + diff --git a/src/typings/payments/card.ts b/src/typings/payments/card.ts new file mode 100644 index 0000000..0164acc --- /dev/null +++ b/src/typings/payments/card.ts @@ -0,0 +1,53 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Card { + + /** + * The [card verification code](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid) (1-20 characters). Depending on the card brand, it is known also as: * CVV2/CVC2 – length: 3 digits * CID – length: 4 digits > If you are using [Client-Side Encryption](https://docs.adyen.com/classic-integration/cse-integration-ecommerce), the CVC code is present in the encrypted data. You must never post the card details to the server. > This field must be always present in a [one-click payment request](https://docs.adyen.com/classic-integration/recurring-payments). > When this value is returned in a response, it is always empty because it is not stored. + */ + 'cvc'?: string; + + /** + * The card expiry month. Format: 2 digits, zero-padded for single digits. For example: * 03 = March * 11 = November + */ + 'expiryMonth': string; + + /** + * The card expiry year. Format: 4 digits. For example: 2020 + */ + 'expiryYear': string; + + /** + * The name of the cardholder, as printed on the card. + */ + 'holderName': string; + + /** + * The issue number of the card (for some UK debit cards only). + */ + 'issueNumber'?: string; + + /** + * The card number (4-19 characters). Do not use any separators. When this value is returned in a response, only the last 4 digits of the card number are returned. + */ + 'number': string; + + /** + * The month component of the start date (for some UK debit cards only). + */ + 'startMonth'?: string; + + /** + * The year component of the start date (for some UK debit cards only). + */ + 'startYear'?: string; +} + diff --git a/src/typings/payments/commonField.ts b/src/typings/payments/commonField.ts new file mode 100644 index 0000000..f27163b --- /dev/null +++ b/src/typings/payments/commonField.ts @@ -0,0 +1,23 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class CommonField { + + /** + * Name of the field. For example, Name of External Platform. + */ + 'name'?: string; + + /** + * Version of the field. For example, Version of External Platform. + */ + 'version'?: string; +} + diff --git a/src/typings/payments/deviceRenderOptions.ts b/src/typings/payments/deviceRenderOptions.ts new file mode 100644 index 0000000..523b80d --- /dev/null +++ b/src/typings/payments/deviceRenderOptions.ts @@ -0,0 +1,37 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class DeviceRenderOptions { + + /** + * Supported SDK interface types. Allowed values: * native * html * both + */ + 'sdkInterface'?: DeviceRenderOptions.SdkInterfaceEnum; + + /** + * UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect + */ + 'sdkUiType'?: Array; +} + +export namespace DeviceRenderOptions { + export enum SdkInterfaceEnum { + Native = 'native', + Html = 'html', + Both = 'both' + } + export enum SdkUiTypeEnum { + MultiSelect = 'multiSelect', + OtherHtml = 'otherHtml', + OutOfBand = 'outOfBand', + SingleSelect = 'singleSelect', + Text = 'text' + } +} diff --git a/src/typings/payments/donationRequest.ts b/src/typings/payments/donationRequest.ts new file mode 100644 index 0000000..7ed1a04 --- /dev/null +++ b/src/typings/payments/donationRequest.ts @@ -0,0 +1,38 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Amount } from './amount'; + +export class DonationRequest { + + /** + * The Adyen account name of the charity. + */ + 'donationAccount': string; + + /** + * The merchant account that is used to process the payment. + */ + 'merchantAccount': string; + + /** + */ + 'modificationAmount': Amount; + + /** + * The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + */ + 'originalReference'?: string; + + /** + * Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. + */ + 'reference'?: string; +} + diff --git a/src/typings/payments/externalPlatform.ts b/src/typings/payments/externalPlatform.ts new file mode 100644 index 0000000..a93b766 --- /dev/null +++ b/src/typings/payments/externalPlatform.ts @@ -0,0 +1,28 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ExternalPlatform { + + /** + * External platform integrator. + */ + 'integrator'?: string; + + /** + * Name of the field. For example, Name of External Platform. + */ + 'name'?: string; + + /** + * Version of the field. For example, Version of External Platform. + */ + 'version'?: string; +} + diff --git a/src/typings/payments/forexQuote.ts b/src/typings/payments/forexQuote.ts new file mode 100644 index 0000000..54f085b --- /dev/null +++ b/src/typings/payments/forexQuote.ts @@ -0,0 +1,70 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Amount } from './amount'; + +export class ForexQuote { + + /** + * The account name. + */ + 'account'?: string; + + /** + * The account type. + */ + 'accountType'?: string; + + /** + */ + 'baseAmount'?: Amount; + + /** + * The base points. + */ + 'basePoints': number; + + /** + */ + 'buy'?: Amount; + + /** + */ + 'interbank'?: Amount; + + /** + * The reference assigned to the forex quote request. + */ + 'reference'?: string; + + /** + */ + 'sell'?: Amount; + + /** + * The signature to validate the integrity. + */ + 'signature'?: string; + + /** + * The source of the forex quote. + */ + 'source'?: string; + + /** + * The type of forex. + */ + 'type'?: string; + + /** + * The date until which the forex quote is valid. + */ + 'validTill': Date; +} + diff --git a/src/typings/payments/fraudCheckResult.ts b/src/typings/payments/fraudCheckResult.ts new file mode 100644 index 0000000..55025b2 --- /dev/null +++ b/src/typings/payments/fraudCheckResult.ts @@ -0,0 +1,28 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class FraudCheckResult { + + /** + * The fraud score generated by the risk check. + */ + 'accountScore': number; + + /** + * The ID of the risk check. + */ + 'checkId': number; + + /** + * The name of the risk check. + */ + 'name': string; +} + diff --git a/src/typings/payments/fraudResult.ts b/src/typings/payments/fraudResult.ts new file mode 100644 index 0000000..00ab308 --- /dev/null +++ b/src/typings/payments/fraudResult.ts @@ -0,0 +1,24 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { FraudCheckResult } from './fraudCheckResult'; + +export class FraudResult { + + /** + * The total fraud score generated by the risk checks. + */ + 'accountScore': number; + + /** + * The result of the individual risk checks. + */ + 'results'?: Array; +} + diff --git a/src/typings/payments/installments.ts b/src/typings/payments/installments.ts new file mode 100644 index 0000000..0fe3c76 --- /dev/null +++ b/src/typings/payments/installments.ts @@ -0,0 +1,29 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Installments { + + /** + * The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). By default, this is set to **regular**. Possible values: * **regular** * **revolving** + */ + 'plan'?: Installments.PlanEnum; + + /** + * Defines the number of installments. Its value needs to be greater than zero. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. + */ + 'value': number; +} + +export namespace Installments { + export enum PlanEnum { + Regular = 'regular', + Revolving = 'revolving' + } +} diff --git a/src/typings/payments/mandate.ts b/src/typings/payments/mandate.ts new file mode 100644 index 0000000..a3fc0c8 --- /dev/null +++ b/src/typings/payments/mandate.ts @@ -0,0 +1,74 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Mandate { + + /** + * The billing amount (in minor units) of the recurring transactions. + */ + 'amount': string; + + /** + * The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. + */ + 'amountRule'?: Mandate.AmountRuleEnum; + + /** + * The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. + */ + 'billingAttemptsRule'?: Mandate.BillingAttemptsRuleEnum; + + /** + * The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`. + */ + 'billingDay'?: string; + + /** + * End date of the billing plan, in YYYY-MM-DD format. + */ + 'endsAt': string; + + /** + * The frequency with which a shopper should be charged. Possible values: **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. + */ + 'frequency': Mandate.FrequencyEnum; + + /** + * The message shown by UPI to the shopper on the approval screen. + */ + 'remarks'?: string; + + /** + * Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date. + */ + 'startsAt'?: string; +} + +export namespace Mandate { + export enum AmountRuleEnum { + Max = 'max', + Exact = 'exact' + } + export enum BillingAttemptsRuleEnum { + On = 'on', + Before = 'before', + After = 'after' + } + export enum FrequencyEnum { + Adhoc = 'adhoc', + Daily = 'daily', + Weekly = 'weekly', + BiWeekly = 'biWeekly', + Monthly = 'monthly', + Quarterly = 'quarterly', + HalfYearly = 'halfYearly', + Yearly = 'yearly' + } +} diff --git a/src/typings/payments/merchantDevice.ts b/src/typings/payments/merchantDevice.ts new file mode 100644 index 0000000..ba250bf --- /dev/null +++ b/src/typings/payments/merchantDevice.ts @@ -0,0 +1,28 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class MerchantDevice { + + /** + * Operating system running on the merchant device. + */ + 'os'?: string; + + /** + * Version of the operating system on the merchant device. + */ + 'osVersion'?: string; + + /** + * Merchant device reference. + */ + 'reference'?: string; +} + diff --git a/src/typings/payments/merchantRiskIndicator.ts b/src/typings/payments/merchantRiskIndicator.ts new file mode 100644 index 0000000..a2d04cf --- /dev/null +++ b/src/typings/payments/merchantRiskIndicator.ts @@ -0,0 +1,102 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Amount } from './amount'; + +export class MerchantRiskIndicator { + + /** + * Whether the chosen delivery address is identical to the billing address. + */ + 'addressMatch'?: boolean; + + /** + * Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` + */ + 'deliveryAddressIndicator'?: MerchantRiskIndicator.DeliveryAddressIndicatorEnum; + + /** + * The delivery email address (for digital goods). + * + * @deprecated + */ + 'deliveryEmail'?: string; + + /** + * For Electronic delivery, the email address to which the merchandise was delivered. Maximum length: 254 characters. + */ + 'deliveryEmailAddress'?: string; + + /** + * The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` + */ + 'deliveryTimeframe'?: MerchantRiskIndicator.DeliveryTimeframeEnum; + + /** + */ + 'giftCardAmount'?: Amount; + + /** + * For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased. + */ + 'giftCardCount'?: number; + + /** + * For prepaid or gift card purchase, [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) three-digit currency code of the gift card, other than those listed in Table A.5 of the EMVCo 3D Secure Protocol and Core Functions Specification. + */ + 'giftCardCurr'?: string; + + /** + * For pre-order purchases, the expected date this product will be available to the shopper. + */ + 'preOrderDate'?: Date; + + /** + * Indicator for whether this transaction is for pre-ordering a product. + */ + 'preOrderPurchase'?: boolean; + + /** + * Indicates whether Cardholder is placing an order for merchandise with a future availability or release date. + */ + 'preOrderPurchaseInd'?: string; + + /** + * Indicator for whether the shopper has already purchased the same items in the past. + */ + 'reorderItems'?: boolean; + + /** + * Indicates whether the cardholder is reordering previously purchased merchandise. + */ + 'reorderItemsInd'?: string; + + /** + * Indicates shipping method chosen for the transaction. + */ + 'shipIndicator'?: string; +} + +export namespace MerchantRiskIndicator { + export enum DeliveryAddressIndicatorEnum { + ShipToBillingAddress = 'shipToBillingAddress', + ShipToVerifiedAddress = 'shipToVerifiedAddress', + ShipToNewAddress = 'shipToNewAddress', + ShipToStore = 'shipToStore', + DigitalGoods = 'digitalGoods', + GoodsNotShipped = 'goodsNotShipped', + Other = 'other' + } + export enum DeliveryTimeframeEnum { + ElectronicDelivery = 'electronicDelivery', + SameDayShipping = 'sameDayShipping', + OvernightShipping = 'overnightShipping', + TwoOrMoreDaysShipping = 'twoOrMoreDaysShipping' + } +} diff --git a/src/typings/payments/models.ts b/src/typings/payments/models.ts new file mode 100644 index 0000000..1cc939f --- /dev/null +++ b/src/typings/payments/models.ts @@ -0,0 +1,82 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +export * from './accountInfo'; +export * from './acctInfo'; +export * from './additionalData3DSecure'; +export * from './additionalDataAirline'; +export * from './additionalDataCarRental'; +export * from './additionalDataCommon'; +export * from './additionalDataLevel23'; +export * from './additionalDataLodging'; +export * from './additionalDataModifications'; +export * from './additionalDataOpenInvoice'; +export * from './additionalDataOpi'; +export * from './additionalDataRatepay'; +export * from './additionalDataRetry'; +export * from './additionalDataRisk'; +export * from './additionalDataRiskStandalone'; +export * from './additionalDataSubMerchant'; +export * from './additionalDataTemporaryServices'; +export * from './additionalDataWallets'; +export * from './address'; +export * from './adjustAuthorisationRequest'; +export * from './amount'; +export * from './applicationInfo'; +export * from './authenticationResultRequest'; +export * from './authenticationResultResponse'; +export * from './bankAccount'; +export * from './browserInfo'; +export * from './cancelOrRefundRequest'; +export * from './cancelRequest'; +export * from './captureRequest'; +export * from './card'; +export * from './commonField'; +export * from './deviceRenderOptions'; +export * from './donationRequest'; +export * from './externalPlatform'; +export * from './forexQuote'; +export * from './fraudCheckResult'; +export * from './fraudResult'; +export * from './installments'; +export * from './mandate'; +export * from './merchantDevice'; +export * from './merchantRiskIndicator'; +export * from './modificationResult'; +export * from './name'; +export * from './paymentRequest'; +export * from './paymentRequest3d'; +export * from './paymentRequest3ds2'; +export * from './paymentResult'; +export * from './phone'; +export * from './recurring'; +export * from './refundRequest'; +export * from './responseAdditionalData3DSecure'; +export * from './responseAdditionalDataBillingAddress'; +export * from './responseAdditionalDataCard'; +export * from './responseAdditionalDataCommon'; +export * from './responseAdditionalDataInstallments'; +export * from './responseAdditionalDataNetworkTokens'; +export * from './responseAdditionalDataOpi'; +export * from './responseAdditionalDataSepa'; +export * from './sDKEphemPubKey'; +export * from './serviceError'; +export * from './shopperInteractionDevice'; +export * from './split'; +export * from './splitAmount'; +export * from './technicalCancelRequest'; +export * from './threeDS1Result'; +export * from './threeDS2RequestData'; +export * from './threeDS2Result'; +export * from './threeDS2ResultRequest'; +export * from './threeDS2ResultResponse'; +export * from './threeDSRequestorAuthenticationInfo'; +export * from './threeDSRequestorPriorAuthenticationInfo'; +export * from './threeDSecureData'; +export * from './voidPendingRefundRequest'; diff --git a/src/typings/payments/modificationResult.ts b/src/typings/payments/modificationResult.ts new file mode 100644 index 0000000..cd1076b --- /dev/null +++ b/src/typings/payments/modificationResult.ts @@ -0,0 +1,40 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ModificationResult { + + /** + * This field contains additional data, which may be returned in a particular modification response. + */ + 'additionalData'?: { [key: string]: string; }; + + /** + * Adyen\'s 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. + */ + 'pspReference': string; + + /** + * Indicates if the modification request has been received for processing. + */ + 'response': ModificationResult.ResponseEnum; +} + +export namespace ModificationResult { + export enum ResponseEnum { + CaptureReceived = '[capture-received]', + CancelReceived = '[cancel-received]', + RefundReceived = '[refund-received]', + CancelOrRefundReceived = '[cancelOrRefund-received]', + AdjustAuthorisationReceived = '[adjustAuthorisation-received]', + DonationReceived = '[donation-received]', + TechnicalCancelReceived = '[technical-cancel-received]', + VoidPendingRefundReceived = '[voidPendingRefund-received]' + } +} diff --git a/src/typings/payments/name.ts b/src/typings/payments/name.ts new file mode 100644 index 0000000..5604e45 --- /dev/null +++ b/src/typings/payments/name.ts @@ -0,0 +1,23 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Name { + + /** + * The first name. + */ + 'firstName': string; + + /** + * The last name. + */ + 'lastName': string; +} + diff --git a/src/typings/payments/paymentRequest.ts b/src/typings/payments/paymentRequest.ts new file mode 100644 index 0000000..802d5eb --- /dev/null +++ b/src/typings/payments/paymentRequest.ts @@ -0,0 +1,277 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { AccountInfo } from './accountInfo'; +import { Address } from './address'; +import { Amount } from './amount'; +import { ApplicationInfo } from './applicationInfo'; +import { BankAccount } from './bankAccount'; +import { BrowserInfo } from './browserInfo'; +import { Card } from './card'; +import { ForexQuote } from './forexQuote'; +import { Installments } from './installments'; +import { Mandate } from './mandate'; +import { MerchantRiskIndicator } from './merchantRiskIndicator'; +import { Name } from './name'; +import { Recurring } from './recurring'; +import { Split } from './split'; +import { ThreeDS2RequestData } from './threeDS2RequestData'; +import { ThreeDSecureData } from './threeDSecureData'; + +export class PaymentRequest { + + /** + */ + 'accountInfo'?: AccountInfo; + + /** + */ + 'additionalAmount'?: Amount; + + /** + * This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + */ + 'additionalData'?: { [key: string]: string; }; + + /** + */ + 'amount': Amount; + + /** + */ + 'applicationInfo'?: ApplicationInfo; + + /** + */ + 'bankAccount'?: BankAccount; + + /** + */ + 'billingAddress'?: Address; + + /** + */ + 'browserInfo'?: BrowserInfo; + + /** + * The delay between the authorisation and scheduled auto-capture, specified in hours. + */ + 'captureDelayHours'?: number; + + /** + */ + 'card'?: Card; + + /** + * The shopper\'s date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + */ + 'dateOfBirth'?: Date; + + /** + */ + 'dccQuote'?: ForexQuote; + + /** + */ + 'deliveryAddress'?: Address; + + /** + * The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + */ + 'deliveryDate'?: Date; + + /** + * A string containing the shopper\'s device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + */ + 'deviceFingerprint'?: string; + + /** + * The type of the entity the payment is processed for. + */ + 'entityType'?: PaymentRequest.EntityTypeEnum; + + /** + * An integer value that is added to the normal fraud score. The value can be either positive or negative. + */ + 'fraudOffset'?: number; + + /** + * The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + */ + 'fundingSource'?: PaymentRequest.FundingSourceEnum; + + /** + */ + 'installments'?: Installments; + + /** + */ + 'mandate'?: Mandate; + + /** + * The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + */ + 'mcc'?: string; + + /** + * The merchant account identifier, with which you want to process the transaction. + */ + 'merchantAccount': string; + + /** + * This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + */ + 'merchantOrderReference'?: string; + + /** + */ + 'merchantRiskIndicator'?: MerchantRiskIndicator; + + /** + * Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + */ + 'metadata'?: { [key: string]: string; }; + + /** + */ + 'mpiData'?: ThreeDSecureData; + + /** + * The two-character country code of the shopper\'s nationality. + */ + 'nationality'?: string; + + /** + * When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + */ + 'orderReference'?: string; + + /** + */ + 'recurring'?: Recurring; + + /** + * Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder\'s balance drops below a certain amount. + */ + 'recurringProcessingModel'?: PaymentRequest.RecurringProcessingModelEnum; + + /** + * The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + */ + 'reference': string; + + /** + * Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. + */ + 'selectedBrand'?: string; + + /** + * The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. + */ + 'selectedRecurringDetailReference'?: string; + + /** + * A session ID used to identify a payment session. + */ + 'sessionId'?: string; + + /** + * The shopper\'s email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + */ + 'shopperEmail'?: string; + + /** + * The shopper\'s IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new). + */ + 'shopperIP'?: string; + + /** + * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + */ + 'shopperInteraction'?: PaymentRequest.ShopperInteractionEnum; + + /** + * The combination of a language code and a country code to specify the language to be used in the payment. + */ + 'shopperLocale'?: string; + + /** + */ + 'shopperName'?: Name; + + /** + * Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + */ + 'shopperReference'?: string; + + /** + * The text to be shown on the shopper\'s bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , \' _ - ? + * /_**. + */ + 'shopperStatement'?: string; + + /** + * The shopper\'s social security number. + */ + 'socialSecurityNumber'?: string; + + /** + * An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + */ + 'splits'?: Array; + + /** + * The ecommerce or point-of-sale store that is processing the payment. Used in [partner arrangement integrations](https://docs.adyen.com/platforms/platforms-for-partners#route-payments) for Adyen for Platforms. + */ + 'store'?: string; + + /** + * The shopper\'s telephone number. + */ + 'telephoneNumber'?: string; + + /** + */ + 'threeDS2RequestData'?: ThreeDS2RequestData; + + /** + * If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + */ + 'threeDSAuthenticationOnly'?: boolean; + + /** + * The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). + */ + 'totalsGroup'?: string; + + /** + * Set to true if the payment should be routed to a trusted MID. + */ + 'trustedShopper'?: boolean; +} + +export namespace PaymentRequest { + export enum EntityTypeEnum { + NaturalPerson = 'NaturalPerson', + CompanyName = 'CompanyName' + } + export enum FundingSourceEnum { + Debit = 'debit' + } + export enum RecurringProcessingModelEnum { + CardOnFile = 'CardOnFile', + Subscription = 'Subscription', + UnscheduledCardOnFile = 'UnscheduledCardOnFile' + } + export enum ShopperInteractionEnum { + Ecommerce = 'Ecommerce', + ContAuth = 'ContAuth', + Moto = 'Moto', + Pos = 'POS' + } +} diff --git a/src/typings/payments/paymentRequest3d.ts b/src/typings/payments/paymentRequest3d.ts new file mode 100644 index 0000000..73801a8 --- /dev/null +++ b/src/typings/payments/paymentRequest3d.ts @@ -0,0 +1,245 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { AccountInfo } from './accountInfo'; +import { Address } from './address'; +import { Amount } from './amount'; +import { ApplicationInfo } from './applicationInfo'; +import { BrowserInfo } from './browserInfo'; +import { ForexQuote } from './forexQuote'; +import { Installments } from './installments'; +import { MerchantRiskIndicator } from './merchantRiskIndicator'; +import { Name } from './name'; +import { Recurring } from './recurring'; +import { Split } from './split'; +import { ThreeDS2RequestData } from './threeDS2RequestData'; + +export class PaymentRequest3d { + + /** + */ + 'accountInfo'?: AccountInfo; + + /** + */ + 'additionalAmount'?: Amount; + + /** + * This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + */ + 'additionalData'?: { [key: string]: string; }; + + /** + */ + 'amount'?: Amount; + + /** + */ + 'applicationInfo'?: ApplicationInfo; + + /** + */ + 'billingAddress'?: Address; + + /** + */ + 'browserInfo'?: BrowserInfo; + + /** + * The delay between the authorisation and scheduled auto-capture, specified in hours. + */ + 'captureDelayHours'?: number; + + /** + * The shopper\'s date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + */ + 'dateOfBirth'?: Date; + + /** + */ + 'dccQuote'?: ForexQuote; + + /** + */ + 'deliveryAddress'?: Address; + + /** + * The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + */ + 'deliveryDate'?: Date; + + /** + * A string containing the shopper\'s device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + */ + 'deviceFingerprint'?: string; + + /** + * An integer value that is added to the normal fraud score. The value can be either positive or negative. + */ + 'fraudOffset'?: number; + + /** + */ + 'installments'?: Installments; + + /** + * The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + */ + 'mcc'?: string; + + /** + * The payment session identifier returned by the card issuer. + */ + 'md': string; + + /** + * The merchant account identifier, with which you want to process the transaction. + */ + 'merchantAccount': string; + + /** + * This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + */ + 'merchantOrderReference'?: string; + + /** + */ + 'merchantRiskIndicator'?: MerchantRiskIndicator; + + /** + * Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + */ + 'metadata'?: { [key: string]: string; }; + + /** + * When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + */ + 'orderReference'?: string; + + /** + * Payment authorisation response returned by the card issuer. The `paResponse` field holds the PaRes value received from the card issuer. + */ + 'paResponse': string; + + /** + */ + 'recurring'?: Recurring; + + /** + * Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder\'s balance drops below a certain amount. + */ + 'recurringProcessingModel'?: PaymentRequest3d.RecurringProcessingModelEnum; + + /** + * The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + */ + 'reference'?: string; + + /** + * Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. + */ + 'selectedBrand'?: string; + + /** + * The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. + */ + 'selectedRecurringDetailReference'?: string; + + /** + * A session ID used to identify a payment session. + */ + 'sessionId'?: string; + + /** + * The shopper\'s email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + */ + 'shopperEmail'?: string; + + /** + * The shopper\'s IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new). + */ + 'shopperIP'?: string; + + /** + * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + */ + 'shopperInteraction'?: PaymentRequest3d.ShopperInteractionEnum; + + /** + * The combination of a language code and a country code to specify the language to be used in the payment. + */ + 'shopperLocale'?: string; + + /** + */ + 'shopperName'?: Name; + + /** + * Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + */ + 'shopperReference'?: string; + + /** + * The text to be shown on the shopper\'s bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , \' _ - ? + * /_**. + */ + 'shopperStatement'?: string; + + /** + * The shopper\'s social security number. + */ + 'socialSecurityNumber'?: string; + + /** + * An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + */ + 'splits'?: Array; + + /** + * The ecommerce or point-of-sale store that is processing the payment. Used in [partner arrangement integrations](https://docs.adyen.com/platforms/platforms-for-partners#route-payments) for Adyen for Platforms. + */ + 'store'?: string; + + /** + * The shopper\'s telephone number. + */ + 'telephoneNumber'?: string; + + /** + */ + 'threeDS2RequestData'?: ThreeDS2RequestData; + + /** + * If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + */ + 'threeDSAuthenticationOnly'?: boolean; + + /** + * The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). + */ + 'totalsGroup'?: string; + + /** + * Set to true if the payment should be routed to a trusted MID. + */ + 'trustedShopper'?: boolean; +} + +export namespace PaymentRequest3d { + export enum RecurringProcessingModelEnum { + CardOnFile = 'CardOnFile', + Subscription = 'Subscription', + UnscheduledCardOnFile = 'UnscheduledCardOnFile' + } + export enum ShopperInteractionEnum { + Ecommerce = 'Ecommerce', + ContAuth = 'ContAuth', + Moto = 'Moto', + Pos = 'POS' + } +} diff --git a/src/typings/payments/paymentRequest3ds2.ts b/src/typings/payments/paymentRequest3ds2.ts new file mode 100644 index 0000000..abf9345 --- /dev/null +++ b/src/typings/payments/paymentRequest3ds2.ts @@ -0,0 +1,245 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { AccountInfo } from './accountInfo'; +import { Address } from './address'; +import { Amount } from './amount'; +import { ApplicationInfo } from './applicationInfo'; +import { BrowserInfo } from './browserInfo'; +import { ForexQuote } from './forexQuote'; +import { Installments } from './installments'; +import { MerchantRiskIndicator } from './merchantRiskIndicator'; +import { Name } from './name'; +import { Recurring } from './recurring'; +import { Split } from './split'; +import { ThreeDS2RequestData } from './threeDS2RequestData'; +import { ThreeDS2Result } from './threeDS2Result'; + +export class PaymentRequest3ds2 { + + /** + */ + 'accountInfo'?: AccountInfo; + + /** + */ + 'additionalAmount'?: Amount; + + /** + * This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + */ + 'additionalData'?: { [key: string]: string; }; + + /** + */ + 'amount': Amount; + + /** + */ + 'applicationInfo'?: ApplicationInfo; + + /** + */ + 'billingAddress'?: Address; + + /** + */ + 'browserInfo'?: BrowserInfo; + + /** + * The delay between the authorisation and scheduled auto-capture, specified in hours. + */ + 'captureDelayHours'?: number; + + /** + * The shopper\'s date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + */ + 'dateOfBirth'?: Date; + + /** + */ + 'dccQuote'?: ForexQuote; + + /** + */ + 'deliveryAddress'?: Address; + + /** + * The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + */ + 'deliveryDate'?: Date; + + /** + * A string containing the shopper\'s device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + */ + 'deviceFingerprint'?: string; + + /** + * An integer value that is added to the normal fraud score. The value can be either positive or negative. + */ + 'fraudOffset'?: number; + + /** + */ + 'installments'?: Installments; + + /** + * The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + */ + 'mcc'?: string; + + /** + * The merchant account identifier, with which you want to process the transaction. + */ + 'merchantAccount': string; + + /** + * This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + */ + 'merchantOrderReference'?: string; + + /** + */ + 'merchantRiskIndicator'?: MerchantRiskIndicator; + + /** + * Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + */ + 'metadata'?: { [key: string]: string; }; + + /** + * When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + */ + 'orderReference'?: string; + + /** + */ + 'recurring'?: Recurring; + + /** + * Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder\'s balance drops below a certain amount. + */ + 'recurringProcessingModel'?: PaymentRequest3ds2.RecurringProcessingModelEnum; + + /** + * The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + */ + 'reference': string; + + /** + * Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. + */ + 'selectedBrand'?: string; + + /** + * The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. + */ + 'selectedRecurringDetailReference'?: string; + + /** + * A session ID used to identify a payment session. + */ + 'sessionId'?: string; + + /** + * The shopper\'s email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + */ + 'shopperEmail'?: string; + + /** + * The shopper\'s IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new). + */ + 'shopperIP'?: string; + + /** + * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + */ + 'shopperInteraction'?: PaymentRequest3ds2.ShopperInteractionEnum; + + /** + * The combination of a language code and a country code to specify the language to be used in the payment. + */ + 'shopperLocale'?: string; + + /** + */ + 'shopperName'?: Name; + + /** + * Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + */ + 'shopperReference'?: string; + + /** + * The text to be shown on the shopper\'s bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , \' _ - ? + * /_**. + */ + 'shopperStatement'?: string; + + /** + * The shopper\'s social security number. + */ + 'socialSecurityNumber'?: string; + + /** + * An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + */ + 'splits'?: Array; + + /** + * The ecommerce or point-of-sale store that is processing the payment. Used in [partner arrangement integrations](https://docs.adyen.com/platforms/platforms-for-partners#route-payments) for Adyen for Platforms. + */ + 'store'?: string; + + /** + * The shopper\'s telephone number. + */ + 'telephoneNumber'?: string; + + /** + */ + 'threeDS2RequestData'?: ThreeDS2RequestData; + + /** + */ + 'threeDS2Result'?: ThreeDS2Result; + + /** + * The ThreeDS2Token that was returned in the /authorise call. + */ + 'threeDS2Token'?: string; + + /** + * If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + */ + 'threeDSAuthenticationOnly'?: boolean; + + /** + * The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). + */ + 'totalsGroup'?: string; + + /** + * Set to true if the payment should be routed to a trusted MID. + */ + 'trustedShopper'?: boolean; +} + +export namespace PaymentRequest3ds2 { + export enum RecurringProcessingModelEnum { + CardOnFile = 'CardOnFile', + Subscription = 'Subscription', + UnscheduledCardOnFile = 'UnscheduledCardOnFile' + } + export enum ShopperInteractionEnum { + Ecommerce = 'Ecommerce', + ContAuth = 'ContAuth', + Moto = 'Moto', + Pos = 'POS' + } +} diff --git a/src/typings/payments/paymentResult.ts b/src/typings/payments/paymentResult.ts new file mode 100644 index 0000000..a92e8d5 --- /dev/null +++ b/src/typings/payments/paymentResult.ts @@ -0,0 +1,84 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Amount } from './amount'; +import { FraudResult } from './fraudResult'; + +export class PaymentResult { + + /** + * Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Account** > **API URLs** > **Additional data settings**. + */ + 'additionalData'?: { [key: string]: string; }; + + /** + * Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. + */ + 'authCode'?: string; + + /** + */ + 'dccAmount'?: Amount; + + /** + * Cryptographic signature used to verify `dccQuote`. > This value only applies if you have implemented Dynamic Currency Conversion. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new). + */ + 'dccSignature'?: string; + + /** + */ + 'fraudResult'?: FraudResult; + + /** + * The URL to direct the shopper to. > In case of SecurePlus, do not redirect a shopper to this URL. + */ + 'issuerUrl'?: string; + + /** + * The payment session. + */ + 'md'?: string; + + /** + * The 3D request data for the issuer. If the value is **CUPSecurePlus-CollectSMSVerificationCode**, collect an SMS code from the shopper and pass it in the `/authorise3D` request. For more information, see [3D Secure](https://docs.adyen.com/classic-integration/3d-secure). + */ + 'paRequest'?: string; + + /** + * Adyen\'s 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. + */ + 'pspReference'?: string; + + /** + * If the payment\'s authorisation is refused or an error occurs during authorisation, this field holds Adyen\'s mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + */ + 'refusalReason'?: string; + + /** + * The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper\'s device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. + */ + 'resultCode'?: PaymentResult.ResultCodeEnum; +} + +export namespace PaymentResult { + export enum ResultCodeEnum { + AuthenticationFinished = 'AuthenticationFinished', + Authorised = 'Authorised', + Cancelled = 'Cancelled', + ChallengeShopper = 'ChallengeShopper', + Error = 'Error', + IdentifyShopper = 'IdentifyShopper', + Pending = 'Pending', + PresentToShopper = 'PresentToShopper', + Received = 'Received', + RedirectShopper = 'RedirectShopper', + Refused = 'Refused', + Success = 'Success' + } +} diff --git a/src/typings/payments/phone.ts b/src/typings/payments/phone.ts new file mode 100644 index 0000000..2cc75e3 --- /dev/null +++ b/src/typings/payments/phone.ts @@ -0,0 +1,23 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Phone { + + /** + * Country code. Length: 1–3 characters. + */ + 'cc'?: string; + + /** + * Subscriber number. Maximum length: 15 characters. + */ + 'subscriber'?: string; +} + diff --git a/src/typings/payments/recurring.ts b/src/typings/payments/recurring.ts new file mode 100644 index 0000000..6ab48f4 --- /dev/null +++ b/src/typings/payments/recurring.ts @@ -0,0 +1,49 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Recurring { + + /** + * The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts). + */ + 'contract'?: Recurring.ContractEnum; + + /** + * A descriptive name for this detail. + */ + 'recurringDetailName'?: string; + + /** + * Date after which no further authorisations shall be performed. Only for 3D Secure 2. + */ + 'recurringExpiry'?: Date; + + /** + * Minimum number of days between authorisations. Only for 3D Secure 2. + */ + 'recurringFrequency'?: string; + + /** + * The name of the token service. + */ + 'tokenService'?: Recurring.TokenServiceEnum; +} + +export namespace Recurring { + export enum ContractEnum { + Oneclick = 'ONECLICK', + Recurring = 'RECURRING', + Payout = 'PAYOUT' + } + export enum TokenServiceEnum { + Visatokenservice = 'VISATOKENSERVICE', + Mctokenservice = 'MCTOKENSERVICE' + } +} diff --git a/src/typings/payments/refundRequest.ts b/src/typings/payments/refundRequest.ts new file mode 100644 index 0000000..311938a --- /dev/null +++ b/src/typings/payments/refundRequest.ts @@ -0,0 +1,64 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Amount } from './amount'; +import { Split } from './split'; +import { ThreeDSecureData } from './threeDSecureData'; + +export class RefundRequest { + + /** + * This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. + */ + 'additionalData'?: { [key: string]: string; }; + + /** + * The merchant account that is used to process the payment. + */ + 'merchantAccount': string; + + /** + */ + 'modificationAmount': Amount; + + /** + */ + 'mpiData'?: ThreeDSecureData; + + /** + * The original merchant reference to cancel. + */ + 'originalMerchantReference'?: string; + + /** + * The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + */ + 'originalReference': string; + + /** + * Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. + */ + 'reference'?: string; + + /** + * An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/platforms/processing-payments#providing-split-information). + */ + 'splits'?: Array; + + /** + * The transaction reference provided by the PED. For point-of-sale integrations only. + */ + 'tenderReference'?: string; + + /** + * Unique terminal ID for the PED that originally processed the request. For point-of-sale integrations only. + */ + 'uniqueTerminalId'?: string; +} + diff --git a/src/typings/payments/responseAdditionalData3DSecure.ts b/src/typings/payments/responseAdditionalData3DSecure.ts new file mode 100644 index 0000000..b2ab311 --- /dev/null +++ b/src/typings/payments/responseAdditionalData3DSecure.ts @@ -0,0 +1,38 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ResponseAdditionalData3DSecure { + + /** + * Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. + */ + 'cardHolderInfo'?: string; + + /** + * The Cardholder Authentication Verification Value (CAVV) for the 3D Secure authentication session, as a Base64-encoded 20-byte array. + */ + 'cavv'?: string; + + /** + * The CAVV algorithm used. + */ + 'cavvAlgorithm'?: string; + + /** + * Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** + */ + 'scaExemptionRequested'?: string; + + /** + * Indicates whether a card is enrolled for 3D Secure 2. + */ + 'threeds2CardEnrolled'?: boolean; +} + diff --git a/src/typings/payments/responseAdditionalDataBillingAddress.ts b/src/typings/payments/responseAdditionalDataBillingAddress.ts new file mode 100644 index 0000000..a8aa8c5 --- /dev/null +++ b/src/typings/payments/responseAdditionalDataBillingAddress.ts @@ -0,0 +1,43 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ResponseAdditionalDataBillingAddress { + + /** + * The billing address city passed in the payment request. + */ + 'billingAddressCity'?: string; + + /** + * The billing address country passed in the payment request. Example: NL + */ + 'billingAddressCountry'?: string; + + /** + * The billing address house number or name passed in the payment request. + */ + 'billingAddressHouseNumberOrName'?: string; + + /** + * The billing address postal code passed in the payment request. Example: 1011 DJ + */ + 'billingAddressPostalCode'?: string; + + /** + * The billing address state or province passed in the payment request. Example: NH + */ + 'billingAddressStateOrProvince'?: string; + + /** + * The billing address street passed in the payment request. + */ + 'billingAddressStreet'?: string; +} + diff --git a/src/typings/payments/responseAdditionalDataCard.ts b/src/typings/payments/responseAdditionalDataCard.ts new file mode 100644 index 0000000..3fe6c68 --- /dev/null +++ b/src/typings/payments/responseAdditionalDataCard.ts @@ -0,0 +1,53 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ResponseAdditionalDataCard { + + /** + * The first six digits of the card number. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with a six-digit BIN. Example: 521234 + */ + 'cardBin'?: string; + + /** + * The cardholder name passed in the payment request. + */ + 'cardHolderName'?: string; + + /** + * The bank or the financial institution granting lines of credit through card association branded payment cards. This information can be included when available. + */ + 'cardIssuingBank'?: string; + + /** + * The country where the card was issued. Example: US + */ + 'cardIssuingCountry'?: string; + + /** + * The currency in which the card is issued, if this information is available. Provided as the currency code or currency number from the ISO-4217 standard. Example: USD + */ + 'cardIssuingCurrency'?: string; + + /** + * The card payment method used for the transaction. Example: amex + */ + 'cardPaymentMethod'?: string; + + /** + * The last four digits of a card number. > Returned only in case of a card payment. + */ + 'cardSummary'?: string; + + /** + * The first eight digits of the card number. Only returned if the card number is 16 digits or more. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with an eight-digit BIN. Example: 52123423 + */ + 'issuerBin'?: string; +} + diff --git a/src/typings/payments/responseAdditionalDataCommon.ts b/src/typings/payments/responseAdditionalDataCommon.ts new file mode 100644 index 0000000..c89edd6 --- /dev/null +++ b/src/typings/payments/responseAdditionalDataCommon.ts @@ -0,0 +1,326 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ResponseAdditionalDataCommon { + + /** + * The name of the Adyen acquirer account. Example: PayPalSandbox_TestAcquirer > Only relevant for PayPal transactions. + */ + 'acquirerAccountCode'?: string; + + /** + * The name of the acquirer processing the payment request. Example: TestPmmAcquirer + */ + 'acquirerCode'?: string; + + /** + * The reference number that can be used for reconciliation in case a non-Adyen acquirer is used for settlement. Example: 7C9N3FNBKT9 + */ + 'acquirerReference'?: string; + + /** + * The Adyen alias of the card. Example: H167852639363479 + */ + 'alias'?: string; + + /** + * The type of the card alias. Example: Default + */ + 'aliasType'?: string; + + /** + * Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. Example: 58747 + */ + 'authCode'?: string; + + /** + * Merchant ID known by the acquirer. + */ + 'authorisationMid'?: string; + + /** + * The currency of the authorised amount, as a three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + */ + 'authorisedAmountCurrency'?: string; + + /** + * Value of the amount authorised. This amount is represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). + */ + 'authorisedAmountValue'?: string; + + /** + * The AVS result code of the payment, which provides information about the outcome of the AVS check. For possible values, see [AVS](https://docs.adyen.com/risk-management/configure-standard-risk-rules/consistency-rules#billing-address-does-not-match-cardholder-address-avs). + */ + 'avsResult'?: string; + + /** + * Raw AVS result received from the acquirer, where available. Example: D + */ + 'avsResultRaw'?: string; + + /** + * BIC of a bank account. Example: TESTNL01 > Only relevant for SEPA Direct Debit transactions. + */ + 'bic'?: string; + + /** + * Includes the co-branded card information. + */ + 'coBrandedWith'?: string; + + /** + * The result of CVC verification. + */ + 'cvcResult'?: string; + + /** + * The raw result of CVC verification. + */ + 'cvcResultRaw'?: string; + + /** + * Supported for 3D Secure 2. The unique transaction identifier assigned by the DS to identify a single transaction. + */ + 'dsTransID'?: string; + + /** + * The Electronic Commerce Indicator returned from the schemes for the 3DS payment session. Example: 02 + */ + 'eci'?: string; + + /** + * The expiry date on the card. Example: 6/2016 > Returned only in case of a card payment. + */ + 'expiryDate'?: string; + + /** + * The currency of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. Example: EUR + */ + 'extraCostsCurrency'?: string; + + /** + * The value of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. The amount is in minor units. + */ + 'extraCostsValue'?: string; + + /** + * The fraud score due to a particular fraud check. The fraud check name is found in the key of the key-value pair. + */ + 'fraudCheckItemNrFraudCheckname'?: string; + + /** + * Indicates if the payment is sent to manual review. + */ + 'fraudManualReview'?: string; + + /** + * The fraud result properties of the payment. + */ + 'fraudResultType'?: ResponseAdditionalDataCommon.FraudResultTypeEnum; + + /** + * Information regarding the funding type of the card. The possible return values are: * CHARGE * CREDIT * DEBIT * PREPAID * PREPAID_RELOADABLE * PREPAID_NONRELOADABLE * DEFFERED_DEBIT > This functionality requires additional configuration on Adyen\'s end. To enable it, contact the Support Team. For receiving this field in the notification, enable **Include Funding Source** in **Notifications** > **Additional settings**. + */ + 'fundingSource'?: string; + + /** + * Indicates availability of funds. Visa: * \"I\" (fast funds are supported) * \"N\" (otherwise) Mastercard: * \"I\" (product type is Prepaid or Debit, or issuing country is in CEE/HGEM list) * \"N\" (otherwise) > Returned when you verify a card BIN or estimate costs, and only if payoutEligible is \"Y\" or \"D\". + */ + 'fundsAvailability'?: string; + + /** + * Provides the more granular indication of why a transaction was refused. When a transaction fails with either \"Refused\", \"Restricted Card\", \"Transaction Not Permitted\", \"Not supported\" or \"DeclinedNon Generic\" refusalReason from the issuer, Adyen cross references its PSP-wide data for extra insight into the refusal reason. If an inferred refusal reason is available, the `inferredRefusalReason`, field is populated and the `refusalReason`, is set to \"Not Supported\". Possible values: * 3D Secure Mandated * Closed Account * ContAuth Not Supported * CVC Mandated * Ecommerce Not Allowed * Crossborder Not Supported * Card Updated * Low Authrate Bin * Non-reloadable prepaid card + */ + 'inferredRefusalReason'?: string; + + /** + * Indicates if the card is used for business purposes only. + */ + 'isCardCommercial'?: string; + + /** + * The issuing country of the card based on the BIN list that Adyen maintains. Example: JP + */ + 'issuerCountry'?: string; + + /** + * A Boolean value indicating whether a liability shift was offered for this payment. + */ + 'liabilityShift'?: string; + + /** + * The `mcBankNetReferenceNumber`, is a minimum of six characters and a maximum of nine characters long. > Contact Support Team to enable this field. + */ + 'mcBankNetReferenceNumber'?: string; + + /** + * A code and message that issuers send to provide more details about the payment. This field is especially useful when implementing a retry logic for declined payments. Possible values: * **01: New account information available** * **02: Cannot approve at this time, try again later** * **03: Do not try again** * **04: Token requirements not fulfilled for this token type** * **21: Payment Cancellation** (only for Mastercard) + */ + 'merchantAdviceCode'?: ResponseAdditionalDataCommon.MerchantAdviceCodeEnum; + + /** + * The reference provided for the transaction. + */ + 'merchantReference'?: string; + + /** + * Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. + */ + 'networkTxReference'?: string; + + /** + * The owner name of a bank account. Only relevant for SEPA Direct Debit transactions. + */ + 'ownerName'?: string; + + /** + * The Payment Account Reference (PAR) value links a network token with the underlying primary account number (PAN). The PAR value consists of 29 uppercase alphanumeric characters. + */ + 'paymentAccountReference'?: string; + + /** + * The payment method used in the transaction. + */ + 'paymentMethod'?: string; + + /** + * The Adyen sub-variant of the payment method used for the payment request. For more information, refer to [PaymentMethodVariant](https://docs.adyen.com/development-resources/paymentmethodvariant). Example: mcpro + */ + 'paymentMethodVariant'?: string; + + /** + * Indicates whether a payout is eligible or not for this card. Visa: * \"Y\" * \"N\" Mastercard: * \"Y\" (domestic and cross-border) * \"D\" (only domestic) * \"N\" (no MoneySend) * \"U\" (unknown) + */ + 'payoutEligible'?: string; + + /** + * The response code from the Real Time Account Updater service. Possible return values are: * CardChanged * CardExpiryChanged * CloseAccount * ContactCardAccountHolder + */ + 'realtimeAccountUpdaterStatus'?: string; + + /** + * Message to be displayed on the terminal. + */ + 'receiptFreeText'?: string; + + /** + * The recurring contract types applicable to the transaction. + */ + 'recurringContractTypes'?: string; + + /** + * The `pspReference`, of the first recurring payment that created the recurring detail. This functionality requires additional configuration on Adyen\'s end. To enable it, contact the Support Team. + */ + 'recurringFirstPspReference'?: string; + + /** + * The reference that uniquely identifies the recurring transaction. + */ + 'recurringRecurringDetailReference'?: string; + + /** + * The provided reference of the shopper for a recurring transaction. + */ + 'recurringShopperReference'?: string; + + /** + * The processing model used for the recurring transaction. + */ + 'recurringProcessingModel'?: ResponseAdditionalDataCommon.RecurringProcessingModelEnum; + + /** + * If the payment is referred, this field is set to true. This field is unavailable if the payment is referred and is usually not returned with ecommerce transactions. Example: true + */ + 'referred'?: string; + + /** + * Raw refusal reason received from the acquirer, where available. Example: AUTHORISED + */ + 'refusalReasonRaw'?: string; + + /** + * The amount of the payment request. + */ + 'requestAmount'?: string; + + /** + * The currency of the payment request. + */ + 'requestCurrencyCode'?: string; + + /** + * The shopper interaction type of the payment request. Example: Ecommerce + */ + 'shopperInteraction'?: string; + + /** + * The shopperReference passed in the payment request. Example: AdyenTestShopperXX + */ + 'shopperReference'?: string; + + /** + * The terminal ID used in a point-of-sale payment. Example: 06022622 + */ + 'terminalId'?: string; + + /** + * A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true + */ + 'threeDAuthenticated'?: string; + + /** + * The raw 3DS authentication result from the card issuer. Example: N + */ + 'threeDAuthenticatedResponse'?: string; + + /** + * A Boolean value indicating whether 3DS was offered for this payment. Example: true + */ + 'threeDOffered'?: string; + + /** + * The raw enrollment result from the 3DS directory services of the card schemes. Example: Y + */ + 'threeDOfferedResponse'?: string; + + /** + * The 3D Secure 2 version. + */ + 'threeDSVersion'?: string; + + /** + * The `visaTransactionId`, has a fixed length of 15 numeric characters. > Contact Support Team to enable this field. + */ + 'visaTransactionId'?: string; + + /** + * The 3DS transaction ID of the 3DS session sent in notifications. The value is Base64-encoded and is returned for transactions with directoryResponse \'N\' or \'Y\'. If you want to submit the xid in your 3D Secure 1 request, use the `mpiData.xid`, field. Example: ODgxNDc2MDg2MDExODk5MAAAAAA= + */ + 'xid'?: string; +} + +export namespace ResponseAdditionalDataCommon { + export enum FraudResultTypeEnum { + Green = 'GREEN', + Fraud = 'FRAUD' + } + export enum MerchantAdviceCodeEnum { + _01NewAccountInformationAvailable = '01: New account information available', + _02CannotApproveAtThisTimeTryAgainLater = '02: Cannot approve at this time, try again later', + _03DoNotTryAgain = '03: Do not try again', + _04TokenRequirementsNotFulfilledForThisTokenType = '04: Token requirements not fulfilled for this token type', + _21PaymentCancellation = '21: Payment Cancellation' + } + export enum RecurringProcessingModelEnum { + CardOnFile = 'CardOnFile', + Subscription = 'Subscription', + UnscheduledCardOnFile = 'UnscheduledCardOnFile' + } +} diff --git a/src/typings/payments/responseAdditionalDataInstallments.ts b/src/typings/payments/responseAdditionalDataInstallments.ts new file mode 100644 index 0000000..5fa34f5 --- /dev/null +++ b/src/typings/payments/responseAdditionalDataInstallments.ts @@ -0,0 +1,73 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ResponseAdditionalDataInstallments { + + /** + * Type of installment. The value of `installmentType` should be **IssuerFinanced**. + */ + 'installmentPaymentDataInstallmentType'?: string; + + /** + * Annual interest rate. + */ + 'installmentPaymentDataOptionItemNrAnnualPercentageRate'?: string; + + /** + * First Installment Amount in minor units. + */ + 'installmentPaymentDataOptionItemNrFirstInstallmentAmount'?: string; + + /** + * Installment fee amount in minor units. + */ + 'installmentPaymentDataOptionItemNrInstallmentFee'?: string; + + /** + * Interest rate for the installment period. + */ + 'installmentPaymentDataOptionItemNrInterestRate'?: string; + + /** + * Maximum number of installments possible for this payment. + */ + 'installmentPaymentDataOptionItemNrMaximumNumberOfInstallments'?: string; + + /** + * Minimum number of installments possible for this payment. + */ + 'installmentPaymentDataOptionItemNrMinimumNumberOfInstallments'?: string; + + /** + * Total number of installments possible for this payment. + */ + 'installmentPaymentDataOptionItemNrNumberOfInstallments'?: string; + + /** + * Subsequent Installment Amount in minor units. + */ + 'installmentPaymentDataOptionItemNrSubsequentInstallmentAmount'?: string; + + /** + * Total amount in minor units. + */ + 'installmentPaymentDataOptionItemNrTotalAmountDue'?: string; + + /** + * Possible values: * PayInInstallmentsOnly * PayInFullOnly * PayInFullOrInstallments + */ + 'installmentPaymentDataPaymentOptions'?: string; + + /** + * The number of installments that the payment amount should be charged with. Example: 5 > Only relevant for card payments in countries that support installments. + */ + 'installmentsValue'?: string; +} + diff --git a/src/typings/payments/responseAdditionalDataNetworkTokens.ts b/src/typings/payments/responseAdditionalDataNetworkTokens.ts new file mode 100644 index 0000000..14d6fd6 --- /dev/null +++ b/src/typings/payments/responseAdditionalDataNetworkTokens.ts @@ -0,0 +1,28 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ResponseAdditionalDataNetworkTokens { + + /** + * Indicates whether a network token is available for the specified card. + */ + 'networkTokenAvailable'?: string; + + /** + * The Bank Identification Number of a tokenized card, which is the first six digits of a card number. + */ + 'networkTokenBin'?: string; + + /** + * The last four digits of a network token. + */ + 'networkTokenTokenSummary'?: string; +} + diff --git a/src/typings/payments/responseAdditionalDataOpi.ts b/src/typings/payments/responseAdditionalDataOpi.ts new file mode 100644 index 0000000..dbac6f3 --- /dev/null +++ b/src/typings/payments/responseAdditionalDataOpi.ts @@ -0,0 +1,18 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ResponseAdditionalDataOpi { + + /** + * Returned in the response if you included `opi.includeTransToken: true` in an ecommerce payment request. This contains an Oracle Payment Interface token that you can store in your Oracle Opera database to identify tokenized ecommerce transactions. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce). + */ + 'opiTransToken'?: string; +} + diff --git a/src/typings/payments/responseAdditionalDataSepa.ts b/src/typings/payments/responseAdditionalDataSepa.ts new file mode 100644 index 0000000..3a36e24 --- /dev/null +++ b/src/typings/payments/responseAdditionalDataSepa.ts @@ -0,0 +1,28 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ResponseAdditionalDataSepa { + + /** + * The transaction signature date. Format: yyyy-MM-dd + */ + 'sepadirectdebitDateOfSignature'?: string; + + /** + * Its value corresponds to the pspReference value of the transaction. + */ + 'sepadirectdebitMandateId'?: string; + + /** + * This field can take one of the following values: * OneOff: (OOFF) Direct debit instruction to initiate exactly one direct debit transaction. * First: (FRST) Initial/first collection in a series of direct debit instructions. * Recurring: (RCUR) Direct debit instruction to carry out regular direct debit transactions initiated by the creditor. * Final: (FNAL) Last/final collection in a series of direct debit instructions. Example: OOFF + */ + 'sepadirectdebitSequenceType'?: string; +} + diff --git a/src/typings/payments/sDKEphemPubKey.ts b/src/typings/payments/sDKEphemPubKey.ts new file mode 100644 index 0000000..a21b522 --- /dev/null +++ b/src/typings/payments/sDKEphemPubKey.ts @@ -0,0 +1,33 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class SDKEphemPubKey { + + /** + * The `crv` value as received from the 3D Secure 2 SDK. + */ + 'crv'?: string; + + /** + * The `kty` value as received from the 3D Secure 2 SDK. + */ + 'kty'?: string; + + /** + * The `x` value as received from the 3D Secure 2 SDK. + */ + 'x'?: string; + + /** + * The `y` value as received from the 3D Secure 2 SDK. + */ + 'y'?: string; +} + diff --git a/src/typings/payments/serviceError.ts b/src/typings/payments/serviceError.ts new file mode 100644 index 0000000..a179790 --- /dev/null +++ b/src/typings/payments/serviceError.ts @@ -0,0 +1,43 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ServiceError { + + /** + * Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Account** > **API URLs**. + */ + 'additionalData'?: { [key: string]: string; }; + + /** + * The error code mapped to the error message. + */ + 'errorCode'?: string; + + /** + * The category of the error. + */ + 'errorType'?: string; + + /** + * A short explanation of the issue. + */ + 'message'?: string; + + /** + * The PSP reference of the payment. + */ + 'pspReference'?: string; + + /** + * The HTTP response status. + */ + 'status'?: number; +} + diff --git a/src/typings/payments/shopperInteractionDevice.ts b/src/typings/payments/shopperInteractionDevice.ts new file mode 100644 index 0000000..2828469 --- /dev/null +++ b/src/typings/payments/shopperInteractionDevice.ts @@ -0,0 +1,28 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ShopperInteractionDevice { + + /** + * Locale on the shopper interaction device. + */ + 'locale'?: string; + + /** + * Operating system running on the shopper interaction device. + */ + 'os'?: string; + + /** + * Version of the operating system on the shopper interaction device. + */ + 'osVersion'?: string; +} + diff --git a/src/typings/payments/split.ts b/src/typings/payments/split.ts new file mode 100644 index 0000000..8fee8ab --- /dev/null +++ b/src/typings/payments/split.ts @@ -0,0 +1,50 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { SplitAmount } from './splitAmount'; + +export class Split { + + /** + * Unique identifier of the account where the split amount should be sent. This is required if `type` is **MarketPlace** or **BalanceAccount**. + */ + 'account'?: string; + + /** + */ + 'amount': SplitAmount; + + /** + * A description of this split. + */ + 'description'?: string; + + /** + * Your reference for the split, which you can use to link the split to other operations such as captures and refunds. This is required if `type` is **MarketPlace** or **BalanceAccount**. For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. If the reference is not provided, the split is reported as part of the aggregated [TransferBalance record type](https://docs.adyen.com/reporting/marketpay-payments-accounting-report) in Adyen for Platforms. + */ + 'reference'?: string; + + /** + * The type of split. Possible values: **Default**, **PaymentFee**, **VAT**, **Commission**, **MarketPlace**, **BalanceAccount**, **Remainder**. + */ + 'type': Split.TypeEnum; +} + +export namespace Split { + export enum TypeEnum { + BalanceAccount = 'BalanceAccount', + Commission = 'Commission', + Default = 'Default', + MarketPlace = 'MarketPlace', + PaymentFee = 'PaymentFee', + Remainder = 'Remainder', + Vat = 'VAT', + Verification = 'Verification' + } +} diff --git a/src/typings/payments/splitAmount.ts b/src/typings/payments/splitAmount.ts new file mode 100644 index 0000000..b884d09 --- /dev/null +++ b/src/typings/payments/splitAmount.ts @@ -0,0 +1,23 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class SplitAmount { + + /** + * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). If this value is not provided, the currency in which the payment is made will be used. + */ + 'currency'?: string; + + /** + * The amount in [minor units](https://docs.adyen.com/development-resources/currency-codes). + */ + 'value': number; +} + diff --git a/src/typings/payments/technicalCancelRequest.ts b/src/typings/payments/technicalCancelRequest.ts new file mode 100644 index 0000000..fb8770e --- /dev/null +++ b/src/typings/payments/technicalCancelRequest.ts @@ -0,0 +1,59 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Amount } from './amount'; +import { Split } from './split'; +import { ThreeDSecureData } from './threeDSecureData'; + +export class TechnicalCancelRequest { + + /** + * This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. + */ + 'additionalData'?: { [key: string]: string; }; + + /** + * The merchant account that is used to process the payment. + */ + 'merchantAccount': string; + + /** + */ + 'modificationAmount'?: Amount; + + /** + */ + 'mpiData'?: ThreeDSecureData; + + /** + * The original merchant reference to cancel. + */ + 'originalMerchantReference': string; + + /** + * Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. + */ + 'reference'?: string; + + /** + * An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/platforms/processing-payments#providing-split-information). + */ + 'splits'?: Array; + + /** + * The transaction reference provided by the PED. For point-of-sale integrations only. + */ + 'tenderReference'?: string; + + /** + * Unique terminal ID for the PED that originally processed the request. For point-of-sale integrations only. + */ + 'uniqueTerminalId'?: string; +} + diff --git a/src/typings/payments/threeDS1Result.ts b/src/typings/payments/threeDS1Result.ts new file mode 100644 index 0000000..1e2d3b5 --- /dev/null +++ b/src/typings/payments/threeDS1Result.ts @@ -0,0 +1,43 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ThreeDS1Result { + + /** + * The cardholder authentication value (base64 encoded). + */ + 'cavv'?: string; + + /** + * The CAVV algorithm used. + */ + 'cavvAlgorithm'?: string; + + /** + * 3D Secure Electronic Commerce Indicator (ECI). + */ + 'eci'?: string; + + /** + * The authentication response from the ACS. + */ + 'threeDAuthenticatedResponse'?: string; + + /** + * Whether 3D Secure was offered or not. + */ + 'threeDOfferedResponse'?: string; + + /** + * A unique transaction identifier generated by the MPI on behalf of the merchant to identify the 3D Secure transaction, in `Base64` encoding. + */ + 'xid'?: string; +} + diff --git a/src/typings/payments/threeDS2RequestData.ts b/src/typings/payments/threeDS2RequestData.ts new file mode 100644 index 0000000..df9373a --- /dev/null +++ b/src/typings/payments/threeDS2RequestData.ts @@ -0,0 +1,248 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { AcctInfo } from './acctInfo'; +import { DeviceRenderOptions } from './deviceRenderOptions'; +import { Phone } from './phone'; +import { SDKEphemPubKey } from './sDKEphemPubKey'; +import { ThreeDSRequestorAuthenticationInfo } from './threeDSRequestorAuthenticationInfo'; +import { ThreeDSRequestorPriorAuthenticationInfo } from './threeDSRequestorPriorAuthenticationInfo'; + +export class ThreeDS2RequestData { + + /** + */ + 'acctInfo'?: AcctInfo; + + /** + * Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit + */ + 'acctType'?: ThreeDS2RequestData.AcctTypeEnum; + + /** + * Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. + */ + 'acquirerBIN'?: string; + + /** + * Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant\'s acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. + */ + 'acquirerMerchantID'?: string; + + /** + * Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. + */ + 'addrMatch'?: ThreeDS2RequestData.AddrMatchEnum; + + /** + * If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + * + * @deprecated + */ + 'authenticationOnly'?: boolean; + + /** + * Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + * + * @deprecated + */ + 'challengeIndicator'?: ThreeDS2RequestData.ChallengeIndicatorEnum; + + /** + * The environment of the shopper. Allowed values: * `app` * `browser` + */ + 'deviceChannel': string; + + /** + */ + 'deviceRenderOptions'?: DeviceRenderOptions; + + /** + */ + 'homePhone'?: Phone; + + /** + * Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. + */ + 'mcc'?: string; + + /** + * Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. + */ + 'merchantName'?: string; + + /** + * The `messageVersion` value indicating the 3D Secure 2 protocol version. + */ + 'messageVersion'?: string; + + /** + */ + 'mobilePhone'?: Phone; + + /** + * URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. + */ + 'notificationURL'?: string; + + /** + * Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. + */ + 'payTokenInd'?: boolean; + + /** + * Indicates the type of payment for which an authentication is requested (message extension) + */ + 'paymentAuthenticationUseCase'?: string; + + /** + * Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. + */ + 'purchaseInstalData'?: string; + + /** + * Date after which no further authorisations shall be performed. Format: YYYYMMDD + */ + 'recurringExpiry'?: string; + + /** + * Indicates the minimum number of days between authorisations. Maximum length: 4 characters. + */ + 'recurringFrequency'?: string; + + /** + * The `sdkAppID` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. + */ + 'sdkAppID'?: string; + + /** + * The `sdkEncData` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. + */ + 'sdkEncData'?: string; + + /** + */ + 'sdkEphemPubKey'?: SDKEphemPubKey; + + /** + * The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. + */ + 'sdkMaxTimeout'?: number; + + /** + * The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. + */ + 'sdkReferenceNumber'?: string; + + /** + * The `sdkTransID` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. + */ + 'sdkTransID'?: string; + + /** + * Version of the 3D Secure 2 mobile SDK. Only for `deviceChannel` set to **app**. + */ + 'sdkVersion'?: string; + + /** + * Completion indicator for the device fingerprinting. + */ + 'threeDSCompInd'?: string; + + /** + * Indicates the type of Authentication request. + */ + 'threeDSRequestorAuthenticationInd'?: string; + + /** + */ + 'threeDSRequestorAuthenticationInfo'?: ThreeDSRequestorAuthenticationInfo; + + /** + * Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) + */ + 'threeDSRequestorChallengeInd'?: ThreeDS2RequestData.ThreeDSRequestorChallengeIndEnum; + + /** + * Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. + */ + 'threeDSRequestorID'?: string; + + /** + * Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. + */ + 'threeDSRequestorName'?: string; + + /** + */ + 'threeDSRequestorPriorAuthenticationInfo'?: ThreeDSRequestorPriorAuthenticationInfo; + + /** + * URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. + */ + 'threeDSRequestorURL'?: string; + + /** + * Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load + */ + 'transType'?: ThreeDS2RequestData.TransTypeEnum; + + /** + * Identify the type of the transaction being authenticated. + */ + 'transactionType'?: ThreeDS2RequestData.TransactionTypeEnum; + + /** + * The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. + */ + 'whiteListStatus'?: string; + + /** + */ + 'workPhone'?: Phone; +} + +export namespace ThreeDS2RequestData { + export enum AcctTypeEnum { + _01 = '01', + _02 = '02', + _03 = '03' + } + export enum AddrMatchEnum { + Y = 'Y', + N = 'N' + } + export enum ChallengeIndicatorEnum { + NoPreference = 'noPreference', + RequestNoChallenge = 'requestNoChallenge', + RequestChallenge = 'requestChallenge', + RequestChallengeAsMandate = 'requestChallengeAsMandate' + } + export enum ThreeDSRequestorChallengeIndEnum { + _01 = '01', + _02 = '02', + _03 = '03', + _04 = '04', + _05 = '05' + } + export enum TransTypeEnum { + _01 = '01', + _03 = '03', + _10 = '10', + _11 = '11', + _28 = '28' + } + export enum TransactionTypeEnum { + GoodsOrServicePurchase = 'goodsOrServicePurchase', + CheckAcceptance = 'checkAcceptance', + AccountFunding = 'accountFunding', + QuasiCashTransaction = 'quasiCashTransaction', + PrepaidActivationAndLoad = 'prepaidActivationAndLoad' + } +} diff --git a/src/typings/payments/threeDS2Result.ts b/src/typings/payments/threeDS2Result.ts new file mode 100644 index 0000000..b55ebb8 --- /dev/null +++ b/src/typings/payments/threeDS2Result.ts @@ -0,0 +1,106 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ThreeDS2Result { + + /** + * The `authenticationValue` value as defined in the 3D Secure 2 specification. + */ + 'authenticationValue'?: string; + + /** + * The algorithm used by the ACS to calculate the authentication value, only for Cartes Bancaires integrations. + */ + 'cavvAlgorithm'?: string; + + /** + * Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). + */ + 'challengeCancel'?: ThreeDS2Result.ChallengeCancelEnum; + + /** + * Specifies a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + */ + 'challengeIndicator'?: ThreeDS2Result.ChallengeIndicatorEnum; + + /** + * The `dsTransID` value as defined in the 3D Secure 2 specification. + */ + 'dsTransID'?: string; + + /** + * The `eci` value as defined in the 3D Secure 2 specification. + */ + 'eci'?: string; + + /** + * Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` + */ + 'exemptionIndicator'?: ThreeDS2Result.ExemptionIndicatorEnum; + + /** + * The `messageVersion` value as defined in the 3D Secure 2 specification. + */ + 'messageVersion'?: string; + + /** + * Risk score calculated by Cartes Bancaires Directory Server (DS). + */ + 'riskScore'?: string; + + /** + * The `threeDSServerTransID` value as defined in the 3D Secure 2 specification. + */ + 'threeDSServerTransID'?: string; + + /** + * The `timestamp` value of the 3D Secure 2 authentication. + */ + 'timestamp'?: string; + + /** + * The `transStatus` value as defined in the 3D Secure 2 specification. + */ + 'transStatus'?: string; + + /** + * Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). + */ + 'transStatusReason'?: string; + + /** + * The `whiteListStatus` value as defined in the 3D Secure 2 specification. + */ + 'whiteListStatus'?: string; +} + +export namespace ThreeDS2Result { + export enum ChallengeCancelEnum { + _01 = '01', + _02 = '02', + _03 = '03', + _04 = '04', + _05 = '05', + _06 = '06', + _07 = '07' + } + export enum ChallengeIndicatorEnum { + NoPreference = 'noPreference', + RequestNoChallenge = 'requestNoChallenge', + RequestChallenge = 'requestChallenge', + RequestChallengeAsMandate = 'requestChallengeAsMandate' + } + export enum ExemptionIndicatorEnum { + LowValue = 'lowValue', + SecureCorporate = 'secureCorporate', + TrustedBeneficiary = 'trustedBeneficiary', + TransactionRiskAnalysis = 'transactionRiskAnalysis' + } +} diff --git a/src/typings/payments/threeDS2ResultRequest.ts b/src/typings/payments/threeDS2ResultRequest.ts new file mode 100644 index 0000000..3a73503 --- /dev/null +++ b/src/typings/payments/threeDS2ResultRequest.ts @@ -0,0 +1,23 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ThreeDS2ResultRequest { + + /** + * The merchant account identifier, with which you want to process the transaction. + */ + 'merchantAccount': string; + + /** + * The pspReference returned in the /authorise call. + */ + 'pspReference': string; +} + diff --git a/src/typings/payments/threeDS2ResultResponse.ts b/src/typings/payments/threeDS2ResultResponse.ts new file mode 100644 index 0000000..cfaeb83 --- /dev/null +++ b/src/typings/payments/threeDS2ResultResponse.ts @@ -0,0 +1,18 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { ThreeDS2Result } from './threeDS2Result'; + +export class ThreeDS2ResultResponse { + + /** + */ + 'threeDS2Result'?: ThreeDS2Result; +} + diff --git a/src/typings/payments/threeDSRequestorAuthenticationInfo.ts b/src/typings/payments/threeDSRequestorAuthenticationInfo.ts new file mode 100644 index 0000000..2112022 --- /dev/null +++ b/src/typings/payments/threeDSRequestorAuthenticationInfo.ts @@ -0,0 +1,38 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ThreeDSRequestorAuthenticationInfo { + + /** + * Data that documents and supports a specific authentication process. Maximum length: 2048 bytes. + */ + 'threeDSReqAuthData'?: string; + + /** + * Mechanism used by the Cardholder to authenticate to the 3DS Requestor. Allowed values: * **01** — No 3DS Requestor authentication occurred (for example, cardholder “logged in” as guest). * **02** — Login to the cardholder account at the 3DS Requestor system using 3DS Requestor’s own credentials. * **03** — Login to the cardholder account at the 3DS Requestor system using federated ID. * **04** — Login to the cardholder account at the 3DS Requestor system using issuer credentials. * **05** — Login to the cardholder account at the 3DS Requestor system using third-party authentication. * **06** — Login to the cardholder account at the 3DS Requestor system using FIDO Authenticator. + */ + 'threeDSReqAuthMethod'?: ThreeDSRequestorAuthenticationInfo.ThreeDSReqAuthMethodEnum; + + /** + * Date and time in UTC of the cardholder authentication. Format: YYYYMMDDHHMM + */ + 'threeDSReqAuthTimestamp'?: string; +} + +export namespace ThreeDSRequestorAuthenticationInfo { + export enum ThreeDSReqAuthMethodEnum { + _01 = '01', + _02 = '02', + _03 = '03', + _04 = '04', + _05 = '05', + _06 = '06' + } +} diff --git a/src/typings/payments/threeDSRequestorPriorAuthenticationInfo.ts b/src/typings/payments/threeDSRequestorPriorAuthenticationInfo.ts new file mode 100644 index 0000000..95ab084 --- /dev/null +++ b/src/typings/payments/threeDSRequestorPriorAuthenticationInfo.ts @@ -0,0 +1,41 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ThreeDSRequestorPriorAuthenticationInfo { + + /** + * Data that documents and supports a specific authentication process. Maximum length: 2048 bytes. + */ + 'threeDSReqPriorAuthData'?: string; + + /** + * Mechanism used by the Cardholder to previously authenticate to the 3DS Requestor. Allowed values: * **01** — Frictionless authentication occurred by ACS. * **02** — Cardholder challenge occurred by ACS. * **03** — AVS verified. * **04** — Other issuer methods. + */ + 'threeDSReqPriorAuthMethod'?: ThreeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthMethodEnum; + + /** + * Date and time in UTC of the prior cardholder authentication. Format: YYYYMMDDHHMM + */ + 'threeDSReqPriorAuthTimestamp'?: string; + + /** + * This data element provides additional information to the ACS to determine the best approach for handing a request. This data element contains an ACS Transaction ID for a prior authenticated transaction. For example, the first recurring transaction that was authenticated with the cardholder. Length: 30 characters. + */ + 'threeDSReqPriorRef'?: string; +} + +export namespace ThreeDSRequestorPriorAuthenticationInfo { + export enum ThreeDSReqPriorAuthMethodEnum { + _01 = '01', + _02 = '02', + _03 = '03', + _04 = '04' + } +} diff --git a/src/typings/payments/threeDSecureData.ts b/src/typings/payments/threeDSecureData.ts new file mode 100644 index 0000000..7e7e972 --- /dev/null +++ b/src/typings/payments/threeDSecureData.ts @@ -0,0 +1,100 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ThreeDSecureData { + + /** + * In 3D Secure 1, the authentication response if the shopper was redirected. In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. + */ + 'authenticationResponse'?: ThreeDSecureData.AuthenticationResponseEnum; + + /** + * The cardholder authentication value (base64 encoded, 20 bytes in a decoded form). + */ + 'cavv'?: string; + + /** + * The CAVV algorithm used. Include this only for 3D Secure 1. + */ + 'cavvAlgorithm'?: string; + + /** + * Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). + */ + 'challengeCancel'?: ThreeDSecureData.ChallengeCancelEnum; + + /** + * In 3D Secure 1, this is the enrollment response from the 3D directory server. In 3D Secure 2, this is the `transStatus` from the `ARes`. + */ + 'directoryResponse'?: ThreeDSecureData.DirectoryResponseEnum; + + /** + * Supported for 3D Secure 2. The unique transaction identifier assigned by the Directory Server (DS) to identify a single transaction. + */ + 'dsTransID'?: string; + + /** + * The electronic commerce indicator. + */ + 'eci'?: string; + + /** + * Risk score calculated by Directory Server (DS). Required for Cartes Bancaires integrations. + */ + 'riskScore'?: string; + + /** + * The version of the 3D Secure protocol. + */ + 'threeDSVersion'?: string; + + /** + * Network token authentication verification value (TAVV). The network token cryptogram. + */ + 'tokenAuthenticationVerificationValue'?: string; + + /** + * Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). + */ + 'transStatusReason'?: string; + + /** + * Supported for 3D Secure 1. The transaction identifier (Base64-encoded, 20 bytes in a decoded form). + */ + 'xid'?: string; +} + +export namespace ThreeDSecureData { + export enum AuthenticationResponseEnum { + Y = 'Y', + N = 'N', + U = 'U', + A = 'A' + } + export enum ChallengeCancelEnum { + _01 = '01', + _02 = '02', + _03 = '03', + _04 = '04', + _05 = '05', + _06 = '06', + _07 = '07' + } + export enum DirectoryResponseEnum { + A = 'A', + C = 'C', + D = 'D', + I = 'I', + N = 'N', + R = 'R', + U = 'U', + Y = 'Y' + } +} diff --git a/src/typings/payments/voidPendingRefundRequest.ts b/src/typings/payments/voidPendingRefundRequest.ts new file mode 100644 index 0000000..502908e --- /dev/null +++ b/src/typings/payments/voidPendingRefundRequest.ts @@ -0,0 +1,64 @@ +/* + * The version of the OpenAPI document: v68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Amount } from './amount'; +import { Split } from './split'; +import { ThreeDSecureData } from './threeDSecureData'; + +export class VoidPendingRefundRequest { + + /** + * This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. + */ + 'additionalData'?: { [key: string]: string; }; + + /** + * The merchant account that is used to process the payment. + */ + 'merchantAccount': string; + + /** + */ + 'modificationAmount'?: Amount; + + /** + */ + 'mpiData'?: ThreeDSecureData; + + /** + * The original merchant reference to cancel. + */ + 'originalMerchantReference'?: string; + + /** + * The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + */ + 'originalReference'?: string; + + /** + * Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. + */ + 'reference'?: string; + + /** + * An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/platforms/processing-payments#providing-split-information). + */ + 'splits'?: Array; + + /** + * The transaction reference provided by the PED. For point-of-sale integrations only. + */ + 'tenderReference'?: string; + + /** + * Unique terminal ID for the PED that originally processed the request. For point-of-sale integrations only. + */ + 'uniqueTerminalId'?: string; +} +