diff --git a/src/typings/relayedAuthorizationWebhooks/amount.ts b/src/typings/relayedAuthorizationWebhooks/amount.ts new file mode 100644 index 000000000..608564d02 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/amount.ts @@ -0,0 +1,46 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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-codes) of the amount. + */ + "currency": string; + /** + * The numeric value of the amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + */ + "value": number; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "currency", + "baseName": "currency", + "type": "string", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "number", + "format": "int64" + } ]; + + static getAttributeTypeMap() { + return Amount.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/amountAdjustment.ts b/src/typings/relayedAuthorizationWebhooks/amountAdjustment.ts new file mode 100644 index 000000000..03a71f5f5 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/amountAdjustment.ts @@ -0,0 +1,84 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 AmountAdjustment { + "amount"?: Amount | null; + /** + * The type of markup that is applied to an authorised payment. Possible values: **exchange**, **forexMarkup**, **authHoldReserve**, **atmMarkup**. + */ + "amountAdjustmentType"?: AmountAdjustment.AmountAdjustmentTypeEnum; + /** + * The basepoints associated with the applied markup. + */ + "basepoints"?: number; + "fixedAmount"?: Amount | null; + "floorAmount"?: Amount | null; + "limitAmount"?: Amount | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "amount", + "baseName": "amount", + "type": "Amount | null", + "format": "" + }, + { + "name": "amountAdjustmentType", + "baseName": "amountAdjustmentType", + "type": "AmountAdjustment.AmountAdjustmentTypeEnum", + "format": "" + }, + { + "name": "basepoints", + "baseName": "basepoints", + "type": "number", + "format": "int32" + }, + { + "name": "fixedAmount", + "baseName": "fixedAmount", + "type": "Amount | null", + "format": "" + }, + { + "name": "floorAmount", + "baseName": "floorAmount", + "type": "Amount | null", + "format": "" + }, + { + "name": "limitAmount", + "baseName": "limitAmount", + "type": "Amount | null", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AmountAdjustment.attributeTypeMap; + } + + public constructor() { + } +} + +export namespace AmountAdjustment { + export enum AmountAdjustmentTypeEnum { + AtmMarkup = 'atmMarkup', + AuthHoldReserve = 'authHoldReserve', + Exchange = 'exchange', + ForexMarkup = 'forexMarkup' + } +} diff --git a/src/typings/relayedAuthorizationWebhooks/authentication.ts b/src/typings/relayedAuthorizationWebhooks/authentication.ts new file mode 100644 index 000000000..dc48869b5 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/authentication.ts @@ -0,0 +1,55 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Phone } from "./phone"; + + +export class Authentication { + /** + * The email address where the one-time password (OTP) is sent. + */ + "email"?: string; + /** + * The password used for 3D Secure password-based authentication. The value must be between 1 to 30 characters and must only contain the following supported characters. * Characters between **a-z**, **A-Z**, and **0-9** * Special characters: **äöüßÄÖÜ+-*_/ç%()=?!~#\'\",;:$&àùòâôûáúó** + */ + "password"?: string; + "phone"?: Phone | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "" + }, + { + "name": "password", + "baseName": "password", + "type": "string", + "format": "" + }, + { + "name": "phone", + "baseName": "phone", + "type": "Phone | null", + "format": "" + } ]; + + static getAttributeTypeMap() { + return Authentication.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/authorisationDecisionRequest.ts b/src/typings/relayedAuthorizationWebhooks/authorisationDecisionRequest.ts new file mode 100644 index 000000000..095e361db --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/authorisationDecisionRequest.ts @@ -0,0 +1,56 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 AuthorisationDecisionRequest { + /** + * The reason of the authorization decision. + */ + "reasonCode"?: string; + /** + * The status of the authorization decision. Possible values: **Authorised** or **Refused**. + */ + "status"?: string; + /** + * The code of the authorization decision. + */ + "statusCode"?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "reasonCode", + "baseName": "reasonCode", + "type": "string", + "format": "" + }, + { + "name": "status", + "baseName": "status", + "type": "string", + "format": "" + }, + { + "name": "statusCode", + "baseName": "statusCode", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AuthorisationDecisionRequest.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/authorisationDecisionResponse.ts b/src/typings/relayedAuthorizationWebhooks/authorisationDecisionResponse.ts new file mode 100644 index 000000000..b96993ee7 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/authorisationDecisionResponse.ts @@ -0,0 +1,52 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 AuthorisationDecisionResponse { + /** + * The reason for refusing the authorization. + */ + "refusalReason"?: string; + /** + * The status of the authorization. Possible values: * **Authorised** * **Refused** For more information, refer to [Use relayed authorization](https://docs.adyen.com/issuing/authorisation/relayed-authorisation/). + */ + "status": AuthorisationDecisionResponse.StatusEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "refusalReason", + "baseName": "refusalReason", + "type": "string", + "format": "" + }, + { + "name": "status", + "baseName": "status", + "type": "AuthorisationDecisionResponse.StatusEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AuthorisationDecisionResponse.attributeTypeMap; + } + + public constructor() { + } +} + +export namespace AuthorisationDecisionResponse { + export enum StatusEnum { + Authorised = 'Authorised', + Refused = 'Refused' + } +} diff --git a/src/typings/relayedAuthorizationWebhooks/balanceMutation.ts b/src/typings/relayedAuthorizationWebhooks/balanceMutation.ts new file mode 100644 index 000000000..dbb7e9ad7 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/balanceMutation.ts @@ -0,0 +1,69 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 BalanceMutation { + "balanceAfter"?: Amount | null; + "balanceBefore"?: Amount | null; + /** + * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + */ + "currency"?: string; + "mutationAmount"?: Amount | null; + /** + * The type of the mutation. + */ + "type"?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "balanceAfter", + "baseName": "balanceAfter", + "type": "Amount | null", + "format": "" + }, + { + "name": "balanceBefore", + "baseName": "balanceBefore", + "type": "Amount | null", + "format": "" + }, + { + "name": "currency", + "baseName": "currency", + "type": "string", + "format": "" + }, + { + "name": "mutationAmount", + "baseName": "mutationAmount", + "type": "Amount | null", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return BalanceMutation.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/bankAccountDetails.ts b/src/typings/relayedAuthorizationWebhooks/bankAccountDetails.ts new file mode 100644 index 000000000..e1442e52c --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/bankAccountDetails.ts @@ -0,0 +1,106 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 BankAccountDetails { + /** + * The bank account number, without separators or whitespace. + */ + "accountNumber"?: string; + /** + * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + */ + "accountType"?: string; + /** + * The bank account branch number, without separators or whitespace + */ + "branchNumber"?: string; + /** + * Business accounts with a `formFactor` value of **physical** are business accounts issued under the central bank of that country. The default value is **physical** for NL, US, and UK business accounts. Adyen creates a local IBAN for business accounts when the `formFactor` value is set to **virtual**. The local IBANs that are supported are for DE and FR, which reference a physical NL account, with funds being routed through the central bank of NL. + */ + "formFactor"?: string; + /** + * The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + */ + "iban"?: string; + /** + * The [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. + */ + "routingNumber"?: string; + /** + * The [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. + */ + "sortCode"?: string; + /** + * **iban** or **usLocal** or **ukLocal** + */ + "type": string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "accountNumber", + "baseName": "accountNumber", + "type": "string", + "format": "" + }, + { + "name": "accountType", + "baseName": "accountType", + "type": "string", + "format": "" + }, + { + "name": "branchNumber", + "baseName": "branchNumber", + "type": "string", + "format": "" + }, + { + "name": "formFactor", + "baseName": "formFactor", + "type": "string", + "format": "" + }, + { + "name": "iban", + "baseName": "iban", + "type": "string", + "format": "" + }, + { + "name": "routingNumber", + "baseName": "routingNumber", + "type": "string", + "format": "" + }, + { + "name": "sortCode", + "baseName": "sortCode", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return BankAccountDetails.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/bulkAddress.ts b/src/typings/relayedAuthorizationWebhooks/bulkAddress.ts new file mode 100644 index 000000000..7154339d1 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/bulkAddress.ts @@ -0,0 +1,156 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 BulkAddress { + /** + * The name of the city. + */ + "city"?: string; + /** + * The name of the company. + */ + "company"?: string; + /** + * The two-character ISO-3166-1 alpha-2 country code. For example, **US**. + */ + "country": string; + /** + * The email address. + */ + "email"?: string; + /** + * The house number or name. + */ + "houseNumberOrName"?: string; + /** + * The name of the street and the number of the building. For example: **Simon Carmiggeltstraat 6-50**. + */ + "line1"?: string; + /** + * Additional information about the delivery address. For example, an apartment number. + */ + "line2"?: string; + /** + * Additional information about the delivery address. + */ + "line3"?: string; + /** + * The full telephone number. + */ + "mobile"?: string; + /** + * The recipient’s name (person or contact), for example ‘John Doe’. + */ + "name"?: string; + /** + * The postal code. Maximum length: * 5 digits for addresses in the US. * 10 characters for all other countries. + */ + "postalCode"?: string; + /** + * The two-letter ISO 3166-2 state or province code. Maximum length: 2 characters for addresses in the US. + */ + "stateOrProvince"?: string; + /** + * The streetname of the house. + */ + "street"?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "city", + "baseName": "city", + "type": "string", + "format": "" + }, + { + "name": "company", + "baseName": "company", + "type": "string", + "format": "" + }, + { + "name": "country", + "baseName": "country", + "type": "string", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "" + }, + { + "name": "houseNumberOrName", + "baseName": "houseNumberOrName", + "type": "string", + "format": "" + }, + { + "name": "line1", + "baseName": "line1", + "type": "string", + "format": "" + }, + { + "name": "line2", + "baseName": "line2", + "type": "string", + "format": "" + }, + { + "name": "line3", + "baseName": "line3", + "type": "string", + "format": "" + }, + { + "name": "mobile", + "baseName": "mobile", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "postalCode", + "baseName": "postalCode", + "type": "string", + "format": "" + }, + { + "name": "stateOrProvince", + "baseName": "stateOrProvince", + "type": "string", + "format": "" + }, + { + "name": "street", + "baseName": "street", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return BulkAddress.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/card.ts b/src/typings/relayedAuthorizationWebhooks/card.ts new file mode 100644 index 000000000..ef7ff0e17 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/card.ts @@ -0,0 +1,166 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Authentication } from "./authentication"; +import { CardConfiguration } from "./cardConfiguration"; +import { DeliveryContact } from "./deliveryContact"; +import { Expiry } from "./expiry"; + + +export class Card { + "authentication"?: Authentication | null; + /** + * The bank identification number (BIN) of the card number. + */ + "bin"?: string; + /** + * The brand of the physical or the virtual card. Possible values: **visa**, **mc**. + */ + "brand": string; + /** + * The brand variant of the physical or the virtual card. For example, **visadebit** or **mcprepaid**. >Reach out to your Adyen contact to get the values relevant for your integration. + */ + "brandVariant": string; + /** + * The name of the cardholder. Maximum length: 26 characters. + */ + "cardholderName": string; + "configuration"?: CardConfiguration | null; + /** + * The CVC2 value of the card. > The CVC2 is not sent by default. This is only returned in the `POST` response for single-use virtual cards. + */ + "cvc"?: string; + "deliveryContact"?: DeliveryContact | null; + "expiration"?: Expiry | null; + /** + * The form factor of the card. Possible values: **virtual**, **physical**. + */ + "formFactor": Card.FormFactorEnum; + /** + * Last last four digits of the card number. + */ + "lastFour"?: string; + /** + * The primary account number (PAN) of the card. > The PAN is masked by default and returned only for single-use virtual cards. + */ + "number"?: string; + /** + * The 3DS configuration of the physical or the virtual card. Possible values: **fullySupported**, **secureCorporate**. > Reach out to your Adyen contact to get the values relevant for your integration. + */ + "threeDSecure"?: string; + /** + * Specifies how many times the card can be used. Possible values: **singleUse**, **multiUse**. > Reach out to your Adyen contact to determine the value relevant for your integration. + */ + "usage"?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "authentication", + "baseName": "authentication", + "type": "Authentication | null", + "format": "" + }, + { + "name": "bin", + "baseName": "bin", + "type": "string", + "format": "" + }, + { + "name": "brand", + "baseName": "brand", + "type": "string", + "format": "" + }, + { + "name": "brandVariant", + "baseName": "brandVariant", + "type": "string", + "format": "" + }, + { + "name": "cardholderName", + "baseName": "cardholderName", + "type": "string", + "format": "" + }, + { + "name": "configuration", + "baseName": "configuration", + "type": "CardConfiguration | null", + "format": "" + }, + { + "name": "cvc", + "baseName": "cvc", + "type": "string", + "format": "" + }, + { + "name": "deliveryContact", + "baseName": "deliveryContact", + "type": "DeliveryContact | null", + "format": "" + }, + { + "name": "expiration", + "baseName": "expiration", + "type": "Expiry | null", + "format": "" + }, + { + "name": "formFactor", + "baseName": "formFactor", + "type": "Card.FormFactorEnum", + "format": "" + }, + { + "name": "lastFour", + "baseName": "lastFour", + "type": "string", + "format": "" + }, + { + "name": "number", + "baseName": "number", + "type": "string", + "format": "" + }, + { + "name": "threeDSecure", + "baseName": "threeDSecure", + "type": "string", + "format": "" + }, + { + "name": "usage", + "baseName": "usage", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return Card.attributeTypeMap; + } + + public constructor() { + } +} + +export namespace Card { + export enum FormFactorEnum { + Physical = 'physical', + Unknown = 'unknown', + Virtual = 'virtual' + } +} diff --git a/src/typings/relayedAuthorizationWebhooks/cardConfiguration.ts b/src/typings/relayedAuthorizationWebhooks/cardConfiguration.ts new file mode 100644 index 000000000..078abb475 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/cardConfiguration.ts @@ -0,0 +1,165 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { BulkAddress } from "./bulkAddress"; + + +export class CardConfiguration { + /** + * The activation label attached to the card that contains the activation instructions. This field overrides the activation label design ID defined in the card configuration profile. + */ + "activation"?: string; + /** + * Your app\'s URL, if you want to activate cards through your app. For example, **my-app://ref1236a7d**. A QR code is created based on this URL, and is included in the carrier. Before you use this field, reach out to your Adyen contact to set up the QR code process. Maximum length: 255 characters. + */ + "activationUrl"?: string; + "bulkAddress"?: BulkAddress | null; + /** + * The unique identifier of the card image. This image is printed on the full front of the card. + */ + "cardImageId"?: string; + /** + * The letter or packaging to which the card is attached. This field overrides the carrier design ID defined in the card configuration profile. + */ + "carrier"?: string; + /** + * The unique identifier of the carrier image. This image is printed on the letter to which the card is attached. + */ + "carrierImageId"?: string; + /** + * The unique identifier of the card configuration profile that contains the settings that are applied to the card. For example, the envelope and PIN mailer designs or the logistics company handling the shipment. You can override some of the existing settings in the configuration profile by providing the corresponding fields in the `configuration` object. For example, send the `shipmentMethod` to override the logistics company defined in the card configuration profile. + */ + "configurationProfileId": string; + /** + * The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. For example, **EUR**. This field overrides the existing currency setting on the card configuration profile. + */ + "currency"?: string; + /** + * Overrides the envelope design ID defined in the card configuration profile. + */ + "envelope"?: string; + /** + * Any additional material, such as marketing material, that is shipped together with the card. This field overrides the insert design ID defined in the card configuration profile. + */ + "insert"?: string; + /** + * A list of two-letter [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes of the card. For example, **[en,es]**. + */ + "languages"?: Array; + /** + * The unique identifier of the logo image. This image is printed on the partial front of the card, for example, a logo on the upper right corner. + */ + "logoImageId"?: string; + /** + * The letter on which the PIN of the card is printed. This field overrides the PIN mailer design ID defined in the card configuration profile. + */ + "pinMailer"?: string; + /** + * The logistics company that ships the card. This field overrides the logistics company defined in the card configuration profile. + */ + "shipmentMethod"?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "activation", + "baseName": "activation", + "type": "string", + "format": "" + }, + { + "name": "activationUrl", + "baseName": "activationUrl", + "type": "string", + "format": "" + }, + { + "name": "bulkAddress", + "baseName": "bulkAddress", + "type": "BulkAddress | null", + "format": "" + }, + { + "name": "cardImageId", + "baseName": "cardImageId", + "type": "string", + "format": "" + }, + { + "name": "carrier", + "baseName": "carrier", + "type": "string", + "format": "" + }, + { + "name": "carrierImageId", + "baseName": "carrierImageId", + "type": "string", + "format": "" + }, + { + "name": "configurationProfileId", + "baseName": "configurationProfileId", + "type": "string", + "format": "" + }, + { + "name": "currency", + "baseName": "currency", + "type": "string", + "format": "" + }, + { + "name": "envelope", + "baseName": "envelope", + "type": "string", + "format": "" + }, + { + "name": "insert", + "baseName": "insert", + "type": "string", + "format": "" + }, + { + "name": "languages", + "baseName": "languages", + "type": "Array", + "format": "" + }, + { + "name": "logoImageId", + "baseName": "logoImageId", + "type": "string", + "format": "" + }, + { + "name": "pinMailer", + "baseName": "pinMailer", + "type": "string", + "format": "" + }, + { + "name": "shipmentMethod", + "baseName": "shipmentMethod", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CardConfiguration.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/deliveryAddress.ts b/src/typings/relayedAuthorizationWebhooks/deliveryAddress.ts new file mode 100644 index 000000000..9caf66b1a --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/deliveryAddress.ts @@ -0,0 +1,96 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 DeliveryAddress { + /** + * The name of the city. + */ + "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 name of the street and the number of the building. For example: **Simon Carmiggeltstraat 6-50**. + */ + "line1"?: string; + /** + * Additional information about the delivery address. For example, an apartment number. + */ + "line2"?: string; + /** + * Additional information about the delivery address. + */ + "line3"?: string; + /** + * The postal code. Maximum length: * 5 digits for an address in the US. * 10 characters for an address in all other countries. + */ + "postalCode"?: string; + /** + * The state or province code, maximum 3 characters. For example, **CA** for California in the US or **ON** for Ontario in Canada. > Required for the US and Canada. + */ + "stateOrProvince"?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "city", + "baseName": "city", + "type": "string", + "format": "" + }, + { + "name": "country", + "baseName": "country", + "type": "string", + "format": "" + }, + { + "name": "line1", + "baseName": "line1", + "type": "string", + "format": "" + }, + { + "name": "line2", + "baseName": "line2", + "type": "string", + "format": "" + }, + { + "name": "line3", + "baseName": "line3", + "type": "string", + "format": "" + }, + { + "name": "postalCode", + "baseName": "postalCode", + "type": "string", + "format": "" + }, + { + "name": "stateOrProvince", + "baseName": "stateOrProvince", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DeliveryAddress.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/deliveryContact.ts b/src/typings/relayedAuthorizationWebhooks/deliveryContact.ts new file mode 100644 index 000000000..492252ca3 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/deliveryContact.ts @@ -0,0 +1,81 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { DeliveryAddress } from "./deliveryAddress"; +import { Name } from "./name"; +import { Phone } from "./phone"; + + +export class DeliveryContact { + "address": DeliveryAddress; + /** + * The company name of the contact. + */ + "company"?: string; + /** + * The email address of the contact. + */ + "email"?: string; + "name": Name; + "phone"?: Phone | null; + /** + * The URL of the contact\'s website. + */ + "webAddress"?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "address", + "baseName": "address", + "type": "DeliveryAddress", + "format": "" + }, + { + "name": "company", + "baseName": "company", + "type": "string", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "Name", + "format": "" + }, + { + "name": "phone", + "baseName": "phone", + "type": "Phone | null", + "format": "" + }, + { + "name": "webAddress", + "baseName": "webAddress", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DeliveryContact.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/expiry.ts b/src/typings/relayedAuthorizationWebhooks/expiry.ts new file mode 100644 index 000000000..aa184dbb0 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/expiry.ts @@ -0,0 +1,46 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 Expiry { + /** + * The month in which the card will expire. + */ + "month"?: string; + /** + * The year in which the card will expire. + */ + "year"?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "month", + "baseName": "month", + "type": "string", + "format": "" + }, + { + "name": "year", + "baseName": "year", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return Expiry.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/ibanAccountIdentification.ts b/src/typings/relayedAuthorizationWebhooks/ibanAccountIdentification.ts new file mode 100644 index 000000000..a830acab1 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/ibanAccountIdentification.ts @@ -0,0 +1,51 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 IbanAccountIdentification { + /** + * The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + */ + "iban": string; + /** + * **iban** + */ + "type": IbanAccountIdentification.TypeEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "iban", + "baseName": "iban", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "IbanAccountIdentification.TypeEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return IbanAccountIdentification.attributeTypeMap; + } + + public constructor() { + } +} + +export namespace IbanAccountIdentification { + export enum TypeEnum { + Iban = 'iban' + } +} diff --git a/src/typings/relayedAuthorizationWebhooks/merchantData.ts b/src/typings/relayedAuthorizationWebhooks/merchantData.ts new file mode 100644 index 000000000..269082122 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/merchantData.ts @@ -0,0 +1,75 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { NameLocation } from "./nameLocation"; + + +export class MerchantData { + /** + * The unique identifier of the merchant\'s acquirer. + */ + "acquirerId"?: string; + /** + * The merchant category code. + */ + "mcc"?: string; + /** + * The unique identifier of the merchant. + */ + "merchantId"?: string; + "nameLocation"?: NameLocation | null; + /** + * The postal code of the merchant. + */ + "postalCode"?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "acquirerId", + "baseName": "acquirerId", + "type": "string", + "format": "" + }, + { + "name": "mcc", + "baseName": "mcc", + "type": "string", + "format": "" + }, + { + "name": "merchantId", + "baseName": "merchantId", + "type": "string", + "format": "" + }, + { + "name": "nameLocation", + "baseName": "nameLocation", + "type": "NameLocation | null", + "format": "" + }, + { + "name": "postalCode", + "baseName": "postalCode", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return MerchantData.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/models.ts b/src/typings/relayedAuthorizationWebhooks/models.ts new file mode 100644 index 000000000..5035e6eaa --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/models.ts @@ -0,0 +1,34 @@ +export * from "./amount" +export * from "./amountAdjustment" +export * from "./authentication" +export * from "./authorisationDecisionRequest" +export * from "./authorisationDecisionResponse" +export * from "./balanceMutation" +export * from "./bankAccountDetails" +export * from "./bulkAddress" +export * from "./card" +export * from "./cardConfiguration" +export * from "./deliveryAddress" +export * from "./deliveryContact" +export * from "./expiry" +export * from "./ibanAccountIdentification" +export * from "./merchantData" +export * from "./name" +export * from "./nameLocation" +export * from "./paymentInstrument" +export * from "./paymentInstrumentAdditionalBankAccountIdentificationsInner" +export * from "./phone" +export * from "./relayedAuthorisationRequest" +export * from "./relayedAuthorisationResponse" +export * from "./resourceReference" +export * from "./serviceError" +export * from "./threeDSecure" +export * from "./transactionEventViolation" +export * from "./transactionRuleReference" +export * from "./transactionRuleSource" +export * from "./transactionRulesResult" +export * from "./transactionScoring" +export * from "./validationResult" + +// serializing and deserializing typed objects +export * from "./objectSerializer" \ No newline at end of file diff --git a/src/typings/relayedAuthorizationWebhooks/name.ts b/src/typings/relayedAuthorizationWebhooks/name.ts new file mode 100644 index 000000000..f751dceab --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/name.ts @@ -0,0 +1,46 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "firstName", + "baseName": "firstName", + "type": "string", + "format": "" + }, + { + "name": "lastName", + "baseName": "lastName", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return Name.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/nameLocation.ts b/src/typings/relayedAuthorizationWebhooks/nameLocation.ts new file mode 100644 index 000000000..f79f922e2 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/nameLocation.ts @@ -0,0 +1,86 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 NameLocation { + /** + * The city where the merchant is located. + */ + "city"?: string; + /** + * The country where the merchant is located in [three-letter country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format. + */ + "country"?: string; + /** + * The home country in [three-digit country code](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) format, used for government-controlled merchants such as embassies. + */ + "countryOfOrigin"?: string; + /** + * The name of the merchant\'s shop or service. + */ + "name"?: string; + /** + * The raw data. + */ + "rawData"?: string; + /** + * The state where the merchant is located. + */ + "state"?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "city", + "baseName": "city", + "type": "string", + "format": "" + }, + { + "name": "country", + "baseName": "country", + "type": "string", + "format": "" + }, + { + "name": "countryOfOrigin", + "baseName": "countryOfOrigin", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "rawData", + "baseName": "rawData", + "type": "string", + "format": "" + }, + { + "name": "state", + "baseName": "state", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return NameLocation.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/objectSerializer.ts b/src/typings/relayedAuthorizationWebhooks/objectSerializer.ts new file mode 100644 index 000000000..888c2d61e --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/objectSerializer.ts @@ -0,0 +1,415 @@ +export * from "./models"; + +import { Amount } from "./amount"; +import { AmountAdjustment } from "./amountAdjustment"; +import { Authentication } from "./authentication"; +import { AuthorisationDecisionRequest } from "./authorisationDecisionRequest"; +import { AuthorisationDecisionResponse } from "./authorisationDecisionResponse"; +import { BalanceMutation } from "./balanceMutation"; +import { BankAccountDetails } from "./bankAccountDetails"; +import { BulkAddress } from "./bulkAddress"; +import { Card } from "./card"; +import { CardConfiguration } from "./cardConfiguration"; +import { DeliveryAddress } from "./deliveryAddress"; +import { DeliveryContact } from "./deliveryContact"; +import { Expiry } from "./expiry"; +import { IbanAccountIdentification } from "./ibanAccountIdentification"; +import { MerchantData } from "./merchantData"; +import { Name } from "./name"; +import { NameLocation } from "./nameLocation"; +import { PaymentInstrument } from "./paymentInstrument"; +import { PaymentInstrumentAdditionalBankAccountIdentificationsInnerClass } from "./paymentInstrumentAdditionalBankAccountIdentificationsInner"; +import { Phone } from "./phone"; +import { RelayedAuthorisationRequest } from "./relayedAuthorisationRequest"; +import { RelayedAuthorisationResponse } from "./relayedAuthorisationResponse"; +import { ResourceReference } from "./resourceReference"; +import { ServiceError } from "./serviceError"; +import { ThreeDSecure } from "./threeDSecure"; +import { TransactionEventViolation } from "./transactionEventViolation"; +import { TransactionRuleReference } from "./transactionRuleReference"; +import { TransactionRuleSource } from "./transactionRuleSource"; +import { TransactionRulesResult } from "./transactionRulesResult"; +import { TransactionScoring } from "./transactionScoring"; +import { ValidationResult } from "./validationResult"; + +/* tslint:disable:no-unused-variable */ +let primitives = [ + "string", + "boolean", + "double", + "integer", + "long", + "float", + "number", + "any" + ]; + +let enumsMap: Set = new Set([ + "AmountAdjustment.AmountAdjustmentTypeEnum", + "AuthorisationDecisionResponse.StatusEnum", + "Card.FormFactorEnum", + "IbanAccountIdentification.TypeEnum", + "PaymentInstrument.StatusEnum", + "PaymentInstrument.StatusReasonEnum", + "PaymentInstrument.TypeEnum", + "PaymentInstrumentAdditionalBankAccountIdentificationsInner.TypeEnum", + "Phone.TypeEnum", + "RelayedAuthorisationRequest.TypeEnum", +]); + +let typeMap: {[index: string]: any} = { + "Amount": Amount, + "AmountAdjustment": AmountAdjustment, + "Authentication": Authentication, + "AuthorisationDecisionRequest": AuthorisationDecisionRequest, + "AuthorisationDecisionResponse": AuthorisationDecisionResponse, + "BalanceMutation": BalanceMutation, + "BankAccountDetails": BankAccountDetails, + "BulkAddress": BulkAddress, + "Card": Card, + "CardConfiguration": CardConfiguration, + "DeliveryAddress": DeliveryAddress, + "DeliveryContact": DeliveryContact, + "Expiry": Expiry, + "IbanAccountIdentification": IbanAccountIdentification, + "MerchantData": MerchantData, + "Name": Name, + "NameLocation": NameLocation, + "PaymentInstrument": PaymentInstrument, + "PaymentInstrumentAdditionalBankAccountIdentificationsInner": PaymentInstrumentAdditionalBankAccountIdentificationsInnerClass, + "Phone": Phone, + "RelayedAuthorisationRequest": RelayedAuthorisationRequest, + "RelayedAuthorisationResponse": RelayedAuthorisationResponse, + "ResourceReference": ResourceReference, + "ServiceError": ServiceError, + "ThreeDSecure": ThreeDSecure, + "TransactionEventViolation": TransactionEventViolation, + "TransactionRuleReference": TransactionRuleReference, + "TransactionRuleSource": TransactionRuleSource, + "TransactionRulesResult": TransactionRulesResult, + "TransactionScoring": TransactionScoring, + "ValidationResult": ValidationResult, +} + +type MimeTypeDescriptor = { + type: string; + subtype: string; + subtypeTokens: string[]; +}; + +/** + * Every mime-type consists of a type, subtype, and optional parameters. + * The subtype can be composite, including information about the content format. + * For example: `application/json-patch+json`, `application/merge-patch+json`. + * + * This helper transforms a string mime-type into an internal representation. + * This simplifies the implementation of predicates that in turn define common rules for parsing or stringifying + * the payload. + */ +const parseMimeType = (mimeType: string): MimeTypeDescriptor => { + const [type = '', subtype = ''] = mimeType.split('/'); + return { + type, + subtype, + subtypeTokens: subtype.split('+'), + }; +}; + +type MimeTypePredicate = (mimeType: string) => boolean; + +// This factory creates a predicate function that checks a string mime-type against defined rules. +const mimeTypePredicateFactory = (predicate: (descriptor: MimeTypeDescriptor) => boolean): MimeTypePredicate => (mimeType) => predicate(parseMimeType(mimeType)); + +// Use this factory when you need to define a simple predicate based only on type and, if applicable, subtype. +const mimeTypeSimplePredicateFactory = (type: string, subtype?: string): MimeTypePredicate => mimeTypePredicateFactory((descriptor) => { + if (descriptor.type !== type) return false; + if (subtype != null && descriptor.subtype !== subtype) return false; + return true; +}); + +// Creating a set of named predicates that will help us determine how to handle different mime-types +const isTextLikeMimeType = mimeTypeSimplePredicateFactory('text'); +const isJsonMimeType = mimeTypeSimplePredicateFactory('application', 'json'); +const isJsonLikeMimeType = mimeTypePredicateFactory((descriptor) => descriptor.type === 'application' && descriptor.subtypeTokens.some((item) => item === 'json')); +const isOctetStreamMimeType = mimeTypeSimplePredicateFactory('application', 'octet-stream'); +const isFormUrlencodedMimeType = mimeTypeSimplePredicateFactory('application', 'x-www-form-urlencoded'); + +// Defining a list of mime-types in the order of prioritization for handling. +const supportedMimeTypePredicatesWithPriority: MimeTypePredicate[] = [ + isJsonMimeType, + isJsonLikeMimeType, + isTextLikeMimeType, + isOctetStreamMimeType, + isFormUrlencodedMimeType, +]; + +const nullableSuffix = " | null"; +const optionalSuffix = " | undefined"; +const arrayPrefix = "Array<"; +const arraySuffix = ">"; +const mapPrefix = "{ [key: string]: "; +const mapSuffix = "; }"; + +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.has(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]; + let mapping = typeMap[expectedType].mapping; + if (mapping != undefined && mapping[discriminatorType]) { + return mapping[discriminatorType]; // use the type given in the discriminator + } else if(typeMap[discriminatorType]) { + return discriminatorType; + } else { + return expectedType; // discriminator did not map to a type + } + } else { + return expectedType; // discriminator was not present (or an empty string) + } + } + } + } + + /** + * Serializes a value into a plain JSON-compatible object based on its type. + * + * Supports primitives, arrays, maps, dates, enums, and classes defined in `typeMap`. + * Falls back to raw data if type is unknown or lacks `getAttributeTypeMap()`. + * + * @param data - The value to serialize. + * @param type - The expected type name as a string. + * @param format - Format hint (e.g. "date" or "date-time"). Default is an empty string. + * @returns A JSON-compatible representation of `data`. + */ + public static serialize(data: any, type: string, format: string = ""): any { + if (data == undefined) { + return data; + } else if (primitives.indexOf(type.toLowerCase()) !== -1) { + return data; + } else if (type.endsWith(nullableSuffix)) { + let subType: string = type.slice(0, -nullableSuffix.length); // Type | null => Type + return ObjectSerializer.serialize(data, subType, format); + } else if (type.endsWith(optionalSuffix)) { + let subType: string = type.slice(0, -optionalSuffix.length); // Type | undefined => Type + return ObjectSerializer.serialize(data, subType, format); + } else if (type.startsWith(arrayPrefix)) { + let subType: string = type.slice(arrayPrefix.length, -arraySuffix.length); // Array => Type + let transformedData: any[] = []; + for (let date of data) { + transformedData.push(ObjectSerializer.serialize(date, subType, format)); + } + return transformedData; + } else if (type.startsWith(mapPrefix)) { + let subType: string = type.slice(mapPrefix.length, -mapSuffix.length); // { [key: string]: Type; } => Type + let transformedData: { [key: string]: any } = {}; + for (let key in data) { + transformedData[key] = ObjectSerializer.serialize( + data[key], + subType, + format, + ); + } + return transformedData; + } else if (type === "Date") { + if (format == "date") { + let month = data.getMonth()+1 + month = month < 10 ? "0" + month.toString() : month.toString() + let day = data.getDate(); + day = day < 10 ? "0" + day.toString() : day.toString(); + + return data.getFullYear() + "-" + month + "-" + day; + } else { + return data.toISOString(); + } + } else { + if (enumsMap.has(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); + + const clazz = typeMap[type]; + + // Safe check for getAttributeTypeMap + if (typeof clazz.getAttributeTypeMap !== "function") { + return { ...data }; // fallback: shallow copy + } + + // get the map for the correct type. + let attributeTypes = typeMap[type].getAttributeTypeMap(); + let instance: {[index: string]: any} = {}; + for (let attributeType of attributeTypes) { + instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type, attributeType.format); + } + return instance; + } + } + + /** + * Deserializes a plain JSON-compatible object into a typed instance. + * + * Handles primitives, arrays, maps, dates, enums, and known classes from `typeMap`. + * Uses discriminators when available to resolve polymorphic types. + * Falls back to raw data if the type is unknown or lacks `getAttributeTypeMap()`. + * + * @param data - The raw input to deserialize. + * @param type - The expected type name as a string. + * @param format - Format hint (e.g. "date" or "date-time"). Default is an empty string. + * @returns A deserialized instance or value of `data`. + */ + public static deserialize(data: any, type: string, format: string = ""): any { + // 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.endsWith(nullableSuffix)) { + let subType: string = type.slice(0, -nullableSuffix.length); // Type | null => Type + return ObjectSerializer.deserialize(data, subType, format); + } else if (type.endsWith(optionalSuffix)) { + let subType: string = type.slice(0, -optionalSuffix.length); // Type | undefined => Type + return ObjectSerializer.deserialize(data, subType, format); + } else if (type.startsWith(arrayPrefix)) { + let subType: string = type.slice(arrayPrefix.length, -arraySuffix.length); // Array => Type + let transformedData: any[] = []; + for (let date of data) { + transformedData.push(ObjectSerializer.deserialize(date, subType, format)); + } + return transformedData; + } else if (type.startsWith(mapPrefix)) { + let subType: string = type.slice(mapPrefix.length, -mapSuffix.length); // { [key: string]: Type; } => Type + let transformedData: { [key: string]: any } = {}; + for (let key in data) { + transformedData[key] = ObjectSerializer.deserialize( + data[key], + subType, + format, + ); + } + return transformedData; + } else if (type === "Date") { + return new Date(data); + } else { + if (enumsMap.has(type)) {// is Enum + return data; + } + + if (!typeMap[type]) { // dont know the type + return data; + } + let instance = new typeMap[type](); + + // Safe check for getAttributeTypeMap + if (typeof typeMap[type].getAttributeTypeMap !== "function") { + Object.assign(instance, data); // fallback: shallow copy + return instance; + } + + let attributeTypes = typeMap[type].getAttributeTypeMap(); + for (let attributeType of attributeTypes) { + let value = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type, attributeType.format); + if (value !== undefined) { + instance[attributeType.name] = value; + } + } + return instance; + } + } + + + /** + * Normalize media type + * + * We currently do not handle any media types attributes, i.e. anything + * after a semicolon. All content is assumed to be UTF-8 compatible. + */ + public static normalizeMediaType(mediaType: string | undefined): string | undefined { + if (mediaType === undefined) { + return undefined; + } + return (mediaType.split(";")[0] ?? '').trim().toLowerCase(); + } + + /** + * From a list of possible media types, choose the one we can handle best. + * + * The order of the given media types does not have any impact on the choice + * made. + */ + public static getPreferredMediaType(mediaTypes: Array): string { + /** According to OAS 3 we should default to json */ + if (mediaTypes.length === 0) { + return "application/json"; + } + + const normalMediaTypes = mediaTypes.map(ObjectSerializer.normalizeMediaType); + + for (const predicate of supportedMimeTypePredicatesWithPriority) { + for (const mediaType of normalMediaTypes) { + if (mediaType != null && predicate(mediaType)) { + return mediaType; + } + } + } + + throw new Error("None of the given media types are supported: " + mediaTypes.join(", ")); + } + + /** + * Convert data to a string according the given media type + */ + public static stringify(data: any, mediaType: string): string { + if (isTextLikeMimeType(mediaType)) { + return String(data); + } + + if (isJsonLikeMimeType(mediaType)) { + return JSON.stringify(data); + } + + throw new Error("The mediaType " + mediaType + " is not supported by ObjectSerializer.stringify."); + } + + /** + * Parse data from a string according to the given media type + */ + public static parse(rawData: string, mediaType: string | undefined) { + if (mediaType === undefined) { + throw new Error("Cannot parse content. No Content-Type defined."); + } + + if (isTextLikeMimeType(mediaType)) { + return rawData; + } + + if (isJsonLikeMimeType(mediaType)) { + return JSON.parse(rawData); + } + + throw new Error("The mediaType " + mediaType + " is not supported by ObjectSerializer.parse."); + } +} diff --git a/src/typings/relayedAuthorizationWebhooks/paymentInstrument.ts b/src/typings/relayedAuthorizationWebhooks/paymentInstrument.ts new file mode 100644 index 000000000..ffcf41205 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/paymentInstrument.ts @@ -0,0 +1,200 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { BankAccountDetails } from "./bankAccountDetails"; +import { Card } from "./card"; +import { PaymentInstrumentAdditionalBankAccountIdentificationsInner } from "./paymentInstrumentAdditionalBankAccountIdentificationsInner"; + + +export class PaymentInstrument { + /** + * Contains optional, additional business account details. Returned when you create a payment instrument with `type` **bankAccount**. + * + * @deprecated since Authorization webhooks v2 + * Please use `bankAccount` object instead + */ + "additionalBankAccountIdentifications"?: Array; + /** + * The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) associated with the payment instrument. + */ + "balanceAccountId": string; + "bankAccount"?: BankAccountDetails | null; + "card"?: Card | null; + /** + * Your description for the payment instrument, maximum 300 characters. + */ + "description"?: string; + /** + * The unique identifier of the payment instrument. + */ + "id": string; + /** + * The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the payment instrument is issued. For example, **NL** or **US**. + */ + "issuingCountryCode": string; + /** + * The unique identifier of the [payment instrument group](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/paymentInstrumentGroups__resParam_id) to which the payment instrument belongs. + */ + "paymentInstrumentGroupId"?: string; + /** + * Your reference for the payment instrument, maximum 150 characters. + */ + "reference"?: string; + /** + * The unique identifier of the payment instrument that replaced this payment instrument. + */ + "replacedById"?: string; + /** + * The unique identifier of the payment instrument that is replaced by this payment instrument. + */ + "replacementOfId"?: string; + /** + * The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. + */ + "status"?: PaymentInstrument.StatusEnum; + /** + * The status comment provides additional information for the statusReason of the payment instrument. + */ + "statusComment"?: string; + /** + * The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. + */ + "statusReason"?: PaymentInstrument.StatusReasonEnum; + /** + * The type of payment instrument. Possible values: **card**, **bankAccount**. + */ + "type": PaymentInstrument.TypeEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "additionalBankAccountIdentifications", + "baseName": "additionalBankAccountIdentifications", + "type": "Array", + "format": "" + }, + { + "name": "balanceAccountId", + "baseName": "balanceAccountId", + "type": "string", + "format": "" + }, + { + "name": "bankAccount", + "baseName": "bankAccount", + "type": "BankAccountDetails | null", + "format": "" + }, + { + "name": "card", + "baseName": "card", + "type": "Card | null", + "format": "" + }, + { + "name": "description", + "baseName": "description", + "type": "string", + "format": "" + }, + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "issuingCountryCode", + "baseName": "issuingCountryCode", + "type": "string", + "format": "" + }, + { + "name": "paymentInstrumentGroupId", + "baseName": "paymentInstrumentGroupId", + "type": "string", + "format": "" + }, + { + "name": "reference", + "baseName": "reference", + "type": "string", + "format": "" + }, + { + "name": "replacedById", + "baseName": "replacedById", + "type": "string", + "format": "" + }, + { + "name": "replacementOfId", + "baseName": "replacementOfId", + "type": "string", + "format": "" + }, + { + "name": "status", + "baseName": "status", + "type": "PaymentInstrument.StatusEnum", + "format": "" + }, + { + "name": "statusComment", + "baseName": "statusComment", + "type": "string", + "format": "" + }, + { + "name": "statusReason", + "baseName": "statusReason", + "type": "PaymentInstrument.StatusReasonEnum", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "PaymentInstrument.TypeEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return PaymentInstrument.attributeTypeMap; + } + + public constructor() { + } +} + +export namespace PaymentInstrument { + export enum StatusEnum { + Active = 'active', + Closed = 'closed', + Inactive = 'inactive', + Suspended = 'suspended' + } + export enum StatusReasonEnum { + AccountClosure = 'accountClosure', + Damaged = 'damaged', + EndOfLife = 'endOfLife', + Expired = 'expired', + Lost = 'lost', + Other = 'other', + Stolen = 'stolen', + SuspectedFraud = 'suspectedFraud', + TransactionRule = 'transactionRule' + } + export enum TypeEnum { + BankAccount = 'bankAccount', + Card = 'card' + } +} diff --git a/src/typings/relayedAuthorizationWebhooks/paymentInstrumentAdditionalBankAccountIdentificationsInner.ts b/src/typings/relayedAuthorizationWebhooks/paymentInstrumentAdditionalBankAccountIdentificationsInner.ts new file mode 100644 index 000000000..afb0ccf7e --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/paymentInstrumentAdditionalBankAccountIdentificationsInner.ts @@ -0,0 +1,29 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { IbanAccountIdentification } from "./ibanAccountIdentification"; + + +/** + * @type PaymentInstrumentAdditionalBankAccountIdentificationsInner + * Type + * @export + */ +export type PaymentInstrumentAdditionalBankAccountIdentificationsInner = IbanAccountIdentification; + +/** +* @type PaymentInstrumentAdditionalBankAccountIdentificationsInnerClass +* @export +*/ +export class PaymentInstrumentAdditionalBankAccountIdentificationsInnerClass { + + static readonly discriminator: string = "type"; + + static readonly mapping: {[index: string]: string} | undefined = undefined; +} diff --git a/src/typings/relayedAuthorizationWebhooks/phone.ts b/src/typings/relayedAuthorizationWebhooks/phone.ts new file mode 100644 index 000000000..eef68b748 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/phone.ts @@ -0,0 +1,52 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 { + /** + * The full phone number provided as a single string. For example, **\"0031 6 11 22 33 44\"**, **\"+316/1122-3344\"**, or **\"(0031) 611223344\"**. + */ + "number": string; + /** + * Type of phone number. Possible values: **Landline**, **Mobile**. + */ + "type": Phone.TypeEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "number", + "baseName": "number", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "Phone.TypeEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return Phone.attributeTypeMap; + } + + public constructor() { + } +} + +export namespace Phone { + export enum TypeEnum { + Landline = 'landline', + Mobile = 'mobile' + } +} diff --git a/src/typings/relayedAuthorizationWebhooks/relayedAuthorisationRequest.ts b/src/typings/relayedAuthorizationWebhooks/relayedAuthorisationRequest.ts new file mode 100644 index 000000000..352641ca9 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/relayedAuthorisationRequest.ts @@ -0,0 +1,266 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 { AmountAdjustment } from "./amountAdjustment"; +import { AuthorisationDecisionRequest } from "./authorisationDecisionRequest"; +import { BalanceMutation } from "./balanceMutation"; +import { MerchantData } from "./merchantData"; +import { PaymentInstrument } from "./paymentInstrument"; +import { ResourceReference } from "./resourceReference"; +import { ThreeDSecure } from "./threeDSecure"; +import { TransactionRulesResult } from "./transactionRulesResult"; +import { TransactionScoring } from "./transactionScoring"; +import { ValidationResult } from "./validationResult"; + + +export class RelayedAuthorisationRequest { + "accountHolder"?: ResourceReference | null; + "amount"?: Amount | null; + /** + * The amount adjustments in the transaction. + */ + "amountAdjustments"?: Array; + /** + * The authorization code for the payment. + */ + "authCode"?: string; + "authorisationDecision"?: AuthorisationDecisionRequest | null; + /** + * The authorization type. Possible values: * **finalAuthorisation** * **preAuthorisation** * **defaultAuthorisation** + */ + "authorisationType"?: string; + "balanceAccount"?: ResourceReference | null; + /** + * The list of balance mutations per event. + */ + "balanceMutations"?: Array; + /** + * The unique identifier of the balance platform. + */ + "balancePlatform"?: string; + /** + * The entry mode of the information of the payment instrument. For example: **contactless**, **chip**, **magstripe**. + */ + "entryMode"?: string; + /** + * The environment from which the webhook originated. Possible values: **test**, **live**. + */ + "environment"?: string; + /** + * The unique identifier of the transfer. + */ + "id"?: string; + "merchantData"?: MerchantData | null; + "originalAmount"?: Amount | null; + "paymentInstrument"?: PaymentInstrument | null; + /** + * The processing type used for this payment. For example: **ecommerce**, **pos**, **moto**. + */ + "processingType"?: string; + /** + * The reference of the payment. + */ + "reference"?: string; + /** + * The risk score provided by the card schemes. + */ + "schemeRiskScore"?: number; + /** + * The identifier of the original payment. This ID is provided by the scheme and can be alphanumeric or numeric, depending on the scheme. + */ + "schemeTraceId"?: string; + /** + * The unique identifier created by the scheme. This ID can be alphanumeric or numeric depending on the scheme. + */ + "schemeUniqueTransactionId"?: string; + /** + * The list of transaction scores. + */ + "scores"?: Array; + "threeDSecure"?: ThreeDSecure | null; + "transactionRulesResult"?: TransactionRulesResult | null; + /** + * Type of notification. + */ + "type"?: RelayedAuthorisationRequest.TypeEnum; + /** + * Contains the checks that Adyen performed to validate the payment and the result of each. + */ + "validationResult"?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "accountHolder", + "baseName": "accountHolder", + "type": "ResourceReference | null", + "format": "" + }, + { + "name": "amount", + "baseName": "amount", + "type": "Amount | null", + "format": "" + }, + { + "name": "amountAdjustments", + "baseName": "amountAdjustments", + "type": "Array", + "format": "" + }, + { + "name": "authCode", + "baseName": "authCode", + "type": "string", + "format": "" + }, + { + "name": "authorisationDecision", + "baseName": "authorisationDecision", + "type": "AuthorisationDecisionRequest | null", + "format": "" + }, + { + "name": "authorisationType", + "baseName": "authorisationType", + "type": "string", + "format": "" + }, + { + "name": "balanceAccount", + "baseName": "balanceAccount", + "type": "ResourceReference | null", + "format": "" + }, + { + "name": "balanceMutations", + "baseName": "balanceMutations", + "type": "Array", + "format": "" + }, + { + "name": "balancePlatform", + "baseName": "balancePlatform", + "type": "string", + "format": "" + }, + { + "name": "entryMode", + "baseName": "entryMode", + "type": "string", + "format": "" + }, + { + "name": "environment", + "baseName": "environment", + "type": "string", + "format": "" + }, + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "merchantData", + "baseName": "merchantData", + "type": "MerchantData | null", + "format": "" + }, + { + "name": "originalAmount", + "baseName": "originalAmount", + "type": "Amount | null", + "format": "" + }, + { + "name": "paymentInstrument", + "baseName": "paymentInstrument", + "type": "PaymentInstrument | null", + "format": "" + }, + { + "name": "processingType", + "baseName": "processingType", + "type": "string", + "format": "" + }, + { + "name": "reference", + "baseName": "reference", + "type": "string", + "format": "" + }, + { + "name": "schemeRiskScore", + "baseName": "schemeRiskScore", + "type": "number", + "format": "int32" + }, + { + "name": "schemeTraceId", + "baseName": "schemeTraceId", + "type": "string", + "format": "" + }, + { + "name": "schemeUniqueTransactionId", + "baseName": "schemeUniqueTransactionId", + "type": "string", + "format": "" + }, + { + "name": "scores", + "baseName": "scores", + "type": "Array", + "format": "" + }, + { + "name": "threeDSecure", + "baseName": "threeDSecure", + "type": "ThreeDSecure | null", + "format": "" + }, + { + "name": "transactionRulesResult", + "baseName": "transactionRulesResult", + "type": "TransactionRulesResult | null", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "RelayedAuthorisationRequest.TypeEnum", + "format": "" + }, + { + "name": "validationResult", + "baseName": "validationResult", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return RelayedAuthorisationRequest.attributeTypeMap; + } + + public constructor() { + } +} + +export namespace RelayedAuthorisationRequest { + export enum TypeEnum { + BalancePlatformAuthorisationRelayed = 'balancePlatform.authorisation.relayed' + } +} diff --git a/src/typings/relayedAuthorizationWebhooks/relayedAuthorisationResponse.ts b/src/typings/relayedAuthorizationWebhooks/relayedAuthorisationResponse.ts new file mode 100644 index 000000000..0fa374736 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/relayedAuthorisationResponse.ts @@ -0,0 +1,55 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { AuthorisationDecisionResponse } from "./authorisationDecisionResponse"; + + +export class RelayedAuthorisationResponse { + "authorisationDecision"?: AuthorisationDecisionResponse | null; + /** + * Object that contains key-value pairs that you can use in your reporting or other business process. + */ + "metadata"?: { [key: string]: string; }; + /** + * Reference of the payment. + */ + "reference"?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "authorisationDecision", + "baseName": "authorisationDecision", + "type": "AuthorisationDecisionResponse | null", + "format": "" + }, + { + "name": "metadata", + "baseName": "metadata", + "type": "{ [key: string]: string; }", + "format": "" + }, + { + "name": "reference", + "baseName": "reference", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return RelayedAuthorisationResponse.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/relayedAuthorizationWebhooksHandler.ts b/src/typings/relayedAuthorizationWebhooks/relayedAuthorizationWebhooksHandler.ts new file mode 100644 index 000000000..0b53adc34 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/relayedAuthorizationWebhooksHandler.ts @@ -0,0 +1,59 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { relayedAuthorizationWebhooks } from ".."; + +/** + * Union type for all supported webhook requests. + * Allows generic handling of configuration-related webhook events. + */ +export type GenericWebhook = + | relayedAuthorizationWebhooks.RelayedAuthorisationRequest; + +/** + * Handler for processing RelayedAuthorizationWebhooks. + * + * This class provides functionality to deserialize the payload of RelayedAuthorizationWebhooks events. + */ +export class RelayedAuthorizationWebhooksHandler { + + private readonly payload: Record; + + public constructor(jsonPayload: string) { + this.payload = JSON.parse(jsonPayload); + } + + /** + * This method checks the type of the webhook payload and returns the appropriate deserialized object. + * + * @returns A deserialized object of type GenericWebhook. + * @throws Error if the type is not recognized. + */ + public getGenericWebhook(): GenericWebhook { + + const type = this.payload["type"]; + + if(Object.values(relayedAuthorizationWebhooks.RelayedAuthorisationRequest.TypeEnum).includes(type)) { + return this.getRelayedAuthorisationRequest(); + } + + throw new Error("Could not parse the json payload: " + this.payload); + + } + + /** + * Deserialize the webhook payload into a RelayedAuthorisationRequest + * + * @returns Deserialized RelayedAuthorisationRequest object. + */ + public getRelayedAuthorisationRequest(): relayedAuthorizationWebhooks.RelayedAuthorisationRequest { + return relayedAuthorizationWebhooks.ObjectSerializer.deserialize(this.payload, "RelayedAuthorisationRequest"); + } + +} \ No newline at end of file diff --git a/src/typings/relayedAuthorizationWebhooks/resourceReference.ts b/src/typings/relayedAuthorizationWebhooks/resourceReference.ts new file mode 100644 index 000000000..dbb5176f0 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/resourceReference.ts @@ -0,0 +1,56 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 ResourceReference { + /** + * The description of the resource. + */ + "description"?: string; + /** + * The unique identifier of the resource. + */ + "id"?: string; + /** + * The reference for the resource. + */ + "reference"?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "description", + "baseName": "description", + "type": "string", + "format": "" + }, + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "reference", + "baseName": "reference", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ResourceReference.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/serviceError.ts b/src/typings/relayedAuthorizationWebhooks/serviceError.ts new file mode 100644 index 000000000..a6ff948f0 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/serviceError.ts @@ -0,0 +1,76 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "errorCode", + "baseName": "errorCode", + "type": "string", + "format": "" + }, + { + "name": "errorType", + "baseName": "errorType", + "type": "string", + "format": "" + }, + { + "name": "message", + "baseName": "message", + "type": "string", + "format": "" + }, + { + "name": "pspReference", + "baseName": "pspReference", + "type": "string", + "format": "" + }, + { + "name": "status", + "baseName": "status", + "type": "number", + "format": "int32" + } ]; + + static getAttributeTypeMap() { + return ServiceError.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/threeDSecure.ts b/src/typings/relayedAuthorizationWebhooks/threeDSecure.ts new file mode 100644 index 000000000..a8b3a3eb6 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/threeDSecure.ts @@ -0,0 +1,66 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 ThreeDSecure { + /** + * The transaction identifier for the Access Control Server + */ + "acsTransactionId"?: string; + /** + * The result from the performed authentication + */ + "authenticationResult"?: string; + /** + * The type of the performed authentication + */ + "authenticationType"?: string; + /** + * The transaction identifier for the Directory server + */ + "dsTransactionId"?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "acsTransactionId", + "baseName": "acsTransactionId", + "type": "string", + "format": "" + }, + { + "name": "authenticationResult", + "baseName": "authenticationResult", + "type": "string", + "format": "" + }, + { + "name": "authenticationType", + "baseName": "authenticationType", + "type": "string", + "format": "" + }, + { + "name": "dsTransactionId", + "baseName": "dsTransactionId", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ThreeDSecure.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/transactionEventViolation.ts b/src/typings/relayedAuthorizationWebhooks/transactionEventViolation.ts new file mode 100644 index 000000000..6724cb0f8 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/transactionEventViolation.ts @@ -0,0 +1,53 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { TransactionRuleReference } from "./transactionRuleReference"; +import { TransactionRuleSource } from "./transactionRuleSource"; + + +export class TransactionEventViolation { + /** + * An explanation about why the transaction rule failed. + */ + "reason"?: string; + "transactionRule"?: TransactionRuleReference | null; + "transactionRuleSource"?: TransactionRuleSource | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "reason", + "baseName": "reason", + "type": "string", + "format": "" + }, + { + "name": "transactionRule", + "baseName": "transactionRule", + "type": "TransactionRuleReference | null", + "format": "" + }, + { + "name": "transactionRuleSource", + "baseName": "transactionRuleSource", + "type": "TransactionRuleSource | null", + "format": "" + } ]; + + static getAttributeTypeMap() { + return TransactionEventViolation.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/transactionRuleReference.ts b/src/typings/relayedAuthorizationWebhooks/transactionRuleReference.ts new file mode 100644 index 000000000..a4625f681 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/transactionRuleReference.ts @@ -0,0 +1,76 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 TransactionRuleReference { + /** + * The description of the resource. + */ + "description"?: string; + /** + * The unique identifier of the resource. + */ + "id"?: string; + /** + * The outcome type of the rule. + */ + "outcomeType"?: string; + /** + * The reference for the resource. + */ + "reference"?: string; + /** + * The transaction score determined by the rule. Returned only when `outcomeType` is **scoreBased**. + */ + "score"?: number; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "description", + "baseName": "description", + "type": "string", + "format": "" + }, + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "outcomeType", + "baseName": "outcomeType", + "type": "string", + "format": "" + }, + { + "name": "reference", + "baseName": "reference", + "type": "string", + "format": "" + }, + { + "name": "score", + "baseName": "score", + "type": "number", + "format": "int32" + } ]; + + static getAttributeTypeMap() { + return TransactionRuleReference.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/transactionRuleSource.ts b/src/typings/relayedAuthorizationWebhooks/transactionRuleSource.ts new file mode 100644 index 000000000..c21184b53 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/transactionRuleSource.ts @@ -0,0 +1,46 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 TransactionRuleSource { + /** + * ID of the resource, when applicable. + */ + "id"?: string; + /** + * Indicates the type of resource for which the transaction rule is defined. Possible values: * **PaymentInstrumentGroup** * **PaymentInstrument** * **BalancePlatform** * **EntityUsageConfiguration** * **PlatformRule**: The transaction rule is a platform-wide rule imposed by Adyen. + */ + "type"?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return TransactionRuleSource.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/transactionRulesResult.ts b/src/typings/relayedAuthorizationWebhooks/transactionRulesResult.ts new file mode 100644 index 000000000..c4173ff87 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/transactionRulesResult.ts @@ -0,0 +1,68 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { TransactionEventViolation } from "./transactionEventViolation"; + + +export class TransactionRulesResult { + /** + * The advice given by the Risk analysis. + */ + "advice"?: string; + /** + * Indicates whether the transaction passed the evaluation for all hardblock rules + */ + "allHardBlockRulesPassed"?: boolean; + /** + * The score of the Risk analysis. + */ + "score"?: number; + /** + * Array containing all the transaction rules that the transaction triggered. + */ + "triggeredTransactionRules"?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "advice", + "baseName": "advice", + "type": "string", + "format": "" + }, + { + "name": "allHardBlockRulesPassed", + "baseName": "allHardBlockRulesPassed", + "type": "boolean", + "format": "" + }, + { + "name": "score", + "baseName": "score", + "type": "number", + "format": "int32" + }, + { + "name": "triggeredTransactionRules", + "baseName": "triggeredTransactionRules", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return TransactionRulesResult.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/transactionScoring.ts b/src/typings/relayedAuthorizationWebhooks/transactionScoring.ts new file mode 100644 index 000000000..91b39dd0d --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/transactionScoring.ts @@ -0,0 +1,46 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 TransactionScoring { + /** + * The type of score. + */ + "type"?: string; + /** + * The value of the score. + */ + "value"?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return TransactionScoring.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/src/typings/relayedAuthorizationWebhooks/validationResult.ts b/src/typings/relayedAuthorizationWebhooks/validationResult.ts new file mode 100644 index 000000000..803b85586 --- /dev/null +++ b/src/typings/relayedAuthorizationWebhooks/validationResult.ts @@ -0,0 +1,46 @@ +/* + * The version of the OpenAPI document: v4 + * + * + * 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 ValidationResult { + /** + * The result of the check. Possible values: - **valid**: The validation was successful. - **invalid**: The validation failed. - **notValidated**: The validation was not performed because some services were unreachable or Adyen does not have the information needed to perform the check. - **notApplicable**: The validation is not applicable. + */ + "result"?: string; + /** + * Type of check. + */ + "type"?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "result", + "baseName": "result", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ValidationResult.attributeTypeMap; + } + + public constructor() { + } +} +