diff --git a/src/Adyen/Model/Checkout/CardDetails.php b/src/Adyen/Model/Checkout/CardDetails.php index 951f0c62..9a369d10 100644 --- a/src/Adyen/Model/Checkout/CardDetails.php +++ b/src/Adyen/Model/Checkout/CardDetails.php @@ -61,6 +61,7 @@ class CardDetails implements ModelInterface, ArrayAccess, \JsonSerializable 'recurringDetailReference' => 'string', 'shopperNotificationReference' => 'string', 'srcCorrelationId' => 'string', + 'srcDigitalCardId' => 'string', 'srcScheme' => 'string', 'srcTokenReference' => 'string', 'storedPaymentMethodId' => 'string', @@ -93,6 +94,7 @@ class CardDetails implements ModelInterface, ArrayAccess, \JsonSerializable 'recurringDetailReference' => null, 'shopperNotificationReference' => null, 'srcCorrelationId' => null, + 'srcDigitalCardId' => null, 'srcScheme' => null, 'srcTokenReference' => null, 'storedPaymentMethodId' => null, @@ -123,6 +125,7 @@ class CardDetails implements ModelInterface, ArrayAccess, \JsonSerializable 'recurringDetailReference' => false, 'shopperNotificationReference' => false, 'srcCorrelationId' => false, + 'srcDigitalCardId' => false, 'srcScheme' => false, 'srcTokenReference' => false, 'storedPaymentMethodId' => false, @@ -233,6 +236,7 @@ public function isNullableSetToNull(string $property): bool 'recurringDetailReference' => 'recurringDetailReference', 'shopperNotificationReference' => 'shopperNotificationReference', 'srcCorrelationId' => 'srcCorrelationId', + 'srcDigitalCardId' => 'srcDigitalCardId', 'srcScheme' => 'srcScheme', 'srcTokenReference' => 'srcTokenReference', 'storedPaymentMethodId' => 'storedPaymentMethodId', @@ -263,6 +267,7 @@ public function isNullableSetToNull(string $property): bool 'recurringDetailReference' => 'setRecurringDetailReference', 'shopperNotificationReference' => 'setShopperNotificationReference', 'srcCorrelationId' => 'setSrcCorrelationId', + 'srcDigitalCardId' => 'setSrcDigitalCardId', 'srcScheme' => 'setSrcScheme', 'srcTokenReference' => 'setSrcTokenReference', 'storedPaymentMethodId' => 'setStoredPaymentMethodId', @@ -293,6 +298,7 @@ public function isNullableSetToNull(string $property): bool 'recurringDetailReference' => 'getRecurringDetailReference', 'shopperNotificationReference' => 'getShopperNotificationReference', 'srcCorrelationId' => 'getSrcCorrelationId', + 'srcDigitalCardId' => 'getSrcDigitalCardId', 'srcScheme' => 'getSrcScheme', 'srcTokenReference' => 'getSrcTokenReference', 'storedPaymentMethodId' => 'getStoredPaymentMethodId', @@ -408,6 +414,7 @@ public function __construct(array $data = null) $this->setIfExists('recurringDetailReference', $data ?? [], null); $this->setIfExists('shopperNotificationReference', $data ?? [], null); $this->setIfExists('srcCorrelationId', $data ?? [], null); + $this->setIfExists('srcDigitalCardId', $data ?? [], null); $this->setIfExists('srcScheme', $data ?? [], null); $this->setIfExists('srcTokenReference', $data ?? [], null); $this->setIfExists('storedPaymentMethodId', $data ?? [], null); @@ -897,6 +904,30 @@ public function setSrcCorrelationId($srcCorrelationId) return $this; } + /** + * Gets srcDigitalCardId + * + * @return string|null + */ + public function getSrcDigitalCardId() + { + return $this->container['srcDigitalCardId']; + } + + /** + * Sets srcDigitalCardId + * + * @param string|null $srcDigitalCardId The SRC reference for the Click to Pay token. + * + * @return self + */ + public function setSrcDigitalCardId($srcDigitalCardId) + { + $this->container['srcDigitalCardId'] = $srcDigitalCardId; + + return $this; + } + /** * Gets srcScheme * diff --git a/src/Adyen/Model/Checkout/CardDonations.php b/src/Adyen/Model/Checkout/CardDonations.php index a2d5ddf7..bc8a5eae 100644 --- a/src/Adyen/Model/Checkout/CardDonations.php +++ b/src/Adyen/Model/Checkout/CardDonations.php @@ -61,6 +61,7 @@ class CardDonations implements ModelInterface, ArrayAccess, \JsonSerializable 'recurringDetailReference' => 'string', 'shopperNotificationReference' => 'string', 'srcCorrelationId' => 'string', + 'srcDigitalCardId' => 'string', 'srcScheme' => 'string', 'srcTokenReference' => 'string', 'storedPaymentMethodId' => 'string', @@ -93,6 +94,7 @@ class CardDonations implements ModelInterface, ArrayAccess, \JsonSerializable 'recurringDetailReference' => null, 'shopperNotificationReference' => null, 'srcCorrelationId' => null, + 'srcDigitalCardId' => null, 'srcScheme' => null, 'srcTokenReference' => null, 'storedPaymentMethodId' => null, @@ -123,6 +125,7 @@ class CardDonations implements ModelInterface, ArrayAccess, \JsonSerializable 'recurringDetailReference' => false, 'shopperNotificationReference' => false, 'srcCorrelationId' => false, + 'srcDigitalCardId' => false, 'srcScheme' => false, 'srcTokenReference' => false, 'storedPaymentMethodId' => false, @@ -233,6 +236,7 @@ public function isNullableSetToNull(string $property): bool 'recurringDetailReference' => 'recurringDetailReference', 'shopperNotificationReference' => 'shopperNotificationReference', 'srcCorrelationId' => 'srcCorrelationId', + 'srcDigitalCardId' => 'srcDigitalCardId', 'srcScheme' => 'srcScheme', 'srcTokenReference' => 'srcTokenReference', 'storedPaymentMethodId' => 'storedPaymentMethodId', @@ -263,6 +267,7 @@ public function isNullableSetToNull(string $property): bool 'recurringDetailReference' => 'setRecurringDetailReference', 'shopperNotificationReference' => 'setShopperNotificationReference', 'srcCorrelationId' => 'setSrcCorrelationId', + 'srcDigitalCardId' => 'setSrcDigitalCardId', 'srcScheme' => 'setSrcScheme', 'srcTokenReference' => 'setSrcTokenReference', 'storedPaymentMethodId' => 'setStoredPaymentMethodId', @@ -293,6 +298,7 @@ public function isNullableSetToNull(string $property): bool 'recurringDetailReference' => 'getRecurringDetailReference', 'shopperNotificationReference' => 'getShopperNotificationReference', 'srcCorrelationId' => 'getSrcCorrelationId', + 'srcDigitalCardId' => 'getSrcDigitalCardId', 'srcScheme' => 'getSrcScheme', 'srcTokenReference' => 'getSrcTokenReference', 'storedPaymentMethodId' => 'getStoredPaymentMethodId', @@ -408,6 +414,7 @@ public function __construct(array $data = null) $this->setIfExists('recurringDetailReference', $data ?? [], null); $this->setIfExists('shopperNotificationReference', $data ?? [], null); $this->setIfExists('srcCorrelationId', $data ?? [], null); + $this->setIfExists('srcDigitalCardId', $data ?? [], null); $this->setIfExists('srcScheme', $data ?? [], null); $this->setIfExists('srcTokenReference', $data ?? [], null); $this->setIfExists('storedPaymentMethodId', $data ?? [], null); @@ -897,6 +904,30 @@ public function setSrcCorrelationId($srcCorrelationId) return $this; } + /** + * Gets srcDigitalCardId + * + * @return string|null + */ + public function getSrcDigitalCardId() + { + return $this->container['srcDigitalCardId']; + } + + /** + * Sets srcDigitalCardId + * + * @param string|null $srcDigitalCardId The SRC reference for the Click to Pay token. + * + * @return self + */ + public function setSrcDigitalCardId($srcDigitalCardId) + { + $this->container['srcDigitalCardId'] = $srcDigitalCardId; + + return $this; + } + /** * Gets srcScheme * diff --git a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php index 8bfe4064..a9b888de 100644 --- a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php +++ b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php @@ -79,6 +79,7 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'number' => 'string', 'shopperNotificationReference' => 'string', 'srcCorrelationId' => 'string', + 'srcDigitalCardId' => 'string', 'srcScheme' => 'string', 'srcTokenReference' => 'string', 'threeDS2SdkVersion' => 'string', @@ -151,6 +152,7 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'number' => null, 'shopperNotificationReference' => null, 'srcCorrelationId' => null, + 'srcDigitalCardId' => null, 'srcScheme' => null, 'srcTokenReference' => null, 'threeDS2SdkVersion' => null, @@ -221,6 +223,7 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'number' => false, 'shopperNotificationReference' => false, 'srcCorrelationId' => false, + 'srcDigitalCardId' => false, 'srcScheme' => false, 'srcTokenReference' => false, 'threeDS2SdkVersion' => false, @@ -371,6 +374,7 @@ public function isNullableSetToNull(string $property): bool 'number' => 'number', 'shopperNotificationReference' => 'shopperNotificationReference', 'srcCorrelationId' => 'srcCorrelationId', + 'srcDigitalCardId' => 'srcDigitalCardId', 'srcScheme' => 'srcScheme', 'srcTokenReference' => 'srcTokenReference', 'threeDS2SdkVersion' => 'threeDS2SdkVersion', @@ -441,6 +445,7 @@ public function isNullableSetToNull(string $property): bool 'number' => 'setNumber', 'shopperNotificationReference' => 'setShopperNotificationReference', 'srcCorrelationId' => 'setSrcCorrelationId', + 'srcDigitalCardId' => 'setSrcDigitalCardId', 'srcScheme' => 'setSrcScheme', 'srcTokenReference' => 'setSrcTokenReference', 'threeDS2SdkVersion' => 'setThreeDS2SdkVersion', @@ -511,6 +516,7 @@ public function isNullableSetToNull(string $property): bool 'number' => 'getNumber', 'shopperNotificationReference' => 'getShopperNotificationReference', 'srcCorrelationId' => 'getSrcCorrelationId', + 'srcDigitalCardId' => 'getSrcDigitalCardId', 'srcScheme' => 'getSrcScheme', 'srcTokenReference' => 'getSrcTokenReference', 'threeDS2SdkVersion' => 'getThreeDS2SdkVersion', @@ -631,6 +637,7 @@ public function __construct(array $data = null) $this->setIfExists('number', $data ?? [], null); $this->setIfExists('shopperNotificationReference', $data ?? [], null); $this->setIfExists('srcCorrelationId', $data ?? [], null); + $this->setIfExists('srcDigitalCardId', $data ?? [], null); $this->setIfExists('srcScheme', $data ?? [], null); $this->setIfExists('srcTokenReference', $data ?? [], null); $this->setIfExists('threeDS2SdkVersion', $data ?? [], null); @@ -1569,6 +1576,30 @@ public function setSrcCorrelationId($srcCorrelationId) return $this; } + /** + * Gets srcDigitalCardId + * + * @return string|null + */ + public function getSrcDigitalCardId() + { + return $this->container['srcDigitalCardId']; + } + + /** + * Sets srcDigitalCardId + * + * @param string|null $srcDigitalCardId The SRC reference for the Click to Pay token. + * + * @return self + */ + public function setSrcDigitalCardId($srcDigitalCardId) + { + $this->container['srcDigitalCardId'] = $srcDigitalCardId; + + return $this; + } + /** * Gets srcScheme * diff --git a/src/Adyen/Model/Checkout/DonationPaymentMethod.php b/src/Adyen/Model/Checkout/DonationPaymentMethod.php index a8c86331..36003472 100644 --- a/src/Adyen/Model/Checkout/DonationPaymentMethod.php +++ b/src/Adyen/Model/Checkout/DonationPaymentMethod.php @@ -65,6 +65,7 @@ class DonationPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'number' => 'string', 'shopperNotificationReference' => 'string', 'srcCorrelationId' => 'string', + 'srcDigitalCardId' => 'string', 'srcScheme' => 'string', 'srcTokenReference' => 'string', 'threeDS2SdkVersion' => 'string', @@ -101,6 +102,7 @@ class DonationPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'number' => null, 'shopperNotificationReference' => null, 'srcCorrelationId' => null, + 'srcDigitalCardId' => null, 'srcScheme' => null, 'srcTokenReference' => null, 'threeDS2SdkVersion' => null, @@ -135,6 +137,7 @@ class DonationPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'number' => false, 'shopperNotificationReference' => false, 'srcCorrelationId' => false, + 'srcDigitalCardId' => false, 'srcScheme' => false, 'srcTokenReference' => false, 'threeDS2SdkVersion' => false, @@ -249,6 +252,7 @@ public function isNullableSetToNull(string $property): bool 'number' => 'number', 'shopperNotificationReference' => 'shopperNotificationReference', 'srcCorrelationId' => 'srcCorrelationId', + 'srcDigitalCardId' => 'srcDigitalCardId', 'srcScheme' => 'srcScheme', 'srcTokenReference' => 'srcTokenReference', 'threeDS2SdkVersion' => 'threeDS2SdkVersion', @@ -283,6 +287,7 @@ public function isNullableSetToNull(string $property): bool 'number' => 'setNumber', 'shopperNotificationReference' => 'setShopperNotificationReference', 'srcCorrelationId' => 'setSrcCorrelationId', + 'srcDigitalCardId' => 'setSrcDigitalCardId', 'srcScheme' => 'setSrcScheme', 'srcTokenReference' => 'setSrcTokenReference', 'threeDS2SdkVersion' => 'setThreeDS2SdkVersion', @@ -317,6 +322,7 @@ public function isNullableSetToNull(string $property): bool 'number' => 'getNumber', 'shopperNotificationReference' => 'getShopperNotificationReference', 'srcCorrelationId' => 'getSrcCorrelationId', + 'srcDigitalCardId' => 'getSrcDigitalCardId', 'srcScheme' => 'getSrcScheme', 'srcTokenReference' => 'getSrcTokenReference', 'threeDS2SdkVersion' => 'getThreeDS2SdkVersion', @@ -401,6 +407,7 @@ public function __construct(array $data = null) $this->setIfExists('number', $data ?? [], null); $this->setIfExists('shopperNotificationReference', $data ?? [], null); $this->setIfExists('srcCorrelationId', $data ?? [], null); + $this->setIfExists('srcDigitalCardId', $data ?? [], null); $this->setIfExists('srcScheme', $data ?? [], null); $this->setIfExists('srcTokenReference', $data ?? [], null); $this->setIfExists('threeDS2SdkVersion', $data ?? [], null); @@ -943,6 +950,30 @@ public function setSrcCorrelationId($srcCorrelationId) return $this; } + /** + * Gets srcDigitalCardId + * + * @return string|null + */ + public function getSrcDigitalCardId() + { + return $this->container['srcDigitalCardId']; + } + + /** + * Sets srcDigitalCardId + * + * @param string|null $srcDigitalCardId The SRC reference for the Click to Pay token. + * + * @return self + */ + public function setSrcDigitalCardId($srcDigitalCardId) + { + $this->container['srcDigitalCardId'] = $srcDigitalCardId; + + return $this; + } + /** * Gets srcScheme * diff --git a/src/Adyen/Model/LegalEntityManagement/Document.php b/src/Adyen/Model/LegalEntityManagement/Document.php index 3de4d3b2..bbb19a99 100644 --- a/src/Adyen/Model/LegalEntityManagement/Document.php +++ b/src/Adyen/Model/LegalEntityManagement/Document.php @@ -305,6 +305,7 @@ public function getModelName() public const TYPE_PROOF_OF_INDUSTRY = 'proofOfIndustry'; public const TYPE_CONSTITUTIONAL_DOCUMENT = 'constitutionalDocument'; public const TYPE_PROOF_OF_FUNDING_OR_WEALTH_SOURCE = 'proofOfFundingOrWealthSource'; + public const TYPE_PROOF_OF_RELATIONSHIP = 'proofOfRelationship'; /** * Gets allowable values of the enum @@ -332,6 +333,7 @@ public function getTypeAllowableValues() self::TYPE_PROOF_OF_INDUSTRY, self::TYPE_CONSTITUTIONAL_DOCUMENT, self::TYPE_PROOF_OF_FUNDING_OR_WEALTH_SOURCE, + self::TYPE_PROOF_OF_RELATIONSHIP, ]; } /** @@ -728,7 +730,7 @@ public function getType() /** * Sets type * - * @param string $type Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, **proofOfIndustry**, **proofOfSignatory**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **liveSelfie**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, or **proofOfFundingOrWealthSource**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * For **trust**, the `type` value can be **constitutionalDocument**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * @param string $type Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, **proofOfIndustry**, **proofOfSignatory**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **liveSelfie**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, **proofOfFundingOrWealthSource** or **proofOfRelationship**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * For **trust**, the `type` value can be **constitutionalDocument**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.php b/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.php index 9cf9151f..63b3cc73 100644 --- a/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.php +++ b/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.php @@ -45,6 +45,7 @@ class GetTermsOfServiceDocumentRequest implements ModelInterface, ArrayAccess, \ */ protected static $openAPITypes = [ 'language' => 'string', + 'termsOfServiceDocumentFormat' => 'string', 'type' => 'string' ]; @@ -57,6 +58,7 @@ class GetTermsOfServiceDocumentRequest implements ModelInterface, ArrayAccess, \ */ protected static $openAPIFormats = [ 'language' => null, + 'termsOfServiceDocumentFormat' => null, 'type' => null ]; @@ -67,6 +69,7 @@ class GetTermsOfServiceDocumentRequest implements ModelInterface, ArrayAccess, \ */ protected static $openAPINullables = [ 'language' => false, + 'termsOfServiceDocumentFormat' => false, 'type' => false ]; @@ -157,6 +160,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'language' => 'language', + 'termsOfServiceDocumentFormat' => 'termsOfServiceDocumentFormat', 'type' => 'type' ]; @@ -167,6 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'language' => 'setLanguage', + 'termsOfServiceDocumentFormat' => 'setTermsOfServiceDocumentFormat', 'type' => 'setType' ]; @@ -177,6 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'language' => 'getLanguage', + 'termsOfServiceDocumentFormat' => 'getTermsOfServiceDocumentFormat', 'type' => 'getType' ]; @@ -264,6 +270,7 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('language', $data ?? [], null); + $this->setIfExists('termsOfServiceDocumentFormat', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -348,6 +355,30 @@ public function setLanguage($language) return $this; } + /** + * Gets termsOfServiceDocumentFormat + * + * @return string|null + */ + public function getTermsOfServiceDocumentFormat() + { + return $this->container['termsOfServiceDocumentFormat']; + } + + /** + * Sets termsOfServiceDocumentFormat + * + * @param string|null $termsOfServiceDocumentFormat The requested format for the Terms of Service document. Default value: JSON. + * + * @return self + */ + public function setTermsOfServiceDocumentFormat($termsOfServiceDocumentFormat) + { + $this->container['termsOfServiceDocumentFormat'] = $termsOfServiceDocumentFormat; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.php b/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.php index 504e3a72..990a5f4e 100644 --- a/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.php +++ b/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.php @@ -47,6 +47,7 @@ class GetTermsOfServiceDocumentResponse implements ModelInterface, ArrayAccess, 'document' => 'string', 'id' => 'string', 'language' => 'string', + 'termsOfServiceDocumentFormat' => 'string', 'termsOfServiceDocumentId' => 'string', 'type' => 'string' ]; @@ -62,6 +63,7 @@ class GetTermsOfServiceDocumentResponse implements ModelInterface, ArrayAccess, 'document' => 'byte', 'id' => null, 'language' => null, + 'termsOfServiceDocumentFormat' => null, 'termsOfServiceDocumentId' => null, 'type' => null ]; @@ -75,6 +77,7 @@ class GetTermsOfServiceDocumentResponse implements ModelInterface, ArrayAccess, 'document' => false, 'id' => false, 'language' => false, + 'termsOfServiceDocumentFormat' => false, 'termsOfServiceDocumentId' => false, 'type' => false ]; @@ -168,6 +171,7 @@ public function isNullableSetToNull(string $property): bool 'document' => 'document', 'id' => 'id', 'language' => 'language', + 'termsOfServiceDocumentFormat' => 'termsOfServiceDocumentFormat', 'termsOfServiceDocumentId' => 'termsOfServiceDocumentId', 'type' => 'type' ]; @@ -181,6 +185,7 @@ public function isNullableSetToNull(string $property): bool 'document' => 'setDocument', 'id' => 'setId', 'language' => 'setLanguage', + 'termsOfServiceDocumentFormat' => 'setTermsOfServiceDocumentFormat', 'termsOfServiceDocumentId' => 'setTermsOfServiceDocumentId', 'type' => 'setType' ]; @@ -194,6 +199,7 @@ public function isNullableSetToNull(string $property): bool 'document' => 'getDocument', 'id' => 'getId', 'language' => 'getLanguage', + 'termsOfServiceDocumentFormat' => 'getTermsOfServiceDocumentFormat', 'termsOfServiceDocumentId' => 'getTermsOfServiceDocumentId', 'type' => 'getType' ]; @@ -284,6 +290,7 @@ public function __construct(array $data = null) $this->setIfExists('document', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('language', $data ?? [], null); + $this->setIfExists('termsOfServiceDocumentFormat', $data ?? [], null); $this->setIfExists('termsOfServiceDocumentId', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -411,6 +418,30 @@ public function setLanguage($language) return $this; } + /** + * Gets termsOfServiceDocumentFormat + * + * @return string|null + */ + public function getTermsOfServiceDocumentFormat() + { + return $this->container['termsOfServiceDocumentFormat']; + } + + /** + * Sets termsOfServiceDocumentFormat + * + * @param string|null $termsOfServiceDocumentFormat The format of the Terms of Service document. + * + * @return self + */ + public function setTermsOfServiceDocumentFormat($termsOfServiceDocumentFormat) + { + $this->container['termsOfServiceDocumentFormat'] = $termsOfServiceDocumentFormat; + + return $this; + } + /** * Gets termsOfServiceDocumentId * diff --git a/src/Adyen/Model/LegalEntityManagement/IdentificationData.php b/src/Adyen/Model/LegalEntityManagement/IdentificationData.php index 70d0c298..7dcaee0d 100644 --- a/src/Adyen/Model/LegalEntityManagement/IdentificationData.php +++ b/src/Adyen/Model/LegalEntityManagement/IdentificationData.php @@ -507,7 +507,7 @@ public function getType() /** * Sets type * - * @param string $type Type of identity data. For individuals, the `type` value is **nationalIdNumber**. For individuals in these countries, the following types are supported. - Australia: **driversLicense**, **passport** - Hong Kong: **driversLicense**, **nationalIdNumber**, **passport** - New Zealand: **driversLicense**, **passport** - Singapore: **driversLicense**, **nationalIdNumber**, **passport** + * @param string $type Type of identity data. For individuals, the following types are supported: - Australia: **driversLicense**, **passport** - Hong Kong: **driversLicense**, **nationalIdNumber**, **passport** - New Zealand: **driversLicense**, **passport** - Singapore: **driversLicense**, **nationalIdNumber**, **passport** - All other supported countries: **nationalIdNumber * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/LegalEntity.php b/src/Adyen/Model/LegalEntityManagement/LegalEntity.php index ccd96130..ae12241c 100644 --- a/src/Adyen/Model/LegalEntityManagement/LegalEntity.php +++ b/src/Adyen/Model/LegalEntityManagement/LegalEntity.php @@ -767,7 +767,7 @@ public function getVerificationPlan() /** * Sets verificationPlan * - * @param string|null $verificationPlan A key-value pair that specifies the verification process for a legal entity. Set to **upfront** for upfront verification for [marketplaces](https://docs.adyen.com/marketplaces/onboard-users#upfront). + * @param string|null $verificationPlan A key-value pair that specifies the verification process for a legal entity. Set to **upfront** for upfront verification for [marketplaces](https://docs.adyen.com/marketplaces/verification-overview/verification-types/#upfront-verification). * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.php b/src/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.php index a7441473..ac4738f9 100644 --- a/src/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.php +++ b/src/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.php @@ -49,6 +49,7 @@ class LegalEntityAssociation implements ModelInterface, ArrayAccess, \JsonSerial 'jobTitle' => 'string', 'legalEntityId' => 'string', 'name' => 'string', + 'relationship' => 'string', 'settlorExemptionReason' => 'string[]', 'type' => 'string' ]; @@ -66,6 +67,7 @@ class LegalEntityAssociation implements ModelInterface, ArrayAccess, \JsonSerial 'jobTitle' => null, 'legalEntityId' => null, 'name' => null, + 'relationship' => null, 'settlorExemptionReason' => null, 'type' => null ]; @@ -81,6 +83,7 @@ class LegalEntityAssociation implements ModelInterface, ArrayAccess, \JsonSerial 'jobTitle' => false, 'legalEntityId' => false, 'name' => false, + 'relationship' => false, 'settlorExemptionReason' => false, 'type' => false ]; @@ -176,6 +179,7 @@ public function isNullableSetToNull(string $property): bool 'jobTitle' => 'jobTitle', 'legalEntityId' => 'legalEntityId', 'name' => 'name', + 'relationship' => 'relationship', 'settlorExemptionReason' => 'settlorExemptionReason', 'type' => 'type' ]; @@ -191,6 +195,7 @@ public function isNullableSetToNull(string $property): bool 'jobTitle' => 'setJobTitle', 'legalEntityId' => 'setLegalEntityId', 'name' => 'setName', + 'relationship' => 'setRelationship', 'settlorExemptionReason' => 'setSettlorExemptionReason', 'type' => 'setType' ]; @@ -206,6 +211,7 @@ public function isNullableSetToNull(string $property): bool 'jobTitle' => 'getJobTitle', 'legalEntityId' => 'getLegalEntityId', 'name' => 'getName', + 'relationship' => 'getRelationship', 'settlorExemptionReason' => 'getSettlorExemptionReason', 'type' => 'getType' ]; @@ -254,6 +260,7 @@ public function getModelName() public const TYPE_DEFINED_BENEFICIARY = 'definedBeneficiary'; public const TYPE_DIRECTOR = 'director'; public const TYPE_IMMEDIATE_PARENT_COMPANY = 'immediateParentCompany'; + public const TYPE_LEGAL_REPRESENTATIVE = 'legalRepresentative'; public const TYPE_PCI_SIGNATORY = 'pciSignatory'; public const TYPE_PROTECTOR = 'protector'; public const TYPE_SECONDARY_TRUSTEE = 'secondaryTrustee'; @@ -278,6 +285,7 @@ public function getTypeAllowableValues() self::TYPE_DEFINED_BENEFICIARY, self::TYPE_DIRECTOR, self::TYPE_IMMEDIATE_PARENT_COMPANY, + self::TYPE_LEGAL_REPRESENTATIVE, self::TYPE_PCI_SIGNATORY, self::TYPE_PROTECTOR, self::TYPE_SECONDARY_TRUSTEE, @@ -312,6 +320,7 @@ public function __construct(array $data = null) $this->setIfExists('jobTitle', $data ?? [], null); $this->setIfExists('legalEntityId', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('relationship', $data ?? [], null); $this->setIfExists('settlorExemptionReason', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -493,6 +502,30 @@ public function setName($name) return $this; } + /** + * Gets relationship + * + * @return string|null + */ + public function getRelationship() + { + return $this->container['relationship']; + } + + /** + * Sets relationship + * + * @param string|null $relationship The individual's relationship to a legal representative if the `type` is **legalRepresentative**. Possible values: **parent**, **guardian**. + * + * @return self + */ + public function setRelationship($relationship) + { + $this->container['relationship'] = $relationship; + + return $this; + } + /** * Gets settlorExemptionReason * @@ -530,7 +563,7 @@ public function getType() /** * Sets type * - * @param string $type Defines the relationship of the legal entity to the current legal entity. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **director**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. Possible value for trusts: **trust** Possible values for trust members: **definedBeneficiary**, **protector**, **secondaryTrustee**, **settlor**, **uboThroughControl**, or **uboThroughOwnership**. + * @param string $type Defines the relationship of the legal entity to the current legal entity. Possible value for individuals: **legalRepresentative**. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **director**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. Possible value for trusts: **trust**. Possible values for trust members: **definedBeneficiary**, **protector**, **secondaryTrustee**, **settlor**, **uboThroughControl**, or **uboThroughOwnership**. * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/LegalEntityInfo.php b/src/Adyen/Model/LegalEntityManagement/LegalEntityInfo.php index 618224db..5f52c157 100644 --- a/src/Adyen/Model/LegalEntityManagement/LegalEntityInfo.php +++ b/src/Adyen/Model/LegalEntityManagement/LegalEntityInfo.php @@ -576,7 +576,7 @@ public function getVerificationPlan() /** * Sets verificationPlan * - * @param string|null $verificationPlan A key-value pair that specifies the verification process for a legal entity. Set to **upfront** for upfront verification for [marketplaces](https://docs.adyen.com/marketplaces/onboard-users#upfront). + * @param string|null $verificationPlan A key-value pair that specifies the verification process for a legal entity. Set to **upfront** for upfront verification for [marketplaces](https://docs.adyen.com/marketplaces/verification-overview/verification-types/#upfront-verification). * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/LegalEntityInfoRequiredType.php b/src/Adyen/Model/LegalEntityManagement/LegalEntityInfoRequiredType.php index 1991f61e..2c675ae2 100644 --- a/src/Adyen/Model/LegalEntityManagement/LegalEntityInfoRequiredType.php +++ b/src/Adyen/Model/LegalEntityManagement/LegalEntityInfoRequiredType.php @@ -579,7 +579,7 @@ public function getVerificationPlan() /** * Sets verificationPlan * - * @param string|null $verificationPlan A key-value pair that specifies the verification process for a legal entity. Set to **upfront** for upfront verification for [marketplaces](https://docs.adyen.com/marketplaces/onboard-users#upfront). + * @param string|null $verificationPlan A key-value pair that specifies the verification process for a legal entity. Set to **upfront** for upfront verification for [marketplaces](https://docs.adyen.com/marketplaces/verification-overview/verification-types/#upfront-verification). * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.php b/src/Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.php index c0d5114b..1289da95 100644 --- a/src/Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.php +++ b/src/Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.php @@ -387,7 +387,7 @@ public function getAcceptedCountries() /** * Sets acceptedCountries * - * @param string[]|null $acceptedCountries acceptedCountries + * @param string[]|null $acceptedCountries The list of countries the user can choose from in hosted onboarding when `editPrefilledCountry` is allowed. The value must be in the two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code format. The array is empty by default, allowing all [countries and regions supported by hosted onboarding](https://docs.adyen.com/platforms/onboard-users/#hosted-onboarding). * * @return self */ @@ -411,7 +411,7 @@ public function getAllowBankAccountFormatSelection() /** * Sets allowBankAccountFormatSelection * - * @param bool|null $allowBankAccountFormatSelection allowBankAccountFormatSelection + * @param bool|null $allowBankAccountFormatSelection Default value: **false** Indicates if the user can select the format for their payout account (if applicable). * * @return self */ @@ -435,7 +435,7 @@ public function getAllowIntraRegionCrossBorderPayout() /** * Sets allowIntraRegionCrossBorderPayout * - * @param bool|null $allowIntraRegionCrossBorderPayout allowIntraRegionCrossBorderPayout + * @param bool|null $allowIntraRegionCrossBorderPayout Default value: **false** Indicates if the user can select a payout account in a different EU/EEA location (including Switzerland and the UK) than the location of their legal entity. * * @return self */ @@ -459,7 +459,7 @@ public function getChangeLegalEntityType() /** * Sets changeLegalEntityType * - * @param bool|null $changeLegalEntityType changeLegalEntityType + * @param bool|null $changeLegalEntityType Default value: **true** Indicates if the user can change their legal entity type. * * @return self */ @@ -483,7 +483,7 @@ public function getEditPrefilledCountry() /** * Sets editPrefilledCountry * - * @param bool|null $editPrefilledCountry editPrefilledCountry + * @param bool|null $editPrefilledCountry Default value: **true** Indicates if the user can change the country of their legal entity's address, for example the registered address of an organization. * * @return self */ @@ -507,7 +507,7 @@ public function getHideOnboardingIntroductionIndividual() /** * Sets hideOnboardingIntroductionIndividual * - * @param bool|null $hideOnboardingIntroductionIndividual hideOnboardingIntroductionIndividual + * @param bool|null $hideOnboardingIntroductionIndividual Default value: **false** Indicates if the user of the individual legal entity type can view the introduction screen. The introduction screen provides brief instructions for the subsequent steps in the hosted onboarding process. * * @return self */ @@ -531,7 +531,7 @@ public function getHideOnboardingIntroductionOrganization() /** * Sets hideOnboardingIntroductionOrganization * - * @param bool|null $hideOnboardingIntroductionOrganization hideOnboardingIntroductionOrganization + * @param bool|null $hideOnboardingIntroductionOrganization Default value: **false** Indicates if the user of the organization legal entity type can view the introduction screen. The introduction screen provides brief instructions for the subsequent steps in the hosted onboarding process. * * @return self */ @@ -555,7 +555,7 @@ public function getHideOnboardingIntroductionSoleProprietor() /** * Sets hideOnboardingIntroductionSoleProprietor * - * @param bool|null $hideOnboardingIntroductionSoleProprietor hideOnboardingIntroductionSoleProprietor + * @param bool|null $hideOnboardingIntroductionSoleProprietor Default value: **false** Indicates if the user of the sole proprietorship legal entity type can view the introduction screen. The introduction screen provides brief instructions for the subsequent steps in the hosted onboarding process. * * @return self */ @@ -579,7 +579,7 @@ public function getHideOnboardingIntroductionTrust() /** * Sets hideOnboardingIntroductionTrust * - * @param bool|null $hideOnboardingIntroductionTrust hideOnboardingIntroductionTrust + * @param bool|null $hideOnboardingIntroductionTrust Default value: **false** Indicates if the user of the trust legal entity type can view the introduction screen. The introduction screen provides brief instructions for the subsequent steps in the hosted onboarding process. * * @return self */ @@ -603,7 +603,7 @@ public function getInstantBankVerification() /** * Sets instantBankVerification * - * @param bool|null $instantBankVerification instantBankVerification + * @param bool|null $instantBankVerification Default value: **true** Indicates if the user can initiate the verification process through open banking providers, like Plaid or Tink. * * @return self */ @@ -627,7 +627,7 @@ public function getRequirePciSignEcomMoto() /** * Sets requirePciSignEcomMoto * - * @param bool|null $requirePciSignEcomMoto requirePciSignEcomMoto + * @param bool|null $requirePciSignEcomMoto Default value: **false** Indicates if the user is required to sign a PCI questionnaires for the **ecomMoto** sales channel type. * * @return self */ @@ -651,7 +651,7 @@ public function getRequirePciSignEcommerce() /** * Sets requirePciSignEcommerce * - * @param bool|null $requirePciSignEcommerce requirePciSignEcommerce + * @param bool|null $requirePciSignEcommerce Default value: **false** Indicates if the user is required to sign a PCI questionnaires for the **eCommerce** sales channel type. * * @return self */ @@ -675,7 +675,7 @@ public function getRequirePciSignPos() /** * Sets requirePciSignPos * - * @param bool|null $requirePciSignPos requirePciSignPos + * @param bool|null $requirePciSignPos Default value: **false** Indicates if the user is required to sign a PCI questionnaires for the **pos** sales channel type. * * @return self */ @@ -699,7 +699,7 @@ public function getRequirePciSignPosMoto() /** * Sets requirePciSignPosMoto * - * @param bool|null $requirePciSignPosMoto requirePciSignPosMoto + * @param bool|null $requirePciSignPosMoto Default value: **false** Indicates if the user is required to sign a PCI questionnaires for the **posMoto** sales channel type. * * @return self */ @@ -723,7 +723,7 @@ public function getTransferInstrumentLimit() /** * Sets transferInstrumentLimit * - * @param int|null $transferInstrumentLimit transferInstrumentLimit + * @param int|null $transferInstrumentLimit The maximum number of transfer instruments the user can create. * * @return self */ diff --git a/src/Adyen/Model/PaymentsApp/BoardingTokenRequest.php b/src/Adyen/Model/PaymentsApp/BoardingTokenRequest.php new file mode 100644 index 00000000..f296d371 --- /dev/null +++ b/src/Adyen/Model/PaymentsApp/BoardingTokenRequest.php @@ -0,0 +1,410 @@ + + */ +class BoardingTokenRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BoardingTokenRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'boardingRequestToken' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'boardingRequestToken' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'boardingRequestToken' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'boardingRequestToken' => 'boardingRequestToken' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'boardingRequestToken' => 'setBoardingRequestToken' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'boardingRequestToken' => 'getBoardingRequestToken' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('boardingRequestToken', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['boardingRequestToken'] === null) { + $invalidProperties[] = "'boardingRequestToken' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets boardingRequestToken + * + * @return string + */ + public function getBoardingRequestToken() + { + return $this->container['boardingRequestToken']; + } + + /** + * Sets boardingRequestToken + * + * @param string $boardingRequestToken The boardingToken request token. + * + * @return self + */ + public function setBoardingRequestToken($boardingRequestToken) + { + $this->container['boardingRequestToken'] = $boardingRequestToken; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/PaymentsApp/BoardingTokenResponse.php b/src/Adyen/Model/PaymentsApp/BoardingTokenResponse.php new file mode 100644 index 00000000..7f79a9d3 --- /dev/null +++ b/src/Adyen/Model/PaymentsApp/BoardingTokenResponse.php @@ -0,0 +1,444 @@ + + */ +class BoardingTokenResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BoardingTokenResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'boardingToken' => 'string', + 'installationId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'boardingToken' => null, + 'installationId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'boardingToken' => false, + 'installationId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'boardingToken' => 'boardingToken', + 'installationId' => 'installationId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'boardingToken' => 'setBoardingToken', + 'installationId' => 'setInstallationId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'boardingToken' => 'getBoardingToken', + 'installationId' => 'getInstallationId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('boardingToken', $data ?? [], null); + $this->setIfExists('installationId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['boardingToken'] === null) { + $invalidProperties[] = "'boardingToken' can't be null"; + } + if ($this->container['installationId'] === null) { + $invalidProperties[] = "'installationId' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets boardingToken + * + * @return string + */ + public function getBoardingToken() + { + return $this->container['boardingToken']; + } + + /** + * Sets boardingToken + * + * @param string $boardingToken The boarding token that allows the Payments App to board. + * + * @return self + */ + public function setBoardingToken($boardingToken) + { + $this->container['boardingToken'] = $boardingToken; + + return $this; + } + + /** + * Gets installationId + * + * @return string + */ + public function getInstallationId() + { + return $this->container['installationId']; + } + + /** + * Sets installationId + * + * @param string $installationId The unique identifier of the Payments App instance. + * + * @return self + */ + public function setInstallationId($installationId) + { + $this->container['installationId'] = $installationId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/PaymentsApp/DefaultErrorResponseEntity.php b/src/Adyen/Model/PaymentsApp/DefaultErrorResponseEntity.php new file mode 100644 index 00000000..70eb07c2 --- /dev/null +++ b/src/Adyen/Model/PaymentsApp/DefaultErrorResponseEntity.php @@ -0,0 +1,625 @@ + + */ +class DefaultErrorResponseEntity implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DefaultErrorResponseEntity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'detail' => 'string', + 'errorCode' => 'string', + 'instance' => 'string', + 'invalidFields' => '\Adyen\Model\PaymentsApp\InvalidField[]', + 'requestId' => 'string', + 'status' => 'int', + 'title' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'detail' => null, + 'errorCode' => null, + 'instance' => null, + 'invalidFields' => null, + 'requestId' => null, + 'status' => 'int32', + 'title' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'detail' => false, + 'errorCode' => false, + 'instance' => false, + 'invalidFields' => false, + 'requestId' => false, + 'status' => true, + 'title' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'detail' => 'detail', + 'errorCode' => 'errorCode', + 'instance' => 'instance', + 'invalidFields' => 'invalidFields', + 'requestId' => 'requestId', + 'status' => 'status', + 'title' => 'title', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'detail' => 'setDetail', + 'errorCode' => 'setErrorCode', + 'instance' => 'setInstance', + 'invalidFields' => 'setInvalidFields', + 'requestId' => 'setRequestId', + 'status' => 'setStatus', + 'title' => 'setTitle', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'detail' => 'getDetail', + 'errorCode' => 'getErrorCode', + 'instance' => 'getInstance', + 'invalidFields' => 'getInvalidFields', + 'requestId' => 'getRequestId', + 'status' => 'getStatus', + 'title' => 'getTitle', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('detail', $data ?? [], null); + $this->setIfExists('errorCode', $data ?? [], null); + $this->setIfExists('instance', $data ?? [], null); + $this->setIfExists('invalidFields', $data ?? [], null); + $this->setIfExists('requestId', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets detail + * + * @return string|null + */ + public function getDetail() + { + return $this->container['detail']; + } + + /** + * Sets detail + * + * @param string|null $detail A human-readable explanation specific to this occurrence of the problem. + * + * @return self + */ + public function setDetail($detail) + { + $this->container['detail'] = $detail; + + return $this; + } + + /** + * Gets errorCode + * + * @return string|null + */ + public function getErrorCode() + { + return $this->container['errorCode']; + } + + /** + * Sets errorCode + * + * @param string|null $errorCode Unique business error code. + * + * @return self + */ + public function setErrorCode($errorCode) + { + $this->container['errorCode'] = $errorCode; + + return $this; + } + + /** + * Gets instance + * + * @return string|null + */ + public function getInstance() + { + return $this->container['instance']; + } + + /** + * Sets instance + * + * @param string|null $instance A URI that identifies the specific occurrence of the problem if applicable. + * + * @return self + */ + public function setInstance($instance) + { + $this->container['instance'] = $instance; + + return $this; + } + + /** + * Gets invalidFields + * + * @return \Adyen\Model\PaymentsApp\InvalidField[]|null + */ + public function getInvalidFields() + { + return $this->container['invalidFields']; + } + + /** + * Sets invalidFields + * + * @param \Adyen\Model\PaymentsApp\InvalidField[]|null $invalidFields Array of fields with validation errors when applicable. + * + * @return self + */ + public function setInvalidFields($invalidFields) + { + $this->container['invalidFields'] = $invalidFields; + + return $this; + } + + /** + * Gets requestId + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['requestId']; + } + + /** + * Sets requestId + * + * @param string|null $requestId The unique reference for the request. + * + * @return self + */ + public function setRequestId($requestId) + { + $this->container['requestId'] = $requestId; + + return $this; + } + + /** + * Gets status + * + * @return int|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param int|null $status The HTTP status code. + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title A short, human-readable summary of the problem type. + * + * @return self + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type A URI that identifies the validation error type. It points to human-readable documentation for the problem type. + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/PaymentsApp/InvalidField.php b/src/Adyen/Model/PaymentsApp/InvalidField.php new file mode 100644 index 00000000..bfa7af1f --- /dev/null +++ b/src/Adyen/Model/PaymentsApp/InvalidField.php @@ -0,0 +1,478 @@ + + */ +class InvalidField implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InvalidField'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'value' => 'string', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'value' => null, + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'name' => false, + 'value' => false, + 'message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'value' => 'value', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'value' => 'setValue', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'value' => 'getValue', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The field that has an invalid value. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value The invalid value. + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message Description of the validation error. + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/PaymentsApp/ModelInterface.php b/src/Adyen/Model/PaymentsApp/ModelInterface.php new file mode 100644 index 00000000..ae48b0b0 --- /dev/null +++ b/src/Adyen/Model/PaymentsApp/ModelInterface.php @@ -0,0 +1,92 @@ +format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach ($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) { + return $timestamp; + } + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if (is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Adyen\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/src/Adyen/Model/PaymentsApp/PaymentsAppDto.php b/src/Adyen/Model/PaymentsApp/PaymentsAppDto.php new file mode 100644 index 00000000..a6cdd04d --- /dev/null +++ b/src/Adyen/Model/PaymentsApp/PaymentsAppDto.php @@ -0,0 +1,509 @@ + + */ +class PaymentsAppDto implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentsAppDto'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'installationId' => 'string', + 'merchantAccountCode' => 'string', + 'merchantStoreCode' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'installationId' => null, + 'merchantAccountCode' => null, + 'merchantStoreCode' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'installationId' => false, + 'merchantAccountCode' => false, + 'merchantStoreCode' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'installationId' => 'installationId', + 'merchantAccountCode' => 'merchantAccountCode', + 'merchantStoreCode' => 'merchantStoreCode', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'installationId' => 'setInstallationId', + 'merchantAccountCode' => 'setMerchantAccountCode', + 'merchantStoreCode' => 'setMerchantStoreCode', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'installationId' => 'getInstallationId', + 'merchantAccountCode' => 'getMerchantAccountCode', + 'merchantStoreCode' => 'getMerchantStoreCode', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('installationId', $data ?? [], null); + $this->setIfExists('merchantAccountCode', $data ?? [], null); + $this->setIfExists('merchantStoreCode', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['installationId'] === null) { + $invalidProperties[] = "'installationId' can't be null"; + } + if ($this->container['merchantAccountCode'] === null) { + $invalidProperties[] = "'merchantAccountCode' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets installationId + * + * @return string + */ + public function getInstallationId() + { + return $this->container['installationId']; + } + + /** + * Sets installationId + * + * @param string $installationId The unique identifier of the Payments App instance. + * + * @return self + */ + public function setInstallationId($installationId) + { + $this->container['installationId'] = $installationId; + + return $this; + } + + /** + * Gets merchantAccountCode + * + * @return string + */ + public function getMerchantAccountCode() + { + return $this->container['merchantAccountCode']; + } + + /** + * Sets merchantAccountCode + * + * @param string $merchantAccountCode The account code associated with the Payments App instance. + * + * @return self + */ + public function setMerchantAccountCode($merchantAccountCode) + { + $this->container['merchantAccountCode'] = $merchantAccountCode; + + return $this; + } + + /** + * Gets merchantStoreCode + * + * @return string|null + */ + public function getMerchantStoreCode() + { + return $this->container['merchantStoreCode']; + } + + /** + * Sets merchantStoreCode + * + * @param string|null $merchantStoreCode The store code associated with the Payments App instance. + * + * @return self + */ + public function setMerchantStoreCode($merchantStoreCode) + { + $this->container['merchantStoreCode'] = $merchantStoreCode; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of the Payments App instance. + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/PaymentsApp/PaymentsAppResponse.php b/src/Adyen/Model/PaymentsApp/PaymentsAppResponse.php new file mode 100644 index 00000000..6f427cd2 --- /dev/null +++ b/src/Adyen/Model/PaymentsApp/PaymentsAppResponse.php @@ -0,0 +1,410 @@ + + */ +class PaymentsAppResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentsAppResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'paymentsApps' => '\Adyen\Model\PaymentsApp\PaymentsAppDto[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'paymentsApps' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'paymentsApps' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'paymentsApps' => 'paymentsApps' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'paymentsApps' => 'setPaymentsApps' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'paymentsApps' => 'getPaymentsApps' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('paymentsApps', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['paymentsApps'] === null) { + $invalidProperties[] = "'paymentsApps' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets paymentsApps + * + * @return \Adyen\Model\PaymentsApp\PaymentsAppDto[] + */ + public function getPaymentsApps() + { + return $this->container['paymentsApps']; + } + + /** + * Sets paymentsApps + * + * @param \Adyen\Model\PaymentsApp\PaymentsAppDto[] $paymentsApps List of Payments Apps. + * + * @return self + */ + public function setPaymentsApps($paymentsApps) + { + $this->container['paymentsApps'] = $paymentsApps; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/Modification.php b/src/Adyen/Model/TransferWebhooks/Modification.php index 41fadc1e..b91226ec 100644 --- a/src/Adyen/Model/TransferWebhooks/Modification.php +++ b/src/Adyen/Model/TransferWebhooks/Modification.php @@ -290,6 +290,7 @@ public function getModelName() public const STATUS_MISC_COST_PENDING = 'miscCostPending'; public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; + public const STATUS_PENDING_APPROVAL = 'pendingApproval'; public const STATUS_RECEIVED = 'received'; public const STATUS_REFUND_PENDING = 'refundPending'; public const STATUS_REFUND_REVERSAL_PENDING = 'refundReversalPending'; @@ -364,6 +365,7 @@ public function getStatusAllowableValues() self::STATUS_MISC_COST_PENDING, self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, + self::STATUS_PENDING_APPROVAL, self::STATUS_RECEIVED, self::STATUS_REFUND_PENDING, self::STATUS_REFUND_REVERSAL_PENDING, diff --git a/src/Adyen/Model/TransferWebhooks/TransferData.php b/src/Adyen/Model/TransferWebhooks/TransferData.php index cd7b1d90..86e6b45c 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferData.php +++ b/src/Adyen/Model/TransferWebhooks/TransferData.php @@ -416,6 +416,7 @@ public function getModelName() public const STATUS_MISC_COST_PENDING = 'miscCostPending'; public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; + public const STATUS_PENDING_APPROVAL = 'pendingApproval'; public const STATUS_RECEIVED = 'received'; public const STATUS_REFUND_PENDING = 'refundPending'; public const STATUS_REFUND_REVERSAL_PENDING = 'refundReversalPending'; @@ -444,6 +445,9 @@ public function getModelName() public const TYPE_CASH_OUT_FEE = 'cashOutFee'; public const TYPE_CASH_OUT_FUNDING = 'cashOutFunding'; public const TYPE_CASH_OUT_INSTRUCTION = 'cashOutInstruction'; + public const TYPE_CASHOUT_FEE = 'cashoutFee'; + public const TYPE_CASHOUT_FUNDING = 'cashoutFunding'; + public const TYPE_CASHOUT_REPAYMENT = 'cashoutRepayment'; public const TYPE_CHARGEBACK = 'chargeback'; public const TYPE_CHARGEBACK_CORRECTION = 'chargebackCorrection'; public const TYPE_CHARGEBACK_REVERSAL = 'chargebackReversal'; @@ -581,6 +585,7 @@ public function getStatusAllowableValues() self::STATUS_MISC_COST_PENDING, self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, + self::STATUS_PENDING_APPROVAL, self::STATUS_RECEIVED, self::STATUS_REFUND_PENDING, self::STATUS_REFUND_REVERSAL_PENDING, @@ -619,6 +624,9 @@ public function getTypeAllowableValues() self::TYPE_CASH_OUT_FEE, self::TYPE_CASH_OUT_FUNDING, self::TYPE_CASH_OUT_INSTRUCTION, + self::TYPE_CASHOUT_FEE, + self::TYPE_CASHOUT_FUNDING, + self::TYPE_CASHOUT_REPAYMENT, self::TYPE_CHARGEBACK, self::TYPE_CHARGEBACK_CORRECTION, self::TYPE_CHARGEBACK_REVERSAL, diff --git a/src/Adyen/Model/TransferWebhooks/TransferEvent.php b/src/Adyen/Model/TransferWebhooks/TransferEvent.php index cb733937..12d52e12 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferEvent.php +++ b/src/Adyen/Model/TransferWebhooks/TransferEvent.php @@ -380,6 +380,7 @@ public function getModelName() public const STATUS_MISC_COST_PENDING = 'miscCostPending'; public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; + public const STATUS_PENDING_APPROVAL = 'pendingApproval'; public const STATUS_RECEIVED = 'received'; public const STATUS_REFUND_PENDING = 'refundPending'; public const STATUS_REFUND_REVERSAL_PENDING = 'refundReversalPending'; @@ -484,6 +485,7 @@ public function getStatusAllowableValues() self::STATUS_MISC_COST_PENDING, self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, + self::STATUS_PENDING_APPROVAL, self::STATUS_RECEIVED, self::STATUS_REFUND_PENDING, self::STATUS_REFUND_REVERSAL_PENDING, diff --git a/src/Adyen/Model/Transfers/Modification.php b/src/Adyen/Model/Transfers/Modification.php index 4ff147d0..21d73423 100644 --- a/src/Adyen/Model/Transfers/Modification.php +++ b/src/Adyen/Model/Transfers/Modification.php @@ -290,6 +290,7 @@ public function getModelName() public const STATUS_MISC_COST_PENDING = 'miscCostPending'; public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; + public const STATUS_PENDING_APPROVAL = 'pendingApproval'; public const STATUS_RECEIVED = 'received'; public const STATUS_REFUND_PENDING = 'refundPending'; public const STATUS_REFUND_REVERSAL_PENDING = 'refundReversalPending'; @@ -364,6 +365,7 @@ public function getStatusAllowableValues() self::STATUS_MISC_COST_PENDING, self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, + self::STATUS_PENDING_APPROVAL, self::STATUS_RECEIVED, self::STATUS_REFUND_PENDING, self::STATUS_REFUND_REVERSAL_PENDING, diff --git a/src/Adyen/Model/Transfers/Transfer.php b/src/Adyen/Model/Transfers/Transfer.php index d2700198..d7be15bc 100644 --- a/src/Adyen/Model/Transfers/Transfer.php +++ b/src/Adyen/Model/Transfers/Transfer.php @@ -380,6 +380,7 @@ public function getModelName() public const STATUS_MISC_COST_PENDING = 'miscCostPending'; public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; + public const STATUS_PENDING_APPROVAL = 'pendingApproval'; public const STATUS_RECEIVED = 'received'; public const STATUS_REFUND_PENDING = 'refundPending'; public const STATUS_REFUND_REVERSAL_PENDING = 'refundReversalPending'; @@ -408,6 +409,9 @@ public function getModelName() public const TYPE_CASH_OUT_FEE = 'cashOutFee'; public const TYPE_CASH_OUT_FUNDING = 'cashOutFunding'; public const TYPE_CASH_OUT_INSTRUCTION = 'cashOutInstruction'; + public const TYPE_CASHOUT_FEE = 'cashoutFee'; + public const TYPE_CASHOUT_FUNDING = 'cashoutFunding'; + public const TYPE_CASHOUT_REPAYMENT = 'cashoutRepayment'; public const TYPE_CHARGEBACK = 'chargeback'; public const TYPE_CHARGEBACK_CORRECTION = 'chargebackCorrection'; public const TYPE_CHARGEBACK_REVERSAL = 'chargebackReversal'; @@ -545,6 +549,7 @@ public function getStatusAllowableValues() self::STATUS_MISC_COST_PENDING, self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, + self::STATUS_PENDING_APPROVAL, self::STATUS_RECEIVED, self::STATUS_REFUND_PENDING, self::STATUS_REFUND_REVERSAL_PENDING, @@ -583,6 +588,9 @@ public function getTypeAllowableValues() self::TYPE_CASH_OUT_FEE, self::TYPE_CASH_OUT_FUNDING, self::TYPE_CASH_OUT_INSTRUCTION, + self::TYPE_CASHOUT_FEE, + self::TYPE_CASHOUT_FUNDING, + self::TYPE_CASHOUT_REPAYMENT, self::TYPE_CHARGEBACK, self::TYPE_CHARGEBACK_CORRECTION, self::TYPE_CHARGEBACK_REVERSAL, diff --git a/src/Adyen/Model/Transfers/TransferData.php b/src/Adyen/Model/Transfers/TransferData.php index 6bb6ca8d..83e464ca 100644 --- a/src/Adyen/Model/Transfers/TransferData.php +++ b/src/Adyen/Model/Transfers/TransferData.php @@ -416,6 +416,7 @@ public function getModelName() public const STATUS_MISC_COST_PENDING = 'miscCostPending'; public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; + public const STATUS_PENDING_APPROVAL = 'pendingApproval'; public const STATUS_RECEIVED = 'received'; public const STATUS_REFUND_PENDING = 'refundPending'; public const STATUS_REFUND_REVERSAL_PENDING = 'refundReversalPending'; @@ -444,6 +445,9 @@ public function getModelName() public const TYPE_CASH_OUT_FEE = 'cashOutFee'; public const TYPE_CASH_OUT_FUNDING = 'cashOutFunding'; public const TYPE_CASH_OUT_INSTRUCTION = 'cashOutInstruction'; + public const TYPE_CASHOUT_FEE = 'cashoutFee'; + public const TYPE_CASHOUT_FUNDING = 'cashoutFunding'; + public const TYPE_CASHOUT_REPAYMENT = 'cashoutRepayment'; public const TYPE_CHARGEBACK = 'chargeback'; public const TYPE_CHARGEBACK_CORRECTION = 'chargebackCorrection'; public const TYPE_CHARGEBACK_REVERSAL = 'chargebackReversal'; @@ -581,6 +585,7 @@ public function getStatusAllowableValues() self::STATUS_MISC_COST_PENDING, self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, + self::STATUS_PENDING_APPROVAL, self::STATUS_RECEIVED, self::STATUS_REFUND_PENDING, self::STATUS_REFUND_REVERSAL_PENDING, @@ -619,6 +624,9 @@ public function getTypeAllowableValues() self::TYPE_CASH_OUT_FEE, self::TYPE_CASH_OUT_FUNDING, self::TYPE_CASH_OUT_INSTRUCTION, + self::TYPE_CASHOUT_FEE, + self::TYPE_CASHOUT_FUNDING, + self::TYPE_CASHOUT_REPAYMENT, self::TYPE_CHARGEBACK, self::TYPE_CHARGEBACK_CORRECTION, self::TYPE_CHARGEBACK_REVERSAL, diff --git a/src/Adyen/Model/Transfers/TransferEvent.php b/src/Adyen/Model/Transfers/TransferEvent.php index 99daa1c7..f2a140d4 100644 --- a/src/Adyen/Model/Transfers/TransferEvent.php +++ b/src/Adyen/Model/Transfers/TransferEvent.php @@ -380,6 +380,7 @@ public function getModelName() public const STATUS_MISC_COST_PENDING = 'miscCostPending'; public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; + public const STATUS_PENDING_APPROVAL = 'pendingApproval'; public const STATUS_RECEIVED = 'received'; public const STATUS_REFUND_PENDING = 'refundPending'; public const STATUS_REFUND_REVERSAL_PENDING = 'refundReversalPending'; @@ -484,6 +485,7 @@ public function getStatusAllowableValues() self::STATUS_MISC_COST_PENDING, self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, + self::STATUS_PENDING_APPROVAL, self::STATUS_RECEIVED, self::STATUS_REFUND_PENDING, self::STATUS_REFUND_REVERSAL_PENDING, diff --git a/src/Adyen/Service/PaymentsApp/PaymentsAppApi.php b/src/Adyen/Service/PaymentsApp/PaymentsAppApi.php new file mode 100644 index 00000000..a8a29a91 --- /dev/null +++ b/src/Adyen/Service/PaymentsApp/PaymentsAppApi.php @@ -0,0 +1,120 @@ +baseURL = $this->createBaseUrl("https://management-live.adyen.com/v1"); + } + + /** + * Create a boarding token - merchant level + * + * @param string $merchantId + * @param \Adyen\Model\PaymentsApp\BoardingTokenRequest $boardingTokenRequest + * @param array|null $requestOptions + * @return \Adyen\Model\PaymentsApp\BoardingTokenResponse + * @throws AdyenException + */ + public function generatePaymentsAppBoardingTokenForMerchant(string $merchantId, \Adyen\Model\PaymentsApp\BoardingTokenRequest $boardingTokenRequest, array $requestOptions = null): \Adyen\Model\PaymentsApp\BoardingTokenResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/generatePaymentsAppBoardingToken"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $boardingTokenRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\PaymentsApp\BoardingTokenResponse::class); + } + + /** + * Create a boarding token - store level + * + * @param string $merchantId + * @param string $storeId + * @param \Adyen\Model\PaymentsApp\BoardingTokenRequest $boardingTokenRequest + * @param array|null $requestOptions + * @return \Adyen\Model\PaymentsApp\BoardingTokenResponse + * @throws AdyenException + */ + public function generatePaymentsAppBoardingTokenForStore(string $merchantId, string $storeId, \Adyen\Model\PaymentsApp\BoardingTokenRequest $boardingTokenRequest, array $requestOptions = null): \Adyen\Model\PaymentsApp\BoardingTokenResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{storeId}'], [$merchantId, $storeId], "/merchants/{merchantId}/stores/{storeId}/generatePaymentsAppBoardingToken"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $boardingTokenRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\PaymentsApp\BoardingTokenResponse::class); + } + + /** + * Get a list of Payments Apps - merchant level + * + * @param string $merchantId + * @param array|null $requestOptions ['queryParams' => ['statuses'=> string, 'limit'=> int, 'offset'=> int]] + * @return \Adyen\Model\PaymentsApp\PaymentsAppResponse + * @throws AdyenException + */ + public function listPaymentsAppForMerchant(string $merchantId, array $requestOptions = null): \Adyen\Model\PaymentsApp\PaymentsAppResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/paymentsApps"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\PaymentsApp\PaymentsAppResponse::class); + } + + /** + * Get a list of Payments Apps - store level + * + * @param string $merchantId + * @param string $storeId + * @param array|null $requestOptions ['queryParams' => ['statuses'=> string, 'limit'=> int, 'offset'=> int]] + * @return \Adyen\Model\PaymentsApp\PaymentsAppResponse + * @throws AdyenException + */ + public function listPaymentsAppForStore(string $merchantId, string $storeId, array $requestOptions = null): \Adyen\Model\PaymentsApp\PaymentsAppResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{storeId}'], [$merchantId, $storeId], "/merchants/{merchantId}/stores/{storeId}/paymentsApps"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\PaymentsApp\PaymentsAppResponse::class); + } + + /** + * Revoke Payments App instance authentication + * + * @param string $merchantId + * @param string $installationId + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function revokePaymentsApp(string $merchantId, string $installationId, array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{installationId}'], [$merchantId, $installationId], "/merchants/{merchantId}/paymentsApps/{installationId}/revoke"); + $this->requestHttp($endpoint, strtolower('POST'), null, $requestOptions); + } +}