diff --git a/README.md b/README.md index 1e02340..96a0d59 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ The Library supports all APIs under the following services: * [Account API](https://docs.adyen.com/api-explorer/#/Account/v6/overview) Current supported version: **v6** * [Fund API](https://docs.adyen.com/api-explorer/#/Fund/v6/overview) Current supported version: **v6** * [Notification Configuration API](https://docs.adyen.com/api-explorer/#/NotificationConfigurationService/v6/overview) Current supported version: **v6** + * [Hosted onboarding API](https://docs.adyen.com/api-explorer/#/Hop/v6/overview) Current supported version: **v6** * [Local/Cloud-based Terminal API](https://docs.adyen.com/point-of-sale/terminal-api-reference): Our point-of-sale integration. * [BIN lookup API](https://docs.adyen.com/api-explorer/#/BinLookup/v50/overview): The BIN Lookup API provides endpoints for retrieving information based on a given BIN. Current supported version: **v50** * [Stored Value API](https://docs.adyen.com/payment-methods/gift-cards/stored-value-api): Manage both online and point-of-sale gift cards and other stored-value cards. Current supported version: **v46** diff --git a/src/__tests__/platforms.spec.ts b/src/__tests__/platforms.spec.ts index acd2f64..ec149e2 100644 --- a/src/__tests__/platforms.spec.ts +++ b/src/__tests__/platforms.spec.ts @@ -26,10 +26,10 @@ import { Client, Platforms } from "../index"; import * as A from "../typings/platformsAccount/models"; import F = IPlatformsFund; import N = IPlatformsNotificationConfiguration; -import H = IPlatformsHostedOnboardingPage; import AccountHolderDetails = A.AccountHolderDetails; import NotificationConfigurationDetails = N.NotificationConfigurationDetails; import HttpClientException from "../httpClient/httpClientException"; +import { GetOnboardingUrlRequest, GetOnboardingUrlResponse, GetPciUrlRequest, GetPciUrlResponse } from "../typings/platformsHostedOnboardingPage/models"; let client: Client; let platforms: Platforms; @@ -175,7 +175,8 @@ describe("Platforms Test", function () { describe("Hop", function () { const cases = [ - ["getOnboardingUrl", createMock(), createMock()] + ["getOnboardingUrl", createMock(), createMock()], + ["getPciQuestionnaireUrl", createMock(), createMock()], ]; test.each(cases)( "should %p", diff --git a/src/services/platforms.ts b/src/services/platforms.ts index 3c1b1d8..537758b 100644 --- a/src/services/platforms.ts +++ b/src/services/platforms.ts @@ -1,23 +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 Service from "../service"; import Client from "../client"; import PlatformsAccount, { AccountTypesEnum } from "./resource/platforms/account"; @@ -58,6 +38,13 @@ import { GetTaxFormResponse, } from "../typings/platformsAccount/models"; +import { + GetOnboardingUrlRequest, + GetOnboardingUrlResponse, + GetPciUrlRequest, + GetPciUrlResponse +} from "../typings/platformsHostedOnboardingPage/models"; + type AccountType = AccountTypesEnum.Accounts; type VerificationType = AccountTypesEnum.Verification; type AccountHoldersType = AccountTypesEnum.AccountHolders; @@ -101,6 +88,7 @@ class Platforms extends Service { /* HOP */ private readonly _getOnboardingUrl: PlatformsHostedOnboardingPage; + private readonly _getPciQuestionnaireUrl: PlatformsHostedOnboardingPage; /* Notification Configuration */ private readonly _createNotificationConfiguration: PlatformsNotificationConfiguration; @@ -144,6 +132,7 @@ class Platforms extends Service { // HOP this._getOnboardingUrl = new PlatformsHostedOnboardingPage(this, "/getOnboardingUrl"); + this._getPciQuestionnaireUrl = new PlatformsHostedOnboardingPage(this, "/getPciQuestionnaireUrl"); // Notification Configuration this._createNotificationConfiguration = new PlatformsNotificationConfiguration(this, "/createNotificationConfiguration"); @@ -224,10 +213,13 @@ class Platforms extends Service { return { accountHolderBalance, accountHolderTransactionList, payoutAccountHolder, refundFundsTransfer, transferFunds, setupBeneficiary, refundNotPaidOutTransfers }; } - public get HostedOnboardingPage(): { getOnboardingUrl: (request: IPlatformsHostedOnboardingPage.GetOnboardingUrlRequest) => Promise } { - const getOnboardingUrl = this.createRequest(this._getOnboardingUrl); - - return { getOnboardingUrl }; + public get HostedOnboardingPage(): { + getOnboardingUrl: (request: GetOnboardingUrlRequest) => Promise; + getPciQuestionnaireUrl: (request: GetPciUrlRequest) => Promise; + } { + const getOnboardingUrl = this.createRequest(this._getOnboardingUrl); + const getPciQuestionnaireUrl = this.createRequest(this._getPciQuestionnaireUrl); + return { getOnboardingUrl, getPciQuestionnaireUrl }; } public get NotificationConfiguration(): { diff --git a/src/services/resource/platforms/hop.ts b/src/services/resource/platforms/hop.ts index 3e2363b..1a571ba 100644 --- a/src/services/resource/platforms/hop.ts +++ b/src/services/resource/platforms/hop.ts @@ -1,29 +1,8 @@ -/* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ - * - * Adyen NodeJS API Library - * - * Copyright (c) 2019 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 Service from "../../../service"; import Resource from "../../resource"; -type Endpoints = "/getOnboardingUrl"; +type Endpoints = "/getOnboardingUrl" | "/getPciQuestionnaireUrl"; class PlatformsHostedOnboardingPage extends Resource { public constructor(service: Service, endpoint: Endpoints) { diff --git a/src/typings/index.ts b/src/typings/index.ts index a4d0105..0b86252 100644 --- a/src/typings/index.ts +++ b/src/typings/index.ts @@ -1,22 +1,3 @@ -/* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ - * 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. - */ - /// /// /// @@ -28,12 +9,13 @@ /// /// /// -/// /// export * as checkout from './checkout/models'; export * as notification from './notification/models'; export * as platformsNotifications from './platformsNotifications/models'; export * as platformsAccount from './platformsAccount/models'; -export * as recurring from './recurring/models' +export * as platformsHostedOnboardingPage from './platformsHostedOnboardingPage/models'; +export * as recurring from './recurring/models'; +export * as storedValue from './storedValue/models'; export * as terminal from './terminal/models'; diff --git a/src/typings/platformsHostedOnboardingPage.ts b/src/typings/platformsHostedOnboardingPage.ts deleted file mode 100644 index 69c2730..0000000 --- a/src/typings/platformsHostedOnboardingPage.ts +++ /dev/null @@ -1,113 +0,0 @@ - -/* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ - * - * Adyen NodeJS API Library - * - * Version of Platforms Hosted Onboarding Page: v6 - * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. - */ - - -declare namespace IPlatformsHostedOnboardingPage { - export interface ErrorFieldType { - /** - * The validation error code. - */ - errorCode?: number; // int32 - /** - * A description of the validation error. - */ - errorDescription?: string; - /** - * The type of error field. - */ - fieldType?: FieldType; - } - export interface FieldType { - /** - * The full name of the property. - */ - field?: string; - /** - * The type of the field. - */ - fieldName?: "accountCode" | "accountHolderCode" | "accountHolderDetails" | "accountNumber" | "accountStateType" | "accountStatus" | "accountType" | "address" | "bankAccount" | "bankAccountCode" | "bankAccountName" | "bankAccountUUID" | "bankBicSwift" | "bankCity" | "bankCode" | "bankName" | "bankStatement" | "branchCode" | "businessContact" | "cardToken" | "checkCode" | "city" | "companyRegistration" | "country" | "countryCode" | "currency" | "currencyCode" | "dateOfBirth" | "description" | "destinationAccountCode" | "document" | "documentExpirationDate" | "documentIssuerCountry" | "documentIssuerState" | "documentName" | "documentNumber" | "documentType" | "doingBusinessAs" | "drivingLicence" | "drivingLicenceBack" | "drivingLicense" | "email" | "firstName" | "fullPhoneNumber" | "gender" | "hopWebserviceUser" | "houseNumberOrName" | "iban" | "idCard" | "idCardBack" | "idCardFront" | "idNumber" | "identityDocument" | "individualDetails" | "lastName" | "legalBusinessName" | "legalEntity" | "legalEntityType" | "merchantAccount" | "merchantCategoryCode" | "merchantReference" | "microDeposit" | "name" | "nationality" | "originalReference" | "ownerCity" | "ownerCountryCode" | "ownerHouseNumberOrName" | "ownerName" | "ownerPostalCode" | "ownerState" | "ownerStreet" | "passport" | "passportNumber" | "payoutMethodCode" | "personalData" | "phoneCountryCode" | "phoneNumber" | "postalCode" | "primaryCurrency" | "reason" | "registrationNumber" | "returnUrl" | "schedule" | "shareholder" | "shareholderCode" | "socialSecurityNumber" | "sourceAccountCode" | "stateOrProvince" | "status" | "stockExchange" | "stockNumber" | "stockTicker" | "store" | "storeDetail" | "storeName" | "storeReference" | "street" | "taxId" | "tier" | "tierNumber" | "transferCode" | "unknown" | "value" | "virtualAccount" | "visaNumber" | "webAddress"; - /** - * The code of the shareholder that the field belongs to. If empty, the field belongs to an account holder. - */ - shareholderCode?: string; - } - export interface GetOnboardingUrlRequest { - /** - * The account holder code you provided when you created the account holder. - */ - accountHolderCode: string; - /** - * Allows editing checks even if all the checks have passed. - */ - editMode?: boolean; - /** - * The platform name which will show up in the welcome page. - */ - platformName?: string; - /** - * The URL where the sub-merchant will be redirected back to after they complete the onboarding, or if their session times out. Maximum length of 500 characters. If you don't provide this, the sub-merchant will be redirected back to the default return URL configured in your platform account. - */ - returnUrl?: string; - /** - * The language to be used in the page, specified by a combination of a language and country code. For example, **pt-BR**. If not specified in the request or if the language is not supported, the page uses the browser language. If the browser language is not supported, the page uses **en-US** by default. For a list supported languages, refer to [Change the page language](https://docs.adyen.com/platforms/hosted-onboarding-page#change-page-language). - */ - shopperLocale?: string; - } - export interface GetOnboardingUrlResponse { - /** - * Contains field validation errors that would prevent requests from being processed. - */ - invalidFields?: ErrorFieldType[]; - /** - * The reference of a request. Can be used to uniquely identify the request. - */ - pspReference?: string; - /** - * The URL to the Hosted Onboarding Page where you should redirect your sub-merchant. This URL must be used within 15 seconds and can only be used once. - */ - redirectUrl?: string; - /** - * The result code. - */ - resultCode?: string; - } -} -declare namespace Paths { - namespace PostGetOnboardingUrl { - export type RequestBody = IPlatformsHostedOnboardingPage.GetOnboardingUrlRequest; - namespace Responses { - export type $200 = IPlatformsHostedOnboardingPage.GetOnboardingUrlResponse; - export interface $400 { - } - export interface $401 { - } - export interface $403 { - } - export interface $422 { - } - export interface $500 { - } - } - } -} diff --git a/src/typings/platformsHostedOnboardingPage/collectInformation.ts b/src/typings/platformsHostedOnboardingPage/collectInformation.ts new file mode 100644 index 0000000..7ed93f6 --- /dev/null +++ b/src/typings/platformsHostedOnboardingPage/collectInformation.ts @@ -0,0 +1,75 @@ +/* + * The version of the OpenAPI document: v6 + * 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 CollectInformation { + /** + * Indicates whether [bank account details](https://docs.adyen.com/platforms/verification-checks/bank-account-check) must be collected. Default is **true**. + */ + 'bankDetails'?: boolean; + /** + * Indicates whether [business details](https://docs.adyen.com/platforms/verification-checks/company-check) must be collected. Default is **true**. + */ + 'businessDetails'?: boolean; + /** + * Indicates whether [individual details](https://docs.adyen.com/platforms/verification-checks/identity-check) must be collected. Default is **true**. + */ + 'individualDetails'?: boolean; + /** + * Indicates whether [legal arrangement details](https://docs.adyen.com/platforms/verification-checks/legal-arrangements) must be collected. Default is **true**. + */ + 'legalArrangementDetails'?: boolean; + /** + * Indicates whether answers to a [PCI questionnaire](https://docs.adyen.com/platforms/platforms-for-partners#onboard-partner-platform) must be collected. Applies only to partner platforms. Default is **true**. + */ + 'pciQuestionnaire'?: boolean; + /** + * Indicates whether [shareholder details](https://docs.adyen.com/platforms/verification-checks/identity-check) must be collected. Defaults to **true**. + */ + 'shareholderDetails'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "bankDetails", + "baseName": "bankDetails", + "type": "boolean" + }, + { + "name": "businessDetails", + "baseName": "businessDetails", + "type": "boolean" + }, + { + "name": "individualDetails", + "baseName": "individualDetails", + "type": "boolean" + }, + { + "name": "legalArrangementDetails", + "baseName": "legalArrangementDetails", + "type": "boolean" + }, + { + "name": "pciQuestionnaire", + "baseName": "pciQuestionnaire", + "type": "boolean" + }, + { + "name": "shareholderDetails", + "baseName": "shareholderDetails", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return CollectInformation.attributeTypeMap; + } +} + diff --git a/src/typings/platformsHostedOnboardingPage/errorFieldType.ts b/src/typings/platformsHostedOnboardingPage/errorFieldType.ts new file mode 100644 index 0000000..6ad0e7c --- /dev/null +++ b/src/typings/platformsHostedOnboardingPage/errorFieldType.ts @@ -0,0 +1,46 @@ +/* + * The version of the OpenAPI document: v6 + * 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 { FieldType } from './fieldType'; + +export class ErrorFieldType { + /** + * The validation error code. + */ + 'errorCode'?: number; + /** + * A description of the validation error. + */ + 'errorDescription'?: string; + 'fieldType'?: FieldType; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "errorCode", + "baseName": "errorCode", + "type": "number" + }, + { + "name": "errorDescription", + "baseName": "errorDescription", + "type": "string" + }, + { + "name": "fieldType", + "baseName": "fieldType", + "type": "FieldType" + } ]; + + static getAttributeTypeMap() { + return ErrorFieldType.attributeTypeMap; + } +} + diff --git a/src/typings/platformsHostedOnboardingPage/fieldType.ts b/src/typings/platformsHostedOnboardingPage/fieldType.ts new file mode 100644 index 0000000..487bf1b --- /dev/null +++ b/src/typings/platformsHostedOnboardingPage/fieldType.ts @@ -0,0 +1,208 @@ +/* + * The version of the OpenAPI document: v6 + * 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 FieldType { + /** + * The full name of the property. + */ + 'field'?: string; + /** + * The type of the field. + */ + 'fieldName'?: FieldType.FieldNameEnum; + /** + * The code of the shareholder that the field belongs to. If empty, the field belongs to an account holder. + */ + 'shareholderCode'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "field", + "baseName": "field", + "type": "string" + }, + { + "name": "fieldName", + "baseName": "fieldName", + "type": "FieldType.FieldNameEnum" + }, + { + "name": "shareholderCode", + "baseName": "shareholderCode", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return FieldType.attributeTypeMap; + } +} + +export namespace FieldType { + export enum FieldNameEnum { + AccountCode = 'accountCode', + AccountHolderCode = 'accountHolderCode', + AccountHolderDetails = 'accountHolderDetails', + AccountNumber = 'accountNumber', + AccountStateType = 'accountStateType', + AccountStatus = 'accountStatus', + AccountType = 'accountType', + Address = 'address', + BalanceAccount = 'balanceAccount', + BalanceAccountActive = 'balanceAccountActive', + BalanceAccountCode = 'balanceAccountCode', + BalanceAccountId = 'balanceAccountId', + BankAccount = 'bankAccount', + BankAccountCode = 'bankAccountCode', + BankAccountName = 'bankAccountName', + BankAccountUuid = 'bankAccountUUID', + BankBicSwift = 'bankBicSwift', + BankCity = 'bankCity', + BankCode = 'bankCode', + BankName = 'bankName', + BankStatement = 'bankStatement', + BranchCode = 'branchCode', + BusinessContact = 'businessContact', + CardToken = 'cardToken', + CheckCode = 'checkCode', + City = 'city', + CompanyRegistration = 'companyRegistration', + ConstitutionalDocument = 'constitutionalDocument', + Country = 'country', + CountryCode = 'countryCode', + Currency = 'currency', + CurrencyCode = 'currencyCode', + DateOfBirth = 'dateOfBirth', + Description = 'description', + DestinationAccountCode = 'destinationAccountCode', + Document = 'document', + DocumentContent = 'documentContent', + DocumentExpirationDate = 'documentExpirationDate', + DocumentIssuerCountry = 'documentIssuerCountry', + DocumentIssuerState = 'documentIssuerState', + DocumentName = 'documentName', + DocumentNumber = 'documentNumber', + DocumentType = 'documentType', + DoingBusinessAs = 'doingBusinessAs', + DrivingLicence = 'drivingLicence', + DrivingLicenceBack = 'drivingLicenceBack', + DrivingLicense = 'drivingLicense', + Email = 'email', + FirstName = 'firstName', + FormType = 'formType', + FullPhoneNumber = 'fullPhoneNumber', + Gender = 'gender', + HopWebserviceUser = 'hopWebserviceUser', + HouseNumberOrName = 'houseNumberOrName', + Iban = 'iban', + IdCard = 'idCard', + IdCardBack = 'idCardBack', + IdCardFront = 'idCardFront', + IdNumber = 'idNumber', + IdentityDocument = 'identityDocument', + IndividualDetails = 'individualDetails', + Infix = 'infix', + JobTitle = 'jobTitle', + LastName = 'lastName', + LastReviewDate = 'lastReviewDate', + LegalArrangement = 'legalArrangement', + LegalArrangementCode = 'legalArrangementCode', + LegalArrangementEntity = 'legalArrangementEntity', + LegalArrangementEntityCode = 'legalArrangementEntityCode', + LegalArrangementLegalForm = 'legalArrangementLegalForm', + LegalArrangementMember = 'legalArrangementMember', + LegalArrangementMembers = 'legalArrangementMembers', + LegalArrangementName = 'legalArrangementName', + LegalArrangementReference = 'legalArrangementReference', + LegalArrangementRegistrationNumber = 'legalArrangementRegistrationNumber', + LegalArrangementTaxNumber = 'legalArrangementTaxNumber', + LegalArrangementType = 'legalArrangementType', + LegalBusinessName = 'legalBusinessName', + LegalEntity = 'legalEntity', + LegalEntityType = 'legalEntityType', + MerchantAccount = 'merchantAccount', + MerchantCategoryCode = 'merchantCategoryCode', + MerchantReference = 'merchantReference', + MicroDeposit = 'microDeposit', + Name = 'name', + Nationality = 'nationality', + OriginalReference = 'originalReference', + OwnerCity = 'ownerCity', + OwnerCountryCode = 'ownerCountryCode', + OwnerDateOfBirth = 'ownerDateOfBirth', + OwnerHouseNumberOrName = 'ownerHouseNumberOrName', + OwnerName = 'ownerName', + OwnerPostalCode = 'ownerPostalCode', + OwnerState = 'ownerState', + OwnerStreet = 'ownerStreet', + Passport = 'passport', + PassportNumber = 'passportNumber', + PayoutMethodCode = 'payoutMethodCode', + PayoutSchedule = 'payoutSchedule', + PciSelfAssessment = 'pciSelfAssessment', + PersonalData = 'personalData', + PhoneCountryCode = 'phoneCountryCode', + PhoneNumber = 'phoneNumber', + PostalCode = 'postalCode', + PrimaryCurrency = 'primaryCurrency', + Reason = 'reason', + RegistrationNumber = 'registrationNumber', + ReturnUrl = 'returnUrl', + Schedule = 'schedule', + Shareholder = 'shareholder', + ShareholderCode = 'shareholderCode', + ShareholderCodeAndSignatoryCode = 'shareholderCodeAndSignatoryCode', + ShareholderCodeOrSignatoryCode = 'shareholderCodeOrSignatoryCode', + ShareholderType = 'shareholderType', + ShopperInteraction = 'shopperInteraction', + Signatory = 'signatory', + SignatoryCode = 'signatoryCode', + SocialSecurityNumber = 'socialSecurityNumber', + SourceAccountCode = 'sourceAccountCode', + SplitAccount = 'splitAccount', + SplitConfigurationUuid = 'splitConfigurationUUID', + SplitCurrency = 'splitCurrency', + SplitValue = 'splitValue', + Splits = 'splits', + StateOrProvince = 'stateOrProvince', + Status = 'status', + StockExchange = 'stockExchange', + StockNumber = 'stockNumber', + StockTicker = 'stockTicker', + Store = 'store', + StoreDetail = 'storeDetail', + StoreName = 'storeName', + StoreReference = 'storeReference', + Street = 'street', + TaxId = 'taxId', + Tier = 'tier', + TierNumber = 'tierNumber', + TransferCode = 'transferCode', + UltimateParentCompany = 'ultimateParentCompany', + UltimateParentCompanyAddressDetails = 'ultimateParentCompanyAddressDetails', + UltimateParentCompanyAddressDetailsCountry = 'ultimateParentCompanyAddressDetailsCountry', + UltimateParentCompanyBusinessDetails = 'ultimateParentCompanyBusinessDetails', + UltimateParentCompanyBusinessDetailsLegalBusinessName = 'ultimateParentCompanyBusinessDetailsLegalBusinessName', + UltimateParentCompanyBusinessDetailsRegistrationNumber = 'ultimateParentCompanyBusinessDetailsRegistrationNumber', + UltimateParentCompanyCode = 'ultimateParentCompanyCode', + UltimateParentCompanyStockExchange = 'ultimateParentCompanyStockExchange', + UltimateParentCompanyStockNumber = 'ultimateParentCompanyStockNumber', + UltimateParentCompanyStockNumberOrStockTicker = 'ultimateParentCompanyStockNumberOrStockTicker', + UltimateParentCompanyStockTicker = 'ultimateParentCompanyStockTicker', + Unknown = 'unknown', + Value = 'value', + VerificationType = 'verificationType', + VirtualAccount = 'virtualAccount', + VisaNumber = 'visaNumber', + WebAddress = 'webAddress', + Year = 'year' + } +} diff --git a/src/typings/platformsHostedOnboardingPage/getOnboardingUrlRequest.ts b/src/typings/platformsHostedOnboardingPage/getOnboardingUrlRequest.ts new file mode 100644 index 0000000..26ddef8 --- /dev/null +++ b/src/typings/platformsHostedOnboardingPage/getOnboardingUrlRequest.ts @@ -0,0 +1,80 @@ +/* + * The version of the OpenAPI document: v6 + * 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 { CollectInformation } from './collectInformation'; +import { ShowPages } from './showPages'; + +export class GetOnboardingUrlRequest { + /** + * The account holder code you provided when you created the account holder. + */ + 'accountHolderCode': string; + 'collectInformation'?: CollectInformation; + /** + * Indicates if editing checks is allowed even if all the checks have passed. + */ + 'editMode'?: boolean; + /** + * The platform name which will show up in the welcome page. + */ + 'platformName'?: string; + /** + * The URL where the account holder will be redirected back to after they complete the onboarding, or if their session times out. Maximum length of 500 characters. If you don\'t provide this, the account holder will be redirected back to the default return URL configured in your platform account. + */ + 'returnUrl'?: string; + /** + * The language to be used in the page, specified by a combination of a language and country code. For example, **pt-BR**. If not specified in the request or if the language is not supported, the page uses the browser language. If the browser language is not supported, the page uses **en-US** by default. For a list supported languages, refer to [Change the page language](https://docs.adyen.com/platforms/hosted-onboarding-page/customize-experience#change-page-language). + */ + 'shopperLocale'?: string; + 'showPages'?: ShowPages; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "accountHolderCode", + "baseName": "accountHolderCode", + "type": "string" + }, + { + "name": "collectInformation", + "baseName": "collectInformation", + "type": "CollectInformation" + }, + { + "name": "editMode", + "baseName": "editMode", + "type": "boolean" + }, + { + "name": "platformName", + "baseName": "platformName", + "type": "string" + }, + { + "name": "returnUrl", + "baseName": "returnUrl", + "type": "string" + }, + { + "name": "shopperLocale", + "baseName": "shopperLocale", + "type": "string" + }, + { + "name": "showPages", + "baseName": "showPages", + "type": "ShowPages" + } ]; + + static getAttributeTypeMap() { + return GetOnboardingUrlRequest.attributeTypeMap; + } +} + diff --git a/src/typings/platformsHostedOnboardingPage/getOnboardingUrlResponse.ts b/src/typings/platformsHostedOnboardingPage/getOnboardingUrlResponse.ts new file mode 100644 index 0000000..f6b1253 --- /dev/null +++ b/src/typings/platformsHostedOnboardingPage/getOnboardingUrlResponse.ts @@ -0,0 +1,58 @@ +/* + * The version of the OpenAPI document: v6 + * 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 { ErrorFieldType } from './errorFieldType'; + +export class GetOnboardingUrlResponse { + /** + * Information about any invalid fields. + */ + 'invalidFields'?: Array; + /** + * The reference of a request. Can be used to uniquely identify the request. + */ + 'pspReference'?: string; + /** + * The URL to the Hosted Onboarding Page where you should redirect your sub-merchant. This URL must be used within 30 seconds and can only be used once. + */ + 'redirectUrl'?: string; + /** + * The result code. + */ + 'resultCode'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "invalidFields", + "baseName": "invalidFields", + "type": "Array" + }, + { + "name": "pspReference", + "baseName": "pspReference", + "type": "string" + }, + { + "name": "redirectUrl", + "baseName": "redirectUrl", + "type": "string" + }, + { + "name": "resultCode", + "baseName": "resultCode", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return GetOnboardingUrlResponse.attributeTypeMap; + } +} + diff --git a/src/typings/platformsHostedOnboardingPage/getPciUrlRequest.ts b/src/typings/platformsHostedOnboardingPage/getPciUrlRequest.ts new file mode 100644 index 0000000..d27f04a --- /dev/null +++ b/src/typings/platformsHostedOnboardingPage/getPciUrlRequest.ts @@ -0,0 +1,39 @@ +/* + * The version of the OpenAPI document: v6 + * 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 GetPciUrlRequest { + /** + * The account holder code you provided when you created the account holder. + */ + 'accountHolderCode': string; + /** + * The URL where the account holder will be redirected back to after they fill out the questionnaire, or if their session times out. Maximum length of 500 characters. + */ + 'returnUrl'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "accountHolderCode", + "baseName": "accountHolderCode", + "type": "string" + }, + { + "name": "returnUrl", + "baseName": "returnUrl", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return GetPciUrlRequest.attributeTypeMap; + } +} + diff --git a/src/typings/platformsHostedOnboardingPage/getPciUrlResponse.ts b/src/typings/platformsHostedOnboardingPage/getPciUrlResponse.ts new file mode 100644 index 0000000..3928628 --- /dev/null +++ b/src/typings/platformsHostedOnboardingPage/getPciUrlResponse.ts @@ -0,0 +1,58 @@ +/* + * The version of the OpenAPI document: v6 + * 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 { ErrorFieldType } from './errorFieldType'; + +export class GetPciUrlResponse { + /** + * Information about any invalid fields. + */ + 'invalidFields'?: Array; + /** + * The reference of a request. Can be used to uniquely identify the request. + */ + 'pspReference'?: string; + /** + * The URL to the PCI compliance questionnaire where you should redirect your account holder. This URL must be used within 30 seconds and can only be used once. + */ + 'redirectUrl'?: string; + /** + * The result code. + */ + 'resultCode'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "invalidFields", + "baseName": "invalidFields", + "type": "Array" + }, + { + "name": "pspReference", + "baseName": "pspReference", + "type": "string" + }, + { + "name": "redirectUrl", + "baseName": "redirectUrl", + "type": "string" + }, + { + "name": "resultCode", + "baseName": "resultCode", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return GetPciUrlResponse.attributeTypeMap; + } +} + diff --git a/src/typings/platformsHostedOnboardingPage/models.ts b/src/typings/platformsHostedOnboardingPage/models.ts new file mode 100644 index 0000000..49159da --- /dev/null +++ b/src/typings/platformsHostedOnboardingPage/models.ts @@ -0,0 +1,172 @@ +/* + * The version of the OpenAPI document: v6 + * 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 './collectInformation'; +export * from './errorFieldType'; +export * from './fieldType'; +export * from './getOnboardingUrlRequest'; +export * from './getOnboardingUrlResponse'; +export * from './getPciUrlRequest'; +export * from './getPciUrlResponse'; +export * from './serviceError'; +export * from './showPages'; + + +import { CollectInformation } from './collectInformation'; +import { ErrorFieldType } from './errorFieldType'; +import { FieldType } from './fieldType'; +import { GetOnboardingUrlRequest } from './getOnboardingUrlRequest'; +import { GetOnboardingUrlResponse } from './getOnboardingUrlResponse'; +import { GetPciUrlRequest } from './getPciUrlRequest'; +import { GetPciUrlResponse } from './getPciUrlResponse'; +import { ServiceError } from './serviceError'; +import { ShowPages } from './showPages'; + +/* tslint:disable:no-unused-variable */ +let primitives = [ + "string", + "boolean", + "double", + "integer", + "long", + "float", + "number", + "any" + ]; + +let enumsMap: {[index: string]: any} = { + "FieldType.FieldNameEnum": FieldType.FieldNameEnum, +} + +let typeMap: {[index: string]: any} = { + "CollectInformation": CollectInformation, + "ErrorFieldType": ErrorFieldType, + "FieldType": FieldType, + "GetOnboardingUrlRequest": GetOnboardingUrlRequest, + "GetOnboardingUrlResponse": GetOnboardingUrlResponse, + "GetPciUrlRequest": GetPciUrlRequest, + "GetPciUrlResponse": GetPciUrlResponse, + "ServiceError": ServiceError, + "ShowPages": ShowPages, +} + +export class ObjectSerializer { + public static findCorrectType(data: any, expectedType: string) { + if (data == undefined) { + return expectedType; + } else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) { + return expectedType; + } else if (expectedType === "Date") { + return expectedType; + } else { + if (enumsMap[expectedType]) { + return expectedType; + } + + if (!typeMap[expectedType]) { + return expectedType; // w/e we don't know the type + } + + // Check the discriminator + let discriminatorProperty = typeMap[expectedType].discriminator; + if (discriminatorProperty == null) { + return expectedType; // the type does not have a discriminator. use it. + } else { + if (data[discriminatorProperty]) { + var discriminatorType = data[discriminatorProperty]; + if(typeMap[discriminatorType]){ + return discriminatorType; // use the type given in the discriminator + } else { + return expectedType; // discriminator did not map to a type + } + } else { + return expectedType; // discriminator was not present (or an empty string) + } + } + } + } + + public static serialize(data: any, type: string) { + if (data == undefined) { + return data; + } else if (primitives.indexOf(type.toLowerCase()) !== -1) { + return data; + } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6 + let subType: string = type.replace("Array<", ""); // Array => Type> + subType = subType.substring(0, subType.length - 1); // Type> => Type + let transformedData: any[] = []; + for (let index = 0; index < data.length; index++) { + let datum = data[index]; + transformedData.push(ObjectSerializer.serialize(datum, subType)); + } + return transformedData; + } else if (type === "Date") { + return data.toISOString(); + } else if (type === "SaleToAcquirerData") { + const dataString = JSON.stringify(data); + return Buffer.from(dataString).toString("base64"); + } else { + if (enumsMap[type]) { + return data; + } + if (!typeMap[type]) { // in case we dont know the type + return data; + } + + // Get the actual type of this object + type = this.findCorrectType(data, type); + + // get the map for the correct type. + let attributeTypes = typeMap[type].getAttributeTypeMap(); + let instance: {[index: string]: any} = {}; + for (let index = 0; index < attributeTypes.length; index++) { + let attributeType = attributeTypes[index]; + instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type); + } + return instance; + } + } + + public static deserialize(data: any, type: string) { + // polymorphism may change the actual type. + type = ObjectSerializer.findCorrectType(data, type); + if (data == undefined) { + return data; + } else if (primitives.indexOf(type.toLowerCase()) !== -1) { + return data; + } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6 + let subType: string = type.replace("Array<", ""); // Array => Type> + subType = subType.substring(0, subType.length - 1); // Type> => Type + let transformedData: any[] = []; + for (let index = 0; index < data.length; index++) { + let datum = data[index]; + transformedData.push(ObjectSerializer.deserialize(datum, subType)); + } + return transformedData; + } else if (type === "Date") { + return new Date(data); + } else { + if (enumsMap[type]) {// is Enum + return data; + } + + if (!typeMap[type]) { // dont know the type + return data; + } + let instance = new typeMap[type](); + let attributeTypes = typeMap[type].getAttributeTypeMap(); + for (let index = 0; index < attributeTypes.length; index++) { + let attributeType = attributeTypes[index]; + instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type); + } + return instance; + } + } +} diff --git a/src/typings/platformsHostedOnboardingPage/serviceError.ts b/src/typings/platformsHostedOnboardingPage/serviceError.ts new file mode 100644 index 0000000..48534a5 --- /dev/null +++ b/src/typings/platformsHostedOnboardingPage/serviceError.ts @@ -0,0 +1,66 @@ +/* + * The version of the OpenAPI document: v6 + * 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 { + /** + * 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; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "errorCode", + "baseName": "errorCode", + "type": "string" + }, + { + "name": "errorType", + "baseName": "errorType", + "type": "string" + }, + { + "name": "message", + "baseName": "message", + "type": "string" + }, + { + "name": "pspReference", + "baseName": "pspReference", + "type": "string" + }, + { + "name": "status", + "baseName": "status", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return ServiceError.attributeTypeMap; + } +} + diff --git a/src/typings/platformsHostedOnboardingPage/showPages.ts b/src/typings/platformsHostedOnboardingPage/showPages.ts new file mode 100644 index 0000000..bd915eb --- /dev/null +++ b/src/typings/platformsHostedOnboardingPage/showPages.ts @@ -0,0 +1,102 @@ +/* + * The version of the OpenAPI document: v6 + * 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 ShowPages { + /** + * Indicates whether the page with bank account details must be shown. Defaults to **true**. + */ + 'bankDetailsSummaryPage'?: boolean; + /** + * Indicates whether the bank check instant verification\' details must be shown. Defaults to **true**. + */ + 'bankVerificationPage'?: boolean; + /** + * Indicates whether the page with the company\'s or organization\'s details must be shown. Defaults to **true**. + */ + 'businessDetailsSummaryPage'?: boolean; + /** + * Indicates whether the checks overview page must be shown. Defaults to **false**. + */ + 'checksOverviewPage'?: boolean; + /** + * Indicates whether the page with the individual\'s details must be shown. Defaults to **true**. + */ + 'individualDetailsSummaryPage'?: boolean; + /** + * Indicates whether the page with the legal arrangements\' details must be shown. Defaults to **true**. + */ + 'legalArrangementsDetailsSummaryPage'?: boolean; + /** + * Indicates whether the page to manually add bank account\' details must be shown. Defaults to **true**. + */ + 'manualBankAccountPage'?: boolean; + /** + * Indicates whether the page with the shareholders\' details must be shown. Defaults to **true**. + */ + 'shareholderDetailsSummaryPage'?: boolean; + /** + * Indicates whether the welcome page must be shown. Defaults to **false**. + */ + 'welcomePage'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "bankDetailsSummaryPage", + "baseName": "bankDetailsSummaryPage", + "type": "boolean" + }, + { + "name": "bankVerificationPage", + "baseName": "bankVerificationPage", + "type": "boolean" + }, + { + "name": "businessDetailsSummaryPage", + "baseName": "businessDetailsSummaryPage", + "type": "boolean" + }, + { + "name": "checksOverviewPage", + "baseName": "checksOverviewPage", + "type": "boolean" + }, + { + "name": "individualDetailsSummaryPage", + "baseName": "individualDetailsSummaryPage", + "type": "boolean" + }, + { + "name": "legalArrangementsDetailsSummaryPage", + "baseName": "legalArrangementsDetailsSummaryPage", + "type": "boolean" + }, + { + "name": "manualBankAccountPage", + "baseName": "manualBankAccountPage", + "type": "boolean" + }, + { + "name": "shareholderDetailsSummaryPage", + "baseName": "shareholderDetailsSummaryPage", + "type": "boolean" + }, + { + "name": "welcomePage", + "baseName": "welcomePage", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return ShowPages.attributeTypeMap; + } +} +