From 6346207da94f96e9eb5cce76adc9ff5a41790e02 Mon Sep 17 00:00:00 2001 From: Adyen Automation Date: Thu, 16 May 2024 07:37:00 +0000 Subject: [PATCH 1/3] [reformat][adyen-sdk-automation] automated change --- .../Model/AcsWebhooks/ObjectSerializer.php | 9 +- .../Model/BalanceControl/ObjectSerializer.php | 9 +- .../AULocalAccountIdentification.php | 41 - .../Model/BalancePlatform/AccountHolder.php | 8 +- .../BalancePlatform/AccountHolderInfo.php | 4 +- .../AccountHolderUpdateRequest.php | 8 +- .../BRLocalAccountIdentification.php | 39 +- src/Adyen/Model/BalancePlatform/Balance.php | 8 +- .../BalanceAccountUpdateRequest.php | 6 +- .../Model/BalancePlatform/BalancePlatform.php | 2 +- .../BankAccountAccountIdentification.php | 75 +- .../BalancePlatform/BankAccountDetails.php | 617 ++++++++++++ ...ValidationRequestAccountIdentification.php | 75 +- .../BalancePlatform/BankAccountModel.php | 15 +- .../BalancePlatform/BankIdentification.php | 4 +- .../CALocalAccountIdentification.php | 41 - .../CZLocalAccountIdentification.php | 41 - .../BalancePlatform/CapabilitySettings.php | 8 +- .../Model/BalancePlatform/Counterparty.php | 2 +- .../CreateSweepConfigurationV2.php | 72 +- .../DKLocalAccountIdentification.php | 41 - .../DelegatedAuthenticationData.php | 413 ++++++++ .../Model/BalancePlatform/DeliveryAddress.php | 8 +- .../Model/BalancePlatform/DeliveryContact.php | 34 + src/Adyen/Model/BalancePlatform/Device.php | 547 +++++++++++ .../HKLocalAccountIdentification.php | 41 - .../HULocalAccountIdentification.php | 41 - src/Adyen/Model/BalancePlatform/Href.php | 410 ++++++++ .../IbanAccountIdentification.php | 41 - src/Adyen/Model/BalancePlatform/Link.php | 546 +++++++++++ .../NOLocalAccountIdentification.php | 41 - .../NZLocalAccountIdentification.php | 41 - .../NumberAndBicAccountIdentification.php | 41 - .../BalancePlatform/ObjectSerializer.php | 9 +- .../PLLocalAccountIdentification.php | 41 - .../BalancePlatform/PaymentInstrument.php | 8 +- ...itionalBankAccountIdentificationsInner.php | 41 - .../PaymentInstrumentGroup.php | 4 +- .../PaymentInstrumentGroupInfo.php | 4 +- .../PlatformPaymentConfiguration.php | 4 +- .../RegisterSCAFinalResponse.php | 410 ++++++++ .../BalancePlatform/RegisterSCARequest.php | 450 +++++++++ .../BalancePlatform/RegisterSCAResponse.php | 512 ++++++++++ .../Model/BalancePlatform/RiskScores.php | 440 +++++++++ .../BalancePlatform/RiskScoresRestriction.php | 447 +++++++++ .../SELocalAccountIdentification.php | 41 - .../SGLocalAccountIdentification.php | 41 - .../SearchRegisteredDevicesResponse.php | 508 ++++++++++ .../BalancePlatform/SweepConfigurationV2.php | 72 +- .../BalancePlatform/SweepCounterparty.php | 2 +- .../Model/BalancePlatform/TransactionRule.php | 6 +- .../BalancePlatform/TransactionRuleInfo.php | 6 +- .../TransactionRuleInterval.php | 2 +- .../TransactionRuleRestrictions.php | 34 + .../UKLocalAccountIdentification.php | 41 - .../USLocalAccountIdentification.php | 41 - .../UpdatePaymentInstrument.php | 8 +- .../UpdateSweepConfigurationV2.php | 72 +- .../Model/BinLookup/ObjectSerializer.php | 9 +- .../Model/Checkout/CheckoutPaymentMethod.php | 4 +- src/Adyen/Model/Checkout/MbwayDetails.php | 4 +- src/Adyen/Model/Checkout/ObjectSerializer.php | 9 +- src/Adyen/Model/Checkout/VippsDetails.php | 2 +- .../ConfigurationWebhooks/AccountHolder.php | 16 +- .../AccountHolderCapability.php | 2 +- .../AccountHolderNotificationData.php | 2 +- .../AccountHolderNotificationRequest.php | 2 +- .../AccountSupportingEntityCapability.php | 2 +- .../Model/ConfigurationWebhooks/Address.php | 2 +- .../Model/ConfigurationWebhooks/Amount.php | 2 +- .../ConfigurationWebhooks/Authentication.php | 2 +- .../Model/ConfigurationWebhooks/Balance.php | 10 +- .../ConfigurationWebhooks/BalanceAccount.php | 46 +- .../BalanceAccountNotificationData.php | 2 +- .../BalanceAccountNotificationRequest.php | 2 +- .../BalancePlatformNotificationResponse.php | 2 +- .../BankAccountDetails.php | 617 ++++++++++++ .../ConfigurationWebhooks/BulkAddress.php | 2 +- .../CapabilityProblem.php | 2 +- .../CapabilityProblemEntity.php | 2 +- .../CapabilityProblemEntityRecursive.php | 2 +- .../CapabilitySettings.php | 10 +- .../Model/ConfigurationWebhooks/Card.php | 8 +- .../CardConfiguration.php | 2 +- .../ConfigurationWebhooks/CardOrderItem.php | 2 +- .../CardOrderItemDeliveryStatus.php | 2 +- .../CardOrderNotificationRequest.php | 2 +- .../ConfigurationWebhooks/ContactDetails.php | 2 +- .../ConfigurationWebhooks/DeliveryAddress.php | 617 ++++++++++++ .../ConfigurationWebhooks/DeliveryContact.php | 620 ++++++++++++ .../Model/ConfigurationWebhooks/Expiry.php | 2 +- .../IbanAccountIdentification.php | 43 +- .../ConfigurationWebhooks/ModelInterface.php | 2 +- .../Model/ConfigurationWebhooks/Name.php | 2 +- .../ObjectSerializer.php | 11 +- .../PaymentInstrument.php | 111 ++- ...itionalBankAccountIdentificationsInner.php | 43 +- .../PaymentInstrumentNotificationData.php | 2 +- .../PaymentNotificationRequest.php | 2 +- .../Model/ConfigurationWebhooks/Phone.php | 6 +- .../ConfigurationWebhooks/PhoneNumber.php | 2 +- .../PlatformPaymentConfiguration.php | 6 +- .../RemediatingAction.php | 2 +- .../Model/ConfigurationWebhooks/Resource.php | 2 +- .../SweepConfigurationNotificationData.php | 2 +- .../SweepConfigurationNotificationRequest.php | 2 +- .../SweepConfigurationV2.php | 206 +++- .../SweepCounterparty.php | 4 +- .../ConfigurationWebhooks/SweepSchedule.php | 2 +- .../VerificationDeadline.php | 2 +- .../VerificationError.php | 2 +- .../VerificationErrorRecursive.php | 2 +- .../Model/DataProtection/ObjectSerializer.php | 9 +- src/Adyen/Model/Disputes/ObjectSerializer.php | 9 +- .../IdentificationData.php | 8 +- .../ObjectSerializer.php | 9 +- .../OnboardingLinkInfo.php | 6 +- .../OnboardingLinkSettings.php | 884 ++++++++++++++++++ .../SoleProprietorship.php | 75 +- .../Model/LegalEntityManagement/Trust.php | 75 +- src/Adyen/Model/Management/AmexInfo.php | 6 +- .../Model/Management/ObjectSerializer.php | 9 +- .../Model/Management/TerminalSettings.php | 11 +- src/Adyen/Model/Management/TestOutput.php | 4 +- src/Adyen/Model/Management/Webhook.php | 2 +- .../ManagementWebhooks/ObjectSerializer.php | 9 +- .../TerminalSettingsData.php | 619 ++++++++++++ .../TerminalSettingsNotificationRequest.php | 555 +++++++++++ .../TerminalSettingsNotificationResponse.php | 410 ++++++++ .../ObjectSerializer.php | 9 +- src/Adyen/Model/Payments/FundDestination.php | 46 +- src/Adyen/Model/Payments/ObjectSerializer.php | 9 +- src/Adyen/Model/Payout/ObjectSerializer.php | 9 +- .../Model/PosMobile/CreateSessionRequest.php | 484 ++++++++++ .../Model/PosMobile/CreateSessionResponse.php | 546 +++++++++++ src/Adyen/Model/PosMobile/ModelInterface.php | 92 ++ .../Model/PosMobile/ObjectSerializer.php | 316 +++++++ .../Model/Recurring/ObjectSerializer.php | 9 +- .../Model/ReportWebhooks/ObjectSerializer.php | 9 +- .../Model/StoredValue/ObjectSerializer.php | 9 +- .../TransactionWebhooks/ObjectSerializer.php | 9 +- .../AULocalAccountIdentification.php | 41 - src/Adyen/Model/TransferWebhooks/Address.php | 10 +- .../BRLocalAccountIdentification.php | 39 +- .../BankAccountV3AccountIdentification.php | 75 +- .../CALocalAccountIdentification.php | 41 - .../CZLocalAccountIdentification.php | 41 - .../ConfirmationTrackingData.php | 512 ++++++++++ .../Model/TransferWebhooks/CounterpartyV3.php | 4 +- .../DKLocalAccountIdentification.php | 41 - .../EstimationTrackingData.php | 481 ++++++++++ .../Model/TransferWebhooks/ExternalReason.php | 478 ++++++++++ .../HKLocalAccountIdentification.php | 41 - .../HULocalAccountIdentification.php | 41 - .../IbanAccountIdentification.php | 41 - .../InternalReviewTrackingData.php | 579 ++++++++++++ .../NOLocalAccountIdentification.php | 41 - .../NZLocalAccountIdentification.php | 41 - .../NumberAndBicAccountIdentification.php | 41 - .../TransferWebhooks/ObjectSerializer.php | 9 +- .../PLLocalAccountIdentification.php | 41 - .../TransferWebhooks/PartyIdentification.php | 6 +- .../SELocalAccountIdentification.php | 41 - .../SGLocalAccountIdentification.php | 41 - .../Model/TransferWebhooks/TransferData.php | 10 +- .../TransferWebhooks/TransferDataTracking.php | 524 +++++++++++ .../Model/TransferWebhooks/TransferEvent.php | 72 ++ .../TransferEventTrackingData.php | 524 +++++++++++ .../TransferNotificationCounterParty.php | 4 +- .../UKLocalAccountIdentification.php | 41 - .../USLocalAccountIdentification.php | 41 - .../AULocalAccountIdentification.php | 41 - src/Adyen/Model/Transfers/Address.php | 10 +- .../BRLocalAccountIdentification.php | 39 +- .../BankAccountV3AccountIdentification.php | 75 +- .../CALocalAccountIdentification.php | 41 - .../CZLocalAccountIdentification.php | 41 - .../Transfers/ConfirmationTrackingData.php | 512 ++++++++++ .../Model/Transfers/CounterpartyInfoV3.php | 4 +- src/Adyen/Model/Transfers/CounterpartyV3.php | 4 +- .../DKLocalAccountIdentification.php | 41 - .../Transfers/EstimationTrackingData.php | 481 ++++++++++ src/Adyen/Model/Transfers/ExternalReason.php | 478 ++++++++++ .../HKLocalAccountIdentification.php | 41 - .../HULocalAccountIdentification.php | 41 - .../Transfers/IbanAccountIdentification.php | 41 - .../Transfers/InternalReviewTrackingData.php | 579 ++++++++++++ .../NOLocalAccountIdentification.php | 41 - .../NZLocalAccountIdentification.php | 41 - .../NumberAndBicAccountIdentification.php | 41 - .../Model/Transfers/ObjectSerializer.php | 9 +- .../PLLocalAccountIdentification.php | 41 - .../Model/Transfers/PartyIdentification.php | 6 +- .../SELocalAccountIdentification.php | 41 - .../SGLocalAccountIdentification.php | 41 - src/Adyen/Model/Transfers/Transaction.php | 102 ++ src/Adyen/Model/Transfers/Transfer.php | 4 + src/Adyen/Model/Transfers/TransferData.php | 10 +- .../Model/Transfers/TransferDataTracking.php | 524 +++++++++++ src/Adyen/Model/Transfers/TransferEvent.php | 72 ++ .../Transfers/TransferEventTrackingData.php | 524 +++++++++++ .../TransferNotificationCounterParty.php | 4 +- src/Adyen/Model/Transfers/TransferView.php | 34 + .../UKLocalAccountIdentification.php | 41 - .../USLocalAccountIdentification.php | 41 - .../Transfers/UltimatePartyIdentification.php | 6 +- .../BalancePlatform/BalanceAccountsApi.php | 3 +- .../BankAccountValidationApi.php | 3 +- .../BalancePlatform/ManageSCADevicesApi.php | 101 ++ .../BalancePlatform/NetworkTokensApi.php | 3 +- src/Adyen/Service/Checkout/RecurringApi.php | 3 +- .../BusinessLinesApi.php | 3 +- .../LegalEntityManagement/DocumentsApi.php | 3 +- .../TransferInstrumentsApi.php | 3 +- .../AllowedOriginsCompanyLevelApi.php | 3 +- .../AllowedOriginsMerchantLevelApi.php | 3 +- .../Service/Management/MyAPICredentialApi.php | 3 +- .../PaymentMethodsMerchantLevelApi.php | 3 +- .../PayoutSettingsMerchantLevelApi.php | 3 +- .../Management/TerminalsTerminalLevelApi.php | 3 +- .../Management/WebhooksCompanyLevelApi.php | 3 +- .../Management/WebhooksMerchantLevelApi.php | 3 +- src/Adyen/Service/PosMobileApi.php | 56 ++ 223 files changed, 18900 insertions(+), 2624 deletions(-) create mode 100644 src/Adyen/Model/BalancePlatform/BankAccountDetails.php create mode 100644 src/Adyen/Model/BalancePlatform/DelegatedAuthenticationData.php create mode 100644 src/Adyen/Model/BalancePlatform/Device.php create mode 100644 src/Adyen/Model/BalancePlatform/Href.php create mode 100644 src/Adyen/Model/BalancePlatform/Link.php create mode 100644 src/Adyen/Model/BalancePlatform/RegisterSCAFinalResponse.php create mode 100644 src/Adyen/Model/BalancePlatform/RegisterSCARequest.php create mode 100644 src/Adyen/Model/BalancePlatform/RegisterSCAResponse.php create mode 100644 src/Adyen/Model/BalancePlatform/RiskScores.php create mode 100644 src/Adyen/Model/BalancePlatform/RiskScoresRestriction.php create mode 100644 src/Adyen/Model/BalancePlatform/SearchRegisteredDevicesResponse.php create mode 100644 src/Adyen/Model/ConfigurationWebhooks/BankAccountDetails.php create mode 100644 src/Adyen/Model/ConfigurationWebhooks/DeliveryAddress.php create mode 100644 src/Adyen/Model/ConfigurationWebhooks/DeliveryContact.php create mode 100644 src/Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.php create mode 100644 src/Adyen/Model/ManagementWebhooks/TerminalSettingsData.php create mode 100644 src/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.php create mode 100644 src/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.php create mode 100644 src/Adyen/Model/PosMobile/CreateSessionRequest.php create mode 100644 src/Adyen/Model/PosMobile/CreateSessionResponse.php create mode 100644 src/Adyen/Model/PosMobile/ModelInterface.php create mode 100644 src/Adyen/Model/PosMobile/ObjectSerializer.php create mode 100644 src/Adyen/Model/TransferWebhooks/ConfirmationTrackingData.php create mode 100644 src/Adyen/Model/TransferWebhooks/EstimationTrackingData.php create mode 100644 src/Adyen/Model/TransferWebhooks/ExternalReason.php create mode 100644 src/Adyen/Model/TransferWebhooks/InternalReviewTrackingData.php create mode 100644 src/Adyen/Model/TransferWebhooks/TransferDataTracking.php create mode 100644 src/Adyen/Model/TransferWebhooks/TransferEventTrackingData.php create mode 100644 src/Adyen/Model/Transfers/ConfirmationTrackingData.php create mode 100644 src/Adyen/Model/Transfers/EstimationTrackingData.php create mode 100644 src/Adyen/Model/Transfers/ExternalReason.php create mode 100644 src/Adyen/Model/Transfers/InternalReviewTrackingData.php create mode 100644 src/Adyen/Model/Transfers/TransferDataTracking.php create mode 100644 src/Adyen/Model/Transfers/TransferEventTrackingData.php create mode 100644 src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php create mode 100644 src/Adyen/Service/PosMobileApi.php diff --git a/src/Adyen/Model/AcsWebhooks/ObjectSerializer.php b/src/Adyen/Model/AcsWebhooks/ObjectSerializer.php index 755ed1ce8..e14421342 100644 --- a/src/Adyen/Model/AcsWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/AcsWebhooks/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/BalanceControl/ObjectSerializer.php b/src/Adyen/Model/BalanceControl/ObjectSerializer.php index b5ae3313d..2ed0eb3a0 100644 --- a/src/Adyen/Model/BalanceControl/ObjectSerializer.php +++ b/src/Adyen/Model/BalanceControl/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php index d9e4c3779..7551f02ce 100644 --- a/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php @@ -46,7 +46,6 @@ class AULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'bsbCode' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -60,7 +59,6 @@ class AULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'bsbCode' => null, - 'formFactor' => null, 'type' => null ]; @@ -72,7 +70,6 @@ class AULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'bsbCode' => false, - 'formFactor' => true, 'type' => false ]; @@ -164,7 +161,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'bsbCode' => 'bsbCode', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -176,7 +172,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'bsbCode' => 'setBsbCode', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -188,7 +183,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'bsbCode' => 'getBsbCode', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -263,7 +257,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bsbCode', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -381,40 +374,6 @@ public function setBsbCode($bsbCode) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/BalancePlatform/AccountHolder.php b/src/Adyen/Model/BalancePlatform/AccountHolder.php index 0172fe516..344d0582c 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolder.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolder.php @@ -289,7 +289,6 @@ public function getModelName() public const STATUS_ACTIVE = 'active'; public const STATUS_CLOSED = 'closed'; - public const STATUS_INACTIVE = 'inactive'; public const STATUS_SUSPENDED = 'suspended'; /** @@ -302,7 +301,6 @@ public function getStatusAllowableValues() return [ self::STATUS_ACTIVE, self::STATUS_CLOSED, - self::STATUS_INACTIVE, self::STATUS_SUSPENDED, ]; } @@ -487,7 +485,7 @@ public function getDescription() /** * Sets description * - * @param string|null $description Your description for the account holder, maximum 300 characters. + * @param string|null $description Your description for the account holder. * * @return self */ @@ -649,7 +647,7 @@ public function getReference() /** * Sets reference * - * @param string|null $reference Your reference for the account holder, maximum 150 characters. + * @param string|null $reference Your reference for the account holder. * * @return self */ @@ -676,7 +674,7 @@ public function getStatus() /** * Sets status * - * @param string|null $status The status of the account holder. Possible values: * **active**: The account holder is active. This is the default status when creating an account holder. * **inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **closed**: The account holder is permanently deactivated by you. This action cannot be undone. + * @param string|null $status The status of the account holder. Possible values: * **active**: The account holder is active. This is the default status when creating an account holder. * **suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **closed**: The account holder is permanently deactivated by you. This action cannot be undone. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php b/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php index 26f75ae49..e8b2a6f0a 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php @@ -429,7 +429,7 @@ public function getDescription() /** * Sets description * - * @param string|null $description Your description for the account holder, maximum 300 characters. + * @param string|null $description Your description for the account holder. * * @return self */ @@ -537,7 +537,7 @@ public function getReference() /** * Sets reference * - * @param string|null $reference Your reference for the account holder, maximum 150 characters. + * @param string|null $reference Your reference for the account holder. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/AccountHolderUpdateRequest.php b/src/Adyen/Model/BalancePlatform/AccountHolderUpdateRequest.php index 391f66711..c65d306d5 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolderUpdateRequest.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolderUpdateRequest.php @@ -277,7 +277,6 @@ public function getModelName() public const STATUS_ACTIVE = 'active'; public const STATUS_CLOSED = 'closed'; - public const STATUS_INACTIVE = 'inactive'; public const STATUS_SUSPENDED = 'suspended'; /** @@ -290,7 +289,6 @@ public function getStatusAllowableValues() return [ self::STATUS_ACTIVE, self::STATUS_CLOSED, - self::STATUS_INACTIVE, self::STATUS_SUSPENDED, ]; } @@ -467,7 +465,7 @@ public function getDescription() /** * Sets description * - * @param string|null $description Your description for the account holder, maximum 300 characters. + * @param string|null $description Your description for the account holder. * * @return self */ @@ -575,7 +573,7 @@ public function getReference() /** * Sets reference * - * @param string|null $reference Your reference for the account holder, maximum 150 characters. + * @param string|null $reference Your reference for the account holder. * * @return self */ @@ -602,7 +600,7 @@ public function getStatus() /** * Sets status * - * @param string|null $status The status of the account holder. Possible values: * **active**: The account holder is active. This is the default status when creating an account holder. * **inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **closed**: The account holder is permanently deactivated by you. This action cannot be undone. + * @param string|null $status The status of the account holder. Possible values: * **active**: The account holder is active. This is the default status when creating an account holder. * **suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **closed**: The account holder is permanently deactivated by you. This action cannot be undone. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/BRLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/BRLocalAccountIdentification.php index b531ed80f..6150e14c1 100644 --- a/src/Adyen/Model/BalancePlatform/BRLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/BRLocalAccountIdentification.php @@ -47,7 +47,7 @@ class BRLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json 'accountNumber' => 'string', 'bankCode' => 'string', 'branchNumber' => 'string', - 'formFactor' => 'string', + 'ispb' => 'string', 'type' => 'string' ]; @@ -62,7 +62,7 @@ class BRLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json 'accountNumber' => null, 'bankCode' => null, 'branchNumber' => null, - 'formFactor' => null, + 'ispb' => null, 'type' => null ]; @@ -75,7 +75,7 @@ class BRLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json 'accountNumber' => false, 'bankCode' => false, 'branchNumber' => false, - 'formFactor' => true, + 'ispb' => false, 'type' => false ]; @@ -168,7 +168,7 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'accountNumber', 'bankCode' => 'bankCode', 'branchNumber' => 'branchNumber', - 'formFactor' => 'formFactor', + 'ispb' => 'ispb', 'type' => 'type' ]; @@ -181,7 +181,7 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'setAccountNumber', 'bankCode' => 'setBankCode', 'branchNumber' => 'setBranchNumber', - 'formFactor' => 'setFormFactor', + 'ispb' => 'setIspb', 'type' => 'setType' ]; @@ -194,7 +194,7 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'getAccountNumber', 'bankCode' => 'getBankCode', 'branchNumber' => 'getBranchNumber', - 'formFactor' => 'getFormFactor', + 'ispb' => 'getIspb', 'type' => 'getType' ]; @@ -270,7 +270,7 @@ public function __construct(array $data = null) $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bankCode', $data ?? [], null); $this->setIfExists('branchNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); + $this->setIfExists('ispb', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -419,35 +419,28 @@ public function setBranchNumber($branchNumber) } /** - * Gets formFactor + * Gets ispb * * @return string|null */ - public function getFormFactor() + public function getIspb() { - return $this->container['formFactor']; + return $this->container['ispb']; } /** - * Sets formFactor + * Sets ispb * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. + * @param string|null $ispb The 8-digit ISPB, with leading zeros. * * @return self */ - public function setFormFactor($formFactor) + public function setIspb($ispb) { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } + if (is_null($ispb)) { + throw new \InvalidArgumentException('non-nullable ispb cannot be null'); } - $this->container['formFactor'] = $formFactor; + $this->container['ispb'] = $ispb; return $this; } diff --git a/src/Adyen/Model/BalancePlatform/Balance.php b/src/Adyen/Model/BalancePlatform/Balance.php index 062479a5f..c9493008f 100644 --- a/src/Adyen/Model/BalancePlatform/Balance.php +++ b/src/Adyen/Model/BalancePlatform/Balance.php @@ -329,7 +329,7 @@ public function getAvailable() /** * Sets available * - * @param int $available The remaining amount available for spending. + * @param int $available The current balance minus any reserved balance. * * @return self */ @@ -356,7 +356,7 @@ public function getBalance() /** * Sets balance * - * @param int $balance The total amount in the balance. + * @param int $balance The current balance of funds in the balance account. These are the funds from all transactions with a value date in the past that have not yet been paid out. * * @return self */ @@ -410,7 +410,7 @@ public function getPending() /** * Sets pending * - * @param int|null $pending The amount pending to be paid out but not yet available in the balance. + * @param int|null $pending The amount of funds that Adyen has processed for this account, but will be settled in a future date. For more information, see how to settle funds for users in your [platform](https://docs.adyen.com/platforms/settle-funds) and [marketplace](https://docs.adyen.com/marketplaces/settle-funds). * * @return self */ @@ -437,7 +437,7 @@ public function getReserved() /** * Sets reserved * - * @param int $reserved The amount reserved for payments that have been authorised, but have not been captured yet. + * @param int $reserved The amount reserved for payments that have been [authorised](https://docs.adyen.com/issuing/payment-stages/#authorised), but not yet [captured](https://docs.adyen.com/issuing/payment-stages/#captured) by the merchant. Applies only to [Adyen-issued cards](https://docs.adyen.com/issuing). * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php b/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php index b0665f09e..6ab92cae5 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php @@ -385,7 +385,7 @@ public function getDescription() /** * Sets description * - * @param string|null $description A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. + * @param string|null $description A human-readable description of the balance account. You can use this parameter to distinguish between multiple balance accounts under an account holder. * * @return self */ @@ -466,7 +466,7 @@ public function getReference() /** * Sets reference * - * @param string|null $reference Your reference to the balance account, maximum 150 characters. + * @param string|null $reference Your reference to the balance account. * * @return self */ @@ -493,7 +493,7 @@ public function getStatus() /** * Sets status * - * @param string|null $status The status of the balance account. Payment instruments linked to the balance account can only be used if the balance account status is **active**. Possible values: **active**, **inactive**, **closed**, **suspended**. + * @param string|null $status The status of the balance account. Payment instruments linked to the balance account can only be used if the balance account status is **active**. Possible values: **active**, **closed**, **suspended**. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/BalancePlatform.php b/src/Adyen/Model/BalancePlatform/BalancePlatform.php index 4c7ba064c..c04fcd7a4 100644 --- a/src/Adyen/Model/BalancePlatform/BalancePlatform.php +++ b/src/Adyen/Model/BalancePlatform/BalancePlatform.php @@ -306,7 +306,7 @@ public function getDescription() /** * Sets description * - * @param string|null $description Your description of the balance platform, maximum 300 characters. + * @param string|null $description Your description of the balance platform. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/BankAccountAccountIdentification.php b/src/Adyen/Model/BalancePlatform/BankAccountAccountIdentification.php index 776faef0d..7a41e6dec 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountAccountIdentification.php @@ -47,10 +47,10 @@ class BankAccountAccountIdentification implements ModelInterface, ArrayAccess, \ protected static $openAPITypes = [ 'accountNumber' => 'string', 'bsbCode' => 'string', - 'formFactor' => 'string', 'type' => 'string', 'bankCode' => 'string', 'branchNumber' => 'string', + 'ispb' => 'string', 'accountType' => 'string', 'institutionNumber' => 'string', 'transitNumber' => 'string', @@ -73,10 +73,10 @@ class BankAccountAccountIdentification implements ModelInterface, ArrayAccess, \ protected static $openAPIFormats = [ 'accountNumber' => null, 'bsbCode' => null, - 'formFactor' => null, 'type' => null, 'bankCode' => null, 'branchNumber' => null, + 'ispb' => null, 'accountType' => null, 'institutionNumber' => null, 'transitNumber' => null, @@ -97,10 +97,10 @@ class BankAccountAccountIdentification implements ModelInterface, ArrayAccess, \ protected static $openAPINullables = [ 'accountNumber' => false, 'bsbCode' => false, - 'formFactor' => true, 'type' => false, 'bankCode' => false, 'branchNumber' => false, + 'ispb' => false, 'accountType' => false, 'institutionNumber' => false, 'transitNumber' => false, @@ -201,10 +201,10 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'bsbCode' => 'bsbCode', - 'formFactor' => 'formFactor', 'type' => 'type', 'bankCode' => 'bankCode', 'branchNumber' => 'branchNumber', + 'ispb' => 'ispb', 'accountType' => 'accountType', 'institutionNumber' => 'institutionNumber', 'transitNumber' => 'transitNumber', @@ -225,10 +225,10 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'bsbCode' => 'setBsbCode', - 'formFactor' => 'setFormFactor', 'type' => 'setType', 'bankCode' => 'setBankCode', 'branchNumber' => 'setBranchNumber', + 'ispb' => 'setIspb', 'accountType' => 'setAccountType', 'institutionNumber' => 'setInstitutionNumber', 'transitNumber' => 'setTransitNumber', @@ -249,10 +249,10 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'bsbCode' => 'getBsbCode', - 'formFactor' => 'getFormFactor', 'type' => 'getType', 'bankCode' => 'getBankCode', 'branchNumber' => 'getBranchNumber', + 'ispb' => 'getIspb', 'accountType' => 'getAccountType', 'institutionNumber' => 'getInstitutionNumber', 'transitNumber' => 'getTransitNumber', @@ -323,10 +323,10 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bsbCode', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('bankCode', $data ?? [], null); $this->setIfExists('branchNumber', $data ?? [], null); + $this->setIfExists('ispb', $data ?? [], null); $this->setIfExists('accountType', $data ?? [], null); $this->setIfExists('institutionNumber', $data ?? [], null); $this->setIfExists('transitNumber', $data ?? [], null); @@ -476,40 +476,6 @@ public function setBsbCode($bsbCode) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * @@ -591,6 +557,33 @@ public function setBranchNumber($branchNumber) return $this; } + /** + * Gets ispb + * + * @return string|null + */ + public function getIspb() + { + return $this->container['ispb']; + } + + /** + * Sets ispb + * + * @param string|null $ispb The 8-digit ISPB, with leading zeros. + * + * @return self + */ + public function setIspb($ispb) + { + if (is_null($ispb)) { + throw new \InvalidArgumentException('non-nullable ispb cannot be null'); + } + $this->container['ispb'] = $ispb; + + return $this; + } + /** * Gets accountType * diff --git a/src/Adyen/Model/BalancePlatform/BankAccountDetails.php b/src/Adyen/Model/BalancePlatform/BankAccountDetails.php new file mode 100644 index 000000000..e093d166c --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BankAccountDetails.php @@ -0,0 +1,617 @@ + + */ +class BankAccountDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BankAccountDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'accountType' => 'string', + 'formFactor' => 'string', + 'iban' => 'string', + 'routingNumber' => 'string', + 'sortCode' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'accountType' => null, + 'formFactor' => null, + 'iban' => null, + 'routingNumber' => null, + 'sortCode' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'accountType' => false, + 'formFactor' => false, + 'iban' => false, + 'routingNumber' => false, + 'sortCode' => 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 = [ + 'accountNumber' => 'accountNumber', + 'accountType' => 'accountType', + 'formFactor' => 'formFactor', + 'iban' => 'iban', + 'routingNumber' => 'routingNumber', + 'sortCode' => 'sortCode', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'accountType' => 'setAccountType', + 'formFactor' => 'setFormFactor', + 'iban' => 'setIban', + 'routingNumber' => 'setRoutingNumber', + 'sortCode' => 'setSortCode', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'accountType' => 'getAccountType', + 'formFactor' => 'getFormFactor', + 'iban' => 'getIban', + 'routingNumber' => 'getRoutingNumber', + 'sortCode' => 'getSortCode', + '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('accountNumber', $data ?? [], null); + $this->setIfExists('accountType', $data ?? [], null); + $this->setIfExists('formFactor', $data ?? [], null); + $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('routingNumber', $data ?? [], null); + $this->setIfExists('sortCode', $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 = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' 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 accountNumber + * + * @return string|null + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string|null $accountNumber The bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets accountType + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['accountType']; + } + + /** + * Sets accountType + * + * @param string|null $accountType The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * + * @return self + */ + public function setAccountType($accountType) + { + if (is_null($accountType)) { + throw new \InvalidArgumentException('non-nullable accountType cannot be null'); + } + $this->container['accountType'] = $accountType; + + return $this; + } + + /** + * Gets formFactor + * + * @return string|null + */ + public function getFormFactor() + { + return $this->container['formFactor']; + } + + /** + * Sets formFactor + * + * @param string|null $formFactor Business accounts with a `formFactor` value of **physical** are business accounts issued under the central bank of that country. The default value is **physical** for NL, US, and UK business accounts. Adyen creates a local IBAN for business accounts when the `formFactor` value is set to **virtual**. The local IBANs that are supported are for DE and FR, which reference a physical NL account, with funds being routed through the central bank of NL. + * + * @return self + */ + public function setFormFactor($formFactor) + { + if (is_null($formFactor)) { + throw new \InvalidArgumentException('non-nullable formFactor cannot be null'); + } + $this->container['formFactor'] = $formFactor; + + return $this; + } + + /** + * Gets iban + * + * @return string|null + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string|null $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * + * @return self + */ + public function setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets routingNumber + * + * @return string|null + */ + public function getRoutingNumber() + { + return $this->container['routingNumber']; + } + + /** + * Sets routingNumber + * + * @param string|null $routingNumber The [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. + * + * @return self + */ + public function setRoutingNumber($routingNumber) + { + if (is_null($routingNumber)) { + throw new \InvalidArgumentException('non-nullable routingNumber cannot be null'); + } + $this->container['routingNumber'] = $routingNumber; + + return $this; + } + + /** + * Gets sortCode + * + * @return string|null + */ + public function getSortCode() + { + return $this->container['sortCode']; + } + + /** + * Sets sortCode + * + * @param string|null $sortCode The [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. + * + * @return self + */ + public function setSortCode($sortCode) + { + if (is_null($sortCode)) { + throw new \InvalidArgumentException('non-nullable sortCode cannot be null'); + } + $this->container['sortCode'] = $sortCode; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **iban** or **usLocal** or **ukLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $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/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php index d09fa1d10..3bf08f379 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php @@ -47,10 +47,10 @@ class BankAccountIdentificationValidationRequestAccountIdentification implements protected static $openAPITypes = [ 'accountNumber' => 'string', 'bsbCode' => 'string', - 'formFactor' => 'string', 'type' => 'string', 'bankCode' => 'string', 'branchNumber' => 'string', + 'ispb' => 'string', 'accountType' => 'string', 'institutionNumber' => 'string', 'transitNumber' => 'string', @@ -73,10 +73,10 @@ class BankAccountIdentificationValidationRequestAccountIdentification implements protected static $openAPIFormats = [ 'accountNumber' => null, 'bsbCode' => null, - 'formFactor' => null, 'type' => null, 'bankCode' => null, 'branchNumber' => null, + 'ispb' => null, 'accountType' => null, 'institutionNumber' => null, 'transitNumber' => null, @@ -97,10 +97,10 @@ class BankAccountIdentificationValidationRequestAccountIdentification implements protected static $openAPINullables = [ 'accountNumber' => false, 'bsbCode' => false, - 'formFactor' => true, 'type' => false, 'bankCode' => false, 'branchNumber' => false, + 'ispb' => false, 'accountType' => false, 'institutionNumber' => false, 'transitNumber' => false, @@ -201,10 +201,10 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'bsbCode' => 'bsbCode', - 'formFactor' => 'formFactor', 'type' => 'type', 'bankCode' => 'bankCode', 'branchNumber' => 'branchNumber', + 'ispb' => 'ispb', 'accountType' => 'accountType', 'institutionNumber' => 'institutionNumber', 'transitNumber' => 'transitNumber', @@ -225,10 +225,10 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'bsbCode' => 'setBsbCode', - 'formFactor' => 'setFormFactor', 'type' => 'setType', 'bankCode' => 'setBankCode', 'branchNumber' => 'setBranchNumber', + 'ispb' => 'setIspb', 'accountType' => 'setAccountType', 'institutionNumber' => 'setInstitutionNumber', 'transitNumber' => 'setTransitNumber', @@ -249,10 +249,10 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'bsbCode' => 'getBsbCode', - 'formFactor' => 'getFormFactor', 'type' => 'getType', 'bankCode' => 'getBankCode', 'branchNumber' => 'getBranchNumber', + 'ispb' => 'getIspb', 'accountType' => 'getAccountType', 'institutionNumber' => 'getInstitutionNumber', 'transitNumber' => 'getTransitNumber', @@ -323,10 +323,10 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bsbCode', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('bankCode', $data ?? [], null); $this->setIfExists('branchNumber', $data ?? [], null); + $this->setIfExists('ispb', $data ?? [], null); $this->setIfExists('accountType', $data ?? [], null); $this->setIfExists('institutionNumber', $data ?? [], null); $this->setIfExists('transitNumber', $data ?? [], null); @@ -476,40 +476,6 @@ public function setBsbCode($bsbCode) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * @@ -591,6 +557,33 @@ public function setBranchNumber($branchNumber) return $this; } + /** + * Gets ispb + * + * @return string|null + */ + public function getIspb() + { + return $this->container['ispb']; + } + + /** + * Sets ispb + * + * @param string|null $ispb The 8-digit ISPB, with leading zeros. + * + * @return self + */ + public function setIspb($ispb) + { + if (is_null($ispb)) { + throw new \InvalidArgumentException('non-nullable ispb cannot be null'); + } + $this->container['ispb'] = $ispb; + + return $this; + } + /** * Gets accountType * diff --git a/src/Adyen/Model/BalancePlatform/BankAccountModel.php b/src/Adyen/Model/BalancePlatform/BankAccountModel.php index fc5a66781..8c46d2302 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountModel.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountModel.php @@ -64,7 +64,7 @@ class BankAccountModel implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ - 'formFactor' => false + 'formFactor' => true ]; /** @@ -314,17 +314,24 @@ public function getFormFactor() /** * Sets formFactor * - * @param string|null $formFactor Form factor of the bank account - **virtual** or **physical** (default) + * @param string|null $formFactor Business accounts with a `formFactor` value of **physical** are business accounts issued under the central bank of that country. The default value is **physical** for NL, US, and UK business accounts. Adyen creates a local IBAN for business accounts when the `formFactor` value is set to **virtual**. The local IBANs that are supported are for DE and FR, which reference a physical NL account, with funds being routed through the central bank of NL. * * @return self */ public function setFormFactor($formFactor) { if (is_null($formFactor)) { - throw new \InvalidArgumentException('non-nullable formFactor cannot be null'); + array_push($this->openAPINullablesSetToNull, 'formFactor'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('formFactor', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $allowedValues = $this->getFormFactorAllowableValues(); - if (!in_array($formFactor, $allowedValues, true)) { + if (!is_null($formFactor) && !in_array($formFactor, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'formFactor', must be one of '%s'", diff --git a/src/Adyen/Model/BalancePlatform/BankIdentification.php b/src/Adyen/Model/BalancePlatform/BankIdentification.php index 6b5724c11..af881ba76 100644 --- a/src/Adyen/Model/BalancePlatform/BankIdentification.php +++ b/src/Adyen/Model/BalancePlatform/BankIdentification.php @@ -229,6 +229,7 @@ public function getModelName() public const IDENTIFICATION_TYPE_IBAN = 'iban'; public const IDENTIFICATION_TYPE_ROUTING_NUMBER = 'routingNumber'; + public const IDENTIFICATION_TYPE_SORT_CODE = 'sortCode'; /** * Gets allowable values of the enum @@ -240,6 +241,7 @@ public function getIdentificationTypeAllowableValues() return [ self::IDENTIFICATION_TYPE_IBAN, self::IDENTIFICATION_TYPE_ROUTING_NUMBER, + self::IDENTIFICATION_TYPE_SORT_CODE, ]; } /** @@ -380,7 +382,7 @@ public function getIdentificationType() /** * Sets identificationType * - * @param string|null $identificationType The type of the identification. Possible values: **iban**, **routingNumber**. + * @param string|null $identificationType The type of the identification. Possible values: **iban**, **routingNumber**, **sortCode**. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php index 6ca1053c4..5a8f98c81 100644 --- a/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php @@ -46,7 +46,6 @@ class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'accountType' => 'string', - 'formFactor' => 'string', 'institutionNumber' => 'string', 'transitNumber' => 'string', 'type' => 'string' @@ -62,7 +61,6 @@ class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'accountType' => null, - 'formFactor' => null, 'institutionNumber' => null, 'transitNumber' => null, 'type' => null @@ -76,7 +74,6 @@ class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'accountType' => false, - 'formFactor' => true, 'institutionNumber' => false, 'transitNumber' => false, 'type' => false @@ -170,7 +167,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'accountType' => 'accountType', - 'formFactor' => 'formFactor', 'institutionNumber' => 'institutionNumber', 'transitNumber' => 'transitNumber', 'type' => 'type' @@ -184,7 +180,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'accountType' => 'setAccountType', - 'formFactor' => 'setFormFactor', 'institutionNumber' => 'setInstitutionNumber', 'transitNumber' => 'setTransitNumber', 'type' => 'setType' @@ -198,7 +193,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'accountType' => 'getAccountType', - 'formFactor' => 'getFormFactor', 'institutionNumber' => 'getInstitutionNumber', 'transitNumber' => 'getTransitNumber', 'type' => 'getType' @@ -289,7 +283,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('accountType', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('institutionNumber', $data ?? [], null); $this->setIfExists('transitNumber', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); @@ -431,40 +424,6 @@ public function setAccountType($accountType) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets institutionNumber * diff --git a/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php index a60b11b6c..1eed20082 100644 --- a/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php @@ -46,7 +46,6 @@ class CZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'bankCode' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -60,7 +59,6 @@ class CZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'bankCode' => null, - 'formFactor' => null, 'type' => null ]; @@ -72,7 +70,6 @@ class CZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'bankCode' => false, - 'formFactor' => true, 'type' => false ]; @@ -164,7 +161,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'bankCode' => 'bankCode', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -176,7 +172,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'bankCode' => 'setBankCode', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -188,7 +183,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'bankCode' => 'getBankCode', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -263,7 +257,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bankCode', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -381,40 +374,6 @@ public function setBankCode($bankCode) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/BalancePlatform/CapabilitySettings.php b/src/Adyen/Model/BalancePlatform/CapabilitySettings.php index 95ce38222..c1302d647 100644 --- a/src/Adyen/Model/BalancePlatform/CapabilitySettings.php +++ b/src/Adyen/Model/BalancePlatform/CapabilitySettings.php @@ -358,7 +358,7 @@ public function getAmountPerIndustry() /** * Sets amountPerIndustry * - * @param array|null $amountPerIndustry + * @param array|null $amountPerIndustry * * @return self */ @@ -385,7 +385,7 @@ public function getAuthorizedCardUsers() /** * Sets authorizedCardUsers * - * @param bool|null $authorizedCardUsers + * @param bool|null $authorizedCardUsers * * @return self */ @@ -412,7 +412,7 @@ public function getFundingSource() /** * Sets fundingSource * - * @param string[]|null $fundingSource + * @param string[]|null $fundingSource * * @return self */ @@ -448,7 +448,7 @@ public function getInterval() /** * Sets interval * - * @param string|null $interval + * @param string|null $interval * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/Counterparty.php b/src/Adyen/Model/BalancePlatform/Counterparty.php index 48bfe2c53..60fe49302 100644 --- a/src/Adyen/Model/BalancePlatform/Counterparty.php +++ b/src/Adyen/Model/BalancePlatform/Counterparty.php @@ -323,7 +323,7 @@ public function getTransferInstrumentId() /** * Sets transferInstrumentId * - * @param string|null $transferInstrumentId Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * @param string|null $transferInstrumentId The unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.php index a6591b224..8a4750982 100644 --- a/src/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.php +++ b/src/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.php @@ -50,6 +50,8 @@ class CreateSweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSe 'description' => 'string', 'priorities' => 'string[]', 'reason' => 'string', + 'reference' => 'string', + 'referenceForBeneficiary' => 'string', 'schedule' => '\Adyen\Model\BalancePlatform\SweepSchedule', 'status' => 'string', 'sweepAmount' => '\Adyen\Model\BalancePlatform\Amount', @@ -72,6 +74,8 @@ class CreateSweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSe 'description' => null, 'priorities' => null, 'reason' => null, + 'reference' => null, + 'referenceForBeneficiary' => null, 'schedule' => null, 'status' => null, 'sweepAmount' => null, @@ -92,6 +96,8 @@ class CreateSweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSe 'description' => false, 'priorities' => false, 'reason' => false, + 'reference' => false, + 'referenceForBeneficiary' => false, 'schedule' => false, 'status' => false, 'sweepAmount' => false, @@ -192,6 +198,8 @@ public function isNullableSetToNull(string $property): bool 'description' => 'description', 'priorities' => 'priorities', 'reason' => 'reason', + 'reference' => 'reference', + 'referenceForBeneficiary' => 'referenceForBeneficiary', 'schedule' => 'schedule', 'status' => 'status', 'sweepAmount' => 'sweepAmount', @@ -212,6 +220,8 @@ public function isNullableSetToNull(string $property): bool 'description' => 'setDescription', 'priorities' => 'setPriorities', 'reason' => 'setReason', + 'reference' => 'setReference', + 'referenceForBeneficiary' => 'setReferenceForBeneficiary', 'schedule' => 'setSchedule', 'status' => 'setStatus', 'sweepAmount' => 'setSweepAmount', @@ -232,6 +242,8 @@ public function isNullableSetToNull(string $property): bool 'description' => 'getDescription', 'priorities' => 'getPriorities', 'reason' => 'getReason', + 'reference' => 'getReference', + 'referenceForBeneficiary' => 'getReferenceForBeneficiary', 'schedule' => 'getSchedule', 'status' => 'getStatus', 'sweepAmount' => 'getSweepAmount', @@ -302,6 +314,7 @@ public function getModelName() public const REASON_DECLINED_BY_TRANSACTION_RULE = 'declinedByTransactionRule'; public const REASON_ERROR = 'error'; public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; + public const REASON_PENDING_APPROVAL = 'pendingApproval'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; @@ -360,6 +373,7 @@ public function getReasonAllowableValues() self::REASON_DECLINED_BY_TRANSACTION_RULE, self::REASON_ERROR, self::REASON_NOT_ENOUGH_BALANCE, + self::REASON_PENDING_APPROVAL, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, @@ -411,6 +425,8 @@ public function __construct(array $data = null) $this->setIfExists('description', $data ?? [], null); $this->setIfExists('priorities', $data ?? [], null); $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('referenceForBeneficiary', $data ?? [], null); $this->setIfExists('schedule', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('sweepAmount', $data ?? [], null); @@ -637,7 +653,7 @@ public function getPriorities() /** * Sets priorities * - * @param string[]|null $priorities The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority listed first, and if that's not possible, it moves on to the next option in the order of provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see [optional priorities setup](https://docs.adyen.com/marketplaces-and-platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). + * @param string[]|null $priorities The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority you list first. If that's not possible, it moves on to the next option in the order of your provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see optional priorities setup for [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) or [platforms](https://docs.adyen.com/platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). * * @return self */ @@ -697,6 +713,60 @@ public function setReason($reason) return $this; } + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the sweep configuration. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets referenceForBeneficiary + * + * @return string|null + */ + public function getReferenceForBeneficiary() + { + return $this->container['referenceForBeneficiary']; + } + + /** + * Sets referenceForBeneficiary + * + * @param string|null $referenceForBeneficiary The reference sent to or received from the counterparty. Only alphanumeric characters are allowed. + * + * @return self + */ + public function setReferenceForBeneficiary($referenceForBeneficiary) + { + if (is_null($referenceForBeneficiary)) { + throw new \InvalidArgumentException('non-nullable referenceForBeneficiary cannot be null'); + } + $this->container['referenceForBeneficiary'] = $referenceForBeneficiary; + + return $this; + } + /** * Gets schedule * diff --git a/src/Adyen/Model/BalancePlatform/DKLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/DKLocalAccountIdentification.php index 8dcc33061..43f7ceb03 100644 --- a/src/Adyen/Model/BalancePlatform/DKLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/DKLocalAccountIdentification.php @@ -46,7 +46,6 @@ class DKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'bankCode' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -60,7 +59,6 @@ class DKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'bankCode' => null, - 'formFactor' => null, 'type' => null ]; @@ -72,7 +70,6 @@ class DKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'bankCode' => false, - 'formFactor' => true, 'type' => false ]; @@ -164,7 +161,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'bankCode' => 'bankCode', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -176,7 +172,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'bankCode' => 'setBankCode', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -188,7 +183,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'bankCode' => 'getBankCode', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -263,7 +257,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bankCode', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -381,40 +374,6 @@ public function setBankCode($bankCode) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/BalancePlatform/DelegatedAuthenticationData.php b/src/Adyen/Model/BalancePlatform/DelegatedAuthenticationData.php new file mode 100644 index 000000000..b4467f53e --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/DelegatedAuthenticationData.php @@ -0,0 +1,413 @@ + + */ +class DelegatedAuthenticationData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DelegatedAuthenticationData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'sdkOutput' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'sdkOutput' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'sdkOutput' => 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 = [ + 'sdkOutput' => 'sdkOutput' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sdkOutput' => 'setSdkOutput' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sdkOutput' => 'getSdkOutput' + ]; + + /** + * 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('sdkOutput', $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['sdkOutput'] === null) { + $invalidProperties[] = "'sdkOutput' 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 sdkOutput + * + * @return string + */ + public function getSdkOutput() + { + return $this->container['sdkOutput']; + } + + /** + * Sets sdkOutput + * + * @param string $sdkOutput A base64-encoded block with the data required to register the SCA device. You obtain this information by using our authentication SDK. + * + * @return self + */ + public function setSdkOutput($sdkOutput) + { + if (is_null($sdkOutput)) { + throw new \InvalidArgumentException('non-nullable sdkOutput cannot be null'); + } + $this->container['sdkOutput'] = $sdkOutput; + + 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/BalancePlatform/DeliveryAddress.php b/src/Adyen/Model/BalancePlatform/DeliveryAddress.php index e3567ad90..30b110386 100644 --- a/src/Adyen/Model/BalancePlatform/DeliveryAddress.php +++ b/src/Adyen/Model/BalancePlatform/DeliveryAddress.php @@ -388,7 +388,7 @@ public function getLine1() /** * Sets line1 * - * @param string|null $line1 The street name. For example, if the address is \"Rokin 49\", provide \"Rokin\". + * @param string|null $line1 The name of the street. Do not include the number of the building. For example, if the address is Simon Carmiggeltstraat 6-50, provide **Simon Carmiggeltstraat**. * * @return self */ @@ -415,7 +415,7 @@ public function getLine2() /** * Sets line2 * - * @param string|null $line2 The house number or name. For example, if the address is \"Rokin 49\", provide \"49\". + * @param string|null $line2 The number of the building. For example, if the address is Simon Carmiggeltstraat 6-50, provide **6-50**. * * @return self */ @@ -442,7 +442,7 @@ public function getLine3() /** * Sets line3 * - * @param string|null $line3 Optional information about the address. + * @param string|null $line3 Additional information about the delivery address. * * @return self */ @@ -496,7 +496,7 @@ public function getStateOrProvince() /** * Sets stateOrProvince * - * @param string|null $stateOrProvince The two-letterISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + * @param string|null $stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/DeliveryContact.php b/src/Adyen/Model/BalancePlatform/DeliveryContact.php index 984cc8d50..aaab6800f 100644 --- a/src/Adyen/Model/BalancePlatform/DeliveryContact.php +++ b/src/Adyen/Model/BalancePlatform/DeliveryContact.php @@ -45,6 +45,7 @@ class DeliveryContact implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'address' => '\Adyen\Model\BalancePlatform\DeliveryAddress', + 'company' => 'string', 'email' => 'string', 'fullPhoneNumber' => 'string', 'name' => '\Adyen\Model\BalancePlatform\Name', @@ -61,6 +62,7 @@ class DeliveryContact implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'address' => null, + 'company' => null, 'email' => null, 'fullPhoneNumber' => null, 'name' => null, @@ -75,6 +77,7 @@ class DeliveryContact implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'address' => false, + 'company' => false, 'email' => false, 'fullPhoneNumber' => false, 'name' => false, @@ -169,6 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'address' => 'address', + 'company' => 'company', 'email' => 'email', 'fullPhoneNumber' => 'fullPhoneNumber', 'name' => 'name', @@ -183,6 +187,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'address' => 'setAddress', + 'company' => 'setCompany', 'email' => 'setEmail', 'fullPhoneNumber' => 'setFullPhoneNumber', 'name' => 'setName', @@ -197,6 +202,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'address' => 'getAddress', + 'company' => 'getCompany', 'email' => 'getEmail', 'fullPhoneNumber' => 'getFullPhoneNumber', 'name' => 'getName', @@ -262,6 +268,7 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('company', $data ?? [], null); $this->setIfExists('email', $data ?? [], null); $this->setIfExists('fullPhoneNumber', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -344,6 +351,33 @@ public function setAddress($address) return $this; } + /** + * Gets company + * + * @return string|null + */ + public function getCompany() + { + return $this->container['company']; + } + + /** + * Sets company + * + * @param string|null $company The company name of the contact. + * + * @return self + */ + public function setCompany($company) + { + if (is_null($company)) { + throw new \InvalidArgumentException('non-nullable company cannot be null'); + } + $this->container['company'] = $company; + + return $this; + } + /** * Gets email * diff --git a/src/Adyen/Model/BalancePlatform/Device.php b/src/Adyen/Model/BalancePlatform/Device.php new file mode 100644 index 000000000..d3714bf37 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Device.php @@ -0,0 +1,547 @@ + + */ +class Device implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Device'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'paymentInstrumentId' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'paymentInstrumentId' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'name' => false, + 'paymentInstrumentId' => 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 = [ + 'id' => 'id', + 'name' => 'name', + 'paymentInstrumentId' => 'paymentInstrumentId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'paymentInstrumentId' => 'setPaymentInstrumentId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'paymentInstrumentId' => 'getPaymentInstrumentId', + '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; + } + + public const TYPE_IOS = 'ios'; + public const TYPE_ANDROID = 'android'; + public const TYPE_BROWSER = 'browser'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_IOS, + self::TYPE_ANDROID, + self::TYPE_BROWSER, + ]; + } + /** + * 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('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('paymentInstrumentId', $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 = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the SCA device. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the SCA device. You can show this name to your user to help them identify the device. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets paymentInstrumentId + * + * @return string|null + */ + public function getPaymentInstrumentId() + { + return $this->container['paymentInstrumentId']; + } + + /** + * Sets paymentInstrumentId + * + * @param string|null $paymentInstrumentId The unique identifier of the payment instrument that is associated with the SCA device. + * + * @return self + */ + public function setPaymentInstrumentId($paymentInstrumentId) + { + if (is_null($paymentInstrumentId)) { + throw new \InvalidArgumentException('non-nullable paymentInstrumentId cannot be null'); + } + $this->container['paymentInstrumentId'] = $paymentInstrumentId; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of device. Possible values: **ios**, **android**, **browser**. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $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/BalancePlatform/HKLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/HKLocalAccountIdentification.php index 618b76dd9..cd6e32741 100644 --- a/src/Adyen/Model/BalancePlatform/HKLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/HKLocalAccountIdentification.php @@ -46,7 +46,6 @@ class HKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'clearingCode' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -60,7 +59,6 @@ class HKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'clearingCode' => null, - 'formFactor' => null, 'type' => null ]; @@ -72,7 +70,6 @@ class HKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'clearingCode' => false, - 'formFactor' => true, 'type' => false ]; @@ -164,7 +161,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'clearingCode' => 'clearingCode', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -176,7 +172,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'clearingCode' => 'setClearingCode', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -188,7 +183,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'clearingCode' => 'getClearingCode', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -263,7 +257,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('clearingCode', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -381,40 +374,6 @@ public function setClearingCode($clearingCode) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php index d41a38cd8..cd58523f4 100644 --- a/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php @@ -45,7 +45,6 @@ class HULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'accountNumber' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -58,7 +57,6 @@ class HULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'accountNumber' => null, - 'formFactor' => null, 'type' => null ]; @@ -69,7 +67,6 @@ class HULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'accountNumber' => false, - 'formFactor' => true, 'type' => false ]; @@ -160,7 +157,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountNumber' => 'accountNumber', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -171,7 +167,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountNumber' => 'setAccountNumber', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -182,7 +177,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountNumber' => 'getAccountNumber', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -256,7 +250,6 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -344,40 +337,6 @@ public function setAccountNumber($accountNumber) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/BalancePlatform/Href.php b/src/Adyen/Model/BalancePlatform/Href.php new file mode 100644 index 000000000..8d05b2804 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Href.php @@ -0,0 +1,410 @@ + + */ +class Href implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Href'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'href' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'href' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'href' => 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 = [ + 'href' => 'href' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'href' => 'setHref' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'href' => 'getHref' + ]; + + /** + * 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('href', $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 href + * + * @return string|null + */ + public function getHref() + { + return $this->container['href']; + } + + /** + * Sets href + * + * @param string|null $href href + * + * @return self + */ + public function setHref($href) + { + if (is_null($href)) { + throw new \InvalidArgumentException('non-nullable href cannot be null'); + } + $this->container['href'] = $href; + + 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/BalancePlatform/IbanAccountIdentification.php b/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php index e2b6f00ff..275b8a04b 100644 --- a/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php @@ -44,7 +44,6 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ - 'formFactor' => 'string', 'iban' => 'string', 'type' => 'string' ]; @@ -57,7 +56,6 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ - 'formFactor' => null, 'iban' => null, 'type' => null ]; @@ -68,7 +66,6 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static $openAPINullables = [ - 'formFactor' => true, 'iban' => false, 'type' => false ]; @@ -159,7 +156,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'formFactor' => 'formFactor', 'iban' => 'iban', 'type' => 'type' ]; @@ -170,7 +166,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'formFactor' => 'setFormFactor', 'iban' => 'setIban', 'type' => 'setType' ]; @@ -181,7 +176,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'formFactor' => 'getFormFactor', 'iban' => 'getIban', 'type' => 'getType' ]; @@ -255,7 +249,6 @@ public function getTypeAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -317,40 +310,6 @@ public function valid() } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets iban * diff --git a/src/Adyen/Model/BalancePlatform/Link.php b/src/Adyen/Model/BalancePlatform/Link.php new file mode 100644 index 000000000..6789475a6 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Link.php @@ -0,0 +1,546 @@ + + */ +class Link implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Link'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'first' => '\Adyen\Model\BalancePlatform\Href', + 'last' => '\Adyen\Model\BalancePlatform\Href', + 'next' => '\Adyen\Model\BalancePlatform\Href', + 'previous' => '\Adyen\Model\BalancePlatform\Href', + 'self' => '\Adyen\Model\BalancePlatform\Href' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'first' => null, + 'last' => null, + 'next' => null, + 'previous' => null, + 'self' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'first' => false, + 'last' => false, + 'next' => false, + 'previous' => false, + 'self' => 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 = [ + 'first' => 'first', + 'last' => 'last', + 'next' => 'next', + 'previous' => 'previous', + 'self' => 'self' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'first' => 'setFirst', + 'last' => 'setLast', + 'next' => 'setNext', + 'previous' => 'setPrevious', + 'self' => 'setSelf' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'first' => 'getFirst', + 'last' => 'getLast', + 'next' => 'getNext', + 'previous' => 'getPrevious', + 'self' => 'getSelf' + ]; + + /** + * 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('first', $data ?? [], null); + $this->setIfExists('last', $data ?? [], null); + $this->setIfExists('next', $data ?? [], null); + $this->setIfExists('previous', $data ?? [], null); + $this->setIfExists('self', $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 first + * + * @return \Adyen\Model\BalancePlatform\Href|null + */ + public function getFirst() + { + return $this->container['first']; + } + + /** + * Sets first + * + * @param \Adyen\Model\BalancePlatform\Href|null $first first + * + * @return self + */ + public function setFirst($first) + { + if (is_null($first)) { + throw new \InvalidArgumentException('non-nullable first cannot be null'); + } + $this->container['first'] = $first; + + return $this; + } + + /** + * Gets last + * + * @return \Adyen\Model\BalancePlatform\Href|null + */ + public function getLast() + { + return $this->container['last']; + } + + /** + * Sets last + * + * @param \Adyen\Model\BalancePlatform\Href|null $last last + * + * @return self + */ + public function setLast($last) + { + if (is_null($last)) { + throw new \InvalidArgumentException('non-nullable last cannot be null'); + } + $this->container['last'] = $last; + + return $this; + } + + /** + * Gets next + * + * @return \Adyen\Model\BalancePlatform\Href|null + */ + public function getNext() + { + return $this->container['next']; + } + + /** + * Sets next + * + * @param \Adyen\Model\BalancePlatform\Href|null $next next + * + * @return self + */ + public function setNext($next) + { + if (is_null($next)) { + throw new \InvalidArgumentException('non-nullable next cannot be null'); + } + $this->container['next'] = $next; + + return $this; + } + + /** + * Gets previous + * + * @return \Adyen\Model\BalancePlatform\Href|null + */ + public function getPrevious() + { + return $this->container['previous']; + } + + /** + * Sets previous + * + * @param \Adyen\Model\BalancePlatform\Href|null $previous previous + * + * @return self + */ + public function setPrevious($previous) + { + if (is_null($previous)) { + throw new \InvalidArgumentException('non-nullable previous cannot be null'); + } + $this->container['previous'] = $previous; + + return $this; + } + + /** + * Gets self + * + * @return \Adyen\Model\BalancePlatform\Href|null + */ + public function getSelf() + { + return $this->container['self']; + } + + /** + * Sets self + * + * @param \Adyen\Model\BalancePlatform\Href|null $self self + * + * @return self + */ + public function setSelf($self) + { + if (is_null($self)) { + throw new \InvalidArgumentException('non-nullable self cannot be null'); + } + $this->container['self'] = $self; + + 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/BalancePlatform/NOLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php index cb56f4ec6..6d54a683e 100644 --- a/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php @@ -45,7 +45,6 @@ class NOLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'accountNumber' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -58,7 +57,6 @@ class NOLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'accountNumber' => null, - 'formFactor' => null, 'type' => null ]; @@ -69,7 +67,6 @@ class NOLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'accountNumber' => false, - 'formFactor' => true, 'type' => false ]; @@ -160,7 +157,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountNumber' => 'accountNumber', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -171,7 +167,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountNumber' => 'setAccountNumber', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -182,7 +177,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountNumber' => 'getAccountNumber', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -256,7 +250,6 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -344,40 +337,6 @@ public function setAccountNumber($accountNumber) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/BalancePlatform/NZLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/NZLocalAccountIdentification.php index 19969cb3d..82c72cf18 100644 --- a/src/Adyen/Model/BalancePlatform/NZLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/NZLocalAccountIdentification.php @@ -45,7 +45,6 @@ class NZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'accountNumber' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -58,7 +57,6 @@ class NZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'accountNumber' => null, - 'formFactor' => null, 'type' => null ]; @@ -69,7 +67,6 @@ class NZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'accountNumber' => false, - 'formFactor' => true, 'type' => false ]; @@ -160,7 +157,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountNumber' => 'accountNumber', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -171,7 +167,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountNumber' => 'setAccountNumber', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -182,7 +177,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountNumber' => 'getAccountNumber', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -256,7 +250,6 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -344,40 +337,6 @@ public function setAccountNumber($accountNumber) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php b/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php index e277f79f9..8c36b4d24 100644 --- a/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php @@ -47,7 +47,6 @@ class NumberAndBicAccountIdentification implements ModelInterface, ArrayAccess, 'accountNumber' => 'string', 'additionalBankIdentification' => '\Adyen\Model\BalancePlatform\AdditionalBankIdentification', 'bic' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -62,7 +61,6 @@ class NumberAndBicAccountIdentification implements ModelInterface, ArrayAccess, 'accountNumber' => null, 'additionalBankIdentification' => null, 'bic' => null, - 'formFactor' => null, 'type' => null ]; @@ -75,7 +73,6 @@ class NumberAndBicAccountIdentification implements ModelInterface, ArrayAccess, 'accountNumber' => false, 'additionalBankIdentification' => false, 'bic' => false, - 'formFactor' => true, 'type' => false ]; @@ -168,7 +165,6 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'accountNumber', 'additionalBankIdentification' => 'additionalBankIdentification', 'bic' => 'bic', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -181,7 +177,6 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'setAccountNumber', 'additionalBankIdentification' => 'setAdditionalBankIdentification', 'bic' => 'setBic', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -194,7 +189,6 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'getAccountNumber', 'additionalBankIdentification' => 'getAdditionalBankIdentification', 'bic' => 'getBic', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -270,7 +264,6 @@ public function __construct(array $data = null) $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('additionalBankIdentification', $data ?? [], null); $this->setIfExists('bic', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -415,40 +408,6 @@ public function setBic($bic) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php index 141ec623e..fa9af7e82 100644 --- a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php +++ b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php index 9ebc41c7e..0911e2e43 100644 --- a/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php @@ -45,7 +45,6 @@ class PLLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'accountNumber' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -58,7 +57,6 @@ class PLLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'accountNumber' => null, - 'formFactor' => null, 'type' => null ]; @@ -69,7 +67,6 @@ class PLLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'accountNumber' => false, - 'formFactor' => true, 'type' => false ]; @@ -160,7 +157,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountNumber' => 'accountNumber', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -171,7 +167,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountNumber' => 'setAccountNumber', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -182,7 +177,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountNumber' => 'getAccountNumber', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -256,7 +250,6 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -344,40 +337,6 @@ public function setAccountNumber($accountNumber) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrument.php b/src/Adyen/Model/BalancePlatform/PaymentInstrument.php index 9d31f45fb..a5eace728 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrument.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrument.php @@ -46,7 +46,7 @@ class PaymentInstrument implements ModelInterface, ArrayAccess, \JsonSerializabl protected static $openAPITypes = [ 'additionalBankAccountIdentifications' => '\Adyen\Model\BalancePlatform\PaymentInstrumentAdditionalBankAccountIdentificationsInner[]', 'balanceAccountId' => 'string', - 'bankAccount' => '\Adyen\Model\BalancePlatform\PaymentInstrumentBankAccount', + 'bankAccount' => '\Adyen\Model\BalancePlatform\BankAccountDetails', 'card' => '\Adyen\Model\BalancePlatform\Card', 'description' => 'string', 'id' => 'string', @@ -456,6 +456,7 @@ public function valid() * Gets additionalBankAccountIdentifications * * @return \Adyen\Model\BalancePlatform\PaymentInstrumentAdditionalBankAccountIdentificationsInner[]|null + * @deprecated */ public function getAdditionalBankAccountIdentifications() { @@ -468,6 +469,7 @@ public function getAdditionalBankAccountIdentifications() * @param \Adyen\Model\BalancePlatform\PaymentInstrumentAdditionalBankAccountIdentificationsInner[]|null $additionalBankAccountIdentifications Contains optional, additional business account details. Returned when you create a payment instrument with `type` **bankAccount**. * * @return self + * @deprecated */ public function setAdditionalBankAccountIdentifications($additionalBankAccountIdentifications) { @@ -509,7 +511,7 @@ public function setBalanceAccountId($balanceAccountId) /** * Gets bankAccount * - * @return \Adyen\Model\BalancePlatform\PaymentInstrumentBankAccount|null + * @return \Adyen\Model\BalancePlatform\BankAccountDetails|null */ public function getBankAccount() { @@ -519,7 +521,7 @@ public function getBankAccount() /** * Sets bankAccount * - * @param \Adyen\Model\BalancePlatform\PaymentInstrumentBankAccount|null $bankAccount bankAccount + * @param \Adyen\Model\BalancePlatform\BankAccountDetails|null $bankAccount bankAccount * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.php index 473e8a6af..5a5e4f96c 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.php @@ -44,7 +44,6 @@ class PaymentInstrumentAdditionalBankAccountIdentificationsInner implements Mode * @var string[] */ protected static $openAPITypes = [ - 'formFactor' => 'string', 'iban' => 'string', 'type' => 'string' ]; @@ -57,7 +56,6 @@ class PaymentInstrumentAdditionalBankAccountIdentificationsInner implements Mode * @psalm-var array */ protected static $openAPIFormats = [ - 'formFactor' => null, 'iban' => null, 'type' => null ]; @@ -68,7 +66,6 @@ class PaymentInstrumentAdditionalBankAccountIdentificationsInner implements Mode * @var boolean[] */ protected static $openAPINullables = [ - 'formFactor' => true, 'iban' => false, 'type' => false ]; @@ -159,7 +156,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'formFactor' => 'formFactor', 'iban' => 'iban', 'type' => 'type' ]; @@ -170,7 +166,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'formFactor' => 'setFormFactor', 'iban' => 'setIban', 'type' => 'setType' ]; @@ -181,7 +176,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'formFactor' => 'getFormFactor', 'iban' => 'getIban', 'type' => 'getType' ]; @@ -242,7 +236,6 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -296,40 +289,6 @@ public function valid() } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets iban * diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php index bcb03905a..5b8cc36b3 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php @@ -357,7 +357,7 @@ public function getDescription() /** * Sets description * - * @param string|null $description Your description for the payment instrument group, maximum 300 characters. + * @param string|null $description Your description for the payment instrument group. * * @return self */ @@ -438,7 +438,7 @@ public function getReference() /** * Sets reference * - * @param string|null $reference Your reference for the payment instrument group, maximum 150 characters. + * @param string|null $reference Your reference for the payment instrument group. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php index c971f3a29..641fddcc4 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php @@ -350,7 +350,7 @@ public function getDescription() /** * Sets description * - * @param string|null $description Your description for the payment instrument group, maximum 300 characters. + * @param string|null $description Your description for the payment instrument group. * * @return self */ @@ -404,7 +404,7 @@ public function getReference() /** * Sets reference * - * @param string|null $reference Your reference for the payment instrument group, maximum 150 characters. + * @param string|null $reference Your reference for the payment instrument group. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.php b/src/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.php index 12eb1e1c9..2c63854f1 100644 --- a/src/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.php +++ b/src/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.php @@ -296,7 +296,7 @@ public function getSalesDayClosingTime() /** * Sets salesDayClosingTime * - * @param string|null $salesDayClosingTime Specifies at what time a [sales day](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement#sales-day) ends. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. + * @param string|null $salesDayClosingTime Specifies at what time a [sales day](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement#sales-day) ends for this account. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. * * @return self */ @@ -323,7 +323,7 @@ public function getSettlementDelayDays() /** * Sets settlementDelayDays * - * @param int|null $settlementDelayDays Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement#settlement-batch) are made available. Possible values: **0** to **10**, or **null**. * Setting this value to an integer enables [Sales day settlement](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement). * Setting this value to **null** enables [Pass-through settlement](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/pass-through-settlement). Default value: **null**. + * @param int|null $settlementDelayDays Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement#settlement-batch) are made available in this balance account. Possible values: **0** to **10**, or **null**. * Setting this value to an integer enables Sales day settlement in this balance account. See how Sales day settlement works in your [marketplace](https://docs.adyen.com/marketplaces/settle-funds/sales-day-settlement) or [platform](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement). * Setting this value to **null** enables Pass-through settlement in this balance account. See how Pass-through settlement works in your [marketplace](https://docs.adyen.com/marketplaces/settle-funds/pass-through-settlement) or [platform](https://docs.adyen.com/platforms/settle-funds/pass-through-settlement). Default value: **null**. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/RegisterSCAFinalResponse.php b/src/Adyen/Model/BalancePlatform/RegisterSCAFinalResponse.php new file mode 100644 index 000000000..369522c67 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/RegisterSCAFinalResponse.php @@ -0,0 +1,410 @@ + + */ +class RegisterSCAFinalResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RegisterSCAFinalResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'success' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'success' => 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 = [ + 'success' => 'success' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess' + ]; + + /** + * 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('success', $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 success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success Specifies if the registration was initiated successfully. + * + * @return self + */ + public function setSuccess($success) + { + if (is_null($success)) { + throw new \InvalidArgumentException('non-nullable success cannot be null'); + } + $this->container['success'] = $success; + + 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/BalancePlatform/RegisterSCARequest.php b/src/Adyen/Model/BalancePlatform/RegisterSCARequest.php new file mode 100644 index 000000000..96682ddde --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/RegisterSCARequest.php @@ -0,0 +1,450 @@ + + */ +class RegisterSCARequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RegisterSCARequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'paymentInstrumentId' => 'string', + 'strongCustomerAuthentication' => '\Adyen\Model\BalancePlatform\DelegatedAuthenticationData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'paymentInstrumentId' => null, + 'strongCustomerAuthentication' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'paymentInstrumentId' => false, + 'strongCustomerAuthentication' => 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 = [ + 'paymentInstrumentId' => 'paymentInstrumentId', + 'strongCustomerAuthentication' => 'strongCustomerAuthentication' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'paymentInstrumentId' => 'setPaymentInstrumentId', + 'strongCustomerAuthentication' => 'setStrongCustomerAuthentication' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'paymentInstrumentId' => 'getPaymentInstrumentId', + 'strongCustomerAuthentication' => 'getStrongCustomerAuthentication' + ]; + + /** + * 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('paymentInstrumentId', $data ?? [], null); + $this->setIfExists('strongCustomerAuthentication', $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['paymentInstrumentId'] === null) { + $invalidProperties[] = "'paymentInstrumentId' can't be null"; + } + if ($this->container['strongCustomerAuthentication'] === null) { + $invalidProperties[] = "'strongCustomerAuthentication' 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 paymentInstrumentId + * + * @return string + */ + public function getPaymentInstrumentId() + { + return $this->container['paymentInstrumentId']; + } + + /** + * Sets paymentInstrumentId + * + * @param string $paymentInstrumentId The unique identifier of the payment instrument for which you are registering the SCA device. + * + * @return self + */ + public function setPaymentInstrumentId($paymentInstrumentId) + { + if (is_null($paymentInstrumentId)) { + throw new \InvalidArgumentException('non-nullable paymentInstrumentId cannot be null'); + } + $this->container['paymentInstrumentId'] = $paymentInstrumentId; + + return $this; + } + + /** + * Gets strongCustomerAuthentication + * + * @return \Adyen\Model\BalancePlatform\DelegatedAuthenticationData + */ + public function getStrongCustomerAuthentication() + { + return $this->container['strongCustomerAuthentication']; + } + + /** + * Sets strongCustomerAuthentication + * + * @param \Adyen\Model\BalancePlatform\DelegatedAuthenticationData $strongCustomerAuthentication strongCustomerAuthentication + * + * @return self + */ + public function setStrongCustomerAuthentication($strongCustomerAuthentication) + { + if (is_null($strongCustomerAuthentication)) { + throw new \InvalidArgumentException('non-nullable strongCustomerAuthentication cannot be null'); + } + $this->container['strongCustomerAuthentication'] = $strongCustomerAuthentication; + + 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/BalancePlatform/RegisterSCAResponse.php b/src/Adyen/Model/BalancePlatform/RegisterSCAResponse.php new file mode 100644 index 000000000..2a2e4f158 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/RegisterSCAResponse.php @@ -0,0 +1,512 @@ + + */ +class RegisterSCAResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RegisterSCAResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'paymentInstrumentId' => 'string', + 'sdkInput' => 'string', + 'success' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'paymentInstrumentId' => null, + 'sdkInput' => null, + 'success' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'paymentInstrumentId' => false, + 'sdkInput' => false, + 'success' => 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 = [ + 'id' => 'id', + 'paymentInstrumentId' => 'paymentInstrumentId', + 'sdkInput' => 'sdkInput', + 'success' => 'success' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'paymentInstrumentId' => 'setPaymentInstrumentId', + 'sdkInput' => 'setSdkInput', + 'success' => 'setSuccess' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'paymentInstrumentId' => 'getPaymentInstrumentId', + 'sdkInput' => 'getSdkInput', + 'success' => 'getSuccess' + ]; + + /** + * 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('id', $data ?? [], null); + $this->setIfExists('paymentInstrumentId', $data ?? [], null); + $this->setIfExists('sdkInput', $data ?? [], null); + $this->setIfExists('success', $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 id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the SCA device you are registering. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets paymentInstrumentId + * + * @return string|null + */ + public function getPaymentInstrumentId() + { + return $this->container['paymentInstrumentId']; + } + + /** + * Sets paymentInstrumentId + * + * @param string|null $paymentInstrumentId The unique identifier of the payment instrument for which you are registering the SCA device. + * + * @return self + */ + public function setPaymentInstrumentId($paymentInstrumentId) + { + if (is_null($paymentInstrumentId)) { + throw new \InvalidArgumentException('non-nullable paymentInstrumentId cannot be null'); + } + $this->container['paymentInstrumentId'] = $paymentInstrumentId; + + return $this; + } + + /** + * Gets sdkInput + * + * @return string|null + */ + public function getSdkInput() + { + return $this->container['sdkInput']; + } + + /** + * Sets sdkInput + * + * @param string|null $sdkInput A string that you must pass to the authentication SDK to continue with the registration process. + * + * @return self + */ + public function setSdkInput($sdkInput) + { + if (is_null($sdkInput)) { + throw new \InvalidArgumentException('non-nullable sdkInput cannot be null'); + } + $this->container['sdkInput'] = $sdkInput; + + return $this; + } + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success Specifies if the registration was initiated successfully. + * + * @return self + */ + public function setSuccess($success) + { + if (is_null($success)) { + throw new \InvalidArgumentException('non-nullable success cannot be null'); + } + $this->container['success'] = $success; + + 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/BalancePlatform/RiskScores.php b/src/Adyen/Model/BalancePlatform/RiskScores.php new file mode 100644 index 000000000..660829ddc --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/RiskScores.php @@ -0,0 +1,440 @@ + + */ +class RiskScores implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RiskScores'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'mastercard' => 'int', + 'visa' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'mastercard' => 'int32', + 'visa' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'mastercard' => true, + 'visa' => true + ]; + + /** + * 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 = [ + 'mastercard' => 'mastercard', + 'visa' => 'visa' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'mastercard' => 'setMastercard', + 'visa' => 'setVisa' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'mastercard' => 'getMastercard', + 'visa' => 'getVisa' + ]; + + /** + * 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('mastercard', $data ?? [], null); + $this->setIfExists('visa', $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 mastercard + * + * @return int|null + */ + public function getMastercard() + { + return $this->container['mastercard']; + } + + /** + * Sets mastercard + * + * @param int|null $mastercard Transaction risk score provided by Mastercard. Values provided by Mastercard range between 0 (lowest risk) to 998 (highest risk). + * + * @return self + */ + public function setMastercard($mastercard) + { + // Do nothing for nullable integers + $this->container['mastercard'] = $mastercard; + + return $this; + } + + /** + * Gets visa + * + * @return int|null + */ + public function getVisa() + { + return $this->container['visa']; + } + + /** + * Sets visa + * + * @param int|null $visa Transaction risk score provided by Visa. Values provided by Visa range between 01 (lowest risk) to 99 (highest risk). + * + * @return self + */ + public function setVisa($visa) + { + // Do nothing for nullable integers + $this->container['visa'] = $visa; + + 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/BalancePlatform/RiskScoresRestriction.php b/src/Adyen/Model/BalancePlatform/RiskScoresRestriction.php new file mode 100644 index 000000000..bc9360d9a --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/RiskScoresRestriction.php @@ -0,0 +1,447 @@ + + */ +class RiskScoresRestriction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RiskScoresRestriction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => '\Adyen\Model\BalancePlatform\RiskScores' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'operation' => false, + 'value' => 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 = [ + 'operation' => 'operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * 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('operation', $data ?? [], null); + $this->setIfExists('value', $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['operation'] === null) { + $invalidProperties[] = "'operation' 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 operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation Defines how the condition must be evaluated. + * + * @return self + */ + public function setOperation($operation) + { + if (is_null($operation)) { + throw new \InvalidArgumentException('non-nullable operation cannot be null'); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return \Adyen\Model\BalancePlatform\RiskScores|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param \Adyen\Model\BalancePlatform\RiskScores|null $value value + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + 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/BalancePlatform/SELocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php index 9be478ab8..fe021841d 100644 --- a/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php @@ -46,7 +46,6 @@ class SELocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'clearingNumber' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -60,7 +59,6 @@ class SELocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'clearingNumber' => null, - 'formFactor' => null, 'type' => null ]; @@ -72,7 +70,6 @@ class SELocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'clearingNumber' => false, - 'formFactor' => true, 'type' => false ]; @@ -164,7 +161,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'clearingNumber' => 'clearingNumber', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -176,7 +172,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'clearingNumber' => 'setClearingNumber', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -188,7 +183,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'clearingNumber' => 'getClearingNumber', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -263,7 +257,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('clearingNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -381,40 +374,6 @@ public function setClearingNumber($clearingNumber) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php index ac756dd56..0530cd31e 100644 --- a/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php @@ -46,7 +46,6 @@ class SGLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'bic' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -60,7 +59,6 @@ class SGLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'bic' => null, - 'formFactor' => null, 'type' => null ]; @@ -72,7 +70,6 @@ class SGLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'bic' => false, - 'formFactor' => true, 'type' => false ]; @@ -164,7 +161,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'bic' => 'bic', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -176,7 +172,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'bic' => 'setBic', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -188,7 +183,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'bic' => 'getBic', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -263,7 +257,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bic', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -378,40 +371,6 @@ public function setBic($bic) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/BalancePlatform/SearchRegisteredDevicesResponse.php b/src/Adyen/Model/BalancePlatform/SearchRegisteredDevicesResponse.php new file mode 100644 index 000000000..121d4379e --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/SearchRegisteredDevicesResponse.php @@ -0,0 +1,508 @@ + + */ +class SearchRegisteredDevicesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SearchRegisteredDevicesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\BalancePlatform\Device[]', + 'itemsTotal' => 'int', + 'link' => '\Adyen\Model\BalancePlatform\Link', + 'pagesTotal' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'itemsTotal' => 'int32', + 'link' => null, + 'pagesTotal' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false, + 'itemsTotal' => true, + 'link' => false, + 'pagesTotal' => true + ]; + + /** + * 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 = [ + 'data' => 'data', + 'itemsTotal' => 'itemsTotal', + 'link' => 'link', + 'pagesTotal' => 'pagesTotal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'itemsTotal' => 'setItemsTotal', + 'link' => 'setLink', + 'pagesTotal' => 'setPagesTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'itemsTotal' => 'getItemsTotal', + 'link' => 'getLink', + 'pagesTotal' => 'getPagesTotal' + ]; + + /** + * 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('data', $data ?? [], null); + $this->setIfExists('itemsTotal', $data ?? [], null); + $this->setIfExists('link', $data ?? [], null); + $this->setIfExists('pagesTotal', $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 data + * + * @return \Adyen\Model\BalancePlatform\Device[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\BalancePlatform\Device[]|null $data Contains a list of registered SCA devices and their corresponding details. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets itemsTotal + * + * @return int|null + */ + public function getItemsTotal() + { + return $this->container['itemsTotal']; + } + + /** + * Sets itemsTotal + * + * @param int|null $itemsTotal The total amount of registered SCA devices that match the query parameters. + * + * @return self + */ + public function setItemsTotal($itemsTotal) + { + // Do nothing for nullable integers + $this->container['itemsTotal'] = $itemsTotal; + + return $this; + } + + /** + * Gets link + * + * @return \Adyen\Model\BalancePlatform\Link|null + */ + public function getLink() + { + return $this->container['link']; + } + + /** + * Sets link + * + * @param \Adyen\Model\BalancePlatform\Link|null $link link + * + * @return self + */ + public function setLink($link) + { + if (is_null($link)) { + throw new \InvalidArgumentException('non-nullable link cannot be null'); + } + $this->container['link'] = $link; + + return $this; + } + + /** + * Gets pagesTotal + * + * @return int|null + */ + public function getPagesTotal() + { + return $this->container['pagesTotal']; + } + + /** + * Sets pagesTotal + * + * @param int|null $pagesTotal The total amount of list pages. + * + * @return self + */ + public function setPagesTotal($pagesTotal) + { + // Do nothing for nullable integers + $this->container['pagesTotal'] = $pagesTotal; + + 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/BalancePlatform/SweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php index a1e253dff..97f124aa3 100644 --- a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php +++ b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php @@ -51,6 +51,8 @@ class SweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSerializ 'id' => 'string', 'priorities' => 'string[]', 'reason' => 'string', + 'reference' => 'string', + 'referenceForBeneficiary' => 'string', 'schedule' => '\Adyen\Model\BalancePlatform\SweepSchedule', 'status' => 'string', 'sweepAmount' => '\Adyen\Model\BalancePlatform\Amount', @@ -74,6 +76,8 @@ class SweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSerializ 'id' => null, 'priorities' => null, 'reason' => null, + 'reference' => null, + 'referenceForBeneficiary' => null, 'schedule' => null, 'status' => null, 'sweepAmount' => null, @@ -95,6 +99,8 @@ class SweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSerializ 'id' => false, 'priorities' => false, 'reason' => false, + 'reference' => false, + 'referenceForBeneficiary' => false, 'schedule' => false, 'status' => false, 'sweepAmount' => false, @@ -196,6 +202,8 @@ public function isNullableSetToNull(string $property): bool 'id' => 'id', 'priorities' => 'priorities', 'reason' => 'reason', + 'reference' => 'reference', + 'referenceForBeneficiary' => 'referenceForBeneficiary', 'schedule' => 'schedule', 'status' => 'status', 'sweepAmount' => 'sweepAmount', @@ -217,6 +225,8 @@ public function isNullableSetToNull(string $property): bool 'id' => 'setId', 'priorities' => 'setPriorities', 'reason' => 'setReason', + 'reference' => 'setReference', + 'referenceForBeneficiary' => 'setReferenceForBeneficiary', 'schedule' => 'setSchedule', 'status' => 'setStatus', 'sweepAmount' => 'setSweepAmount', @@ -238,6 +248,8 @@ public function isNullableSetToNull(string $property): bool 'id' => 'getId', 'priorities' => 'getPriorities', 'reason' => 'getReason', + 'reference' => 'getReference', + 'referenceForBeneficiary' => 'getReferenceForBeneficiary', 'schedule' => 'getSchedule', 'status' => 'getStatus', 'sweepAmount' => 'getSweepAmount', @@ -308,6 +320,7 @@ public function getModelName() public const REASON_DECLINED_BY_TRANSACTION_RULE = 'declinedByTransactionRule'; public const REASON_ERROR = 'error'; public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; + public const REASON_PENDING_APPROVAL = 'pendingApproval'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; @@ -366,6 +379,7 @@ public function getReasonAllowableValues() self::REASON_DECLINED_BY_TRANSACTION_RULE, self::REASON_ERROR, self::REASON_NOT_ENOUGH_BALANCE, + self::REASON_PENDING_APPROVAL, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, @@ -418,6 +432,8 @@ public function __construct(array $data = null) $this->setIfExists('id', $data ?? [], null); $this->setIfExists('priorities', $data ?? [], null); $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('referenceForBeneficiary', $data ?? [], null); $this->setIfExists('schedule', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('sweepAmount', $data ?? [], null); @@ -674,7 +690,7 @@ public function getPriorities() /** * Sets priorities * - * @param string[]|null $priorities The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority listed first, and if that's not possible, it moves on to the next option in the order of provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see [optional priorities setup](https://docs.adyen.com/marketplaces-and-platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). + * @param string[]|null $priorities The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority you list first. If that's not possible, it moves on to the next option in the order of your provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see optional priorities setup for [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) or [platforms](https://docs.adyen.com/platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). * * @return self */ @@ -734,6 +750,60 @@ public function setReason($reason) return $this; } + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the sweep configuration. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets referenceForBeneficiary + * + * @return string|null + */ + public function getReferenceForBeneficiary() + { + return $this->container['referenceForBeneficiary']; + } + + /** + * Sets referenceForBeneficiary + * + * @param string|null $referenceForBeneficiary The reference sent to or received from the counterparty. Only alphanumeric characters are allowed. + * + * @return self + */ + public function setReferenceForBeneficiary($referenceForBeneficiary) + { + if (is_null($referenceForBeneficiary)) { + throw new \InvalidArgumentException('non-nullable referenceForBeneficiary cannot be null'); + } + $this->container['referenceForBeneficiary'] = $referenceForBeneficiary; + + return $this; + } + /** * Gets schedule * diff --git a/src/Adyen/Model/BalancePlatform/SweepCounterparty.php b/src/Adyen/Model/BalancePlatform/SweepCounterparty.php index aaf4e58c5..ea27d1a01 100644 --- a/src/Adyen/Model/BalancePlatform/SweepCounterparty.php +++ b/src/Adyen/Model/BalancePlatform/SweepCounterparty.php @@ -357,7 +357,7 @@ public function getTransferInstrumentId() /** * Sets transferInstrumentId * - * @param string|null $transferInstrumentId The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) depending on the sweep `type` . To [set up automated top-up sweeps to balance accounts](https://docs.adyen.com/marketplaces-and-platforms/top-up-balance-account/#before-you-begin), use this parameter in combination with a `merchantAccount` and a sweep `type` of **pull**. Top-up sweeps start a direct debit request from the source transfer instrument. Contact Adyen Support to enable this feature. + * @param string|null $transferInstrumentId The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) depending on the sweep `type`. To set up automated top-up sweeps to balance accounts in your [marketplace](https://docs.adyen.com/marketplaces/top-up-balance-account/#before-you-begin) or [platform](https://docs.adyen.com/platforms/top-up-balance-account/#before-you-begin), use this parameter in combination with a `merchantAccount` and a sweep `type` of **pull**. Top-up sweeps start a direct debit request from the source transfer instrument. Contact Adyen Support to enable this feature. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/TransactionRule.php b/src/Adyen/Model/BalancePlatform/TransactionRule.php index 7ce540e7d..90959dc7b 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRule.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRule.php @@ -296,6 +296,7 @@ public function getModelName() public const OUTCOME_TYPE_ENFORCE_SCA = 'enforceSCA'; public const OUTCOME_TYPE_HARD_BLOCK = 'hardBlock'; public const OUTCOME_TYPE_SCORE_BASED = 'scoreBased'; + public const OUTCOME_TYPE_TIMED_BLOCK = 'timedBlock'; public const REQUEST_TYPE_AUTHENTICATION = 'authentication'; public const REQUEST_TYPE_AUTHORIZATION = 'authorization'; public const REQUEST_TYPE_BANK_TRANSFER = 'bankTransfer'; @@ -318,6 +319,7 @@ public function getOutcomeTypeAllowableValues() self::OUTCOME_TYPE_ENFORCE_SCA, self::OUTCOME_TYPE_HARD_BLOCK, self::OUTCOME_TYPE_SCORE_BASED, + self::OUTCOME_TYPE_TIMED_BLOCK, ]; } /** @@ -527,7 +529,7 @@ public function getDescription() /** * Sets description * - * @param string $description Your description for the transaction rule, maximum 300 characters. + * @param string $description Your description for the transaction rule. * * @return self */ @@ -699,7 +701,7 @@ public function getReference() /** * Sets reference * - * @param string $reference Your reference for the transaction rule, maximum 150 characters. + * @param string $reference Your reference for the transaction rule. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php index 7163b92fe..571794acd 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php @@ -290,6 +290,7 @@ public function getModelName() public const OUTCOME_TYPE_ENFORCE_SCA = 'enforceSCA'; public const OUTCOME_TYPE_HARD_BLOCK = 'hardBlock'; public const OUTCOME_TYPE_SCORE_BASED = 'scoreBased'; + public const OUTCOME_TYPE_TIMED_BLOCK = 'timedBlock'; public const REQUEST_TYPE_AUTHENTICATION = 'authentication'; public const REQUEST_TYPE_AUTHORIZATION = 'authorization'; public const REQUEST_TYPE_BANK_TRANSFER = 'bankTransfer'; @@ -312,6 +313,7 @@ public function getOutcomeTypeAllowableValues() self::OUTCOME_TYPE_ENFORCE_SCA, self::OUTCOME_TYPE_HARD_BLOCK, self::OUTCOME_TYPE_SCORE_BASED, + self::OUTCOME_TYPE_TIMED_BLOCK, ]; } /** @@ -520,7 +522,7 @@ public function getDescription() /** * Sets description * - * @param string $description Your description for the transaction rule, maximum 300 characters. + * @param string $description Your description for the transaction rule. * * @return self */ @@ -665,7 +667,7 @@ public function getReference() /** * Sets reference * - * @param string $reference Your reference for the transaction rule, maximum 150 characters. + * @param string $reference Your reference for the transaction rule. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php index 243e16d77..4ae7096bc 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php @@ -536,7 +536,7 @@ public function getType() /** * Sets type * - * @param string $type The [type of interval](https://docs.adyen.com/issuing/transaction-rules#time-intervals) during which the rule conditions and limits apply, and how often counters are reset. Possible values: * **perTransaction**: conditions are evaluated and the counters are reset for every transaction. * **daily**: the counters are reset daily at 00:00:00 UTC. * **weekly**: the counters are reset every Monday at 00:00:00 UTC. * **monthly**: the counters reset every first day of the month at 00:00:00 UTC. * **lifetime**: conditions are applied to the lifetime of the payment instrument. * **rolling**: conditions are applied and the counters are reset based on a `duration`. If the reset date and time are not provided, Adyen applies the default reset time similar to fixed intervals. For example, if the duration is every two weeks, the counter resets every third Monday at 00:00:00 UTC. * **sliding**: conditions are applied and the counters are reset based on the current time and a `duration` that you specify. + * @param string $type The [type of interval](https://docs.adyen.com/issuing/transaction-rules#time-intervals) during which the rule conditions and limits apply, and how often counters are reset. Possible values: * **perTransaction**: conditions are evaluated and the counters are reset for every transaction. * **daily**: the counters are reset daily at 00:00:00 CET. * **weekly**: the counters are reset every Monday at 00:00:00 CET. * **monthly**: the counters reset every first day of the month at 00:00:00 CET. * **lifetime**: conditions are applied to the lifetime of the payment instrument. * **rolling**: conditions are applied and the counters are reset based on a `duration`. If the reset date and time are not provided, Adyen applies the default reset time similar to fixed intervals. For example, if the duration is every two weeks, the counter resets every third Monday at 00:00:00 CET. * **sliding**: conditions are applied and the counters are reset based on the current time and a `duration` that you specify. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php b/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php index 7104d2fad..10ac56d07 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php @@ -57,6 +57,7 @@ class TransactionRuleRestrictions implements ModelInterface, ArrayAccess, \JsonS 'merchantNames' => '\Adyen\Model\BalancePlatform\MerchantNamesRestriction', 'merchants' => '\Adyen\Model\BalancePlatform\MerchantsRestriction', 'processingTypes' => '\Adyen\Model\BalancePlatform\ProcessingTypesRestriction', + 'riskScores' => '\Adyen\Model\BalancePlatform\RiskScoresRestriction', 'sameAmountRestriction' => '\Adyen\Model\BalancePlatform\SameAmountRestriction', 'sameCounterpartyRestriction' => '\Adyen\Model\BalancePlatform\SameCounterpartyRestriction', 'timeOfDay' => '\Adyen\Model\BalancePlatform\TimeOfDayRestriction', @@ -84,6 +85,7 @@ class TransactionRuleRestrictions implements ModelInterface, ArrayAccess, \JsonS 'merchantNames' => null, 'merchants' => null, 'processingTypes' => null, + 'riskScores' => null, 'sameAmountRestriction' => null, 'sameCounterpartyRestriction' => null, 'timeOfDay' => null, @@ -109,6 +111,7 @@ class TransactionRuleRestrictions implements ModelInterface, ArrayAccess, \JsonS 'merchantNames' => false, 'merchants' => false, 'processingTypes' => false, + 'riskScores' => false, 'sameAmountRestriction' => false, 'sameCounterpartyRestriction' => false, 'timeOfDay' => false, @@ -214,6 +217,7 @@ public function isNullableSetToNull(string $property): bool 'merchantNames' => 'merchantNames', 'merchants' => 'merchants', 'processingTypes' => 'processingTypes', + 'riskScores' => 'riskScores', 'sameAmountRestriction' => 'sameAmountRestriction', 'sameCounterpartyRestriction' => 'sameCounterpartyRestriction', 'timeOfDay' => 'timeOfDay', @@ -239,6 +243,7 @@ public function isNullableSetToNull(string $property): bool 'merchantNames' => 'setMerchantNames', 'merchants' => 'setMerchants', 'processingTypes' => 'setProcessingTypes', + 'riskScores' => 'setRiskScores', 'sameAmountRestriction' => 'setSameAmountRestriction', 'sameCounterpartyRestriction' => 'setSameCounterpartyRestriction', 'timeOfDay' => 'setTimeOfDay', @@ -264,6 +269,7 @@ public function isNullableSetToNull(string $property): bool 'merchantNames' => 'getMerchantNames', 'merchants' => 'getMerchants', 'processingTypes' => 'getProcessingTypes', + 'riskScores' => 'getRiskScores', 'sameAmountRestriction' => 'getSameAmountRestriction', 'sameCounterpartyRestriction' => 'getSameCounterpartyRestriction', 'timeOfDay' => 'getTimeOfDay', @@ -340,6 +346,7 @@ public function __construct(array $data = null) $this->setIfExists('merchantNames', $data ?? [], null); $this->setIfExists('merchants', $data ?? [], null); $this->setIfExists('processingTypes', $data ?? [], null); + $this->setIfExists('riskScores', $data ?? [], null); $this->setIfExists('sameAmountRestriction', $data ?? [], null); $this->setIfExists('sameCounterpartyRestriction', $data ?? [], null); $this->setIfExists('timeOfDay', $data ?? [], null); @@ -739,6 +746,33 @@ public function setProcessingTypes($processingTypes) return $this; } + /** + * Gets riskScores + * + * @return \Adyen\Model\BalancePlatform\RiskScoresRestriction|null + */ + public function getRiskScores() + { + return $this->container['riskScores']; + } + + /** + * Sets riskScores + * + * @param \Adyen\Model\BalancePlatform\RiskScoresRestriction|null $riskScores riskScores + * + * @return self + */ + public function setRiskScores($riskScores) + { + if (is_null($riskScores)) { + throw new \InvalidArgumentException('non-nullable riskScores cannot be null'); + } + $this->container['riskScores'] = $riskScores; + + return $this; + } + /** * Gets sameAmountRestriction * diff --git a/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php index 2990ee9dd..27cea03bb 100644 --- a/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php @@ -45,7 +45,6 @@ class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'accountNumber' => 'string', - 'formFactor' => 'string', 'sortCode' => 'string', 'type' => 'string' ]; @@ -59,7 +58,6 @@ class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'accountNumber' => null, - 'formFactor' => null, 'sortCode' => null, 'type' => null ]; @@ -71,7 +69,6 @@ class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'accountNumber' => false, - 'formFactor' => true, 'sortCode' => false, 'type' => false ]; @@ -163,7 +160,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountNumber' => 'accountNumber', - 'formFactor' => 'formFactor', 'sortCode' => 'sortCode', 'type' => 'type' ]; @@ -175,7 +171,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountNumber' => 'setAccountNumber', - 'formFactor' => 'setFormFactor', 'sortCode' => 'setSortCode', 'type' => 'setType' ]; @@ -187,7 +182,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountNumber' => 'getAccountNumber', - 'formFactor' => 'getFormFactor', 'sortCode' => 'getSortCode', 'type' => 'getType' ]; @@ -262,7 +256,6 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('sortCode', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -354,40 +347,6 @@ public function setAccountNumber($accountNumber) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets sortCode * diff --git a/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php index e880d301a..efe9efe37 100644 --- a/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php @@ -46,7 +46,6 @@ class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'accountType' => 'string', - 'formFactor' => 'string', 'routingNumber' => 'string', 'type' => 'string' ]; @@ -61,7 +60,6 @@ class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'accountType' => null, - 'formFactor' => null, 'routingNumber' => null, 'type' => null ]; @@ -74,7 +72,6 @@ class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'accountType' => false, - 'formFactor' => true, 'routingNumber' => false, 'type' => false ]; @@ -167,7 +164,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'accountType' => 'accountType', - 'formFactor' => 'formFactor', 'routingNumber' => 'routingNumber', 'type' => 'type' ]; @@ -180,7 +176,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'accountType' => 'setAccountType', - 'formFactor' => 'setFormFactor', 'routingNumber' => 'setRoutingNumber', 'type' => 'setType' ]; @@ -193,7 +188,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'accountType' => 'getAccountType', - 'formFactor' => 'getFormFactor', 'routingNumber' => 'getRoutingNumber', 'type' => 'getType' ]; @@ -283,7 +277,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('accountType', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('routingNumber', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -421,40 +414,6 @@ public function setAccountType($accountType) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets routingNumber * diff --git a/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php b/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php index c3486861a..58b3b60e3 100644 --- a/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php +++ b/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php @@ -46,7 +46,7 @@ class UpdatePaymentInstrument implements ModelInterface, ArrayAccess, \JsonSeria protected static $openAPITypes = [ 'additionalBankAccountIdentifications' => '\Adyen\Model\BalancePlatform\PaymentInstrumentAdditionalBankAccountIdentificationsInner[]', 'balanceAccountId' => 'string', - 'bankAccount' => '\Adyen\Model\BalancePlatform\PaymentInstrumentBankAccount', + 'bankAccount' => '\Adyen\Model\BalancePlatform\BankAccountDetails', 'card' => '\Adyen\Model\BalancePlatform\Card', 'description' => 'string', 'id' => 'string', @@ -463,6 +463,7 @@ public function valid() * Gets additionalBankAccountIdentifications * * @return \Adyen\Model\BalancePlatform\PaymentInstrumentAdditionalBankAccountIdentificationsInner[]|null + * @deprecated */ public function getAdditionalBankAccountIdentifications() { @@ -475,6 +476,7 @@ public function getAdditionalBankAccountIdentifications() * @param \Adyen\Model\BalancePlatform\PaymentInstrumentAdditionalBankAccountIdentificationsInner[]|null $additionalBankAccountIdentifications Contains optional, additional business account details. Returned when you create a payment instrument with `type` **bankAccount**. * * @return self + * @deprecated */ public function setAdditionalBankAccountIdentifications($additionalBankAccountIdentifications) { @@ -516,7 +518,7 @@ public function setBalanceAccountId($balanceAccountId) /** * Gets bankAccount * - * @return \Adyen\Model\BalancePlatform\PaymentInstrumentBankAccount|null + * @return \Adyen\Model\BalancePlatform\BankAccountDetails|null */ public function getBankAccount() { @@ -526,7 +528,7 @@ public function getBankAccount() /** * Sets bankAccount * - * @param \Adyen\Model\BalancePlatform\PaymentInstrumentBankAccount|null $bankAccount bankAccount + * @param \Adyen\Model\BalancePlatform\BankAccountDetails|null $bankAccount bankAccount * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.php index b064e5f77..4afa62b0c 100644 --- a/src/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.php +++ b/src/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.php @@ -51,6 +51,8 @@ class UpdateSweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSe 'id' => 'string', 'priorities' => 'string[]', 'reason' => 'string', + 'reference' => 'string', + 'referenceForBeneficiary' => 'string', 'schedule' => '\Adyen\Model\BalancePlatform\SweepSchedule', 'status' => 'string', 'sweepAmount' => '\Adyen\Model\BalancePlatform\Amount', @@ -74,6 +76,8 @@ class UpdateSweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSe 'id' => null, 'priorities' => null, 'reason' => null, + 'reference' => null, + 'referenceForBeneficiary' => null, 'schedule' => null, 'status' => null, 'sweepAmount' => null, @@ -95,6 +99,8 @@ class UpdateSweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSe 'id' => false, 'priorities' => false, 'reason' => false, + 'reference' => false, + 'referenceForBeneficiary' => false, 'schedule' => false, 'status' => false, 'sweepAmount' => false, @@ -196,6 +202,8 @@ public function isNullableSetToNull(string $property): bool 'id' => 'id', 'priorities' => 'priorities', 'reason' => 'reason', + 'reference' => 'reference', + 'referenceForBeneficiary' => 'referenceForBeneficiary', 'schedule' => 'schedule', 'status' => 'status', 'sweepAmount' => 'sweepAmount', @@ -217,6 +225,8 @@ public function isNullableSetToNull(string $property): bool 'id' => 'setId', 'priorities' => 'setPriorities', 'reason' => 'setReason', + 'reference' => 'setReference', + 'referenceForBeneficiary' => 'setReferenceForBeneficiary', 'schedule' => 'setSchedule', 'status' => 'setStatus', 'sweepAmount' => 'setSweepAmount', @@ -238,6 +248,8 @@ public function isNullableSetToNull(string $property): bool 'id' => 'getId', 'priorities' => 'getPriorities', 'reason' => 'getReason', + 'reference' => 'getReference', + 'referenceForBeneficiary' => 'getReferenceForBeneficiary', 'schedule' => 'getSchedule', 'status' => 'getStatus', 'sweepAmount' => 'getSweepAmount', @@ -308,6 +320,7 @@ public function getModelName() public const REASON_DECLINED_BY_TRANSACTION_RULE = 'declinedByTransactionRule'; public const REASON_ERROR = 'error'; public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; + public const REASON_PENDING_APPROVAL = 'pendingApproval'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; @@ -366,6 +379,7 @@ public function getReasonAllowableValues() self::REASON_DECLINED_BY_TRANSACTION_RULE, self::REASON_ERROR, self::REASON_NOT_ENOUGH_BALANCE, + self::REASON_PENDING_APPROVAL, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, @@ -418,6 +432,8 @@ public function __construct(array $data = null) $this->setIfExists('id', $data ?? [], null); $this->setIfExists('priorities', $data ?? [], null); $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('referenceForBeneficiary', $data ?? [], null); $this->setIfExists('schedule', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('sweepAmount', $data ?? [], null); @@ -662,7 +678,7 @@ public function getPriorities() /** * Sets priorities * - * @param string[]|null $priorities The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority listed first, and if that's not possible, it moves on to the next option in the order of provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see [optional priorities setup](https://docs.adyen.com/marketplaces-and-platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). + * @param string[]|null $priorities The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority you list first. If that's not possible, it moves on to the next option in the order of your provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see optional priorities setup for [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) or [platforms](https://docs.adyen.com/platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). * * @return self */ @@ -722,6 +738,60 @@ public function setReason($reason) return $this; } + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the sweep configuration. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets referenceForBeneficiary + * + * @return string|null + */ + public function getReferenceForBeneficiary() + { + return $this->container['referenceForBeneficiary']; + } + + /** + * Sets referenceForBeneficiary + * + * @param string|null $referenceForBeneficiary The reference sent to or received from the counterparty. Only alphanumeric characters are allowed. + * + * @return self + */ + public function setReferenceForBeneficiary($referenceForBeneficiary) + { + if (is_null($referenceForBeneficiary)) { + throw new \InvalidArgumentException('non-nullable referenceForBeneficiary cannot be null'); + } + $this->container['referenceForBeneficiary'] = $referenceForBeneficiary; + + return $this; + } + /** * Gets schedule * diff --git a/src/Adyen/Model/BinLookup/ObjectSerializer.php b/src/Adyen/Model/BinLookup/ObjectSerializer.php index 4bdfceeda..09437b7d8 100644 --- a/src/Adyen/Model/BinLookup/ObjectSerializer.php +++ b/src/Adyen/Model/BinLookup/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php index cb856866a..463b3ef5f 100644 --- a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php +++ b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php @@ -1852,7 +1852,7 @@ public function getShopperEmail() /** * Sets shopperEmail * - * @param string $shopperEmail + * @param string $shopperEmail * * @return self */ @@ -1879,7 +1879,7 @@ public function getTelephoneNumber() /** * Sets telephoneNumber * - * @param string $telephoneNumber + * @param string $telephoneNumber * * @return self */ diff --git a/src/Adyen/Model/Checkout/MbwayDetails.php b/src/Adyen/Model/Checkout/MbwayDetails.php index b55de8e2f..feec9e45a 100644 --- a/src/Adyen/Model/Checkout/MbwayDetails.php +++ b/src/Adyen/Model/Checkout/MbwayDetails.php @@ -364,7 +364,7 @@ public function getShopperEmail() /** * Sets shopperEmail * - * @param string $shopperEmail + * @param string $shopperEmail * * @return self */ @@ -391,7 +391,7 @@ public function getTelephoneNumber() /** * Sets telephoneNumber * - * @param string $telephoneNumber + * @param string $telephoneNumber * * @return self */ diff --git a/src/Adyen/Model/Checkout/ObjectSerializer.php b/src/Adyen/Model/Checkout/ObjectSerializer.php index 2b682c18f..628f63adc 100644 --- a/src/Adyen/Model/Checkout/ObjectSerializer.php +++ b/src/Adyen/Model/Checkout/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Checkout/VippsDetails.php b/src/Adyen/Model/Checkout/VippsDetails.php index 143c331a7..25819f922 100644 --- a/src/Adyen/Model/Checkout/VippsDetails.php +++ b/src/Adyen/Model/Checkout/VippsDetails.php @@ -424,7 +424,7 @@ public function getTelephoneNumber() /** * Sets telephoneNumber * - * @param string $telephoneNumber + * @param string $telephoneNumber * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/AccountHolder.php b/src/Adyen/Model/ConfigurationWebhooks/AccountHolder.php index 3b67f1ca0..a34bc424b 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/AccountHolder.php +++ b/src/Adyen/Model/ConfigurationWebhooks/AccountHolder.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * @@ -287,10 +287,9 @@ public function getModelName() return self::$openAPIModelName; } - public const STATUS_ACTIVE = 'Active'; - public const STATUS_CLOSED = 'Closed'; - public const STATUS_INACTIVE = 'Inactive'; - public const STATUS_SUSPENDED = 'Suspended'; + public const STATUS_ACTIVE = 'active'; + public const STATUS_CLOSED = 'closed'; + public const STATUS_SUSPENDED = 'suspended'; /** * Gets allowable values of the enum @@ -302,7 +301,6 @@ public function getStatusAllowableValues() return [ self::STATUS_ACTIVE, self::STATUS_CLOSED, - self::STATUS_INACTIVE, self::STATUS_SUSPENDED, ]; } @@ -487,7 +485,7 @@ public function getDescription() /** * Sets description * - * @param string|null $description Your description for the account holder, maximum 300 characters. + * @param string|null $description Your description for the account holder. * * @return self */ @@ -649,7 +647,7 @@ public function getReference() /** * Sets reference * - * @param string|null $reference Your reference for the account holder, maximum 150 characters. + * @param string|null $reference Your reference for the account holder. * * @return self */ @@ -676,7 +674,7 @@ public function getStatus() /** * Sets status * - * @param string|null $status The status of the account holder. Possible values: * **Active**: The account holder is active. This is the default status when creating an account holder. * **Inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **Suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **Closed**: The account holder is permanently deactivated by you. This action cannot be undone. + * @param string|null $status The status of the account holder. Possible values: * **active**: The account holder is active. This is the default status when creating an account holder. * **suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **closed**: The account holder is permanently deactivated by you. This action cannot be undone. * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.php b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.php index 1f74586a8..aa9a2a151 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.php +++ b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.php b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.php index 5a7954cb8..a155f42bb 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.php +++ b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.php index 94b9d9afe..14a0ccb52 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.php +++ b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.php b/src/Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.php index 6ebb54753..9fcbfb883 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.php +++ b/src/Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/Address.php b/src/Adyen/Model/ConfigurationWebhooks/Address.php index 927c30fbf..1f1668736 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Address.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Address.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/Amount.php b/src/Adyen/Model/ConfigurationWebhooks/Amount.php index cb21123d0..cc5836be4 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Amount.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Amount.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/Authentication.php b/src/Adyen/Model/ConfigurationWebhooks/Authentication.php index 411453ae7..53025685e 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Authentication.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Authentication.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/Balance.php b/src/Adyen/Model/ConfigurationWebhooks/Balance.php index 31a4660c9..f422c37d2 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Balance.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Balance.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * @@ -329,7 +329,7 @@ public function getAvailable() /** * Sets available * - * @param int $available The remaining amount available for spending. + * @param int $available The current balance minus any reserved balance. * * @return self */ @@ -356,7 +356,7 @@ public function getBalance() /** * Sets balance * - * @param int $balance The total amount in the balance. + * @param int $balance The current balance of funds in the balance account. These are the funds from all transactions with a value date in the past that have not yet been paid out. * * @return self */ @@ -410,7 +410,7 @@ public function getPending() /** * Sets pending * - * @param int|null $pending The amount pending to be paid out but not yet available in the balance. + * @param int|null $pending The amount of funds that Adyen has processed for this account, but will be settled in a future date. For more information, see how to settle funds for users in your [platform](https://docs.adyen.com/platforms/settle-funds) and [marketplace](https://docs.adyen.com/marketplaces/settle-funds). * * @return self */ @@ -437,7 +437,7 @@ public function getReserved() /** * Sets reserved * - * @param int $reserved The amount reserved for payments that have been authorised, but have not been captured yet. + * @param int $reserved The amount reserved for payments that have been [authorised](https://docs.adyen.com/issuing/payment-stages/#authorised), but not yet [captured](https://docs.adyen.com/issuing/payment-stages/#captured) by the merchant. Applies only to [Adyen-issued cards](https://docs.adyen.com/issuing). * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/BalanceAccount.php b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccount.php index 42caf2cf6..cb49ddfaa 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/BalanceAccount.php +++ b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccount.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * @@ -51,7 +51,6 @@ class BalanceAccount implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'string', 'metadata' => 'array', 'migratedAccountCode' => 'string', - 'paymentInstruments' => '\Adyen\Model\ConfigurationWebhooks\PaymentInstrumentReference[]', 'platformPaymentConfiguration' => '\Adyen\Model\ConfigurationWebhooks\PlatformPaymentConfiguration', 'reference' => 'string', 'status' => 'string', @@ -73,7 +72,6 @@ class BalanceAccount implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => null, 'metadata' => null, 'migratedAccountCode' => null, - 'paymentInstruments' => null, 'platformPaymentConfiguration' => null, 'reference' => null, 'status' => null, @@ -93,7 +91,6 @@ class BalanceAccount implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => false, 'metadata' => false, 'migratedAccountCode' => false, - 'paymentInstruments' => false, 'platformPaymentConfiguration' => false, 'reference' => false, 'status' => false, @@ -193,7 +190,6 @@ public function isNullableSetToNull(string $property): bool 'id' => 'id', 'metadata' => 'metadata', 'migratedAccountCode' => 'migratedAccountCode', - 'paymentInstruments' => 'paymentInstruments', 'platformPaymentConfiguration' => 'platformPaymentConfiguration', 'reference' => 'reference', 'status' => 'status', @@ -213,7 +209,6 @@ public function isNullableSetToNull(string $property): bool 'id' => 'setId', 'metadata' => 'setMetadata', 'migratedAccountCode' => 'setMigratedAccountCode', - 'paymentInstruments' => 'setPaymentInstruments', 'platformPaymentConfiguration' => 'setPlatformPaymentConfiguration', 'reference' => 'setReference', 'status' => 'setStatus', @@ -233,7 +228,6 @@ public function isNullableSetToNull(string $property): bool 'id' => 'getId', 'metadata' => 'getMetadata', 'migratedAccountCode' => 'getMigratedAccountCode', - 'paymentInstruments' => 'getPaymentInstruments', 'platformPaymentConfiguration' => 'getPlatformPaymentConfiguration', 'reference' => 'getReference', 'status' => 'getStatus', @@ -281,10 +275,10 @@ public function getModelName() return self::$openAPIModelName; } - public const STATUS_ACTIVE = 'Active'; - public const STATUS_CLOSED = 'Closed'; - public const STATUS_INACTIVE = 'Inactive'; - public const STATUS_SUSPENDED = 'Suspended'; + public const STATUS_ACTIVE = 'active'; + public const STATUS_CLOSED = 'closed'; + public const STATUS_INACTIVE = 'inactive'; + public const STATUS_SUSPENDED = 'suspended'; /** * Gets allowable values of the enum @@ -322,7 +316,6 @@ public function __construct(array $data = null) $this->setIfExists('id', $data ?? [], null); $this->setIfExists('metadata', $data ?? [], null); $this->setIfExists('migratedAccountCode', $data ?? [], null); - $this->setIfExists('paymentInstruments', $data ?? [], null); $this->setIfExists('platformPaymentConfiguration', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); @@ -575,33 +568,6 @@ public function setMigratedAccountCode($migratedAccountCode) return $this; } - /** - * Gets paymentInstruments - * - * @return \Adyen\Model\ConfigurationWebhooks\PaymentInstrumentReference[]|null - */ - public function getPaymentInstruments() - { - return $this->container['paymentInstruments']; - } - - /** - * Sets paymentInstruments - * - * @param \Adyen\Model\ConfigurationWebhooks\PaymentInstrumentReference[]|null $paymentInstruments List of [payment instruments](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/paymentInstruments) associated with the balance account. - * - * @return self - */ - public function setPaymentInstruments($paymentInstruments) - { - if (is_null($paymentInstruments)) { - throw new \InvalidArgumentException('non-nullable paymentInstruments cannot be null'); - } - $this->container['paymentInstruments'] = $paymentInstruments; - - return $this; - } - /** * Gets platformPaymentConfiguration * @@ -669,7 +635,7 @@ public function getStatus() /** * Sets status * - * @param string|null $status The status of the balance account, set to **Active** by default. + * @param string|null $status The status of the balance account, set to **active** by default. * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.php b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.php index 5132009b0..8cb2b6a83 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.php +++ b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.php index 651ad07e0..81e29f7e8 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.php +++ b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.php b/src/Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.php index 7ddd77978..bca6faa1a 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.php +++ b/src/Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/BankAccountDetails.php b/src/Adyen/Model/ConfigurationWebhooks/BankAccountDetails.php new file mode 100644 index 000000000..bf6fc5257 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/BankAccountDetails.php @@ -0,0 +1,617 @@ + + */ +class BankAccountDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BankAccountDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'accountType' => 'string', + 'formFactor' => 'string', + 'iban' => 'string', + 'routingNumber' => 'string', + 'sortCode' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'accountType' => null, + 'formFactor' => null, + 'iban' => null, + 'routingNumber' => null, + 'sortCode' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'accountType' => false, + 'formFactor' => false, + 'iban' => false, + 'routingNumber' => false, + 'sortCode' => 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 = [ + 'accountNumber' => 'accountNumber', + 'accountType' => 'accountType', + 'formFactor' => 'formFactor', + 'iban' => 'iban', + 'routingNumber' => 'routingNumber', + 'sortCode' => 'sortCode', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'accountType' => 'setAccountType', + 'formFactor' => 'setFormFactor', + 'iban' => 'setIban', + 'routingNumber' => 'setRoutingNumber', + 'sortCode' => 'setSortCode', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'accountType' => 'getAccountType', + 'formFactor' => 'getFormFactor', + 'iban' => 'getIban', + 'routingNumber' => 'getRoutingNumber', + 'sortCode' => 'getSortCode', + '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('accountNumber', $data ?? [], null); + $this->setIfExists('accountType', $data ?? [], null); + $this->setIfExists('formFactor', $data ?? [], null); + $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('routingNumber', $data ?? [], null); + $this->setIfExists('sortCode', $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 = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' 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 accountNumber + * + * @return string|null + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string|null $accountNumber The bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets accountType + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['accountType']; + } + + /** + * Sets accountType + * + * @param string|null $accountType The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * + * @return self + */ + public function setAccountType($accountType) + { + if (is_null($accountType)) { + throw new \InvalidArgumentException('non-nullable accountType cannot be null'); + } + $this->container['accountType'] = $accountType; + + return $this; + } + + /** + * Gets formFactor + * + * @return string|null + */ + public function getFormFactor() + { + return $this->container['formFactor']; + } + + /** + * Sets formFactor + * + * @param string|null $formFactor Business accounts with a `formFactor` value of **physical** are business accounts issued under the central bank of that country. The default value is **physical** for NL, US, and UK business accounts. Adyen creates a local IBAN for business accounts when the `formFactor` value is set to **virtual**. The local IBANs that are supported are for DE and FR, which reference a physical NL account, with funds being routed through the central bank of NL. + * + * @return self + */ + public function setFormFactor($formFactor) + { + if (is_null($formFactor)) { + throw new \InvalidArgumentException('non-nullable formFactor cannot be null'); + } + $this->container['formFactor'] = $formFactor; + + return $this; + } + + /** + * Gets iban + * + * @return string|null + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string|null $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * + * @return self + */ + public function setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets routingNumber + * + * @return string|null + */ + public function getRoutingNumber() + { + return $this->container['routingNumber']; + } + + /** + * Sets routingNumber + * + * @param string|null $routingNumber The [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. + * + * @return self + */ + public function setRoutingNumber($routingNumber) + { + if (is_null($routingNumber)) { + throw new \InvalidArgumentException('non-nullable routingNumber cannot be null'); + } + $this->container['routingNumber'] = $routingNumber; + + return $this; + } + + /** + * Gets sortCode + * + * @return string|null + */ + public function getSortCode() + { + return $this->container['sortCode']; + } + + /** + * Sets sortCode + * + * @param string|null $sortCode The [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. + * + * @return self + */ + public function setSortCode($sortCode) + { + if (is_null($sortCode)) { + throw new \InvalidArgumentException('non-nullable sortCode cannot be null'); + } + $this->container['sortCode'] = $sortCode; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **iban** or **usLocal** or **ukLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $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/ConfigurationWebhooks/BulkAddress.php b/src/Adyen/Model/ConfigurationWebhooks/BulkAddress.php index ec3739725..f0a9e41c9 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/BulkAddress.php +++ b/src/Adyen/Model/ConfigurationWebhooks/BulkAddress.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblem.php b/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblem.php index 4b78e2b8f..80baffb47 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblem.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblem.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntity.php b/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntity.php index e26aea7fe..00b9f84c6 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntity.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntity.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.php b/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.php index e96d057e3..666b0f038 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php b/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php index 13a31e24c..e89f34bd5 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * @@ -358,7 +358,7 @@ public function getAmountPerIndustry() /** * Sets amountPerIndustry * - * @param array|null $amountPerIndustry + * @param array|null $amountPerIndustry * * @return self */ @@ -385,7 +385,7 @@ public function getAuthorizedCardUsers() /** * Sets authorizedCardUsers * - * @param bool|null $authorizedCardUsers + * @param bool|null $authorizedCardUsers * * @return self */ @@ -412,7 +412,7 @@ public function getFundingSource() /** * Sets fundingSource * - * @param string[]|null $fundingSource + * @param string[]|null $fundingSource * * @return self */ @@ -448,7 +448,7 @@ public function getInterval() /** * Sets interval * - * @param string|null $interval + * @param string|null $interval * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/Card.php b/src/Adyen/Model/ConfigurationWebhooks/Card.php index a4ba0ed42..08240150b 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Card.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Card.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * @@ -51,7 +51,7 @@ class Card implements ModelInterface, ArrayAccess, \JsonSerializable 'cardholderName' => 'string', 'configuration' => '\Adyen\Model\ConfigurationWebhooks\CardConfiguration', 'cvc' => 'string', - 'deliveryContact' => '\Adyen\Model\ConfigurationWebhooks\Contact', + 'deliveryContact' => '\Adyen\Model\ConfigurationWebhooks\DeliveryContact', 'expiration' => '\Adyen\Model\ConfigurationWebhooks\Expiry', 'formFactor' => 'string', 'lastFour' => 'string', @@ -592,7 +592,7 @@ public function setCvc($cvc) /** * Gets deliveryContact * - * @return \Adyen\Model\ConfigurationWebhooks\Contact|null + * @return \Adyen\Model\ConfigurationWebhooks\DeliveryContact|null */ public function getDeliveryContact() { @@ -602,7 +602,7 @@ public function getDeliveryContact() /** * Sets deliveryContact * - * @param \Adyen\Model\ConfigurationWebhooks\Contact|null $deliveryContact deliveryContact + * @param \Adyen\Model\ConfigurationWebhooks\DeliveryContact|null $deliveryContact deliveryContact * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/CardConfiguration.php b/src/Adyen/Model/ConfigurationWebhooks/CardConfiguration.php index 1f7b91848..364ef9ef8 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CardConfiguration.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CardConfiguration.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/CardOrderItem.php b/src/Adyen/Model/ConfigurationWebhooks/CardOrderItem.php index 4272fa87f..8133963c6 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CardOrderItem.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CardOrderItem.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.php b/src/Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.php index 94dd81ed5..24a9c5320 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.php index b47ddcb4b..a649c8956 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/ContactDetails.php b/src/Adyen/Model/ConfigurationWebhooks/ContactDetails.php index fb005e0ac..619301438 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/ContactDetails.php +++ b/src/Adyen/Model/ConfigurationWebhooks/ContactDetails.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/DeliveryAddress.php b/src/Adyen/Model/ConfigurationWebhooks/DeliveryAddress.php new file mode 100644 index 000000000..89c9ea763 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/DeliveryAddress.php @@ -0,0 +1,617 @@ + + */ +class DeliveryAddress implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DeliveryAddress'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'country' => 'string', + 'line1' => 'string', + 'line2' => 'string', + 'line3' => 'string', + 'postalCode' => 'string', + 'stateOrProvince' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'city' => null, + 'country' => null, + 'line1' => null, + 'line2' => null, + 'line3' => null, + 'postalCode' => null, + 'stateOrProvince' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'city' => false, + 'country' => false, + 'line1' => false, + 'line2' => false, + 'line3' => false, + 'postalCode' => false, + 'stateOrProvince' => 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 = [ + 'city' => 'city', + 'country' => 'country', + 'line1' => 'line1', + 'line2' => 'line2', + 'line3' => 'line3', + 'postalCode' => 'postalCode', + 'stateOrProvince' => 'stateOrProvince' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'line1' => 'setLine1', + 'line2' => 'setLine2', + 'line3' => 'setLine3', + 'postalCode' => 'setPostalCode', + 'stateOrProvince' => 'setStateOrProvince' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'line1' => 'getLine1', + 'line2' => 'getLine2', + 'line3' => 'getLine3', + 'postalCode' => 'getPostalCode', + 'stateOrProvince' => 'getStateOrProvince' + ]; + + /** + * 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('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('line1', $data ?? [], null); + $this->setIfExists('line2', $data ?? [], null); + $this->setIfExists('line3', $data ?? [], null); + $this->setIfExists('postalCode', $data ?? [], null); + $this->setIfExists('stateOrProvince', $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['country'] === null) { + $invalidProperties[] = "'country' 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 city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city The name of the city. + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country The two-character ISO-3166-1 alpha-2 country code. For example, **US**. >If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets line1 + * + * @return string|null + */ + public function getLine1() + { + return $this->container['line1']; + } + + /** + * Sets line1 + * + * @param string|null $line1 The name of the street. Do not include the number of the building. For example, if the address is Simon Carmiggeltstraat 6-50, provide **Simon Carmiggeltstraat**. + * + * @return self + */ + public function setLine1($line1) + { + if (is_null($line1)) { + throw new \InvalidArgumentException('non-nullable line1 cannot be null'); + } + $this->container['line1'] = $line1; + + return $this; + } + + /** + * Gets line2 + * + * @return string|null + */ + public function getLine2() + { + return $this->container['line2']; + } + + /** + * Sets line2 + * + * @param string|null $line2 The number of the building. For example, if the address is Simon Carmiggeltstraat 6-50, provide **6-50**. + * + * @return self + */ + public function setLine2($line2) + { + if (is_null($line2)) { + throw new \InvalidArgumentException('non-nullable line2 cannot be null'); + } + $this->container['line2'] = $line2; + + return $this; + } + + /** + * Gets line3 + * + * @return string|null + */ + public function getLine3() + { + return $this->container['line3']; + } + + /** + * Sets line3 + * + * @param string|null $line3 Additional information about the delivery address. + * + * @return self + */ + public function setLine3($line3) + { + if (is_null($line3)) { + throw new \InvalidArgumentException('non-nullable line3 cannot be null'); + } + $this->container['line3'] = $line3; + + return $this; + } + + /** + * Gets postalCode + * + * @return string|null + */ + public function getPostalCode() + { + return $this->container['postalCode']; + } + + /** + * Sets postalCode + * + * @param string|null $postalCode The postal code. Maximum length: * 5 digits for an address in the US. * 10 characters for an address in all other countries. + * + * @return self + */ + public function setPostalCode($postalCode) + { + if (is_null($postalCode)) { + throw new \InvalidArgumentException('non-nullable postalCode cannot be null'); + } + $this->container['postalCode'] = $postalCode; + + return $this; + } + + /** + * Gets stateOrProvince + * + * @return string|null + */ + public function getStateOrProvince() + { + return $this->container['stateOrProvince']; + } + + /** + * Sets stateOrProvince + * + * @param string|null $stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + * + * @return self + */ + public function setStateOrProvince($stateOrProvince) + { + if (is_null($stateOrProvince)) { + throw new \InvalidArgumentException('non-nullable stateOrProvince cannot be null'); + } + $this->container['stateOrProvince'] = $stateOrProvince; + + 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/ConfigurationWebhooks/DeliveryContact.php b/src/Adyen/Model/ConfigurationWebhooks/DeliveryContact.php new file mode 100644 index 000000000..e300bd18a --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/DeliveryContact.php @@ -0,0 +1,620 @@ + + */ +class DeliveryContact implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DeliveryContact'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address' => '\Adyen\Model\ConfigurationWebhooks\DeliveryAddress', + 'company' => 'string', + 'email' => 'string', + 'fullPhoneNumber' => 'string', + 'name' => '\Adyen\Model\ConfigurationWebhooks\Name', + 'phoneNumber' => '\Adyen\Model\ConfigurationWebhooks\PhoneNumber', + 'webAddress' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address' => null, + 'company' => null, + 'email' => null, + 'fullPhoneNumber' => null, + 'name' => null, + 'phoneNumber' => null, + 'webAddress' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'address' => false, + 'company' => false, + 'email' => false, + 'fullPhoneNumber' => false, + 'name' => false, + 'phoneNumber' => false, + 'webAddress' => 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 = [ + 'address' => 'address', + 'company' => 'company', + 'email' => 'email', + 'fullPhoneNumber' => 'fullPhoneNumber', + 'name' => 'name', + 'phoneNumber' => 'phoneNumber', + 'webAddress' => 'webAddress' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'company' => 'setCompany', + 'email' => 'setEmail', + 'fullPhoneNumber' => 'setFullPhoneNumber', + 'name' => 'setName', + 'phoneNumber' => 'setPhoneNumber', + 'webAddress' => 'setWebAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'company' => 'getCompany', + 'email' => 'getEmail', + 'fullPhoneNumber' => 'getFullPhoneNumber', + 'name' => 'getName', + 'phoneNumber' => 'getPhoneNumber', + 'webAddress' => 'getWebAddress' + ]; + + /** + * 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('address', $data ?? [], null); + $this->setIfExists('company', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('fullPhoneNumber', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('phoneNumber', $data ?? [], null); + $this->setIfExists('webAddress', $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['address'] === null) { + $invalidProperties[] = "'address' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' 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 address + * + * @return \Adyen\Model\ConfigurationWebhooks\DeliveryAddress + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Adyen\Model\ConfigurationWebhooks\DeliveryAddress $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets company + * + * @return string|null + */ + public function getCompany() + { + return $this->container['company']; + } + + /** + * Sets company + * + * @param string|null $company The company name of the contact. + * + * @return self + */ + public function setCompany($company) + { + if (is_null($company)) { + throw new \InvalidArgumentException('non-nullable company cannot be null'); + } + $this->container['company'] = $company; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The email address of the contact. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets fullPhoneNumber + * + * @return string|null + */ + public function getFullPhoneNumber() + { + return $this->container['fullPhoneNumber']; + } + + /** + * Sets fullPhoneNumber + * + * @param string|null $fullPhoneNumber The full phone number of the contact provided as a single string. It will be handled as a landline phone. **Examples:** \"0031 6 11 22 33 44\", \"+316/1122-3344\", \"(0031) 611223344\" + * + * @return self + */ + public function setFullPhoneNumber($fullPhoneNumber) + { + if (is_null($fullPhoneNumber)) { + throw new \InvalidArgumentException('non-nullable fullPhoneNumber cannot be null'); + } + $this->container['fullPhoneNumber'] = $fullPhoneNumber; + + return $this; + } + + /** + * Gets name + * + * @return \Adyen\Model\ConfigurationWebhooks\Name + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Adyen\Model\ConfigurationWebhooks\Name $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets phoneNumber + * + * @return \Adyen\Model\ConfigurationWebhooks\PhoneNumber|null + */ + public function getPhoneNumber() + { + return $this->container['phoneNumber']; + } + + /** + * Sets phoneNumber + * + * @param \Adyen\Model\ConfigurationWebhooks\PhoneNumber|null $phoneNumber phoneNumber + * + * @return self + */ + public function setPhoneNumber($phoneNumber) + { + if (is_null($phoneNumber)) { + throw new \InvalidArgumentException('non-nullable phoneNumber cannot be null'); + } + $this->container['phoneNumber'] = $phoneNumber; + + return $this; + } + + /** + * Gets webAddress + * + * @return string|null + */ + public function getWebAddress() + { + return $this->container['webAddress']; + } + + /** + * Sets webAddress + * + * @param string|null $webAddress The URL of the contact's website. + * + * @return self + */ + public function setWebAddress($webAddress) + { + if (is_null($webAddress)) { + throw new \InvalidArgumentException('non-nullable webAddress cannot be null'); + } + $this->container['webAddress'] = $webAddress; + + 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/ConfigurationWebhooks/Expiry.php b/src/Adyen/Model/ConfigurationWebhooks/Expiry.php index 06abdb1a1..cbfef0832 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Expiry.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Expiry.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.php b/src/Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.php index 95ed05fb3..b8ad9086d 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.php +++ b/src/Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * @@ -44,7 +44,6 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ - 'formFactor' => 'string', 'iban' => 'string', 'type' => 'string' ]; @@ -57,7 +56,6 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ - 'formFactor' => null, 'iban' => null, 'type' => null ]; @@ -68,7 +66,6 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static $openAPINullables = [ - 'formFactor' => true, 'iban' => false, 'type' => false ]; @@ -159,7 +156,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'formFactor' => 'formFactor', 'iban' => 'iban', 'type' => 'type' ]; @@ -170,7 +166,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'formFactor' => 'setFormFactor', 'iban' => 'setIban', 'type' => 'setType' ]; @@ -181,7 +176,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'formFactor' => 'getFormFactor', 'iban' => 'getIban', 'type' => 'getType' ]; @@ -255,7 +249,6 @@ public function getTypeAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -317,40 +310,6 @@ public function valid() } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets iban * diff --git a/src/Adyen/Model/ConfigurationWebhooks/ModelInterface.php b/src/Adyen/Model/ConfigurationWebhooks/ModelInterface.php index 903c81b07..29be0aade 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/ModelInterface.php +++ b/src/Adyen/Model/ConfigurationWebhooks/ModelInterface.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/Name.php b/src/Adyen/Model/ConfigurationWebhooks/Name.php index 541b549cd..dca3bd365 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Name.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Name.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php b/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php index a94c73762..2d912cd58 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrument.php b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrument.php index 1dce82cff..bde9ae854 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrument.php +++ b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrument.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * @@ -46,7 +46,7 @@ class PaymentInstrument implements ModelInterface, ArrayAccess, \JsonSerializabl protected static $openAPITypes = [ 'additionalBankAccountIdentifications' => '\Adyen\Model\ConfigurationWebhooks\PaymentInstrumentAdditionalBankAccountIdentificationsInner[]', 'balanceAccountId' => 'string', - 'bankAccount' => '\Adyen\Model\ConfigurationWebhooks\PaymentInstrumentBankAccount', + 'bankAccount' => '\Adyen\Model\ConfigurationWebhooks\BankAccountDetails', 'card' => '\Adyen\Model\ConfigurationWebhooks\Card', 'description' => 'string', 'id' => 'string', @@ -54,6 +54,7 @@ class PaymentInstrument implements ModelInterface, ArrayAccess, \JsonSerializabl 'paymentInstrumentGroupId' => 'string', 'reference' => 'string', 'status' => 'string', + 'statusReason' => 'string', 'type' => 'string' ]; @@ -75,6 +76,7 @@ class PaymentInstrument implements ModelInterface, ArrayAccess, \JsonSerializabl 'paymentInstrumentGroupId' => null, 'reference' => null, 'status' => null, + 'statusReason' => null, 'type' => null ]; @@ -94,6 +96,7 @@ class PaymentInstrument implements ModelInterface, ArrayAccess, \JsonSerializabl 'paymentInstrumentGroupId' => false, 'reference' => false, 'status' => false, + 'statusReason' => false, 'type' => false ]; @@ -193,6 +196,7 @@ public function isNullableSetToNull(string $property): bool 'paymentInstrumentGroupId' => 'paymentInstrumentGroupId', 'reference' => 'reference', 'status' => 'status', + 'statusReason' => 'statusReason', 'type' => 'type' ]; @@ -212,6 +216,7 @@ public function isNullableSetToNull(string $property): bool 'paymentInstrumentGroupId' => 'setPaymentInstrumentGroupId', 'reference' => 'setReference', 'status' => 'setStatus', + 'statusReason' => 'setStatusReason', 'type' => 'setType' ]; @@ -231,6 +236,7 @@ public function isNullableSetToNull(string $property): bool 'paymentInstrumentGroupId' => 'getPaymentInstrumentGroupId', 'reference' => 'getReference', 'status' => 'getStatus', + 'statusReason' => 'getStatusReason', 'type' => 'getType' ]; @@ -275,15 +281,19 @@ public function getModelName() return self::$openAPIModelName; } - public const STATUS_ACTIVE = 'Active'; - public const STATUS_CLOSED = 'Closed'; - public const STATUS_INACTIVE = 'Inactive'; - public const STATUS_LOST = 'Lost'; - public const STATUS_REQUESTED = 'Requested'; - public const STATUS_STOLEN = 'Stolen'; - public const STATUS_SUSPENDED = 'Suspended'; - public const STATUS_BLOCKED = 'blocked'; - public const STATUS_DISCARDED = 'discarded'; + public const STATUS_ACTIVE = 'active'; + public const STATUS_CLOSED = 'closed'; + public const STATUS_INACTIVE = 'inactive'; + public const STATUS_SUSPENDED = 'suspended'; + public const STATUS_REASON_ACCOUNT_CLOSURE = 'accountClosure'; + public const STATUS_REASON_DAMAGED = 'damaged'; + public const STATUS_REASON_END_OF_LIFE = 'endOfLife'; + public const STATUS_REASON_EXPIRED = 'expired'; + public const STATUS_REASON_LOST = 'lost'; + public const STATUS_REASON_OTHER = 'other'; + public const STATUS_REASON_STOLEN = 'stolen'; + public const STATUS_REASON_SUSPECTED_FRAUD = 'suspectedFraud'; + public const STATUS_REASON_TRANSACTION_RULE = 'transactionRule'; public const TYPE_BANK_ACCOUNT = 'bankAccount'; public const TYPE_CARD = 'card'; @@ -298,12 +308,26 @@ public function getStatusAllowableValues() self::STATUS_ACTIVE, self::STATUS_CLOSED, self::STATUS_INACTIVE, - self::STATUS_LOST, - self::STATUS_REQUESTED, - self::STATUS_STOLEN, self::STATUS_SUSPENDED, - self::STATUS_BLOCKED, - self::STATUS_DISCARDED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusReasonAllowableValues() + { + return [ + self::STATUS_REASON_ACCOUNT_CLOSURE, + self::STATUS_REASON_DAMAGED, + self::STATUS_REASON_END_OF_LIFE, + self::STATUS_REASON_EXPIRED, + self::STATUS_REASON_LOST, + self::STATUS_REASON_OTHER, + self::STATUS_REASON_STOLEN, + self::STATUS_REASON_SUSPECTED_FRAUD, + self::STATUS_REASON_TRANSACTION_RULE, ]; } /** @@ -343,6 +367,7 @@ public function __construct(array $data = null) $this->setIfExists('paymentInstrumentGroupId', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('statusReason', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -391,6 +416,15 @@ public function listInvalidProperties() ); } + $allowedValues = $this->getStatusReasonAllowableValues(); + if (!is_null($this->container['statusReason']) && !in_array($this->container['statusReason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'statusReason', must be one of '%s'", + $this->container['statusReason'], + implode("', '", $allowedValues) + ); + } + if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } @@ -422,6 +456,7 @@ public function valid() * Gets additionalBankAccountIdentifications * * @return \Adyen\Model\ConfigurationWebhooks\PaymentInstrumentAdditionalBankAccountIdentificationsInner[]|null + * @deprecated */ public function getAdditionalBankAccountIdentifications() { @@ -434,6 +469,7 @@ public function getAdditionalBankAccountIdentifications() * @param \Adyen\Model\ConfigurationWebhooks\PaymentInstrumentAdditionalBankAccountIdentificationsInner[]|null $additionalBankAccountIdentifications Contains optional, additional business account details. Returned when you create a payment instrument with `type` **bankAccount**. * * @return self + * @deprecated */ public function setAdditionalBankAccountIdentifications($additionalBankAccountIdentifications) { @@ -475,7 +511,7 @@ public function setBalanceAccountId($balanceAccountId) /** * Gets bankAccount * - * @return \Adyen\Model\ConfigurationWebhooks\PaymentInstrumentBankAccount|null + * @return \Adyen\Model\ConfigurationWebhooks\BankAccountDetails|null */ public function getBankAccount() { @@ -485,7 +521,7 @@ public function getBankAccount() /** * Sets bankAccount * - * @param \Adyen\Model\ConfigurationWebhooks\PaymentInstrumentBankAccount|null $bankAccount bankAccount + * @param \Adyen\Model\ConfigurationWebhooks\BankAccountDetails|null $bankAccount bankAccount * * @return self */ @@ -674,7 +710,7 @@ public function getStatus() /** * Sets status * - * @param string|null $status The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **Active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **Requested**. Possible values: * **Active**: The payment instrument is active and can be used to make payments. * **Requested**: The payment instrument has been requested. This state is applicable for physical cards. * **Inactive**: The payment instrument is inactive and cannot be used to make payments. * **Suspended**: The payment instrument is temporarily suspended and cannot be used to make payments. * **Closed**: The payment instrument is permanently closed. This action cannot be undone. * **Stolen** * **Lost** + * @param string|null $status The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. * * @return self */ @@ -698,6 +734,43 @@ public function setStatus($status) return $this; } + /** + * Gets statusReason + * + * @return string|null + */ + public function getStatusReason() + { + return $this->container['statusReason']; + } + + /** + * Sets statusReason + * + * @param string|null $statusReason The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. + * + * @return self + */ + public function setStatusReason($statusReason) + { + if (is_null($statusReason)) { + throw new \InvalidArgumentException('non-nullable statusReason cannot be null'); + } + $allowedValues = $this->getStatusReasonAllowableValues(); + if (!in_array($statusReason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'statusReason', must be one of '%s'", + $statusReason, + implode("', '", $allowedValues) + ) + ); + } + $this->container['statusReason'] = $statusReason; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.php b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.php index cc9c08218..0ab0217b3 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.php +++ b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * @@ -44,7 +44,6 @@ class PaymentInstrumentAdditionalBankAccountIdentificationsInner implements Mode * @var string[] */ protected static $openAPITypes = [ - 'formFactor' => 'string', 'iban' => 'string', 'type' => 'string' ]; @@ -57,7 +56,6 @@ class PaymentInstrumentAdditionalBankAccountIdentificationsInner implements Mode * @psalm-var array */ protected static $openAPIFormats = [ - 'formFactor' => null, 'iban' => null, 'type' => null ]; @@ -68,7 +66,6 @@ class PaymentInstrumentAdditionalBankAccountIdentificationsInner implements Mode * @var boolean[] */ protected static $openAPINullables = [ - 'formFactor' => true, 'iban' => false, 'type' => false ]; @@ -159,7 +156,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'formFactor' => 'formFactor', 'iban' => 'iban', 'type' => 'type' ]; @@ -170,7 +166,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'formFactor' => 'setFormFactor', 'iban' => 'setIban', 'type' => 'setType' ]; @@ -181,7 +176,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'formFactor' => 'getFormFactor', 'iban' => 'getIban', 'type' => 'getType' ]; @@ -242,7 +236,6 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -296,40 +289,6 @@ public function valid() } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets iban * diff --git a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.php b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.php index 39c982ae1..64bb9dc7f 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.php +++ b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.php index 6965730a1..591c64af6 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.php +++ b/src/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/Phone.php b/src/Adyen/Model/ConfigurationWebhooks/Phone.php index df0b1ae8a..fedf9be5c 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Phone.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Phone.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * @@ -221,8 +221,8 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_LANDLINE = 'Landline'; - public const TYPE_MOBILE = 'Mobile'; + public const TYPE_LANDLINE = 'landline'; + public const TYPE_MOBILE = 'mobile'; /** * Gets allowable values of the enum diff --git a/src/Adyen/Model/ConfigurationWebhooks/PhoneNumber.php b/src/Adyen/Model/ConfigurationWebhooks/PhoneNumber.php index 8a7f85b39..b251cbcf4 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/PhoneNumber.php +++ b/src/Adyen/Model/ConfigurationWebhooks/PhoneNumber.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.php b/src/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.php index 8b927e20e..6c964f755 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.php +++ b/src/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * @@ -296,7 +296,7 @@ public function getSalesDayClosingTime() /** * Sets salesDayClosingTime * - * @param string|null $salesDayClosingTime Specifies at what time a [sales day](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement#sales-day) ends. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. + * @param string|null $salesDayClosingTime Specifies at what time a [sales day](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement#sales-day) ends for this account. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. * * @return self */ @@ -323,7 +323,7 @@ public function getSettlementDelayDays() /** * Sets settlementDelayDays * - * @param int|null $settlementDelayDays Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement#settlement-batch) are made available. Possible values: **0** to **10**, or **null**. * Setting this value to an integer enables [Sales day settlement](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement). * Setting this value to **null** enables [Pass-through settlement](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/pass-through-settlement). Default value: **null**. + * @param int|null $settlementDelayDays Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement#settlement-batch) are made available in this balance account. Possible values: **0** to **10**, or **null**. * Setting this value to an integer enables Sales day settlement in this balance account. See how Sales day settlement works in your [marketplace](https://docs.adyen.com/marketplaces/settle-funds/sales-day-settlement) or [platform](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement). * Setting this value to **null** enables Pass-through settlement in this balance account. See how Pass-through settlement works in your [marketplace](https://docs.adyen.com/marketplaces/settle-funds/pass-through-settlement) or [platform](https://docs.adyen.com/platforms/settle-funds/pass-through-settlement). Default value: **null**. * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/RemediatingAction.php b/src/Adyen/Model/ConfigurationWebhooks/RemediatingAction.php index 126a78b34..f597c4290 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/RemediatingAction.php +++ b/src/Adyen/Model/ConfigurationWebhooks/RemediatingAction.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/Resource.php b/src/Adyen/Model/ConfigurationWebhooks/Resource.php index 6b1516e31..727429ba1 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Resource.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Resource.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.php b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.php index b3ed5650f..e93a5113e 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.php +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.php index 7801290fa..f34b4ad7f 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.php +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.php b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.php index 89b6fcf65..63b89c7ad 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.php +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * @@ -44,11 +44,15 @@ class SweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ + 'category' => 'string', 'counterparty' => '\Adyen\Model\ConfigurationWebhooks\SweepCounterparty', 'currency' => 'string', 'description' => 'string', 'id' => 'string', + 'priorities' => 'string[]', 'reason' => 'string', + 'reference' => 'string', + 'referenceForBeneficiary' => 'string', 'schedule' => '\Adyen\Model\ConfigurationWebhooks\SweepSchedule', 'status' => 'string', 'sweepAmount' => '\Adyen\Model\ConfigurationWebhooks\Amount', @@ -65,11 +69,15 @@ class SweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ + 'category' => null, 'counterparty' => null, 'currency' => null, 'description' => null, 'id' => null, + 'priorities' => null, 'reason' => null, + 'reference' => null, + 'referenceForBeneficiary' => null, 'schedule' => null, 'status' => null, 'sweepAmount' => null, @@ -84,11 +92,15 @@ class SweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSerializ * @var boolean[] */ protected static $openAPINullables = [ + 'category' => false, 'counterparty' => false, 'currency' => false, 'description' => false, 'id' => false, + 'priorities' => false, 'reason' => false, + 'reference' => false, + 'referenceForBeneficiary' => false, 'schedule' => false, 'status' => false, 'sweepAmount' => false, @@ -183,11 +195,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'category' => 'category', 'counterparty' => 'counterparty', 'currency' => 'currency', 'description' => 'description', 'id' => 'id', + 'priorities' => 'priorities', 'reason' => 'reason', + 'reference' => 'reference', + 'referenceForBeneficiary' => 'referenceForBeneficiary', 'schedule' => 'schedule', 'status' => 'status', 'sweepAmount' => 'sweepAmount', @@ -202,11 +218,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'category' => 'setCategory', 'counterparty' => 'setCounterparty', 'currency' => 'setCurrency', 'description' => 'setDescription', 'id' => 'setId', + 'priorities' => 'setPriorities', 'reason' => 'setReason', + 'reference' => 'setReference', + 'referenceForBeneficiary' => 'setReferenceForBeneficiary', 'schedule' => 'setSchedule', 'status' => 'setStatus', 'sweepAmount' => 'setSweepAmount', @@ -221,11 +241,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'category' => 'getCategory', 'counterparty' => 'getCounterparty', 'currency' => 'getCurrency', 'description' => 'getDescription', 'id' => 'getId', + 'priorities' => 'getPriorities', 'reason' => 'getReason', + 'reference' => 'getReference', + 'referenceForBeneficiary' => 'getReferenceForBeneficiary', 'schedule' => 'getSchedule', 'status' => 'getStatus', 'sweepAmount' => 'getSweepAmount', @@ -275,6 +299,15 @@ public function getModelName() return self::$openAPIModelName; } + public const CATEGORY_BANK = 'bank'; + public const CATEGORY_INTERNAL = 'internal'; + public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; + public const PRIORITIES_CROSS_BORDER = 'crossBorder'; + public const PRIORITIES_FAST = 'fast'; + public const PRIORITIES_INSTANT = 'instant'; + public const PRIORITIES_INTERNAL = 'internal'; + public const PRIORITIES_REGULAR = 'regular'; + public const PRIORITIES_WIRE = 'wire'; public const REASON_AMOUNT_LIMIT_EXCEEDED = 'amountLimitExceeded'; public const REASON_APPROVED = 'approved'; public const REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE = 'balanceAccountTemporarilyBlockedByTransactionRule'; @@ -287,6 +320,7 @@ public function getModelName() public const REASON_DECLINED_BY_TRANSACTION_RULE = 'declinedByTransactionRule'; public const REASON_ERROR = 'error'; public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; + public const REASON_PENDING_APPROVAL = 'pendingApproval'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; @@ -296,6 +330,35 @@ public function getModelName() public const TYPE_PULL = 'pull'; public const TYPE_PUSH = 'push'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCategoryAllowableValues() + { + return [ + self::CATEGORY_BANK, + self::CATEGORY_INTERNAL, + self::CATEGORY_PLATFORM_PAYMENT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPrioritiesAllowableValues() + { + return [ + self::PRIORITIES_CROSS_BORDER, + self::PRIORITIES_FAST, + self::PRIORITIES_INSTANT, + self::PRIORITIES_INTERNAL, + self::PRIORITIES_REGULAR, + self::PRIORITIES_WIRE, + ]; + } /** * Gets allowable values of the enum * @@ -316,6 +379,7 @@ public function getReasonAllowableValues() self::REASON_DECLINED_BY_TRANSACTION_RULE, self::REASON_ERROR, self::REASON_NOT_ENOUGH_BALANCE, + self::REASON_PENDING_APPROVAL, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, @@ -361,11 +425,15 @@ public function getTypeAllowableValues() */ public function __construct(array $data = null) { + $this->setIfExists('category', $data ?? [], null); $this->setIfExists('counterparty', $data ?? [], null); $this->setIfExists('currency', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('priorities', $data ?? [], null); $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('referenceForBeneficiary', $data ?? [], null); $this->setIfExists('schedule', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('sweepAmount', $data ?? [], null); @@ -401,6 +469,15 @@ public function listInvalidProperties() { $invalidProperties = []; + $allowedValues = $this->getCategoryAllowableValues(); + if (!is_null($this->container['category']) && !in_array($this->container['category'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'category', must be one of '%s'", + $this->container['category'], + implode("', '", $allowedValues) + ); + } + if ($this->container['counterparty'] === null) { $invalidProperties[] = "'counterparty' can't be null"; } @@ -455,6 +532,43 @@ public function valid() } + /** + * Gets category + * + * @return string|null + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param string|null $category The type of transfer that results from the sweep. Possible values: - **bank**: Sweep to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. Required when setting `priorities`. + * + * @return self + */ + public function setCategory($category) + { + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); + } + $allowedValues = $this->getCategoryAllowableValues(); + if (!in_array($category, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'category', must be one of '%s'", + $category, + implode("', '", $allowedValues) + ) + ); + } + $this->container['category'] = $category; + + return $this; + } + /** * Gets counterparty * @@ -563,6 +677,42 @@ public function setId($id) return $this; } + /** + * Gets priorities + * + * @return string[]|null + */ + public function getPriorities() + { + return $this->container['priorities']; + } + + /** + * Sets priorities + * + * @param string[]|null $priorities The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority you list first. If that's not possible, it moves on to the next option in the order of your provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see optional priorities setup for [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) or [platforms](https://docs.adyen.com/platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). + * + * @return self + */ + public function setPriorities($priorities) + { + if (is_null($priorities)) { + throw new \InvalidArgumentException('non-nullable priorities cannot be null'); + } + $allowedValues = $this->getPrioritiesAllowableValues(); + if (array_diff($priorities, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'priorities', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['priorities'] = $priorities; + + return $this; + } + /** * Gets reason * @@ -600,6 +750,60 @@ public function setReason($reason) return $this; } + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the sweep configuration. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets referenceForBeneficiary + * + * @return string|null + */ + public function getReferenceForBeneficiary() + { + return $this->container['referenceForBeneficiary']; + } + + /** + * Sets referenceForBeneficiary + * + * @param string|null $referenceForBeneficiary The reference sent to or received from the counterparty. Only alphanumeric characters are allowed. + * + * @return self + */ + public function setReferenceForBeneficiary($referenceForBeneficiary) + { + if (is_null($referenceForBeneficiary)) { + throw new \InvalidArgumentException('non-nullable referenceForBeneficiary cannot be null'); + } + $this->container['referenceForBeneficiary'] = $referenceForBeneficiary; + + return $this; + } + /** * Gets schedule * diff --git a/src/Adyen/Model/ConfigurationWebhooks/SweepCounterparty.php b/src/Adyen/Model/ConfigurationWebhooks/SweepCounterparty.php index d6a2f90eb..25b65dc27 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/SweepCounterparty.php +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepCounterparty.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * @@ -357,7 +357,7 @@ public function getTransferInstrumentId() /** * Sets transferInstrumentId * - * @param string|null $transferInstrumentId The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) depending on the sweep `type` . To [set up automated top-up sweeps to balance accounts](https://docs.adyen.com/marketplaces-and-platforms/top-up-balance-account/#before-you-begin), use this parameter in combination with a `merchantAccount` and a sweep `type` of **pull**. Top-up sweeps start a direct debit request from the source transfer instrument. Contact Adyen Support to enable this feature. + * @param string|null $transferInstrumentId The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) depending on the sweep `type`. To set up automated top-up sweeps to balance accounts in your [marketplace](https://docs.adyen.com/marketplaces/top-up-balance-account/#before-you-begin) or [platform](https://docs.adyen.com/platforms/top-up-balance-account/#before-you-begin), use this parameter in combination with a `merchantAccount` and a sweep `type` of **pull**. Top-up sweeps start a direct debit request from the source transfer instrument. Contact Adyen Support to enable this feature. * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/SweepSchedule.php b/src/Adyen/Model/ConfigurationWebhooks/SweepSchedule.php index ce7b42fee..1b8bd2fa1 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/SweepSchedule.php +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepSchedule.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/VerificationDeadline.php b/src/Adyen/Model/ConfigurationWebhooks/VerificationDeadline.php index 78d607ee4..8d875353a 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/VerificationDeadline.php +++ b/src/Adyen/Model/ConfigurationWebhooks/VerificationDeadline.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/VerificationError.php b/src/Adyen/Model/ConfigurationWebhooks/VerificationError.php index dee6e43f6..782ebb497 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/VerificationError.php +++ b/src/Adyen/Model/ConfigurationWebhooks/VerificationError.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.php b/src/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.php index 8ffeb999b..6993029c6 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.php +++ b/src/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.php @@ -3,7 +3,7 @@ /** * Configuration webhooks * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.1 * diff --git a/src/Adyen/Model/DataProtection/ObjectSerializer.php b/src/Adyen/Model/DataProtection/ObjectSerializer.php index 1b86733ae..fe8491817 100644 --- a/src/Adyen/Model/DataProtection/ObjectSerializer.php +++ b/src/Adyen/Model/DataProtection/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Disputes/ObjectSerializer.php b/src/Adyen/Model/Disputes/ObjectSerializer.php index 5ef9f66af..d363f9e2a 100644 --- a/src/Adyen/Model/Disputes/ObjectSerializer.php +++ b/src/Adyen/Model/Disputes/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/LegalEntityManagement/IdentificationData.php b/src/Adyen/Model/LegalEntityManagement/IdentificationData.php index cdebc4e75..8ae919fde 100644 --- a/src/Adyen/Model/LegalEntityManagement/IdentificationData.php +++ b/src/Adyen/Model/LegalEntityManagement/IdentificationData.php @@ -252,6 +252,9 @@ public function getModelName() } public const TYPE_NATIONAL_ID_NUMBER = 'nationalIdNumber'; + public const TYPE_PASSPORT = 'passport'; + public const TYPE_DRIVERS_LICENSE = 'driversLicense'; + public const TYPE_IDENTITY_CARD = 'identityCard'; /** * Gets allowable values of the enum @@ -262,6 +265,9 @@ public function getTypeAllowableValues() { return [ self::TYPE_NATIONAL_ID_NUMBER, + self::TYPE_PASSPORT, + self::TYPE_DRIVERS_LICENSE, + self::TYPE_IDENTITY_CARD, ]; } /** @@ -519,7 +525,7 @@ public function getType() /** * Sets type * - * @param string $type Type of identity data. For **individual**, the `type` value is **nationalIdNumber**. + * @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** * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php b/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php index d25ad19d7..66642b915 100644 --- a/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php +++ b/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/LegalEntityManagement/OnboardingLinkInfo.php b/src/Adyen/Model/LegalEntityManagement/OnboardingLinkInfo.php index 26ff99732..7add4bf65 100644 --- a/src/Adyen/Model/LegalEntityManagement/OnboardingLinkInfo.php +++ b/src/Adyen/Model/LegalEntityManagement/OnboardingLinkInfo.php @@ -46,7 +46,7 @@ class OnboardingLinkInfo implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPITypes = [ 'locale' => 'string', 'redirectUrl' => 'string', - 'settings' => 'array', + 'settings' => '\Adyen\Model\LegalEntityManagement\OnboardingLinkSettings', 'themeId' => 'string' ]; @@ -354,7 +354,7 @@ public function setRedirectUrl($redirectUrl) /** * Gets settings * - * @return array|null + * @return \Adyen\Model\LegalEntityManagement\OnboardingLinkSettings|null */ public function getSettings() { @@ -364,7 +364,7 @@ public function getSettings() /** * Sets settings * - * @param array|null $settings Boolean key-value pairs indicating the settings for the hosted onboarding page. The keys are the settings. Possible keys: By default, these values are set to **true**. Set to **false** to not allow the action. - **changeLegalEntityType**: The user can change their legal entity type. - **editPrefilledCountry**: The user can change the country of their legal entity's address, for example the registered address of an organization. By default, these values are set to **false**. Set to **true** to allow the action. - **allowBankAccountFormatSelection**: The user can select the format for their payout account if applicable. - **allowIntraRegionCrossBorderPayout**: The user can select a payout account in a different EU/EEA country (including Switzerland and the UK) than the country of their legal entity. By default, these value are set to **false**. Set the following values to **true** to require the user to sign PCI questionnaires based on their sales channels. The user must sign PCI questionnaires for all relevant sales channels. - **requirePciSignEcommerce** - **requirePciSignPos** - **requirePciSignEcomMoto** - **requirePciSignPosMoto** + * @param \Adyen\Model\LegalEntityManagement\OnboardingLinkSettings|null $settings settings * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.php b/src/Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.php new file mode 100644 index 000000000..66caa2f6d --- /dev/null +++ b/src/Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.php @@ -0,0 +1,884 @@ + + */ +class OnboardingLinkSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OnboardingLinkSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'acceptedCountries' => 'string[]', + 'allowBankAccountFormatSelection' => 'bool', + 'allowIntraRegionCrossBorderPayout' => 'bool', + 'changeLegalEntityType' => 'bool', + 'editPrefilledCountry' => 'bool', + 'hideOnboardingIntroductionIndividual' => 'bool', + 'hideOnboardingIntroductionOrganization' => 'bool', + 'hideOnboardingIntroductionSoleProprietor' => 'bool', + 'hideOnboardingIntroductionTrust' => 'bool', + 'instantBankVerification' => 'bool', + 'requirePciSignEcomMoto' => 'bool', + 'requirePciSignEcommerce' => 'bool', + 'requirePciSignPos' => 'bool', + 'requirePciSignPosMoto' => 'bool', + 'transferInstrumentLimit' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'acceptedCountries' => null, + 'allowBankAccountFormatSelection' => null, + 'allowIntraRegionCrossBorderPayout' => null, + 'changeLegalEntityType' => null, + 'editPrefilledCountry' => null, + 'hideOnboardingIntroductionIndividual' => null, + 'hideOnboardingIntroductionOrganization' => null, + 'hideOnboardingIntroductionSoleProprietor' => null, + 'hideOnboardingIntroductionTrust' => null, + 'instantBankVerification' => null, + 'requirePciSignEcomMoto' => null, + 'requirePciSignEcommerce' => null, + 'requirePciSignPos' => null, + 'requirePciSignPosMoto' => null, + 'transferInstrumentLimit' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'acceptedCountries' => false, + 'allowBankAccountFormatSelection' => false, + 'allowIntraRegionCrossBorderPayout' => false, + 'changeLegalEntityType' => false, + 'editPrefilledCountry' => false, + 'hideOnboardingIntroductionIndividual' => false, + 'hideOnboardingIntroductionOrganization' => false, + 'hideOnboardingIntroductionSoleProprietor' => false, + 'hideOnboardingIntroductionTrust' => false, + 'instantBankVerification' => false, + 'requirePciSignEcomMoto' => false, + 'requirePciSignEcommerce' => false, + 'requirePciSignPos' => false, + 'requirePciSignPosMoto' => false, + 'transferInstrumentLimit' => true + ]; + + /** + * 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 = [ + 'acceptedCountries' => 'acceptedCountries', + 'allowBankAccountFormatSelection' => 'allowBankAccountFormatSelection', + 'allowIntraRegionCrossBorderPayout' => 'allowIntraRegionCrossBorderPayout', + 'changeLegalEntityType' => 'changeLegalEntityType', + 'editPrefilledCountry' => 'editPrefilledCountry', + 'hideOnboardingIntroductionIndividual' => 'hideOnboardingIntroductionIndividual', + 'hideOnboardingIntroductionOrganization' => 'hideOnboardingIntroductionOrganization', + 'hideOnboardingIntroductionSoleProprietor' => 'hideOnboardingIntroductionSoleProprietor', + 'hideOnboardingIntroductionTrust' => 'hideOnboardingIntroductionTrust', + 'instantBankVerification' => 'instantBankVerification', + 'requirePciSignEcomMoto' => 'requirePciSignEcomMoto', + 'requirePciSignEcommerce' => 'requirePciSignEcommerce', + 'requirePciSignPos' => 'requirePciSignPos', + 'requirePciSignPosMoto' => 'requirePciSignPosMoto', + 'transferInstrumentLimit' => 'transferInstrumentLimit' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'acceptedCountries' => 'setAcceptedCountries', + 'allowBankAccountFormatSelection' => 'setAllowBankAccountFormatSelection', + 'allowIntraRegionCrossBorderPayout' => 'setAllowIntraRegionCrossBorderPayout', + 'changeLegalEntityType' => 'setChangeLegalEntityType', + 'editPrefilledCountry' => 'setEditPrefilledCountry', + 'hideOnboardingIntroductionIndividual' => 'setHideOnboardingIntroductionIndividual', + 'hideOnboardingIntroductionOrganization' => 'setHideOnboardingIntroductionOrganization', + 'hideOnboardingIntroductionSoleProprietor' => 'setHideOnboardingIntroductionSoleProprietor', + 'hideOnboardingIntroductionTrust' => 'setHideOnboardingIntroductionTrust', + 'instantBankVerification' => 'setInstantBankVerification', + 'requirePciSignEcomMoto' => 'setRequirePciSignEcomMoto', + 'requirePciSignEcommerce' => 'setRequirePciSignEcommerce', + 'requirePciSignPos' => 'setRequirePciSignPos', + 'requirePciSignPosMoto' => 'setRequirePciSignPosMoto', + 'transferInstrumentLimit' => 'setTransferInstrumentLimit' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'acceptedCountries' => 'getAcceptedCountries', + 'allowBankAccountFormatSelection' => 'getAllowBankAccountFormatSelection', + 'allowIntraRegionCrossBorderPayout' => 'getAllowIntraRegionCrossBorderPayout', + 'changeLegalEntityType' => 'getChangeLegalEntityType', + 'editPrefilledCountry' => 'getEditPrefilledCountry', + 'hideOnboardingIntroductionIndividual' => 'getHideOnboardingIntroductionIndividual', + 'hideOnboardingIntroductionOrganization' => 'getHideOnboardingIntroductionOrganization', + 'hideOnboardingIntroductionSoleProprietor' => 'getHideOnboardingIntroductionSoleProprietor', + 'hideOnboardingIntroductionTrust' => 'getHideOnboardingIntroductionTrust', + 'instantBankVerification' => 'getInstantBankVerification', + 'requirePciSignEcomMoto' => 'getRequirePciSignEcomMoto', + 'requirePciSignEcommerce' => 'getRequirePciSignEcommerce', + 'requirePciSignPos' => 'getRequirePciSignPos', + 'requirePciSignPosMoto' => 'getRequirePciSignPosMoto', + 'transferInstrumentLimit' => 'getTransferInstrumentLimit' + ]; + + /** + * 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('acceptedCountries', $data ?? [], null); + $this->setIfExists('allowBankAccountFormatSelection', $data ?? [], null); + $this->setIfExists('allowIntraRegionCrossBorderPayout', $data ?? [], null); + $this->setIfExists('changeLegalEntityType', $data ?? [], null); + $this->setIfExists('editPrefilledCountry', $data ?? [], null); + $this->setIfExists('hideOnboardingIntroductionIndividual', $data ?? [], null); + $this->setIfExists('hideOnboardingIntroductionOrganization', $data ?? [], null); + $this->setIfExists('hideOnboardingIntroductionSoleProprietor', $data ?? [], null); + $this->setIfExists('hideOnboardingIntroductionTrust', $data ?? [], null); + $this->setIfExists('instantBankVerification', $data ?? [], null); + $this->setIfExists('requirePciSignEcomMoto', $data ?? [], null); + $this->setIfExists('requirePciSignEcommerce', $data ?? [], null); + $this->setIfExists('requirePciSignPos', $data ?? [], null); + $this->setIfExists('requirePciSignPosMoto', $data ?? [], null); + $this->setIfExists('transferInstrumentLimit', $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 acceptedCountries + * + * @return string[]|null + */ + public function getAcceptedCountries() + { + return $this->container['acceptedCountries']; + } + + /** + * Sets acceptedCountries + * + * @param string[]|null $acceptedCountries acceptedCountries + * + * @return self + */ + public function setAcceptedCountries($acceptedCountries) + { + if (is_null($acceptedCountries)) { + throw new \InvalidArgumentException('non-nullable acceptedCountries cannot be null'); + } + $this->container['acceptedCountries'] = $acceptedCountries; + + return $this; + } + + /** + * Gets allowBankAccountFormatSelection + * + * @return bool|null + */ + public function getAllowBankAccountFormatSelection() + { + return $this->container['allowBankAccountFormatSelection']; + } + + /** + * Sets allowBankAccountFormatSelection + * + * @param bool|null $allowBankAccountFormatSelection allowBankAccountFormatSelection + * + * @return self + */ + public function setAllowBankAccountFormatSelection($allowBankAccountFormatSelection) + { + if (is_null($allowBankAccountFormatSelection)) { + throw new \InvalidArgumentException('non-nullable allowBankAccountFormatSelection cannot be null'); + } + $this->container['allowBankAccountFormatSelection'] = $allowBankAccountFormatSelection; + + return $this; + } + + /** + * Gets allowIntraRegionCrossBorderPayout + * + * @return bool|null + */ + public function getAllowIntraRegionCrossBorderPayout() + { + return $this->container['allowIntraRegionCrossBorderPayout']; + } + + /** + * Sets allowIntraRegionCrossBorderPayout + * + * @param bool|null $allowIntraRegionCrossBorderPayout allowIntraRegionCrossBorderPayout + * + * @return self + */ + public function setAllowIntraRegionCrossBorderPayout($allowIntraRegionCrossBorderPayout) + { + if (is_null($allowIntraRegionCrossBorderPayout)) { + throw new \InvalidArgumentException('non-nullable allowIntraRegionCrossBorderPayout cannot be null'); + } + $this->container['allowIntraRegionCrossBorderPayout'] = $allowIntraRegionCrossBorderPayout; + + return $this; + } + + /** + * Gets changeLegalEntityType + * + * @return bool|null + */ + public function getChangeLegalEntityType() + { + return $this->container['changeLegalEntityType']; + } + + /** + * Sets changeLegalEntityType + * + * @param bool|null $changeLegalEntityType changeLegalEntityType + * + * @return self + */ + public function setChangeLegalEntityType($changeLegalEntityType) + { + if (is_null($changeLegalEntityType)) { + throw new \InvalidArgumentException('non-nullable changeLegalEntityType cannot be null'); + } + $this->container['changeLegalEntityType'] = $changeLegalEntityType; + + return $this; + } + + /** + * Gets editPrefilledCountry + * + * @return bool|null + */ + public function getEditPrefilledCountry() + { + return $this->container['editPrefilledCountry']; + } + + /** + * Sets editPrefilledCountry + * + * @param bool|null $editPrefilledCountry editPrefilledCountry + * + * @return self + */ + public function setEditPrefilledCountry($editPrefilledCountry) + { + if (is_null($editPrefilledCountry)) { + throw new \InvalidArgumentException('non-nullable editPrefilledCountry cannot be null'); + } + $this->container['editPrefilledCountry'] = $editPrefilledCountry; + + return $this; + } + + /** + * Gets hideOnboardingIntroductionIndividual + * + * @return bool|null + */ + public function getHideOnboardingIntroductionIndividual() + { + return $this->container['hideOnboardingIntroductionIndividual']; + } + + /** + * Sets hideOnboardingIntroductionIndividual + * + * @param bool|null $hideOnboardingIntroductionIndividual hideOnboardingIntroductionIndividual + * + * @return self + */ + public function setHideOnboardingIntroductionIndividual($hideOnboardingIntroductionIndividual) + { + if (is_null($hideOnboardingIntroductionIndividual)) { + throw new \InvalidArgumentException('non-nullable hideOnboardingIntroductionIndividual cannot be null'); + } + $this->container['hideOnboardingIntroductionIndividual'] = $hideOnboardingIntroductionIndividual; + + return $this; + } + + /** + * Gets hideOnboardingIntroductionOrganization + * + * @return bool|null + */ + public function getHideOnboardingIntroductionOrganization() + { + return $this->container['hideOnboardingIntroductionOrganization']; + } + + /** + * Sets hideOnboardingIntroductionOrganization + * + * @param bool|null $hideOnboardingIntroductionOrganization hideOnboardingIntroductionOrganization + * + * @return self + */ + public function setHideOnboardingIntroductionOrganization($hideOnboardingIntroductionOrganization) + { + if (is_null($hideOnboardingIntroductionOrganization)) { + throw new \InvalidArgumentException('non-nullable hideOnboardingIntroductionOrganization cannot be null'); + } + $this->container['hideOnboardingIntroductionOrganization'] = $hideOnboardingIntroductionOrganization; + + return $this; + } + + /** + * Gets hideOnboardingIntroductionSoleProprietor + * + * @return bool|null + */ + public function getHideOnboardingIntroductionSoleProprietor() + { + return $this->container['hideOnboardingIntroductionSoleProprietor']; + } + + /** + * Sets hideOnboardingIntroductionSoleProprietor + * + * @param bool|null $hideOnboardingIntroductionSoleProprietor hideOnboardingIntroductionSoleProprietor + * + * @return self + */ + public function setHideOnboardingIntroductionSoleProprietor($hideOnboardingIntroductionSoleProprietor) + { + if (is_null($hideOnboardingIntroductionSoleProprietor)) { + throw new \InvalidArgumentException('non-nullable hideOnboardingIntroductionSoleProprietor cannot be null'); + } + $this->container['hideOnboardingIntroductionSoleProprietor'] = $hideOnboardingIntroductionSoleProprietor; + + return $this; + } + + /** + * Gets hideOnboardingIntroductionTrust + * + * @return bool|null + */ + public function getHideOnboardingIntroductionTrust() + { + return $this->container['hideOnboardingIntroductionTrust']; + } + + /** + * Sets hideOnboardingIntroductionTrust + * + * @param bool|null $hideOnboardingIntroductionTrust hideOnboardingIntroductionTrust + * + * @return self + */ + public function setHideOnboardingIntroductionTrust($hideOnboardingIntroductionTrust) + { + if (is_null($hideOnboardingIntroductionTrust)) { + throw new \InvalidArgumentException('non-nullable hideOnboardingIntroductionTrust cannot be null'); + } + $this->container['hideOnboardingIntroductionTrust'] = $hideOnboardingIntroductionTrust; + + return $this; + } + + /** + * Gets instantBankVerification + * + * @return bool|null + */ + public function getInstantBankVerification() + { + return $this->container['instantBankVerification']; + } + + /** + * Sets instantBankVerification + * + * @param bool|null $instantBankVerification instantBankVerification + * + * @return self + */ + public function setInstantBankVerification($instantBankVerification) + { + if (is_null($instantBankVerification)) { + throw new \InvalidArgumentException('non-nullable instantBankVerification cannot be null'); + } + $this->container['instantBankVerification'] = $instantBankVerification; + + return $this; + } + + /** + * Gets requirePciSignEcomMoto + * + * @return bool|null + */ + public function getRequirePciSignEcomMoto() + { + return $this->container['requirePciSignEcomMoto']; + } + + /** + * Sets requirePciSignEcomMoto + * + * @param bool|null $requirePciSignEcomMoto requirePciSignEcomMoto + * + * @return self + */ + public function setRequirePciSignEcomMoto($requirePciSignEcomMoto) + { + if (is_null($requirePciSignEcomMoto)) { + throw new \InvalidArgumentException('non-nullable requirePciSignEcomMoto cannot be null'); + } + $this->container['requirePciSignEcomMoto'] = $requirePciSignEcomMoto; + + return $this; + } + + /** + * Gets requirePciSignEcommerce + * + * @return bool|null + */ + public function getRequirePciSignEcommerce() + { + return $this->container['requirePciSignEcommerce']; + } + + /** + * Sets requirePciSignEcommerce + * + * @param bool|null $requirePciSignEcommerce requirePciSignEcommerce + * + * @return self + */ + public function setRequirePciSignEcommerce($requirePciSignEcommerce) + { + if (is_null($requirePciSignEcommerce)) { + throw new \InvalidArgumentException('non-nullable requirePciSignEcommerce cannot be null'); + } + $this->container['requirePciSignEcommerce'] = $requirePciSignEcommerce; + + return $this; + } + + /** + * Gets requirePciSignPos + * + * @return bool|null + */ + public function getRequirePciSignPos() + { + return $this->container['requirePciSignPos']; + } + + /** + * Sets requirePciSignPos + * + * @param bool|null $requirePciSignPos requirePciSignPos + * + * @return self + */ + public function setRequirePciSignPos($requirePciSignPos) + { + if (is_null($requirePciSignPos)) { + throw new \InvalidArgumentException('non-nullable requirePciSignPos cannot be null'); + } + $this->container['requirePciSignPos'] = $requirePciSignPos; + + return $this; + } + + /** + * Gets requirePciSignPosMoto + * + * @return bool|null + */ + public function getRequirePciSignPosMoto() + { + return $this->container['requirePciSignPosMoto']; + } + + /** + * Sets requirePciSignPosMoto + * + * @param bool|null $requirePciSignPosMoto requirePciSignPosMoto + * + * @return self + */ + public function setRequirePciSignPosMoto($requirePciSignPosMoto) + { + if (is_null($requirePciSignPosMoto)) { + throw new \InvalidArgumentException('non-nullable requirePciSignPosMoto cannot be null'); + } + $this->container['requirePciSignPosMoto'] = $requirePciSignPosMoto; + + return $this; + } + + /** + * Gets transferInstrumentLimit + * + * @return int|null + */ + public function getTransferInstrumentLimit() + { + return $this->container['transferInstrumentLimit']; + } + + /** + * Sets transferInstrumentLimit + * + * @param int|null $transferInstrumentLimit transferInstrumentLimit + * + * @return self + */ + public function setTransferInstrumentLimit($transferInstrumentLimit) + { + // Do nothing for nullable integers + $this->container['transferInstrumentLimit'] = $transferInstrumentLimit; + + 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/LegalEntityManagement/SoleProprietorship.php b/src/Adyen/Model/LegalEntityManagement/SoleProprietorship.php index 994f4f7f8..32f62a848 100644 --- a/src/Adyen/Model/LegalEntityManagement/SoleProprietorship.php +++ b/src/Adyen/Model/LegalEntityManagement/SoleProprietorship.php @@ -46,12 +46,12 @@ class SoleProprietorship implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPITypes = [ 'countryOfGoverningLaw' => 'string', 'dateOfIncorporation' => 'string', - 'description' => 'string', 'doingBusinessAs' => 'string', 'name' => 'string', 'principalPlaceOfBusiness' => '\Adyen\Model\LegalEntityManagement\Address', 'registeredAddress' => '\Adyen\Model\LegalEntityManagement\Address', 'registrationNumber' => 'string', + 'taxAbsent' => 'bool', 'taxInformation' => '\Adyen\Model\LegalEntityManagement\TaxInformation[]', 'vatAbsenceReason' => 'string', 'vatNumber' => 'string' @@ -67,12 +67,12 @@ class SoleProprietorship implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPIFormats = [ 'countryOfGoverningLaw' => null, 'dateOfIncorporation' => null, - 'description' => null, 'doingBusinessAs' => null, 'name' => null, 'principalPlaceOfBusiness' => null, 'registeredAddress' => null, 'registrationNumber' => null, + 'taxAbsent' => null, 'taxInformation' => null, 'vatAbsenceReason' => null, 'vatNumber' => null @@ -86,12 +86,12 @@ class SoleProprietorship implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPINullables = [ 'countryOfGoverningLaw' => false, 'dateOfIncorporation' => false, - 'description' => false, 'doingBusinessAs' => false, 'name' => false, 'principalPlaceOfBusiness' => false, 'registeredAddress' => false, 'registrationNumber' => false, + 'taxAbsent' => true, 'taxInformation' => false, 'vatAbsenceReason' => false, 'vatNumber' => false @@ -185,12 +185,12 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'countryOfGoverningLaw' => 'countryOfGoverningLaw', 'dateOfIncorporation' => 'dateOfIncorporation', - 'description' => 'description', 'doingBusinessAs' => 'doingBusinessAs', 'name' => 'name', 'principalPlaceOfBusiness' => 'principalPlaceOfBusiness', 'registeredAddress' => 'registeredAddress', 'registrationNumber' => 'registrationNumber', + 'taxAbsent' => 'taxAbsent', 'taxInformation' => 'taxInformation', 'vatAbsenceReason' => 'vatAbsenceReason', 'vatNumber' => 'vatNumber' @@ -204,12 +204,12 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'countryOfGoverningLaw' => 'setCountryOfGoverningLaw', 'dateOfIncorporation' => 'setDateOfIncorporation', - 'description' => 'setDescription', 'doingBusinessAs' => 'setDoingBusinessAs', 'name' => 'setName', 'principalPlaceOfBusiness' => 'setPrincipalPlaceOfBusiness', 'registeredAddress' => 'setRegisteredAddress', 'registrationNumber' => 'setRegistrationNumber', + 'taxAbsent' => 'setTaxAbsent', 'taxInformation' => 'setTaxInformation', 'vatAbsenceReason' => 'setVatAbsenceReason', 'vatNumber' => 'setVatNumber' @@ -223,12 +223,12 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'countryOfGoverningLaw' => 'getCountryOfGoverningLaw', 'dateOfIncorporation' => 'getDateOfIncorporation', - 'description' => 'getDescription', 'doingBusinessAs' => 'getDoingBusinessAs', 'name' => 'getName', 'principalPlaceOfBusiness' => 'getPrincipalPlaceOfBusiness', 'registeredAddress' => 'getRegisteredAddress', 'registrationNumber' => 'getRegistrationNumber', + 'taxAbsent' => 'getTaxAbsent', 'taxInformation' => 'getTaxInformation', 'vatAbsenceReason' => 'getVatAbsenceReason', 'vatNumber' => 'getVatNumber' @@ -307,12 +307,12 @@ public function __construct(array $data = null) { $this->setIfExists('countryOfGoverningLaw', $data ?? [], null); $this->setIfExists('dateOfIncorporation', $data ?? [], null); - $this->setIfExists('description', $data ?? [], null); $this->setIfExists('doingBusinessAs', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); $this->setIfExists('principalPlaceOfBusiness', $data ?? [], null); $this->setIfExists('registeredAddress', $data ?? [], null); $this->setIfExists('registrationNumber', $data ?? [], null); + $this->setIfExists('taxAbsent', $data ?? [], null); $this->setIfExists('taxInformation', $data ?? [], null); $this->setIfExists('vatAbsenceReason', $data ?? [], null); $this->setIfExists('vatNumber', $data ?? [], null); @@ -432,33 +432,6 @@ public function setDateOfIncorporation($dateOfIncorporation) return $this; } - /** - * Gets description - * - * @return string|null - */ - public function getDescription() - { - return $this->container['description']; - } - - /** - * Sets description - * - * @param string|null $description Short description about the Legal Arrangement. - * - * @return self - */ - public function setDescription($description) - { - if (is_null($description)) { - throw new \InvalidArgumentException('non-nullable description cannot be null'); - } - $this->container['description'] = $description; - - return $this; - } - /** * Gets doingBusinessAs * @@ -594,6 +567,40 @@ public function setRegistrationNumber($registrationNumber) return $this; } + /** + * Gets taxAbsent + * + * @return bool|null + */ + public function getTaxAbsent() + { + return $this->container['taxAbsent']; + } + + /** + * Sets taxAbsent + * + * @param bool|null $taxAbsent The tax information is absent. + * + * @return self + */ + public function setTaxAbsent($taxAbsent) + { + if (is_null($taxAbsent)) { + array_push($this->openAPINullablesSetToNull, 'taxAbsent'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxAbsent', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxAbsent'] = $taxAbsent; + + return $this; + } + /** * Gets taxInformation * diff --git a/src/Adyen/Model/LegalEntityManagement/Trust.php b/src/Adyen/Model/LegalEntityManagement/Trust.php index 50ec3d221..d33d4082d 100644 --- a/src/Adyen/Model/LegalEntityManagement/Trust.php +++ b/src/Adyen/Model/LegalEntityManagement/Trust.php @@ -46,12 +46,12 @@ class Trust implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'countryOfGoverningLaw' => 'string', 'dateOfIncorporation' => 'string', - 'description' => 'string', 'doingBusinessAs' => 'string', 'name' => 'string', 'principalPlaceOfBusiness' => '\Adyen\Model\LegalEntityManagement\Address', 'registeredAddress' => '\Adyen\Model\LegalEntityManagement\Address', 'registrationNumber' => 'string', + 'taxAbsent' => 'bool', 'taxInformation' => '\Adyen\Model\LegalEntityManagement\TaxInformation[]', 'type' => 'string', 'undefinedBeneficiaryInfo' => '\Adyen\Model\LegalEntityManagement\UndefinedBeneficiary[]', @@ -69,12 +69,12 @@ class Trust implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'countryOfGoverningLaw' => null, 'dateOfIncorporation' => null, - 'description' => null, 'doingBusinessAs' => null, 'name' => null, 'principalPlaceOfBusiness' => null, 'registeredAddress' => null, 'registrationNumber' => null, + 'taxAbsent' => null, 'taxInformation' => null, 'type' => null, 'undefinedBeneficiaryInfo' => null, @@ -90,12 +90,12 @@ class Trust implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPINullables = [ 'countryOfGoverningLaw' => false, 'dateOfIncorporation' => false, - 'description' => false, 'doingBusinessAs' => false, 'name' => false, 'principalPlaceOfBusiness' => false, 'registeredAddress' => false, 'registrationNumber' => false, + 'taxAbsent' => true, 'taxInformation' => false, 'type' => false, 'undefinedBeneficiaryInfo' => false, @@ -191,12 +191,12 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'countryOfGoverningLaw' => 'countryOfGoverningLaw', 'dateOfIncorporation' => 'dateOfIncorporation', - 'description' => 'description', 'doingBusinessAs' => 'doingBusinessAs', 'name' => 'name', 'principalPlaceOfBusiness' => 'principalPlaceOfBusiness', 'registeredAddress' => 'registeredAddress', 'registrationNumber' => 'registrationNumber', + 'taxAbsent' => 'taxAbsent', 'taxInformation' => 'taxInformation', 'type' => 'type', 'undefinedBeneficiaryInfo' => 'undefinedBeneficiaryInfo', @@ -212,12 +212,12 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'countryOfGoverningLaw' => 'setCountryOfGoverningLaw', 'dateOfIncorporation' => 'setDateOfIncorporation', - 'description' => 'setDescription', 'doingBusinessAs' => 'setDoingBusinessAs', 'name' => 'setName', 'principalPlaceOfBusiness' => 'setPrincipalPlaceOfBusiness', 'registeredAddress' => 'setRegisteredAddress', 'registrationNumber' => 'setRegistrationNumber', + 'taxAbsent' => 'setTaxAbsent', 'taxInformation' => 'setTaxInformation', 'type' => 'setType', 'undefinedBeneficiaryInfo' => 'setUndefinedBeneficiaryInfo', @@ -233,12 +233,12 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'countryOfGoverningLaw' => 'getCountryOfGoverningLaw', 'dateOfIncorporation' => 'getDateOfIncorporation', - 'description' => 'getDescription', 'doingBusinessAs' => 'getDoingBusinessAs', 'name' => 'getName', 'principalPlaceOfBusiness' => 'getPrincipalPlaceOfBusiness', 'registeredAddress' => 'getRegisteredAddress', 'registrationNumber' => 'getRegistrationNumber', + 'taxAbsent' => 'getTaxAbsent', 'taxInformation' => 'getTaxInformation', 'type' => 'getType', 'undefinedBeneficiaryInfo' => 'getUndefinedBeneficiaryInfo', @@ -359,12 +359,12 @@ public function __construct(array $data = null) { $this->setIfExists('countryOfGoverningLaw', $data ?? [], null); $this->setIfExists('dateOfIncorporation', $data ?? [], null); - $this->setIfExists('description', $data ?? [], null); $this->setIfExists('doingBusinessAs', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); $this->setIfExists('principalPlaceOfBusiness', $data ?? [], null); $this->setIfExists('registeredAddress', $data ?? [], null); $this->setIfExists('registrationNumber', $data ?? [], null); + $this->setIfExists('taxAbsent', $data ?? [], null); $this->setIfExists('taxInformation', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('undefinedBeneficiaryInfo', $data ?? [], null); @@ -498,33 +498,6 @@ public function setDateOfIncorporation($dateOfIncorporation) return $this; } - /** - * Gets description - * - * @return string|null - */ - public function getDescription() - { - return $this->container['description']; - } - - /** - * Sets description - * - * @param string|null $description Short description about the trust. - * - * @return self - */ - public function setDescription($description) - { - if (is_null($description)) { - throw new \InvalidArgumentException('non-nullable description cannot be null'); - } - $this->container['description'] = $description; - - return $this; - } - /** * Gets doingBusinessAs * @@ -660,6 +633,40 @@ public function setRegistrationNumber($registrationNumber) return $this; } + /** + * Gets taxAbsent + * + * @return bool|null + */ + public function getTaxAbsent() + { + return $this->container['taxAbsent']; + } + + /** + * Sets taxAbsent + * + * @param bool|null $taxAbsent The tax information is absent. + * + * @return self + */ + public function setTaxAbsent($taxAbsent) + { + if (is_null($taxAbsent)) { + array_push($this->openAPINullablesSetToNull, 'taxAbsent'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxAbsent', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxAbsent'] = $taxAbsent; + + return $this; + } + /** * Gets taxInformation * diff --git a/src/Adyen/Model/Management/AmexInfo.php b/src/Adyen/Model/Management/AmexInfo.php index db037939a..7f36ef654 100644 --- a/src/Adyen/Model/Management/AmexInfo.php +++ b/src/Adyen/Model/Management/AmexInfo.php @@ -331,7 +331,7 @@ public function getMidNumber() /** * Sets midNumber * - * @param string|null $midNumber MID number. Format: 10 numeric characters + * @param string|null $midNumber MID (Merchant ID) number. Format: 10 numeric characters. Must be provided only when requesting `gatewayContract` or `paymentDesignatorContract` service levels. * * @return self */ @@ -358,7 +358,7 @@ public function getReuseMidNumber() /** * Sets reuseMidNumber * - * @param bool|null $reuseMidNumber Indicates whether the Amex Merchant ID is reused from previously setup payment methods + * @param bool|null $reuseMidNumber Indicates whether the Amex Merchant ID is reused from a previously setup Amex payment method. This is only applicable for `gatewayContract` and `paymentDesignatorContract` service levels. The default value is `false`. * * @return self */ @@ -385,7 +385,7 @@ public function getServiceLevel() /** * Sets serviceLevel * - * @param string $serviceLevel Service level + * @param string $serviceLevel Specifies the service level (settlement type) of this payment method. Possible values: * **noContract** — Adyen holds the contract with American Express. * **gatewayContract** — American Express receives the settlement and handles disputes. They then pay out to the merchant directly. * **paymentDesignatorContract** — Adyen receives the settlement and handles disputes. Adyen then pays out to the merchant. * * @return self */ diff --git a/src/Adyen/Model/Management/ObjectSerializer.php b/src/Adyen/Model/Management/ObjectSerializer.php index cc5272bf9..2ff0b7ef6 100644 --- a/src/Adyen/Model/Management/ObjectSerializer.php +++ b/src/Adyen/Model/Management/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Management/TerminalSettings.php b/src/Adyen/Model/Management/TerminalSettings.php index bb635d312..63f2c0291 100644 --- a/src/Adyen/Model/Management/TerminalSettings.php +++ b/src/Adyen/Model/Management/TerminalSettings.php @@ -108,7 +108,7 @@ class TerminalSettings implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPINullables = [ 'cardholderReceipt' => false, 'connectivity' => false, - 'gratuities' => false, + 'gratuities' => true, 'hardware' => false, 'localization' => false, 'nexo' => false, @@ -497,7 +497,14 @@ public function getGratuities() public function setGratuities($gratuities) { if (is_null($gratuities)) { - throw new \InvalidArgumentException('non-nullable gratuities cannot be null'); + array_push($this->openAPINullablesSetToNull, 'gratuities'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('gratuities', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['gratuities'] = $gratuities; diff --git a/src/Adyen/Model/Management/TestOutput.php b/src/Adyen/Model/Management/TestOutput.php index 25b7d327f..5a5a51049 100644 --- a/src/Adyen/Model/Management/TestOutput.php +++ b/src/Adyen/Model/Management/TestOutput.php @@ -354,7 +354,7 @@ public function getOutput() /** * Sets output * - * @param string|null $output The response your server returned for the test webhook. Your server must respond with **[accepted]** for the test webhook to be successful (`data.status`: **success**). Find out more about [accepting notifications](https://docs.adyen.com/development-resources/webhooks#accept-notifications) You can use the value of this field together with the [`responseCode`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/merchants/{merchantId}/webhooks/{id}/test__resParam_data-responseCode) value to troubleshoot unsuccessful test webhooks. + * @param string|null $output The response your server returned for the test webhook. Your server must respond with **HTTP 2xx* for the test webhook to be successful (`data.status`: **success**). Find out more about [accepting notifications](https://docs.adyen.com/development-resources/webhooks#accept-notifications) You can use the value of this field together with the [`responseCode`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/merchants/{merchantId}/webhooks/{id}/test__resParam_data-responseCode) value to troubleshoot unsuccessful test webhooks. * * @return self */ @@ -462,7 +462,7 @@ public function getStatus() /** * Sets status * - * @param string $status The status of the test request. Possible values are: * **success**, if `data.output`: **[accepted]** and `data.responseCode`: **200**. * **failed**, in all other cases. You can use the value of the [`output`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/merchants/{merchantId}/webhooks/{id}/test__resParam_data-output) field together with the [`responseCode`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/merchants/{merchantId}/webhooks/{id}/test__resParam_data-responseCode) value to troubleshoot failed test webhooks. + * @param string $status The status of the test request. Possible values are: * **success**, `data.responseCode`: **2xx**. * **failed**, in all other cases. You can use the value of the [`output`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/merchants/{merchantId}/webhooks/{id}/test__resParam_data-output) field together with the [`responseCode`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/merchants/{merchantId}/webhooks/{id}/test__resParam_data-responseCode) value to troubleshoot failed test webhooks. * * @return self */ diff --git a/src/Adyen/Model/Management/Webhook.php b/src/Adyen/Model/Management/Webhook.php index 2b3470a20..ebfa2a159 100644 --- a/src/Adyen/Model/Management/Webhook.php +++ b/src/Adyen/Model/Management/Webhook.php @@ -1099,7 +1099,7 @@ public function getType() /** * Sets type * - * @param string $type The type of webhook. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **ach-notification-of-change-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **terminal-api-notification** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). + * @param string $type The type of webhook. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **ach-notification-of-change-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **terminal-api-notification** - **terminal-settings** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). * * @return self */ diff --git a/src/Adyen/Model/ManagementWebhooks/ObjectSerializer.php b/src/Adyen/Model/ManagementWebhooks/ObjectSerializer.php index 9c73e94b9..a3626e45d 100644 --- a/src/Adyen/Model/ManagementWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/ManagementWebhooks/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/ManagementWebhooks/TerminalSettingsData.php b/src/Adyen/Model/ManagementWebhooks/TerminalSettingsData.php new file mode 100644 index 000000000..ba221cb7c --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/TerminalSettingsData.php @@ -0,0 +1,619 @@ + + */ +class TerminalSettingsData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TerminalSettingsData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'companyId' => 'string', + 'merchantId' => 'string', + 'storeId' => 'string', + 'terminalId' => 'string', + 'updateSource' => 'string', + 'user' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'companyId' => null, + 'merchantId' => null, + 'storeId' => null, + 'terminalId' => null, + 'updateSource' => null, + 'user' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'companyId' => false, + 'merchantId' => false, + 'storeId' => false, + 'terminalId' => false, + 'updateSource' => false, + 'user' => 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 = [ + 'companyId' => 'companyId', + 'merchantId' => 'merchantId', + 'storeId' => 'storeId', + 'terminalId' => 'terminalId', + 'updateSource' => 'updateSource', + 'user' => 'user' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'companyId' => 'setCompanyId', + 'merchantId' => 'setMerchantId', + 'storeId' => 'setStoreId', + 'terminalId' => 'setTerminalId', + 'updateSource' => 'setUpdateSource', + 'user' => 'setUser' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'companyId' => 'getCompanyId', + 'merchantId' => 'getMerchantId', + 'storeId' => 'getStoreId', + 'terminalId' => 'getTerminalId', + 'updateSource' => 'getUpdateSource', + 'user' => 'getUser' + ]; + + /** + * 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; + } + + public const UPDATE_SOURCE_CUSTOMER_AREA = 'Customer Area'; + public const UPDATE_SOURCE_MANAGEMENT_API = 'Management Api'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getUpdateSourceAllowableValues() + { + return [ + self::UPDATE_SOURCE_CUSTOMER_AREA, + self::UPDATE_SOURCE_MANAGEMENT_API, + ]; + } + /** + * 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('companyId', $data ?? [], null); + $this->setIfExists('merchantId', $data ?? [], null); + $this->setIfExists('storeId', $data ?? [], null); + $this->setIfExists('terminalId', $data ?? [], null); + $this->setIfExists('updateSource', $data ?? [], null); + $this->setIfExists('user', $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['updateSource'] === null) { + $invalidProperties[] = "'updateSource' can't be null"; + } + $allowedValues = $this->getUpdateSourceAllowableValues(); + if (!is_null($this->container['updateSource']) && !in_array($this->container['updateSource'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'updateSource', must be one of '%s'", + $this->container['updateSource'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['user'] === null) { + $invalidProperties[] = "'user' 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 companyId + * + * @return string|null + */ + public function getCompanyId() + { + return $this->container['companyId']; + } + + /** + * Sets companyId + * + * @param string|null $companyId The unique identifier of the company account. + * + * @return self + */ + public function setCompanyId($companyId) + { + if (is_null($companyId)) { + throw new \InvalidArgumentException('non-nullable companyId cannot be null'); + } + $this->container['companyId'] = $companyId; + + return $this; + } + + /** + * Gets merchantId + * + * @return string|null + */ + public function getMerchantId() + { + return $this->container['merchantId']; + } + + /** + * Sets merchantId + * + * @param string|null $merchantId The unique identifier of the merchant account. + * + * @return self + */ + public function setMerchantId($merchantId) + { + if (is_null($merchantId)) { + throw new \InvalidArgumentException('non-nullable merchantId cannot be null'); + } + $this->container['merchantId'] = $merchantId; + + return $this; + } + + /** + * Gets storeId + * + * @return string|null + */ + public function getStoreId() + { + return $this->container['storeId']; + } + + /** + * Sets storeId + * + * @param string|null $storeId The unique identifier of the store. + * + * @return self + */ + public function setStoreId($storeId) + { + if (is_null($storeId)) { + throw new \InvalidArgumentException('non-nullable storeId cannot be null'); + } + $this->container['storeId'] = $storeId; + + return $this; + } + + /** + * Gets terminalId + * + * @return string|null + */ + public function getTerminalId() + { + return $this->container['terminalId']; + } + + /** + * Sets terminalId + * + * @param string|null $terminalId The unique identifier of the terminal. + * + * @return self + */ + public function setTerminalId($terminalId) + { + if (is_null($terminalId)) { + throw new \InvalidArgumentException('non-nullable terminalId cannot be null'); + } + $this->container['terminalId'] = $terminalId; + + return $this; + } + + /** + * Gets updateSource + * + * @return string + */ + public function getUpdateSource() + { + return $this->container['updateSource']; + } + + /** + * Sets updateSource + * + * @param string $updateSource Indicates whether the terminal settings were updated using the Customer Area or the Management API. + * + * @return self + */ + public function setUpdateSource($updateSource) + { + if (is_null($updateSource)) { + throw new \InvalidArgumentException('non-nullable updateSource cannot be null'); + } + $allowedValues = $this->getUpdateSourceAllowableValues(); + if (!in_array($updateSource, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'updateSource', must be one of '%s'", + $updateSource, + implode("', '", $allowedValues) + ) + ); + } + $this->container['updateSource'] = $updateSource; + + return $this; + } + + /** + * Gets user + * + * @return string + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param string $user The user that updated the terminal settings. Can be Adyen or your API credential username. + * + * @return self + */ + public function setUser($user) + { + if (is_null($user)) { + throw new \InvalidArgumentException('non-nullable user cannot be null'); + } + $this->container['user'] = $user; + + 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/ManagementWebhooks/TerminalSettingsNotificationRequest.php b/src/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.php new file mode 100644 index 000000000..4208cea2c --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.php @@ -0,0 +1,555 @@ + + */ +class TerminalSettingsNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TerminalSettingsNotificationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'createdAt' => '\DateTime', + 'data' => '\Adyen\Model\ManagementWebhooks\TerminalSettingsData', + 'environment' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'createdAt' => 'date-time', + 'data' => null, + 'environment' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'createdAt' => false, + 'data' => false, + 'environment' => 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 = [ + 'createdAt' => 'createdAt', + 'data' => 'data', + 'environment' => 'environment', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'createdAt' => 'setCreatedAt', + 'data' => 'setData', + 'environment' => 'setEnvironment', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'createdAt' => 'getCreatedAt', + 'data' => 'getData', + 'environment' => 'getEnvironment', + '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; + } + + public const TYPE_TERMINAL_SETTINGS_MODIFIED = 'terminalSettings.modified'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_TERMINAL_SETTINGS_MODIFIED, + ]; + } + /** + * 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('createdAt', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('environment', $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 = []; + + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['environment'] === null) { + $invalidProperties[] = "'environment' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Timestamp for when the webhook was created. + * + * @return self + */ + public function setCreatedAt($createdAt) + { + if (is_null($createdAt)) { + throw new \InvalidArgumentException('non-nullable createdAt cannot be null'); + } + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets data + * + * @return \Adyen\Model\ManagementWebhooks\TerminalSettingsData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\ManagementWebhooks\TerminalSettingsData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets environment + * + * @return string + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param string $environment The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @return self + */ + public function setEnvironment($environment) + { + if (is_null($environment)) { + throw new \InvalidArgumentException('non-nullable environment cannot be null'); + } + $this->container['environment'] = $environment; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of notification. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $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/ManagementWebhooks/TerminalSettingsNotificationResponse.php b/src/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.php new file mode 100644 index 000000000..64104d998 --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.php @@ -0,0 +1,410 @@ + + */ +class TerminalSettingsNotificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TerminalSettingsNotificationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'notificationResponse' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'notificationResponse' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'notificationResponse' => 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 = [ + 'notificationResponse' => 'notificationResponse' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'notificationResponse' => 'setNotificationResponse' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'notificationResponse' => 'getNotificationResponse' + ]; + + /** + * 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('notificationResponse', $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 notificationResponse + * + * @return string|null + */ + public function getNotificationResponse() + { + return $this->container['notificationResponse']; + } + + /** + * Sets notificationResponse + * + * @param string|null $notificationResponse Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * + * @return self + */ + public function setNotificationResponse($notificationResponse) + { + if (is_null($notificationResponse)) { + throw new \InvalidArgumentException('non-nullable notificationResponse cannot be null'); + } + $this->container['notificationResponse'] = $notificationResponse; + + 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/POSTerminalManagement/ObjectSerializer.php b/src/Adyen/Model/POSTerminalManagement/ObjectSerializer.php index 8032f208b..b6a5027ee 100644 --- a/src/Adyen/Model/POSTerminalManagement/ObjectSerializer.php +++ b/src/Adyen/Model/POSTerminalManagement/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Payments/FundDestination.php b/src/Adyen/Model/Payments/FundDestination.php index 63bd2d77a..5e8033d9e 100644 --- a/src/Adyen/Model/Payments/FundDestination.php +++ b/src/Adyen/Model/Payments/FundDestination.php @@ -52,7 +52,8 @@ class FundDestination implements ModelInterface, ArrayAccess, \JsonSerializable 'shopperName' => '\Adyen\Model\Payments\Name', 'shopperReference' => 'string', 'subMerchant' => '\Adyen\Model\Payments\SubMerchant', - 'telephoneNumber' => 'string' + 'telephoneNumber' => 'string', + 'walletPurpose' => 'string' ]; /** @@ -71,7 +72,8 @@ class FundDestination implements ModelInterface, ArrayAccess, \JsonSerializable 'shopperName' => null, 'shopperReference' => null, 'subMerchant' => null, - 'telephoneNumber' => null + 'telephoneNumber' => null, + 'walletPurpose' => null ]; /** @@ -88,7 +90,8 @@ class FundDestination implements ModelInterface, ArrayAccess, \JsonSerializable 'shopperName' => false, 'shopperReference' => false, 'subMerchant' => false, - 'telephoneNumber' => false + 'telephoneNumber' => false, + 'walletPurpose' => false ]; /** @@ -185,7 +188,8 @@ public function isNullableSetToNull(string $property): bool 'shopperName' => 'shopperName', 'shopperReference' => 'shopperReference', 'subMerchant' => 'subMerchant', - 'telephoneNumber' => 'telephoneNumber' + 'telephoneNumber' => 'telephoneNumber', + 'walletPurpose' => 'walletPurpose' ]; /** @@ -202,7 +206,8 @@ public function isNullableSetToNull(string $property): bool 'shopperName' => 'setShopperName', 'shopperReference' => 'setShopperReference', 'subMerchant' => 'setSubMerchant', - 'telephoneNumber' => 'setTelephoneNumber' + 'telephoneNumber' => 'setTelephoneNumber', + 'walletPurpose' => 'setWalletPurpose' ]; /** @@ -219,7 +224,8 @@ public function isNullableSetToNull(string $property): bool 'shopperName' => 'getShopperName', 'shopperReference' => 'getShopperReference', 'subMerchant' => 'getSubMerchant', - 'telephoneNumber' => 'getTelephoneNumber' + 'telephoneNumber' => 'getTelephoneNumber', + 'walletPurpose' => 'getWalletPurpose' ]; /** @@ -288,6 +294,7 @@ public function __construct(array $data = null) $this->setIfExists('shopperReference', $data ?? [], null); $this->setIfExists('subMerchant', $data ?? [], null); $this->setIfExists('telephoneNumber', $data ?? [], null); + $this->setIfExists('walletPurpose', $data ?? [], null); } /** @@ -574,6 +581,33 @@ public function setTelephoneNumber($telephoneNumber) return $this; } + + /** + * Gets walletPurpose + * + * @return string|null + */ + public function getWalletPurpose() + { + return $this->container['walletPurpose']; + } + + /** + * Sets walletPurpose + * + * @param string|null $walletPurpose The purpose of a digital wallet transaction. + * + * @return self + */ + public function setWalletPurpose($walletPurpose) + { + if (is_null($walletPurpose)) { + throw new \InvalidArgumentException('non-nullable walletPurpose cannot be null'); + } + $this->container['walletPurpose'] = $walletPurpose; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Payments/ObjectSerializer.php b/src/Adyen/Model/Payments/ObjectSerializer.php index 4e217461d..ae7a870cb 100644 --- a/src/Adyen/Model/Payments/ObjectSerializer.php +++ b/src/Adyen/Model/Payments/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Payout/ObjectSerializer.php b/src/Adyen/Model/Payout/ObjectSerializer.php index ad1c991ab..0d50f4363 100644 --- a/src/Adyen/Model/Payout/ObjectSerializer.php +++ b/src/Adyen/Model/Payout/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/PosMobile/CreateSessionRequest.php b/src/Adyen/Model/PosMobile/CreateSessionRequest.php new file mode 100644 index 000000000..ad42f517e --- /dev/null +++ b/src/Adyen/Model/PosMobile/CreateSessionRequest.php @@ -0,0 +1,484 @@ + + */ +class CreateSessionRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateSessionRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'merchantAccount' => 'string', + 'setupToken' => 'string', + 'store' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merchantAccount' => null, + 'setupToken' => null, + 'store' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'merchantAccount' => false, + 'setupToken' => false, + 'store' => 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 = [ + 'merchantAccount' => 'merchantAccount', + 'setupToken' => 'setupToken', + 'store' => 'store' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchantAccount' => 'setMerchantAccount', + 'setupToken' => 'setSetupToken', + 'store' => 'setStore' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchantAccount' => 'getMerchantAccount', + 'setupToken' => 'getSetupToken', + 'store' => 'getStore' + ]; + + /** + * 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('merchantAccount', $data ?? [], null); + $this->setIfExists('setupToken', $data ?? [], null); + $this->setIfExists('store', $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['merchantAccount'] === null) { + $invalidProperties[] = "'merchantAccount' can't be null"; + } + if ($this->container['setupToken'] === null) { + $invalidProperties[] = "'setupToken' 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 merchantAccount + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchantAccount']; + } + + /** + * Sets merchantAccount + * + * @param string $merchantAccount The unique identifier of your merchant account. + * + * @return self + */ + public function setMerchantAccount($merchantAccount) + { + if (is_null($merchantAccount)) { + throw new \InvalidArgumentException('non-nullable merchantAccount cannot be null'); + } + $this->container['merchantAccount'] = $merchantAccount; + + return $this; + } + + /** + * Gets setupToken + * + * @return string + */ + public function getSetupToken() + { + return $this->container['setupToken']; + } + + /** + * Sets setupToken + * + * @param string $setupToken The setup token provided by the POS Mobile SDK. - When using the Android POS Mobile SDK, obtain the token through the `AuthenticationService.authenticate(setupToken)` callback of `AuthenticationService`. - When using the iOS POS Mobile SDK, obtain the token through the `PaymentServiceDelegate.register(with:)` callback of `PaymentServiceDelegate`. + * + * @return self + */ + public function setSetupToken($setupToken) + { + if (is_null($setupToken)) { + throw new \InvalidArgumentException('non-nullable setupToken cannot be null'); + } + $this->container['setupToken'] = $setupToken; + + return $this; + } + + /** + * Gets store + * + * @return string|null + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string|null $store The unique identifier of the store that you want to process transactions for. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + 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/PosMobile/CreateSessionResponse.php b/src/Adyen/Model/PosMobile/CreateSessionResponse.php new file mode 100644 index 000000000..d08190994 --- /dev/null +++ b/src/Adyen/Model/PosMobile/CreateSessionResponse.php @@ -0,0 +1,546 @@ + + */ +class CreateSessionResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateSessionResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'installationId' => 'string', + 'merchantAccount' => 'string', + 'sdkData' => 'string', + 'store' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'installationId' => null, + 'merchantAccount' => null, + 'sdkData' => null, + 'store' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'installationId' => false, + 'merchantAccount' => false, + 'sdkData' => false, + 'store' => 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 = [ + 'id' => 'id', + 'installationId' => 'installationId', + 'merchantAccount' => 'merchantAccount', + 'sdkData' => 'sdkData', + 'store' => 'store' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'installationId' => 'setInstallationId', + 'merchantAccount' => 'setMerchantAccount', + 'sdkData' => 'setSdkData', + 'store' => 'setStore' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'installationId' => 'getInstallationId', + 'merchantAccount' => 'getMerchantAccount', + 'sdkData' => 'getSdkData', + 'store' => 'getStore' + ]; + + /** + * 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('id', $data ?? [], null); + $this->setIfExists('installationId', $data ?? [], null); + $this->setIfExists('merchantAccount', $data ?? [], null); + $this->setIfExists('sdkData', $data ?? [], null); + $this->setIfExists('store', $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 id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the session. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets installationId + * + * @return string|null + */ + public function getInstallationId() + { + return $this->container['installationId']; + } + + /** + * Sets installationId + * + * @param string|null $installationId The unique identifier of the SDK installation. If you create the [Terminal API](https://docs.adyen.com/point-of-sale/design-your-integration/terminal-api/) transaction request on your backend, use this as the `POIID` in the `MessageHeader` of the request. + * + * @return self + */ + public function setInstallationId($installationId) + { + if (is_null($installationId)) { + throw new \InvalidArgumentException('non-nullable installationId cannot be null'); + } + $this->container['installationId'] = $installationId; + + return $this; + } + + /** + * Gets merchantAccount + * + * @return string|null + */ + public function getMerchantAccount() + { + return $this->container['merchantAccount']; + } + + /** + * Sets merchantAccount + * + * @param string|null $merchantAccount The unique identifier of your merchant account. + * + * @return self + */ + public function setMerchantAccount($merchantAccount) + { + if (is_null($merchantAccount)) { + throw new \InvalidArgumentException('non-nullable merchantAccount cannot be null'); + } + $this->container['merchantAccount'] = $merchantAccount; + + return $this; + } + + /** + * Gets sdkData + * + * @return string|null + */ + public function getSdkData() + { + return $this->container['sdkData']; + } + + /** + * Sets sdkData + * + * @param string|null $sdkData The data that the SDK uses to authenticate responses from the Adyen payments platform. Pass this value to your POS app. + * + * @return self + */ + public function setSdkData($sdkData) + { + if (is_null($sdkData)) { + throw new \InvalidArgumentException('non-nullable sdkData cannot be null'); + } + $this->container['sdkData'] = $sdkData; + + return $this; + } + + /** + * Gets store + * + * @return string|null + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string|null $store The unique identifier of the store that you want to process transactions for. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + 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/PosMobile/ModelInterface.php b/src/Adyen/Model/PosMobile/ModelInterface.php new file mode 100644 index 000000000..fbbd84dea --- /dev/null +++ b/src/Adyen/Model/PosMobile/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/Recurring/ObjectSerializer.php b/src/Adyen/Model/Recurring/ObjectSerializer.php index 7adbf8e59..3b2a857bf 100644 --- a/src/Adyen/Model/Recurring/ObjectSerializer.php +++ b/src/Adyen/Model/Recurring/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/ReportWebhooks/ObjectSerializer.php b/src/Adyen/Model/ReportWebhooks/ObjectSerializer.php index 97f670389..a8a265ce9 100644 --- a/src/Adyen/Model/ReportWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/ReportWebhooks/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/StoredValue/ObjectSerializer.php b/src/Adyen/Model/StoredValue/ObjectSerializer.php index ed3372fb3..934975452 100644 --- a/src/Adyen/Model/StoredValue/ObjectSerializer.php +++ b/src/Adyen/Model/StoredValue/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/TransactionWebhooks/ObjectSerializer.php b/src/Adyen/Model/TransactionWebhooks/ObjectSerializer.php index 6592bf84d..9ccc67586 100644 --- a/src/Adyen/Model/TransactionWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/TransactionWebhooks/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/TransferWebhooks/AULocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/AULocalAccountIdentification.php index b92f71318..f6f35db49 100644 --- a/src/Adyen/Model/TransferWebhooks/AULocalAccountIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/AULocalAccountIdentification.php @@ -46,7 +46,6 @@ class AULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'bsbCode' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -60,7 +59,6 @@ class AULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'bsbCode' => null, - 'formFactor' => null, 'type' => null ]; @@ -72,7 +70,6 @@ class AULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'bsbCode' => false, - 'formFactor' => true, 'type' => false ]; @@ -164,7 +161,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'bsbCode' => 'bsbCode', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -176,7 +172,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'bsbCode' => 'setBsbCode', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -188,7 +183,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'bsbCode' => 'getBsbCode', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -263,7 +257,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bsbCode', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -381,40 +374,6 @@ public function setBsbCode($bsbCode) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/TransferWebhooks/Address.php b/src/Adyen/Model/TransferWebhooks/Address.php index c3ab2458d..7bbd21d9e 100644 --- a/src/Adyen/Model/TransferWebhooks/Address.php +++ b/src/Adyen/Model/TransferWebhooks/Address.php @@ -327,7 +327,7 @@ public function getCity() /** * Sets city * - * @param string|null $city The name of the city. + * @param string|null $city The name of the city. Supported characters: [a-z] [A-Z] [0-9] . - — / # , ’ ° ( ) : ; [ ] & \\ | and Space. * * @return self */ @@ -381,7 +381,7 @@ public function getLine1() /** * Sets line1 * - * @param string|null $line1 First line of the street address. + * @param string|null $line1 First line of the street address. Supported characters: [a-z] [A-Z] [0-9] . - — / # , ’ ° ( ) : ; [ ] & \\ | and Space. * * @return self */ @@ -408,7 +408,7 @@ public function getLine2() /** * Sets line2 * - * @param string|null $line2 Second line of the street address. + * @param string|null $line2 Second line of the street address. Supported characters: [a-z] [A-Z] [0-9] . - — / # , ’ ° ( ) : ; [ ] & \\ | and Space. * * @return self */ @@ -435,7 +435,7 @@ public function getPostalCode() /** * Sets postalCode * - * @param string|null $postalCode The postal code. Maximum length: * 5 digits for an address in the US. * 10 characters for an address in all other countries. + * @param string|null $postalCode The postal code. Maximum length: * 5 digits for an address in the US. * 10 characters for an address in all other countries. Supported characters: [a-z] [A-Z] [0-9] and Space. * * @return self */ @@ -462,7 +462,7 @@ public function getStateOrProvince() /** * Sets stateOrProvince * - * @param string|null $stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + * @param string|null $stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/BRLocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/BRLocalAccountIdentification.php index a44a5ca31..f50584c03 100644 --- a/src/Adyen/Model/TransferWebhooks/BRLocalAccountIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/BRLocalAccountIdentification.php @@ -47,7 +47,7 @@ class BRLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json 'accountNumber' => 'string', 'bankCode' => 'string', 'branchNumber' => 'string', - 'formFactor' => 'string', + 'ispb' => 'string', 'type' => 'string' ]; @@ -62,7 +62,7 @@ class BRLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json 'accountNumber' => null, 'bankCode' => null, 'branchNumber' => null, - 'formFactor' => null, + 'ispb' => null, 'type' => null ]; @@ -75,7 +75,7 @@ class BRLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json 'accountNumber' => false, 'bankCode' => false, 'branchNumber' => false, - 'formFactor' => true, + 'ispb' => false, 'type' => false ]; @@ -168,7 +168,7 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'accountNumber', 'bankCode' => 'bankCode', 'branchNumber' => 'branchNumber', - 'formFactor' => 'formFactor', + 'ispb' => 'ispb', 'type' => 'type' ]; @@ -181,7 +181,7 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'setAccountNumber', 'bankCode' => 'setBankCode', 'branchNumber' => 'setBranchNumber', - 'formFactor' => 'setFormFactor', + 'ispb' => 'setIspb', 'type' => 'setType' ]; @@ -194,7 +194,7 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'getAccountNumber', 'bankCode' => 'getBankCode', 'branchNumber' => 'getBranchNumber', - 'formFactor' => 'getFormFactor', + 'ispb' => 'getIspb', 'type' => 'getType' ]; @@ -270,7 +270,7 @@ public function __construct(array $data = null) $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bankCode', $data ?? [], null); $this->setIfExists('branchNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); + $this->setIfExists('ispb', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -419,35 +419,28 @@ public function setBranchNumber($branchNumber) } /** - * Gets formFactor + * Gets ispb * * @return string|null */ - public function getFormFactor() + public function getIspb() { - return $this->container['formFactor']; + return $this->container['ispb']; } /** - * Sets formFactor + * Sets ispb * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. + * @param string|null $ispb The 8-digit ISPB, with leading zeros. * * @return self */ - public function setFormFactor($formFactor) + public function setIspb($ispb) { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } + if (is_null($ispb)) { + throw new \InvalidArgumentException('non-nullable ispb cannot be null'); } - $this->container['formFactor'] = $formFactor; + $this->container['ispb'] = $ispb; return $this; } diff --git a/src/Adyen/Model/TransferWebhooks/BankAccountV3AccountIdentification.php b/src/Adyen/Model/TransferWebhooks/BankAccountV3AccountIdentification.php index 2167b39e2..ac344e88c 100644 --- a/src/Adyen/Model/TransferWebhooks/BankAccountV3AccountIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/BankAccountV3AccountIdentification.php @@ -47,10 +47,10 @@ class BankAccountV3AccountIdentification implements ModelInterface, ArrayAccess, protected static $openAPITypes = [ 'accountNumber' => 'string', 'bsbCode' => 'string', - 'formFactor' => 'string', 'type' => 'string', 'bankCode' => 'string', 'branchNumber' => 'string', + 'ispb' => 'string', 'accountType' => 'string', 'institutionNumber' => 'string', 'transitNumber' => 'string', @@ -73,10 +73,10 @@ class BankAccountV3AccountIdentification implements ModelInterface, ArrayAccess, protected static $openAPIFormats = [ 'accountNumber' => null, 'bsbCode' => null, - 'formFactor' => null, 'type' => null, 'bankCode' => null, 'branchNumber' => null, + 'ispb' => null, 'accountType' => null, 'institutionNumber' => null, 'transitNumber' => null, @@ -97,10 +97,10 @@ class BankAccountV3AccountIdentification implements ModelInterface, ArrayAccess, protected static $openAPINullables = [ 'accountNumber' => false, 'bsbCode' => false, - 'formFactor' => true, 'type' => false, 'bankCode' => false, 'branchNumber' => false, + 'ispb' => false, 'accountType' => false, 'institutionNumber' => false, 'transitNumber' => false, @@ -201,10 +201,10 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'bsbCode' => 'bsbCode', - 'formFactor' => 'formFactor', 'type' => 'type', 'bankCode' => 'bankCode', 'branchNumber' => 'branchNumber', + 'ispb' => 'ispb', 'accountType' => 'accountType', 'institutionNumber' => 'institutionNumber', 'transitNumber' => 'transitNumber', @@ -225,10 +225,10 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'bsbCode' => 'setBsbCode', - 'formFactor' => 'setFormFactor', 'type' => 'setType', 'bankCode' => 'setBankCode', 'branchNumber' => 'setBranchNumber', + 'ispb' => 'setIspb', 'accountType' => 'setAccountType', 'institutionNumber' => 'setInstitutionNumber', 'transitNumber' => 'setTransitNumber', @@ -249,10 +249,10 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'bsbCode' => 'getBsbCode', - 'formFactor' => 'getFormFactor', 'type' => 'getType', 'bankCode' => 'getBankCode', 'branchNumber' => 'getBranchNumber', + 'ispb' => 'getIspb', 'accountType' => 'getAccountType', 'institutionNumber' => 'getInstitutionNumber', 'transitNumber' => 'getTransitNumber', @@ -323,10 +323,10 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bsbCode', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('bankCode', $data ?? [], null); $this->setIfExists('branchNumber', $data ?? [], null); + $this->setIfExists('ispb', $data ?? [], null); $this->setIfExists('accountType', $data ?? [], null); $this->setIfExists('institutionNumber', $data ?? [], null); $this->setIfExists('transitNumber', $data ?? [], null); @@ -476,40 +476,6 @@ public function setBsbCode($bsbCode) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * @@ -591,6 +557,33 @@ public function setBranchNumber($branchNumber) return $this; } + /** + * Gets ispb + * + * @return string|null + */ + public function getIspb() + { + return $this->container['ispb']; + } + + /** + * Sets ispb + * + * @param string|null $ispb The 8-digit ISPB, with leading zeros. + * + * @return self + */ + public function setIspb($ispb) + { + if (is_null($ispb)) { + throw new \InvalidArgumentException('non-nullable ispb cannot be null'); + } + $this->container['ispb'] = $ispb; + + return $this; + } + /** * Gets accountType * diff --git a/src/Adyen/Model/TransferWebhooks/CALocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/CALocalAccountIdentification.php index 129ea4806..5a55b7011 100644 --- a/src/Adyen/Model/TransferWebhooks/CALocalAccountIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/CALocalAccountIdentification.php @@ -46,7 +46,6 @@ class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'accountType' => 'string', - 'formFactor' => 'string', 'institutionNumber' => 'string', 'transitNumber' => 'string', 'type' => 'string' @@ -62,7 +61,6 @@ class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'accountType' => null, - 'formFactor' => null, 'institutionNumber' => null, 'transitNumber' => null, 'type' => null @@ -76,7 +74,6 @@ class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'accountType' => false, - 'formFactor' => true, 'institutionNumber' => false, 'transitNumber' => false, 'type' => false @@ -170,7 +167,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'accountType' => 'accountType', - 'formFactor' => 'formFactor', 'institutionNumber' => 'institutionNumber', 'transitNumber' => 'transitNumber', 'type' => 'type' @@ -184,7 +180,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'accountType' => 'setAccountType', - 'formFactor' => 'setFormFactor', 'institutionNumber' => 'setInstitutionNumber', 'transitNumber' => 'setTransitNumber', 'type' => 'setType' @@ -198,7 +193,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'accountType' => 'getAccountType', - 'formFactor' => 'getFormFactor', 'institutionNumber' => 'getInstitutionNumber', 'transitNumber' => 'getTransitNumber', 'type' => 'getType' @@ -289,7 +283,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('accountType', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('institutionNumber', $data ?? [], null); $this->setIfExists('transitNumber', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); @@ -431,40 +424,6 @@ public function setAccountType($accountType) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets institutionNumber * diff --git a/src/Adyen/Model/TransferWebhooks/CZLocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/CZLocalAccountIdentification.php index be8bc3e82..02388df89 100644 --- a/src/Adyen/Model/TransferWebhooks/CZLocalAccountIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/CZLocalAccountIdentification.php @@ -46,7 +46,6 @@ class CZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'bankCode' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -60,7 +59,6 @@ class CZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'bankCode' => null, - 'formFactor' => null, 'type' => null ]; @@ -72,7 +70,6 @@ class CZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'bankCode' => false, - 'formFactor' => true, 'type' => false ]; @@ -164,7 +161,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'bankCode' => 'bankCode', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -176,7 +172,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'bankCode' => 'setBankCode', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -188,7 +183,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'bankCode' => 'getBankCode', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -263,7 +257,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bankCode', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -381,40 +374,6 @@ public function setBankCode($bankCode) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/TransferWebhooks/ConfirmationTrackingData.php b/src/Adyen/Model/TransferWebhooks/ConfirmationTrackingData.php new file mode 100644 index 000000000..1e641fbe2 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/ConfirmationTrackingData.php @@ -0,0 +1,512 @@ + + */ +class ConfirmationTrackingData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfirmationTrackingData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'status' => 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 = [ + 'status' => 'status', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + '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; + } + + public const STATUS_CREDITED = 'credited'; + public const TYPE_CONFIRMATION = 'confirmation'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_CREDITED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CONFIRMATION, + ]; + } + /** + * 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('status', $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 = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Possible values: - **credited**: Transfer is credited to beneficiary. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **confirmation** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $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/TransferWebhooks/CounterpartyV3.php b/src/Adyen/Model/TransferWebhooks/CounterpartyV3.php index a88dbca6e..50f120d32 100644 --- a/src/Adyen/Model/TransferWebhooks/CounterpartyV3.php +++ b/src/Adyen/Model/TransferWebhooks/CounterpartyV3.php @@ -310,7 +310,7 @@ public function getBalanceAccountId() /** * Sets balanceAccountId * - * @param string|null $balanceAccountId Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). + * @param string|null $balanceAccountId The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). * * @return self */ @@ -391,7 +391,7 @@ public function getTransferInstrumentId() /** * Sets transferInstrumentId * - * @param string|null $transferInstrumentId Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * @param string|null $transferInstrumentId The unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/DKLocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/DKLocalAccountIdentification.php index 1b8341be0..23975a0d3 100644 --- a/src/Adyen/Model/TransferWebhooks/DKLocalAccountIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/DKLocalAccountIdentification.php @@ -46,7 +46,6 @@ class DKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'bankCode' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -60,7 +59,6 @@ class DKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'bankCode' => null, - 'formFactor' => null, 'type' => null ]; @@ -72,7 +70,6 @@ class DKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'bankCode' => false, - 'formFactor' => true, 'type' => false ]; @@ -164,7 +161,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'bankCode' => 'bankCode', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -176,7 +172,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'bankCode' => 'setBankCode', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -188,7 +183,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'bankCode' => 'getBankCode', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -263,7 +257,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bankCode', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -381,40 +374,6 @@ public function setBankCode($bankCode) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/TransferWebhooks/EstimationTrackingData.php b/src/Adyen/Model/TransferWebhooks/EstimationTrackingData.php new file mode 100644 index 000000000..795ce43fa --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/EstimationTrackingData.php @@ -0,0 +1,481 @@ + + */ +class EstimationTrackingData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'EstimationTrackingData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'estimatedArrivalTime' => '\DateTime', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'estimatedArrivalTime' => 'date-time', + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'estimatedArrivalTime' => 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 = [ + 'estimatedArrivalTime' => 'estimatedArrivalTime', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'estimatedArrivalTime' => 'setEstimatedArrivalTime', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'estimatedArrivalTime' => 'getEstimatedArrivalTime', + '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; + } + + public const TYPE_ESTIMATION = 'estimation'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_ESTIMATION, + ]; + } + /** + * 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('estimatedArrivalTime', $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 = []; + + if ($this->container['estimatedArrivalTime'] === null) { + $invalidProperties[] = "'estimatedArrivalTime' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 estimatedArrivalTime + * + * @return \DateTime + */ + public function getEstimatedArrivalTime() + { + return $this->container['estimatedArrivalTime']; + } + + /** + * Sets estimatedArrivalTime + * + * @param \DateTime $estimatedArrivalTime The estimated time the beneficiary should have access to the funds. + * + * @return self + */ + public function setEstimatedArrivalTime($estimatedArrivalTime) + { + if (is_null($estimatedArrivalTime)) { + throw new \InvalidArgumentException('non-nullable estimatedArrivalTime cannot be null'); + } + $this->container['estimatedArrivalTime'] = $estimatedArrivalTime; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **estimation** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $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/TransferWebhooks/ExternalReason.php b/src/Adyen/Model/TransferWebhooks/ExternalReason.php new file mode 100644 index 000000000..e90516a8d --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/ExternalReason.php @@ -0,0 +1,478 @@ + + */ +class ExternalReason implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExternalReason'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'code' => 'string', + 'description' => 'string', + 'namespace' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => null, + 'description' => null, + 'namespace' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'code' => false, + 'description' => false, + 'namespace' => 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 = [ + 'code' => 'code', + 'description' => 'description', + 'namespace' => 'namespace' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'description' => 'setDescription', + 'namespace' => 'setNamespace' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'description' => 'getDescription', + 'namespace' => 'getNamespace' + ]; + + /** + * 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('code', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('namespace', $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 code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The code for this reason code. + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description for this reason code. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets namespace + * + * @return string|null + */ + public function getNamespace() + { + return $this->container['namespace']; + } + + /** + * Sets namespace + * + * @param string|null $namespace The namespace for this reason code. + * + * @return self + */ + public function setNamespace($namespace) + { + if (is_null($namespace)) { + throw new \InvalidArgumentException('non-nullable namespace cannot be null'); + } + $this->container['namespace'] = $namespace; + + 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/HKLocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/HKLocalAccountIdentification.php index 92991ea8e..8c044991e 100644 --- a/src/Adyen/Model/TransferWebhooks/HKLocalAccountIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/HKLocalAccountIdentification.php @@ -46,7 +46,6 @@ class HKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'clearingCode' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -60,7 +59,6 @@ class HKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'clearingCode' => null, - 'formFactor' => null, 'type' => null ]; @@ -72,7 +70,6 @@ class HKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'clearingCode' => false, - 'formFactor' => true, 'type' => false ]; @@ -164,7 +161,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'clearingCode' => 'clearingCode', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -176,7 +172,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'clearingCode' => 'setClearingCode', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -188,7 +183,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'clearingCode' => 'getClearingCode', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -263,7 +257,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('clearingCode', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -381,40 +374,6 @@ public function setClearingCode($clearingCode) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/TransferWebhooks/HULocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/HULocalAccountIdentification.php index 699596c18..1104d3a2a 100644 --- a/src/Adyen/Model/TransferWebhooks/HULocalAccountIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/HULocalAccountIdentification.php @@ -45,7 +45,6 @@ class HULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'accountNumber' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -58,7 +57,6 @@ class HULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'accountNumber' => null, - 'formFactor' => null, 'type' => null ]; @@ -69,7 +67,6 @@ class HULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'accountNumber' => false, - 'formFactor' => true, 'type' => false ]; @@ -160,7 +157,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountNumber' => 'accountNumber', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -171,7 +167,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountNumber' => 'setAccountNumber', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -182,7 +177,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountNumber' => 'getAccountNumber', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -256,7 +250,6 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -344,40 +337,6 @@ public function setAccountNumber($accountNumber) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/TransferWebhooks/IbanAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/IbanAccountIdentification.php index ae1cd758b..afdd5b7a1 100644 --- a/src/Adyen/Model/TransferWebhooks/IbanAccountIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/IbanAccountIdentification.php @@ -44,7 +44,6 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ - 'formFactor' => 'string', 'iban' => 'string', 'type' => 'string' ]; @@ -57,7 +56,6 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ - 'formFactor' => null, 'iban' => null, 'type' => null ]; @@ -68,7 +66,6 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static $openAPINullables = [ - 'formFactor' => true, 'iban' => false, 'type' => false ]; @@ -159,7 +156,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'formFactor' => 'formFactor', 'iban' => 'iban', 'type' => 'type' ]; @@ -170,7 +166,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'formFactor' => 'setFormFactor', 'iban' => 'setIban', 'type' => 'setType' ]; @@ -181,7 +176,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'formFactor' => 'getFormFactor', 'iban' => 'getIban', 'type' => 'getType' ]; @@ -255,7 +249,6 @@ public function getTypeAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -317,40 +310,6 @@ public function valid() } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets iban * diff --git a/src/Adyen/Model/TransferWebhooks/InternalReviewTrackingData.php b/src/Adyen/Model/TransferWebhooks/InternalReviewTrackingData.php new file mode 100644 index 000000000..fe58a0f2c --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/InternalReviewTrackingData.php @@ -0,0 +1,579 @@ + + */ +class InternalReviewTrackingData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InternalReviewTrackingData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'reason' => 'string', + 'status' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'reason' => null, + 'status' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'reason' => false, + 'status' => 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 = [ + 'reason' => 'reason', + 'status' => 'status', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'reason' => 'setReason', + 'status' => 'setStatus', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'reason' => 'getReason', + 'status' => 'getStatus', + '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; + } + + public const REASON_REFUSED_FOR_REGULATORY_REASONS = 'refusedForRegulatoryReasons'; + public const STATUS_PENDING = 'pending'; + public const STATUS_FAILED = 'failed'; + public const TYPE_INTERNAL_REVIEW = 'internalReview'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getReasonAllowableValues() + { + return [ + self::REASON_REFUSED_FOR_REGULATORY_REASONS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_PENDING, + self::STATUS_FAILED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_INTERNAL_REVIEW, + ]; + } + /** + * 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('reason', $data ?? [], null); + $this->setIfExists('status', $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 = []; + + $allowedValues = $this->getReasonAllowableValues(); + if (!is_null($this->container['reason']) && !in_array($this->container['reason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'reason', must be one of '%s'", + $this->container['reason'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason Possible values: - **refusedForRegulatoryReasons**. + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $allowedValues = $this->getReasonAllowableValues(); + if (!in_array($reason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'reason', must be one of '%s'", + $reason, + implode("', '", $allowedValues) + ) + ); + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Possible values: - **pending**: Transfer is under internal review. - **failed**: Transfer failed to pass internal review. See field **reason** for details. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **internalReview** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $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/TransferWebhooks/NOLocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/NOLocalAccountIdentification.php index 463d5f94b..7d1585575 100644 --- a/src/Adyen/Model/TransferWebhooks/NOLocalAccountIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/NOLocalAccountIdentification.php @@ -45,7 +45,6 @@ class NOLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'accountNumber' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -58,7 +57,6 @@ class NOLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'accountNumber' => null, - 'formFactor' => null, 'type' => null ]; @@ -69,7 +67,6 @@ class NOLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'accountNumber' => false, - 'formFactor' => true, 'type' => false ]; @@ -160,7 +157,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountNumber' => 'accountNumber', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -171,7 +167,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountNumber' => 'setAccountNumber', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -182,7 +177,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountNumber' => 'getAccountNumber', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -256,7 +250,6 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -344,40 +337,6 @@ public function setAccountNumber($accountNumber) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/TransferWebhooks/NZLocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/NZLocalAccountIdentification.php index 1529d67f8..8217c1ff0 100644 --- a/src/Adyen/Model/TransferWebhooks/NZLocalAccountIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/NZLocalAccountIdentification.php @@ -45,7 +45,6 @@ class NZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'accountNumber' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -58,7 +57,6 @@ class NZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'accountNumber' => null, - 'formFactor' => null, 'type' => null ]; @@ -69,7 +67,6 @@ class NZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'accountNumber' => false, - 'formFactor' => true, 'type' => false ]; @@ -160,7 +157,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountNumber' => 'accountNumber', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -171,7 +167,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountNumber' => 'setAccountNumber', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -182,7 +177,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountNumber' => 'getAccountNumber', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -256,7 +250,6 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -344,40 +337,6 @@ public function setAccountNumber($accountNumber) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/TransferWebhooks/NumberAndBicAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/NumberAndBicAccountIdentification.php index 6ab6977fc..83bc4aace 100644 --- a/src/Adyen/Model/TransferWebhooks/NumberAndBicAccountIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/NumberAndBicAccountIdentification.php @@ -47,7 +47,6 @@ class NumberAndBicAccountIdentification implements ModelInterface, ArrayAccess, 'accountNumber' => 'string', 'additionalBankIdentification' => '\Adyen\Model\TransferWebhooks\AdditionalBankIdentification', 'bic' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -62,7 +61,6 @@ class NumberAndBicAccountIdentification implements ModelInterface, ArrayAccess, 'accountNumber' => null, 'additionalBankIdentification' => null, 'bic' => null, - 'formFactor' => null, 'type' => null ]; @@ -75,7 +73,6 @@ class NumberAndBicAccountIdentification implements ModelInterface, ArrayAccess, 'accountNumber' => false, 'additionalBankIdentification' => false, 'bic' => false, - 'formFactor' => true, 'type' => false ]; @@ -168,7 +165,6 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'accountNumber', 'additionalBankIdentification' => 'additionalBankIdentification', 'bic' => 'bic', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -181,7 +177,6 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'setAccountNumber', 'additionalBankIdentification' => 'setAdditionalBankIdentification', 'bic' => 'setBic', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -194,7 +189,6 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'getAccountNumber', 'additionalBankIdentification' => 'getAdditionalBankIdentification', 'bic' => 'getBic', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -270,7 +264,6 @@ public function __construct(array $data = null) $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('additionalBankIdentification', $data ?? [], null); $this->setIfExists('bic', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -415,40 +408,6 @@ public function setBic($bic) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/TransferWebhooks/ObjectSerializer.php b/src/Adyen/Model/TransferWebhooks/ObjectSerializer.php index 01b25bf23..d05b26906 100644 --- a/src/Adyen/Model/TransferWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/TransferWebhooks/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/TransferWebhooks/PLLocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/PLLocalAccountIdentification.php index c229495c3..6127aedbb 100644 --- a/src/Adyen/Model/TransferWebhooks/PLLocalAccountIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/PLLocalAccountIdentification.php @@ -45,7 +45,6 @@ class PLLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'accountNumber' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -58,7 +57,6 @@ class PLLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'accountNumber' => null, - 'formFactor' => null, 'type' => null ]; @@ -69,7 +67,6 @@ class PLLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'accountNumber' => false, - 'formFactor' => true, 'type' => false ]; @@ -160,7 +157,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountNumber' => 'accountNumber', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -171,7 +167,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountNumber' => 'setAccountNumber', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -182,7 +177,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountNumber' => 'getAccountNumber', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -256,7 +250,6 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -344,40 +337,6 @@ public function setAccountNumber($accountNumber) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/TransferWebhooks/PartyIdentification.php b/src/Adyen/Model/TransferWebhooks/PartyIdentification.php index 2b43e2380..1a1bedc79 100644 --- a/src/Adyen/Model/TransferWebhooks/PartyIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/PartyIdentification.php @@ -413,7 +413,7 @@ public function getFirstName() /** * Sets firstName * - * @param string|null $firstName First name of the individual. Allowed only when `type` is **individual**. + * @param string|null $firstName First name of the individual. Allowed only when `type` is **individual**. Supported characters: [a-z] [A-Z] - . / — and Space. * * @return self */ @@ -440,7 +440,7 @@ public function getFullName() /** * Sets fullName * - * @param string $fullName The name of the entity. + * @param string $fullName The name of the entity. Supported characters: [a-z] [A-Z] [0-9] , . ; : - — / \\ + & ! ? @ ( ) \" ' and Space. * * @return self */ @@ -467,7 +467,7 @@ public function getLastName() /** * Sets lastName * - * @param string|null $lastName Last name of the individual. Allowed only when `type` is **individual**. + * @param string|null $lastName Last name of the individual. Allowed only when `type` is **individual**. Supported characters: [a-z] [A-Z] - . / — and Space. * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/SELocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/SELocalAccountIdentification.php index a69579cc3..c783c4484 100644 --- a/src/Adyen/Model/TransferWebhooks/SELocalAccountIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/SELocalAccountIdentification.php @@ -46,7 +46,6 @@ class SELocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'clearingNumber' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -60,7 +59,6 @@ class SELocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'clearingNumber' => null, - 'formFactor' => null, 'type' => null ]; @@ -72,7 +70,6 @@ class SELocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'clearingNumber' => false, - 'formFactor' => true, 'type' => false ]; @@ -164,7 +161,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'clearingNumber' => 'clearingNumber', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -176,7 +172,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'clearingNumber' => 'setClearingNumber', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -188,7 +183,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'clearingNumber' => 'getClearingNumber', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -263,7 +257,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('clearingNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -381,40 +374,6 @@ public function setClearingNumber($clearingNumber) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/TransferWebhooks/SGLocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/SGLocalAccountIdentification.php index 9411d2e25..3496821fd 100644 --- a/src/Adyen/Model/TransferWebhooks/SGLocalAccountIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/SGLocalAccountIdentification.php @@ -46,7 +46,6 @@ class SGLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'bic' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -60,7 +59,6 @@ class SGLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'bic' => null, - 'formFactor' => null, 'type' => null ]; @@ -72,7 +70,6 @@ class SGLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'bic' => false, - 'formFactor' => true, 'type' => false ]; @@ -164,7 +161,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'bic' => 'bic', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -176,7 +172,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'bic' => 'setBic', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -188,7 +183,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'bic' => 'getBic', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -263,7 +257,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bic', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -378,40 +371,6 @@ public function setBic($bic) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/TransferWebhooks/TransferData.php b/src/Adyen/Model/TransferWebhooks/TransferData.php index 16710e580..1ca1fb974 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferData.php +++ b/src/Adyen/Model/TransferWebhooks/TransferData.php @@ -63,7 +63,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'referenceForBeneficiary' => 'string', 'sequenceNumber' => 'int', 'status' => 'string', - 'tracking' => '\Adyen\Model\TransferWebhooks\TransferNotificationTransferTracking', + 'tracking' => '\Adyen\Model\TransferWebhooks\TransferDataTracking', 'transactionRulesResult' => '\Adyen\Model\TransferWebhooks\TransactionRulesResult', 'type' => 'string' ]; @@ -359,6 +359,7 @@ public function getModelName() public const REASON_DECLINED_BY_TRANSACTION_RULE = 'declinedByTransactionRule'; public const REASON_ERROR = 'error'; public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; + public const REASON_PENDING_APPROVAL = 'pendingApproval'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; @@ -435,6 +436,7 @@ public function getModelName() public const TYPE_BALANCE_ROLLOVER = 'balanceRollover'; public const TYPE_BANK_DIRECT_DEBIT = 'bankDirectDebit'; public const TYPE_BANK_TRANSFER = 'bankTransfer'; + public const TYPE_CAPITAL_FUNDS_COLLECTION = 'capitalFundsCollection'; public const TYPE_CAPTURE = 'capture'; public const TYPE_CAPTURE_REVERSAL = 'captureReversal'; public const TYPE_CARD_TRANSFER = 'cardTransfer'; @@ -511,6 +513,7 @@ public function getReasonAllowableValues() self::REASON_DECLINED_BY_TRANSACTION_RULE, self::REASON_ERROR, self::REASON_NOT_ENOUGH_BALANCE, + self::REASON_PENDING_APPROVAL, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, @@ -607,6 +610,7 @@ public function getTypeAllowableValues() self::TYPE_BALANCE_ROLLOVER, self::TYPE_BANK_DIRECT_DEBIT, self::TYPE_BANK_TRANSFER, + self::TYPE_CAPITAL_FUNDS_COLLECTION, self::TYPE_CAPTURE, self::TYPE_CAPTURE_REVERSAL, self::TYPE_CARD_TRANSFER, @@ -1327,7 +1331,7 @@ public function setStatus($status) /** * Gets tracking * - * @return \Adyen\Model\TransferWebhooks\TransferNotificationTransferTracking|null + * @return \Adyen\Model\TransferWebhooks\TransferDataTracking|null */ public function getTracking() { @@ -1337,7 +1341,7 @@ public function getTracking() /** * Sets tracking * - * @param \Adyen\Model\TransferWebhooks\TransferNotificationTransferTracking|null $tracking tracking + * @param \Adyen\Model\TransferWebhooks\TransferDataTracking|null $tracking tracking * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/TransferDataTracking.php b/src/Adyen/Model/TransferWebhooks/TransferDataTracking.php new file mode 100644 index 000000000..60ee502e4 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/TransferDataTracking.php @@ -0,0 +1,524 @@ + + */ +class TransferDataTracking implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferData_tracking'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'type' => 'string', + 'estimatedArrivalTime' => '\DateTime', + 'reason' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'type' => null, + 'estimatedArrivalTime' => 'date-time', + 'reason' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'status' => false, + 'type' => false, + 'estimatedArrivalTime' => false, + 'reason' => 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 = [ + 'status' => 'status', + 'type' => 'type', + 'estimatedArrivalTime' => 'estimatedArrivalTime', + 'reason' => 'reason' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'type' => 'setType', + 'estimatedArrivalTime' => 'setEstimatedArrivalTime', + 'reason' => 'setReason' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'type' => 'getType', + 'estimatedArrivalTime' => 'getEstimatedArrivalTime', + 'reason' => 'getReason' + ]; + + /** + * 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('status', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('estimatedArrivalTime', $data ?? [], null); + $this->setIfExists('reason', $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['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + + if ($this->container['estimatedArrivalTime'] === null) { + $invalidProperties[] = "'estimatedArrivalTime' 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 status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Possible values: - **pending**: Transfer is under internal review. - **failed**: Transfer failed to pass internal review. See field **reason** for details. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **internalReview** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets estimatedArrivalTime + * + * @return \DateTime + */ + public function getEstimatedArrivalTime() + { + return $this->container['estimatedArrivalTime']; + } + + /** + * Sets estimatedArrivalTime + * + * @param \DateTime $estimatedArrivalTime The estimated time the beneficiary should have access to the funds. + * + * @return self + */ + public function setEstimatedArrivalTime($estimatedArrivalTime) + { + if (is_null($estimatedArrivalTime)) { + throw new \InvalidArgumentException('non-nullable estimatedArrivalTime cannot be null'); + } + $this->container['estimatedArrivalTime'] = $estimatedArrivalTime; + + return $this; + } + + /** + * Gets reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason Possible values: - **refusedForRegulatoryReasons**. + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $this->container['reason'] = $reason; + + 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/TransferEvent.php b/src/Adyen/Model/TransferWebhooks/TransferEvent.php index 5f4f66996..a9d8177b3 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferEvent.php +++ b/src/Adyen/Model/TransferWebhooks/TransferEvent.php @@ -48,12 +48,14 @@ class TransferEvent implements ModelInterface, ArrayAccess, \JsonSerializable 'amountAdjustments' => '\Adyen\Model\TransferWebhooks\AmountAdjustment[]', 'bookingDate' => '\DateTime', 'estimatedArrivalTime' => '\DateTime', + 'externalReason' => '\Adyen\Model\TransferWebhooks\ExternalReason', 'id' => 'string', 'modification' => '\Adyen\Model\TransferWebhooks\Modification', 'mutations' => '\Adyen\Model\TransferWebhooks\BalanceMutation[]', 'originalAmount' => '\Adyen\Model\TransferWebhooks\Amount', 'reason' => 'string', 'status' => 'string', + 'trackingData' => '\Adyen\Model\TransferWebhooks\TransferEventTrackingData', 'transactionId' => 'string', 'type' => 'string', 'updateDate' => '\DateTime', @@ -72,12 +74,14 @@ class TransferEvent implements ModelInterface, ArrayAccess, \JsonSerializable 'amountAdjustments' => null, 'bookingDate' => 'date-time', 'estimatedArrivalTime' => 'date-time', + 'externalReason' => null, 'id' => null, 'modification' => null, 'mutations' => null, 'originalAmount' => null, 'reason' => null, 'status' => null, + 'trackingData' => null, 'transactionId' => null, 'type' => null, 'updateDate' => 'date-time', @@ -94,12 +98,14 @@ class TransferEvent implements ModelInterface, ArrayAccess, \JsonSerializable 'amountAdjustments' => false, 'bookingDate' => false, 'estimatedArrivalTime' => false, + 'externalReason' => false, 'id' => false, 'modification' => false, 'mutations' => false, 'originalAmount' => false, 'reason' => false, 'status' => false, + 'trackingData' => false, 'transactionId' => false, 'type' => false, 'updateDate' => false, @@ -196,12 +202,14 @@ public function isNullableSetToNull(string $property): bool 'amountAdjustments' => 'amountAdjustments', 'bookingDate' => 'bookingDate', 'estimatedArrivalTime' => 'estimatedArrivalTime', + 'externalReason' => 'externalReason', 'id' => 'id', 'modification' => 'modification', 'mutations' => 'mutations', 'originalAmount' => 'originalAmount', 'reason' => 'reason', 'status' => 'status', + 'trackingData' => 'trackingData', 'transactionId' => 'transactionId', 'type' => 'type', 'updateDate' => 'updateDate', @@ -218,12 +226,14 @@ public function isNullableSetToNull(string $property): bool 'amountAdjustments' => 'setAmountAdjustments', 'bookingDate' => 'setBookingDate', 'estimatedArrivalTime' => 'setEstimatedArrivalTime', + 'externalReason' => 'setExternalReason', 'id' => 'setId', 'modification' => 'setModification', 'mutations' => 'setMutations', 'originalAmount' => 'setOriginalAmount', 'reason' => 'setReason', 'status' => 'setStatus', + 'trackingData' => 'setTrackingData', 'transactionId' => 'setTransactionId', 'type' => 'setType', 'updateDate' => 'setUpdateDate', @@ -240,12 +250,14 @@ public function isNullableSetToNull(string $property): bool 'amountAdjustments' => 'getAmountAdjustments', 'bookingDate' => 'getBookingDate', 'estimatedArrivalTime' => 'getEstimatedArrivalTime', + 'externalReason' => 'getExternalReason', 'id' => 'getId', 'modification' => 'getModification', 'mutations' => 'getMutations', 'originalAmount' => 'getOriginalAmount', 'reason' => 'getReason', 'status' => 'getStatus', + 'trackingData' => 'getTrackingData', 'transactionId' => 'getTransactionId', 'type' => 'getType', 'updateDate' => 'getUpdateDate', @@ -305,6 +317,7 @@ public function getModelName() public const REASON_DECLINED_BY_TRANSACTION_RULE = 'declinedByTransactionRule'; public const REASON_ERROR = 'error'; public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; + public const REASON_PENDING_APPROVAL = 'pendingApproval'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; @@ -397,6 +410,7 @@ public function getReasonAllowableValues() self::REASON_DECLINED_BY_TRANSACTION_RULE, self::REASON_ERROR, self::REASON_NOT_ENOUGH_BALANCE, + self::REASON_PENDING_APPROVAL, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, @@ -509,12 +523,14 @@ public function __construct(array $data = null) $this->setIfExists('amountAdjustments', $data ?? [], null); $this->setIfExists('bookingDate', $data ?? [], null); $this->setIfExists('estimatedArrivalTime', $data ?? [], null); + $this->setIfExists('externalReason', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('modification', $data ?? [], null); $this->setIfExists('mutations', $data ?? [], null); $this->setIfExists('originalAmount', $data ?? [], null); $this->setIfExists('reason', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('trackingData', $data ?? [], null); $this->setIfExists('transactionId', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('updateDate', $data ?? [], null); @@ -675,6 +691,7 @@ public function setBookingDate($bookingDate) * Gets estimatedArrivalTime * * @return \DateTime|null + * @deprecated */ public function getEstimatedArrivalTime() { @@ -687,6 +704,7 @@ public function getEstimatedArrivalTime() * @param \DateTime|null $estimatedArrivalTime The estimated time the beneficiary should have access to the funds. * * @return self + * @deprecated */ public function setEstimatedArrivalTime($estimatedArrivalTime) { @@ -698,6 +716,33 @@ public function setEstimatedArrivalTime($estimatedArrivalTime) return $this; } + /** + * Gets externalReason + * + * @return \Adyen\Model\TransferWebhooks\ExternalReason|null + */ + public function getExternalReason() + { + return $this->container['externalReason']; + } + + /** + * Sets externalReason + * + * @param \Adyen\Model\TransferWebhooks\ExternalReason|null $externalReason externalReason + * + * @return self + */ + public function setExternalReason($externalReason) + { + if (is_null($externalReason)) { + throw new \InvalidArgumentException('non-nullable externalReason cannot be null'); + } + $this->container['externalReason'] = $externalReason; + + return $this; + } + /** * Gets id * @@ -880,6 +925,33 @@ public function setStatus($status) return $this; } + /** + * Gets trackingData + * + * @return \Adyen\Model\TransferWebhooks\TransferEventTrackingData|null + */ + public function getTrackingData() + { + return $this->container['trackingData']; + } + + /** + * Sets trackingData + * + * @param \Adyen\Model\TransferWebhooks\TransferEventTrackingData|null $trackingData trackingData + * + * @return self + */ + public function setTrackingData($trackingData) + { + if (is_null($trackingData)) { + throw new \InvalidArgumentException('non-nullable trackingData cannot be null'); + } + $this->container['trackingData'] = $trackingData; + + return $this; + } + /** * Gets transactionId * diff --git a/src/Adyen/Model/TransferWebhooks/TransferEventTrackingData.php b/src/Adyen/Model/TransferWebhooks/TransferEventTrackingData.php new file mode 100644 index 000000000..948cffdc6 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/TransferEventTrackingData.php @@ -0,0 +1,524 @@ + + */ +class TransferEventTrackingData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferEvent_trackingData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'type' => 'string', + 'estimatedArrivalTime' => '\DateTime', + 'reason' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'type' => null, + 'estimatedArrivalTime' => 'date-time', + 'reason' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'status' => false, + 'type' => false, + 'estimatedArrivalTime' => false, + 'reason' => 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 = [ + 'status' => 'status', + 'type' => 'type', + 'estimatedArrivalTime' => 'estimatedArrivalTime', + 'reason' => 'reason' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'type' => 'setType', + 'estimatedArrivalTime' => 'setEstimatedArrivalTime', + 'reason' => 'setReason' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'type' => 'getType', + 'estimatedArrivalTime' => 'getEstimatedArrivalTime', + 'reason' => 'getReason' + ]; + + /** + * 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('status', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('estimatedArrivalTime', $data ?? [], null); + $this->setIfExists('reason', $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['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + + if ($this->container['estimatedArrivalTime'] === null) { + $invalidProperties[] = "'estimatedArrivalTime' 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 status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Possible values: - **pending**: Transfer is under internal review. - **failed**: Transfer failed to pass internal review. See field **reason** for details. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **internalReview** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets estimatedArrivalTime + * + * @return \DateTime + */ + public function getEstimatedArrivalTime() + { + return $this->container['estimatedArrivalTime']; + } + + /** + * Sets estimatedArrivalTime + * + * @param \DateTime $estimatedArrivalTime The estimated time the beneficiary should have access to the funds. + * + * @return self + */ + public function setEstimatedArrivalTime($estimatedArrivalTime) + { + if (is_null($estimatedArrivalTime)) { + throw new \InvalidArgumentException('non-nullable estimatedArrivalTime cannot be null'); + } + $this->container['estimatedArrivalTime'] = $estimatedArrivalTime; + + return $this; + } + + /** + * Gets reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason Possible values: - **refusedForRegulatoryReasons**. + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $this->container['reason'] = $reason; + + 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/TransferNotificationCounterParty.php b/src/Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.php index 86f4796e3..909505170 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.php +++ b/src/Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.php @@ -310,7 +310,7 @@ public function getBalanceAccountId() /** * Sets balanceAccountId * - * @param string|null $balanceAccountId Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). + * @param string|null $balanceAccountId The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). * * @return self */ @@ -391,7 +391,7 @@ public function getTransferInstrumentId() /** * Sets transferInstrumentId * - * @param string|null $transferInstrumentId Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * @param string|null $transferInstrumentId The unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/UKLocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/UKLocalAccountIdentification.php index 13505990b..c9456a385 100644 --- a/src/Adyen/Model/TransferWebhooks/UKLocalAccountIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/UKLocalAccountIdentification.php @@ -45,7 +45,6 @@ class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'accountNumber' => 'string', - 'formFactor' => 'string', 'sortCode' => 'string', 'type' => 'string' ]; @@ -59,7 +58,6 @@ class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'accountNumber' => null, - 'formFactor' => null, 'sortCode' => null, 'type' => null ]; @@ -71,7 +69,6 @@ class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'accountNumber' => false, - 'formFactor' => true, 'sortCode' => false, 'type' => false ]; @@ -163,7 +160,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountNumber' => 'accountNumber', - 'formFactor' => 'formFactor', 'sortCode' => 'sortCode', 'type' => 'type' ]; @@ -175,7 +171,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountNumber' => 'setAccountNumber', - 'formFactor' => 'setFormFactor', 'sortCode' => 'setSortCode', 'type' => 'setType' ]; @@ -187,7 +182,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountNumber' => 'getAccountNumber', - 'formFactor' => 'getFormFactor', 'sortCode' => 'getSortCode', 'type' => 'getType' ]; @@ -262,7 +256,6 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('sortCode', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -354,40 +347,6 @@ public function setAccountNumber($accountNumber) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets sortCode * diff --git a/src/Adyen/Model/TransferWebhooks/USLocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/USLocalAccountIdentification.php index b537723eb..dc133729c 100644 --- a/src/Adyen/Model/TransferWebhooks/USLocalAccountIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/USLocalAccountIdentification.php @@ -46,7 +46,6 @@ class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'accountType' => 'string', - 'formFactor' => 'string', 'routingNumber' => 'string', 'type' => 'string' ]; @@ -61,7 +60,6 @@ class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'accountType' => null, - 'formFactor' => null, 'routingNumber' => null, 'type' => null ]; @@ -74,7 +72,6 @@ class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'accountType' => false, - 'formFactor' => true, 'routingNumber' => false, 'type' => false ]; @@ -167,7 +164,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'accountType' => 'accountType', - 'formFactor' => 'formFactor', 'routingNumber' => 'routingNumber', 'type' => 'type' ]; @@ -180,7 +176,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'accountType' => 'setAccountType', - 'formFactor' => 'setFormFactor', 'routingNumber' => 'setRoutingNumber', 'type' => 'setType' ]; @@ -193,7 +188,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'accountType' => 'getAccountType', - 'formFactor' => 'getFormFactor', 'routingNumber' => 'getRoutingNumber', 'type' => 'getType' ]; @@ -283,7 +277,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('accountType', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('routingNumber', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -421,40 +414,6 @@ public function setAccountType($accountType) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets routingNumber * diff --git a/src/Adyen/Model/Transfers/AULocalAccountIdentification.php b/src/Adyen/Model/Transfers/AULocalAccountIdentification.php index f9c1ecf7a..7c2bf9262 100644 --- a/src/Adyen/Model/Transfers/AULocalAccountIdentification.php +++ b/src/Adyen/Model/Transfers/AULocalAccountIdentification.php @@ -46,7 +46,6 @@ class AULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'bsbCode' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -60,7 +59,6 @@ class AULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'bsbCode' => null, - 'formFactor' => null, 'type' => null ]; @@ -72,7 +70,6 @@ class AULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'bsbCode' => false, - 'formFactor' => true, 'type' => false ]; @@ -164,7 +161,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'bsbCode' => 'bsbCode', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -176,7 +172,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'bsbCode' => 'setBsbCode', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -188,7 +183,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'bsbCode' => 'getBsbCode', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -263,7 +257,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bsbCode', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -381,40 +374,6 @@ public function setBsbCode($bsbCode) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/Transfers/Address.php b/src/Adyen/Model/Transfers/Address.php index 06c0c4b3f..8e21e7008 100644 --- a/src/Adyen/Model/Transfers/Address.php +++ b/src/Adyen/Model/Transfers/Address.php @@ -327,7 +327,7 @@ public function getCity() /** * Sets city * - * @param string|null $city The name of the city. + * @param string|null $city The name of the city. Supported characters: [a-z] [A-Z] [0-9] . - — / # , ’ ° ( ) : ; [ ] & \\ | and Space. * * @return self */ @@ -381,7 +381,7 @@ public function getLine1() /** * Sets line1 * - * @param string|null $line1 First line of the street address. + * @param string|null $line1 First line of the street address. Supported characters: [a-z] [A-Z] [0-9] . - — / # , ’ ° ( ) : ; [ ] & \\ | and Space. * * @return self */ @@ -408,7 +408,7 @@ public function getLine2() /** * Sets line2 * - * @param string|null $line2 Second line of the street address. + * @param string|null $line2 Second line of the street address. Supported characters: [a-z] [A-Z] [0-9] . - — / # , ’ ° ( ) : ; [ ] & \\ | and Space. * * @return self */ @@ -435,7 +435,7 @@ public function getPostalCode() /** * Sets postalCode * - * @param string|null $postalCode The postal code. Maximum length: * 5 digits for an address in the US. * 10 characters for an address in all other countries. + * @param string|null $postalCode The postal code. Maximum length: * 5 digits for an address in the US. * 10 characters for an address in all other countries. Supported characters: [a-z] [A-Z] [0-9] and Space. * * @return self */ @@ -462,7 +462,7 @@ public function getStateOrProvince() /** * Sets stateOrProvince * - * @param string|null $stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + * @param string|null $stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. * * @return self */ diff --git a/src/Adyen/Model/Transfers/BRLocalAccountIdentification.php b/src/Adyen/Model/Transfers/BRLocalAccountIdentification.php index 0d23be169..9a4c500f7 100644 --- a/src/Adyen/Model/Transfers/BRLocalAccountIdentification.php +++ b/src/Adyen/Model/Transfers/BRLocalAccountIdentification.php @@ -47,7 +47,7 @@ class BRLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json 'accountNumber' => 'string', 'bankCode' => 'string', 'branchNumber' => 'string', - 'formFactor' => 'string', + 'ispb' => 'string', 'type' => 'string' ]; @@ -62,7 +62,7 @@ class BRLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json 'accountNumber' => null, 'bankCode' => null, 'branchNumber' => null, - 'formFactor' => null, + 'ispb' => null, 'type' => null ]; @@ -75,7 +75,7 @@ class BRLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json 'accountNumber' => false, 'bankCode' => false, 'branchNumber' => false, - 'formFactor' => true, + 'ispb' => false, 'type' => false ]; @@ -168,7 +168,7 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'accountNumber', 'bankCode' => 'bankCode', 'branchNumber' => 'branchNumber', - 'formFactor' => 'formFactor', + 'ispb' => 'ispb', 'type' => 'type' ]; @@ -181,7 +181,7 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'setAccountNumber', 'bankCode' => 'setBankCode', 'branchNumber' => 'setBranchNumber', - 'formFactor' => 'setFormFactor', + 'ispb' => 'setIspb', 'type' => 'setType' ]; @@ -194,7 +194,7 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'getAccountNumber', 'bankCode' => 'getBankCode', 'branchNumber' => 'getBranchNumber', - 'formFactor' => 'getFormFactor', + 'ispb' => 'getIspb', 'type' => 'getType' ]; @@ -270,7 +270,7 @@ public function __construct(array $data = null) $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bankCode', $data ?? [], null); $this->setIfExists('branchNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); + $this->setIfExists('ispb', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -419,35 +419,28 @@ public function setBranchNumber($branchNumber) } /** - * Gets formFactor + * Gets ispb * * @return string|null */ - public function getFormFactor() + public function getIspb() { - return $this->container['formFactor']; + return $this->container['ispb']; } /** - * Sets formFactor + * Sets ispb * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. + * @param string|null $ispb The 8-digit ISPB, with leading zeros. * * @return self */ - public function setFormFactor($formFactor) + public function setIspb($ispb) { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } + if (is_null($ispb)) { + throw new \InvalidArgumentException('non-nullable ispb cannot be null'); } - $this->container['formFactor'] = $formFactor; + $this->container['ispb'] = $ispb; return $this; } diff --git a/src/Adyen/Model/Transfers/BankAccountV3AccountIdentification.php b/src/Adyen/Model/Transfers/BankAccountV3AccountIdentification.php index 69608d84b..e9909f254 100644 --- a/src/Adyen/Model/Transfers/BankAccountV3AccountIdentification.php +++ b/src/Adyen/Model/Transfers/BankAccountV3AccountIdentification.php @@ -47,10 +47,10 @@ class BankAccountV3AccountIdentification implements ModelInterface, ArrayAccess, protected static $openAPITypes = [ 'accountNumber' => 'string', 'bsbCode' => 'string', - 'formFactor' => 'string', 'type' => 'string', 'bankCode' => 'string', 'branchNumber' => 'string', + 'ispb' => 'string', 'accountType' => 'string', 'institutionNumber' => 'string', 'transitNumber' => 'string', @@ -73,10 +73,10 @@ class BankAccountV3AccountIdentification implements ModelInterface, ArrayAccess, protected static $openAPIFormats = [ 'accountNumber' => null, 'bsbCode' => null, - 'formFactor' => null, 'type' => null, 'bankCode' => null, 'branchNumber' => null, + 'ispb' => null, 'accountType' => null, 'institutionNumber' => null, 'transitNumber' => null, @@ -97,10 +97,10 @@ class BankAccountV3AccountIdentification implements ModelInterface, ArrayAccess, protected static $openAPINullables = [ 'accountNumber' => false, 'bsbCode' => false, - 'formFactor' => true, 'type' => false, 'bankCode' => false, 'branchNumber' => false, + 'ispb' => false, 'accountType' => false, 'institutionNumber' => false, 'transitNumber' => false, @@ -201,10 +201,10 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'bsbCode' => 'bsbCode', - 'formFactor' => 'formFactor', 'type' => 'type', 'bankCode' => 'bankCode', 'branchNumber' => 'branchNumber', + 'ispb' => 'ispb', 'accountType' => 'accountType', 'institutionNumber' => 'institutionNumber', 'transitNumber' => 'transitNumber', @@ -225,10 +225,10 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'bsbCode' => 'setBsbCode', - 'formFactor' => 'setFormFactor', 'type' => 'setType', 'bankCode' => 'setBankCode', 'branchNumber' => 'setBranchNumber', + 'ispb' => 'setIspb', 'accountType' => 'setAccountType', 'institutionNumber' => 'setInstitutionNumber', 'transitNumber' => 'setTransitNumber', @@ -249,10 +249,10 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'bsbCode' => 'getBsbCode', - 'formFactor' => 'getFormFactor', 'type' => 'getType', 'bankCode' => 'getBankCode', 'branchNumber' => 'getBranchNumber', + 'ispb' => 'getIspb', 'accountType' => 'getAccountType', 'institutionNumber' => 'getInstitutionNumber', 'transitNumber' => 'getTransitNumber', @@ -323,10 +323,10 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bsbCode', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('bankCode', $data ?? [], null); $this->setIfExists('branchNumber', $data ?? [], null); + $this->setIfExists('ispb', $data ?? [], null); $this->setIfExists('accountType', $data ?? [], null); $this->setIfExists('institutionNumber', $data ?? [], null); $this->setIfExists('transitNumber', $data ?? [], null); @@ -476,40 +476,6 @@ public function setBsbCode($bsbCode) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * @@ -591,6 +557,33 @@ public function setBranchNumber($branchNumber) return $this; } + /** + * Gets ispb + * + * @return string|null + */ + public function getIspb() + { + return $this->container['ispb']; + } + + /** + * Sets ispb + * + * @param string|null $ispb The 8-digit ISPB, with leading zeros. + * + * @return self + */ + public function setIspb($ispb) + { + if (is_null($ispb)) { + throw new \InvalidArgumentException('non-nullable ispb cannot be null'); + } + $this->container['ispb'] = $ispb; + + return $this; + } + /** * Gets accountType * diff --git a/src/Adyen/Model/Transfers/CALocalAccountIdentification.php b/src/Adyen/Model/Transfers/CALocalAccountIdentification.php index a43eec576..f50937639 100644 --- a/src/Adyen/Model/Transfers/CALocalAccountIdentification.php +++ b/src/Adyen/Model/Transfers/CALocalAccountIdentification.php @@ -46,7 +46,6 @@ class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'accountType' => 'string', - 'formFactor' => 'string', 'institutionNumber' => 'string', 'transitNumber' => 'string', 'type' => 'string' @@ -62,7 +61,6 @@ class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'accountType' => null, - 'formFactor' => null, 'institutionNumber' => null, 'transitNumber' => null, 'type' => null @@ -76,7 +74,6 @@ class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'accountType' => false, - 'formFactor' => true, 'institutionNumber' => false, 'transitNumber' => false, 'type' => false @@ -170,7 +167,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'accountType' => 'accountType', - 'formFactor' => 'formFactor', 'institutionNumber' => 'institutionNumber', 'transitNumber' => 'transitNumber', 'type' => 'type' @@ -184,7 +180,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'accountType' => 'setAccountType', - 'formFactor' => 'setFormFactor', 'institutionNumber' => 'setInstitutionNumber', 'transitNumber' => 'setTransitNumber', 'type' => 'setType' @@ -198,7 +193,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'accountType' => 'getAccountType', - 'formFactor' => 'getFormFactor', 'institutionNumber' => 'getInstitutionNumber', 'transitNumber' => 'getTransitNumber', 'type' => 'getType' @@ -289,7 +283,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('accountType', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('institutionNumber', $data ?? [], null); $this->setIfExists('transitNumber', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); @@ -431,40 +424,6 @@ public function setAccountType($accountType) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets institutionNumber * diff --git a/src/Adyen/Model/Transfers/CZLocalAccountIdentification.php b/src/Adyen/Model/Transfers/CZLocalAccountIdentification.php index 8e0462991..b0f087366 100644 --- a/src/Adyen/Model/Transfers/CZLocalAccountIdentification.php +++ b/src/Adyen/Model/Transfers/CZLocalAccountIdentification.php @@ -46,7 +46,6 @@ class CZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'bankCode' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -60,7 +59,6 @@ class CZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'bankCode' => null, - 'formFactor' => null, 'type' => null ]; @@ -72,7 +70,6 @@ class CZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'bankCode' => false, - 'formFactor' => true, 'type' => false ]; @@ -164,7 +161,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'bankCode' => 'bankCode', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -176,7 +172,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'bankCode' => 'setBankCode', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -188,7 +183,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'bankCode' => 'getBankCode', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -263,7 +257,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bankCode', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -381,40 +374,6 @@ public function setBankCode($bankCode) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/Transfers/ConfirmationTrackingData.php b/src/Adyen/Model/Transfers/ConfirmationTrackingData.php new file mode 100644 index 000000000..30d4a533e --- /dev/null +++ b/src/Adyen/Model/Transfers/ConfirmationTrackingData.php @@ -0,0 +1,512 @@ + + */ +class ConfirmationTrackingData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfirmationTrackingData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'status' => 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 = [ + 'status' => 'status', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + '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; + } + + public const STATUS_CREDITED = 'credited'; + public const TYPE_CONFIRMATION = 'confirmation'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_CREDITED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CONFIRMATION, + ]; + } + /** + * 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('status', $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 = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Possible values: - **credited**: Transfer is credited to beneficiary. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **confirmation** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $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/Transfers/CounterpartyInfoV3.php b/src/Adyen/Model/Transfers/CounterpartyInfoV3.php index a9fa88df7..2d59227d5 100644 --- a/src/Adyen/Model/Transfers/CounterpartyInfoV3.php +++ b/src/Adyen/Model/Transfers/CounterpartyInfoV3.php @@ -303,7 +303,7 @@ public function getBalanceAccountId() /** * Sets balanceAccountId * - * @param string|null $balanceAccountId Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). + * @param string|null $balanceAccountId The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). * * @return self */ @@ -357,7 +357,7 @@ public function getTransferInstrumentId() /** * Sets transferInstrumentId * - * @param string|null $transferInstrumentId Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * @param string|null $transferInstrumentId The unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). * * @return self */ diff --git a/src/Adyen/Model/Transfers/CounterpartyV3.php b/src/Adyen/Model/Transfers/CounterpartyV3.php index abb8eff3b..5ff81f4b3 100644 --- a/src/Adyen/Model/Transfers/CounterpartyV3.php +++ b/src/Adyen/Model/Transfers/CounterpartyV3.php @@ -310,7 +310,7 @@ public function getBalanceAccountId() /** * Sets balanceAccountId * - * @param string|null $balanceAccountId Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). + * @param string|null $balanceAccountId The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). * * @return self */ @@ -391,7 +391,7 @@ public function getTransferInstrumentId() /** * Sets transferInstrumentId * - * @param string|null $transferInstrumentId Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * @param string|null $transferInstrumentId The unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). * * @return self */ diff --git a/src/Adyen/Model/Transfers/DKLocalAccountIdentification.php b/src/Adyen/Model/Transfers/DKLocalAccountIdentification.php index 62242d855..bc42edab5 100644 --- a/src/Adyen/Model/Transfers/DKLocalAccountIdentification.php +++ b/src/Adyen/Model/Transfers/DKLocalAccountIdentification.php @@ -46,7 +46,6 @@ class DKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'bankCode' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -60,7 +59,6 @@ class DKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'bankCode' => null, - 'formFactor' => null, 'type' => null ]; @@ -72,7 +70,6 @@ class DKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'bankCode' => false, - 'formFactor' => true, 'type' => false ]; @@ -164,7 +161,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'bankCode' => 'bankCode', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -176,7 +172,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'bankCode' => 'setBankCode', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -188,7 +183,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'bankCode' => 'getBankCode', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -263,7 +257,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bankCode', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -381,40 +374,6 @@ public function setBankCode($bankCode) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/Transfers/EstimationTrackingData.php b/src/Adyen/Model/Transfers/EstimationTrackingData.php new file mode 100644 index 000000000..ce74ea2d8 --- /dev/null +++ b/src/Adyen/Model/Transfers/EstimationTrackingData.php @@ -0,0 +1,481 @@ + + */ +class EstimationTrackingData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'EstimationTrackingData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'estimatedArrivalTime' => '\DateTime', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'estimatedArrivalTime' => 'date-time', + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'estimatedArrivalTime' => 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 = [ + 'estimatedArrivalTime' => 'estimatedArrivalTime', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'estimatedArrivalTime' => 'setEstimatedArrivalTime', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'estimatedArrivalTime' => 'getEstimatedArrivalTime', + '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; + } + + public const TYPE_ESTIMATION = 'estimation'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_ESTIMATION, + ]; + } + /** + * 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('estimatedArrivalTime', $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 = []; + + if ($this->container['estimatedArrivalTime'] === null) { + $invalidProperties[] = "'estimatedArrivalTime' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 estimatedArrivalTime + * + * @return \DateTime + */ + public function getEstimatedArrivalTime() + { + return $this->container['estimatedArrivalTime']; + } + + /** + * Sets estimatedArrivalTime + * + * @param \DateTime $estimatedArrivalTime The estimated time the beneficiary should have access to the funds. + * + * @return self + */ + public function setEstimatedArrivalTime($estimatedArrivalTime) + { + if (is_null($estimatedArrivalTime)) { + throw new \InvalidArgumentException('non-nullable estimatedArrivalTime cannot be null'); + } + $this->container['estimatedArrivalTime'] = $estimatedArrivalTime; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **estimation** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $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/Transfers/ExternalReason.php b/src/Adyen/Model/Transfers/ExternalReason.php new file mode 100644 index 000000000..7075b755d --- /dev/null +++ b/src/Adyen/Model/Transfers/ExternalReason.php @@ -0,0 +1,478 @@ + + */ +class ExternalReason implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExternalReason'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'code' => 'string', + 'description' => 'string', + 'namespace' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => null, + 'description' => null, + 'namespace' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'code' => false, + 'description' => false, + 'namespace' => 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 = [ + 'code' => 'code', + 'description' => 'description', + 'namespace' => 'namespace' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'description' => 'setDescription', + 'namespace' => 'setNamespace' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'description' => 'getDescription', + 'namespace' => 'getNamespace' + ]; + + /** + * 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('code', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('namespace', $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 code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The code for this reason code. + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description for this reason code. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets namespace + * + * @return string|null + */ + public function getNamespace() + { + return $this->container['namespace']; + } + + /** + * Sets namespace + * + * @param string|null $namespace The namespace for this reason code. + * + * @return self + */ + public function setNamespace($namespace) + { + if (is_null($namespace)) { + throw new \InvalidArgumentException('non-nullable namespace cannot be null'); + } + $this->container['namespace'] = $namespace; + + 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/Transfers/HKLocalAccountIdentification.php b/src/Adyen/Model/Transfers/HKLocalAccountIdentification.php index 714bda34b..92e3a65a4 100644 --- a/src/Adyen/Model/Transfers/HKLocalAccountIdentification.php +++ b/src/Adyen/Model/Transfers/HKLocalAccountIdentification.php @@ -46,7 +46,6 @@ class HKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'clearingCode' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -60,7 +59,6 @@ class HKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'clearingCode' => null, - 'formFactor' => null, 'type' => null ]; @@ -72,7 +70,6 @@ class HKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'clearingCode' => false, - 'formFactor' => true, 'type' => false ]; @@ -164,7 +161,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'clearingCode' => 'clearingCode', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -176,7 +172,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'clearingCode' => 'setClearingCode', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -188,7 +183,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'clearingCode' => 'getClearingCode', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -263,7 +257,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('clearingCode', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -381,40 +374,6 @@ public function setClearingCode($clearingCode) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/Transfers/HULocalAccountIdentification.php b/src/Adyen/Model/Transfers/HULocalAccountIdentification.php index 34623fe6d..68a24846d 100644 --- a/src/Adyen/Model/Transfers/HULocalAccountIdentification.php +++ b/src/Adyen/Model/Transfers/HULocalAccountIdentification.php @@ -45,7 +45,6 @@ class HULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'accountNumber' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -58,7 +57,6 @@ class HULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'accountNumber' => null, - 'formFactor' => null, 'type' => null ]; @@ -69,7 +67,6 @@ class HULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'accountNumber' => false, - 'formFactor' => true, 'type' => false ]; @@ -160,7 +157,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountNumber' => 'accountNumber', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -171,7 +167,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountNumber' => 'setAccountNumber', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -182,7 +177,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountNumber' => 'getAccountNumber', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -256,7 +250,6 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -344,40 +337,6 @@ public function setAccountNumber($accountNumber) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/Transfers/IbanAccountIdentification.php b/src/Adyen/Model/Transfers/IbanAccountIdentification.php index d84f473b8..915278dd7 100644 --- a/src/Adyen/Model/Transfers/IbanAccountIdentification.php +++ b/src/Adyen/Model/Transfers/IbanAccountIdentification.php @@ -44,7 +44,6 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ - 'formFactor' => 'string', 'iban' => 'string', 'type' => 'string' ]; @@ -57,7 +56,6 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ - 'formFactor' => null, 'iban' => null, 'type' => null ]; @@ -68,7 +66,6 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static $openAPINullables = [ - 'formFactor' => true, 'iban' => false, 'type' => false ]; @@ -159,7 +156,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'formFactor' => 'formFactor', 'iban' => 'iban', 'type' => 'type' ]; @@ -170,7 +166,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'formFactor' => 'setFormFactor', 'iban' => 'setIban', 'type' => 'setType' ]; @@ -181,7 +176,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'formFactor' => 'getFormFactor', 'iban' => 'getIban', 'type' => 'getType' ]; @@ -255,7 +249,6 @@ public function getTypeAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -317,40 +310,6 @@ public function valid() } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets iban * diff --git a/src/Adyen/Model/Transfers/InternalReviewTrackingData.php b/src/Adyen/Model/Transfers/InternalReviewTrackingData.php new file mode 100644 index 000000000..e2c1a7af2 --- /dev/null +++ b/src/Adyen/Model/Transfers/InternalReviewTrackingData.php @@ -0,0 +1,579 @@ + + */ +class InternalReviewTrackingData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InternalReviewTrackingData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'reason' => 'string', + 'status' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'reason' => null, + 'status' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'reason' => false, + 'status' => 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 = [ + 'reason' => 'reason', + 'status' => 'status', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'reason' => 'setReason', + 'status' => 'setStatus', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'reason' => 'getReason', + 'status' => 'getStatus', + '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; + } + + public const REASON_REFUSED_FOR_REGULATORY_REASONS = 'refusedForRegulatoryReasons'; + public const STATUS_PENDING = 'pending'; + public const STATUS_FAILED = 'failed'; + public const TYPE_INTERNAL_REVIEW = 'internalReview'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getReasonAllowableValues() + { + return [ + self::REASON_REFUSED_FOR_REGULATORY_REASONS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_PENDING, + self::STATUS_FAILED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_INTERNAL_REVIEW, + ]; + } + /** + * 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('reason', $data ?? [], null); + $this->setIfExists('status', $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 = []; + + $allowedValues = $this->getReasonAllowableValues(); + if (!is_null($this->container['reason']) && !in_array($this->container['reason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'reason', must be one of '%s'", + $this->container['reason'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason Possible values: - **refusedForRegulatoryReasons**. + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $allowedValues = $this->getReasonAllowableValues(); + if (!in_array($reason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'reason', must be one of '%s'", + $reason, + implode("', '", $allowedValues) + ) + ); + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Possible values: - **pending**: Transfer is under internal review. - **failed**: Transfer failed to pass internal review. See field **reason** for details. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **internalReview** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $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/Transfers/NOLocalAccountIdentification.php b/src/Adyen/Model/Transfers/NOLocalAccountIdentification.php index f07ae1ee2..56eaaa8e4 100644 --- a/src/Adyen/Model/Transfers/NOLocalAccountIdentification.php +++ b/src/Adyen/Model/Transfers/NOLocalAccountIdentification.php @@ -45,7 +45,6 @@ class NOLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'accountNumber' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -58,7 +57,6 @@ class NOLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'accountNumber' => null, - 'formFactor' => null, 'type' => null ]; @@ -69,7 +67,6 @@ class NOLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'accountNumber' => false, - 'formFactor' => true, 'type' => false ]; @@ -160,7 +157,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountNumber' => 'accountNumber', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -171,7 +167,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountNumber' => 'setAccountNumber', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -182,7 +177,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountNumber' => 'getAccountNumber', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -256,7 +250,6 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -344,40 +337,6 @@ public function setAccountNumber($accountNumber) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/Transfers/NZLocalAccountIdentification.php b/src/Adyen/Model/Transfers/NZLocalAccountIdentification.php index 26758057c..3148ea4ee 100644 --- a/src/Adyen/Model/Transfers/NZLocalAccountIdentification.php +++ b/src/Adyen/Model/Transfers/NZLocalAccountIdentification.php @@ -45,7 +45,6 @@ class NZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'accountNumber' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -58,7 +57,6 @@ class NZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'accountNumber' => null, - 'formFactor' => null, 'type' => null ]; @@ -69,7 +67,6 @@ class NZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'accountNumber' => false, - 'formFactor' => true, 'type' => false ]; @@ -160,7 +157,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountNumber' => 'accountNumber', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -171,7 +167,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountNumber' => 'setAccountNumber', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -182,7 +177,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountNumber' => 'getAccountNumber', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -256,7 +250,6 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -344,40 +337,6 @@ public function setAccountNumber($accountNumber) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/Transfers/NumberAndBicAccountIdentification.php b/src/Adyen/Model/Transfers/NumberAndBicAccountIdentification.php index 4e84e7108..21da727ec 100644 --- a/src/Adyen/Model/Transfers/NumberAndBicAccountIdentification.php +++ b/src/Adyen/Model/Transfers/NumberAndBicAccountIdentification.php @@ -47,7 +47,6 @@ class NumberAndBicAccountIdentification implements ModelInterface, ArrayAccess, 'accountNumber' => 'string', 'additionalBankIdentification' => '\Adyen\Model\Transfers\AdditionalBankIdentification', 'bic' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -62,7 +61,6 @@ class NumberAndBicAccountIdentification implements ModelInterface, ArrayAccess, 'accountNumber' => null, 'additionalBankIdentification' => null, 'bic' => null, - 'formFactor' => null, 'type' => null ]; @@ -75,7 +73,6 @@ class NumberAndBicAccountIdentification implements ModelInterface, ArrayAccess, 'accountNumber' => false, 'additionalBankIdentification' => false, 'bic' => false, - 'formFactor' => true, 'type' => false ]; @@ -168,7 +165,6 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'accountNumber', 'additionalBankIdentification' => 'additionalBankIdentification', 'bic' => 'bic', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -181,7 +177,6 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'setAccountNumber', 'additionalBankIdentification' => 'setAdditionalBankIdentification', 'bic' => 'setBic', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -194,7 +189,6 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'getAccountNumber', 'additionalBankIdentification' => 'getAdditionalBankIdentification', 'bic' => 'getBic', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -270,7 +264,6 @@ public function __construct(array $data = null) $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('additionalBankIdentification', $data ?? [], null); $this->setIfExists('bic', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -415,40 +408,6 @@ public function setBic($bic) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/Transfers/ObjectSerializer.php b/src/Adyen/Model/Transfers/ObjectSerializer.php index b9cbe36bf..349b367b3 100644 --- a/src/Adyen/Model/Transfers/ObjectSerializer.php +++ b/src/Adyen/Model/Transfers/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Transfers/PLLocalAccountIdentification.php b/src/Adyen/Model/Transfers/PLLocalAccountIdentification.php index 813434e81..1a77dd379 100644 --- a/src/Adyen/Model/Transfers/PLLocalAccountIdentification.php +++ b/src/Adyen/Model/Transfers/PLLocalAccountIdentification.php @@ -45,7 +45,6 @@ class PLLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'accountNumber' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -58,7 +57,6 @@ class PLLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'accountNumber' => null, - 'formFactor' => null, 'type' => null ]; @@ -69,7 +67,6 @@ class PLLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'accountNumber' => false, - 'formFactor' => true, 'type' => false ]; @@ -160,7 +157,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountNumber' => 'accountNumber', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -171,7 +167,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountNumber' => 'setAccountNumber', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -182,7 +177,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountNumber' => 'getAccountNumber', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -256,7 +250,6 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -344,40 +337,6 @@ public function setAccountNumber($accountNumber) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/Transfers/PartyIdentification.php b/src/Adyen/Model/Transfers/PartyIdentification.php index 1b09f67b4..aca8e771c 100644 --- a/src/Adyen/Model/Transfers/PartyIdentification.php +++ b/src/Adyen/Model/Transfers/PartyIdentification.php @@ -413,7 +413,7 @@ public function getFirstName() /** * Sets firstName * - * @param string|null $firstName First name of the individual. Allowed only when `type` is **individual**. + * @param string|null $firstName First name of the individual. Allowed only when `type` is **individual**. Supported characters: [a-z] [A-Z] - . / — and Space. * * @return self */ @@ -440,7 +440,7 @@ public function getFullName() /** * Sets fullName * - * @param string $fullName The name of the entity. + * @param string $fullName The name of the entity. Supported characters: [a-z] [A-Z] [0-9] , . ; : - — / \\ + & ! ? @ ( ) \" ' and Space. * * @return self */ @@ -467,7 +467,7 @@ public function getLastName() /** * Sets lastName * - * @param string|null $lastName Last name of the individual. Allowed only when `type` is **individual**. + * @param string|null $lastName Last name of the individual. Allowed only when `type` is **individual**. Supported characters: [a-z] [A-Z] - . / — and Space. * * @return self */ diff --git a/src/Adyen/Model/Transfers/SELocalAccountIdentification.php b/src/Adyen/Model/Transfers/SELocalAccountIdentification.php index 48703fb34..294b68e36 100644 --- a/src/Adyen/Model/Transfers/SELocalAccountIdentification.php +++ b/src/Adyen/Model/Transfers/SELocalAccountIdentification.php @@ -46,7 +46,6 @@ class SELocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'clearingNumber' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -60,7 +59,6 @@ class SELocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'clearingNumber' => null, - 'formFactor' => null, 'type' => null ]; @@ -72,7 +70,6 @@ class SELocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'clearingNumber' => false, - 'formFactor' => true, 'type' => false ]; @@ -164,7 +161,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'clearingNumber' => 'clearingNumber', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -176,7 +172,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'clearingNumber' => 'setClearingNumber', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -188,7 +183,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'clearingNumber' => 'getClearingNumber', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -263,7 +257,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('clearingNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -381,40 +374,6 @@ public function setClearingNumber($clearingNumber) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/Transfers/SGLocalAccountIdentification.php b/src/Adyen/Model/Transfers/SGLocalAccountIdentification.php index 50b1b19fe..2ae4691ff 100644 --- a/src/Adyen/Model/Transfers/SGLocalAccountIdentification.php +++ b/src/Adyen/Model/Transfers/SGLocalAccountIdentification.php @@ -46,7 +46,6 @@ class SGLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'bic' => 'string', - 'formFactor' => 'string', 'type' => 'string' ]; @@ -60,7 +59,6 @@ class SGLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'bic' => null, - 'formFactor' => null, 'type' => null ]; @@ -72,7 +70,6 @@ class SGLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'bic' => false, - 'formFactor' => true, 'type' => false ]; @@ -164,7 +161,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'bic' => 'bic', - 'formFactor' => 'formFactor', 'type' => 'type' ]; @@ -176,7 +172,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'bic' => 'setBic', - 'formFactor' => 'setFormFactor', 'type' => 'setType' ]; @@ -188,7 +183,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'bic' => 'getBic', - 'formFactor' => 'getFormFactor', 'type' => 'getType' ]; @@ -263,7 +257,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bic', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -378,40 +371,6 @@ public function setBic($bic) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets type * diff --git a/src/Adyen/Model/Transfers/Transaction.php b/src/Adyen/Model/Transfers/Transaction.php index 8a42697d8..b0b25d6c4 100644 --- a/src/Adyen/Model/Transfers/Transaction.php +++ b/src/Adyen/Model/Transfers/Transaction.php @@ -50,7 +50,10 @@ class Transaction implements ModelInterface, ArrayAccess, \JsonSerializable 'balancePlatform' => 'string', 'bookingDate' => '\DateTime', 'creationDate' => '\DateTime', + 'description' => 'string', 'id' => 'string', + 'paymentInstrument' => '\Adyen\Model\Transfers\PaymentInstrument', + 'referenceForBeneficiary' => 'string', 'status' => 'string', 'transfer' => '\Adyen\Model\Transfers\TransferView', 'valueDate' => '\DateTime' @@ -70,7 +73,10 @@ class Transaction implements ModelInterface, ArrayAccess, \JsonSerializable 'balancePlatform' => null, 'bookingDate' => 'date-time', 'creationDate' => 'date-time', + 'description' => null, 'id' => null, + 'paymentInstrument' => null, + 'referenceForBeneficiary' => null, 'status' => null, 'transfer' => null, 'valueDate' => 'date-time' @@ -88,7 +94,10 @@ class Transaction implements ModelInterface, ArrayAccess, \JsonSerializable 'balancePlatform' => false, 'bookingDate' => false, 'creationDate' => false, + 'description' => false, 'id' => false, + 'paymentInstrument' => false, + 'referenceForBeneficiary' => false, 'status' => false, 'transfer' => false, 'valueDate' => false @@ -186,7 +195,10 @@ public function isNullableSetToNull(string $property): bool 'balancePlatform' => 'balancePlatform', 'bookingDate' => 'bookingDate', 'creationDate' => 'creationDate', + 'description' => 'description', 'id' => 'id', + 'paymentInstrument' => 'paymentInstrument', + 'referenceForBeneficiary' => 'referenceForBeneficiary', 'status' => 'status', 'transfer' => 'transfer', 'valueDate' => 'valueDate' @@ -204,7 +216,10 @@ public function isNullableSetToNull(string $property): bool 'balancePlatform' => 'setBalancePlatform', 'bookingDate' => 'setBookingDate', 'creationDate' => 'setCreationDate', + 'description' => 'setDescription', 'id' => 'setId', + 'paymentInstrument' => 'setPaymentInstrument', + 'referenceForBeneficiary' => 'setReferenceForBeneficiary', 'status' => 'setStatus', 'transfer' => 'setTransfer', 'valueDate' => 'setValueDate' @@ -222,7 +237,10 @@ public function isNullableSetToNull(string $property): bool 'balancePlatform' => 'getBalancePlatform', 'bookingDate' => 'getBookingDate', 'creationDate' => 'getCreationDate', + 'description' => 'getDescription', 'id' => 'getId', + 'paymentInstrument' => 'getPaymentInstrument', + 'referenceForBeneficiary' => 'getReferenceForBeneficiary', 'status' => 'getStatus', 'transfer' => 'getTransfer', 'valueDate' => 'getValueDate' @@ -305,7 +323,10 @@ public function __construct(array $data = null) $this->setIfExists('balancePlatform', $data ?? [], null); $this->setIfExists('bookingDate', $data ?? [], null); $this->setIfExists('creationDate', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('paymentInstrument', $data ?? [], null); + $this->setIfExists('referenceForBeneficiary', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('transfer', $data ?? [], null); $this->setIfExists('valueDate', $data ?? [], null); @@ -548,6 +569,33 @@ public function setCreationDate($creationDate) return $this; } + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The `description` from the `/transfers` request. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + /** * Gets id * @@ -575,6 +623,60 @@ public function setId($id) return $this; } + /** + * Gets paymentInstrument + * + * @return \Adyen\Model\Transfers\PaymentInstrument|null + */ + public function getPaymentInstrument() + { + return $this->container['paymentInstrument']; + } + + /** + * Sets paymentInstrument + * + * @param \Adyen\Model\Transfers\PaymentInstrument|null $paymentInstrument paymentInstrument + * + * @return self + */ + public function setPaymentInstrument($paymentInstrument) + { + if (is_null($paymentInstrument)) { + throw new \InvalidArgumentException('non-nullable paymentInstrument cannot be null'); + } + $this->container['paymentInstrument'] = $paymentInstrument; + + return $this; + } + + /** + * Gets referenceForBeneficiary + * + * @return string|null + */ + public function getReferenceForBeneficiary() + { + return $this->container['referenceForBeneficiary']; + } + + /** + * Sets referenceForBeneficiary + * + * @param string|null $referenceForBeneficiary The reference sent to or received from the counterparty. * For outgoing funds, this is the [`referenceForBeneficiary`](https://docs.adyen.com/api-explorer/#/transfers/latest/post/transfers__resParam_referenceForBeneficiary) from the [`/transfers`](https://docs.adyen.com/api-explorer/#/transfers/latest/post/transfers__reqParam_referenceForBeneficiary) request. * For incoming funds, this is the reference from the sender. + * + * @return self + */ + public function setReferenceForBeneficiary($referenceForBeneficiary) + { + if (is_null($referenceForBeneficiary)) { + throw new \InvalidArgumentException('non-nullable referenceForBeneficiary cannot be null'); + } + $this->container['referenceForBeneficiary'] = $referenceForBeneficiary; + + return $this; + } + /** * Gets status * diff --git a/src/Adyen/Model/Transfers/Transfer.php b/src/Adyen/Model/Transfers/Transfer.php index f3751bc41..9423b6179 100644 --- a/src/Adyen/Model/Transfers/Transfer.php +++ b/src/Adyen/Model/Transfers/Transfer.php @@ -323,6 +323,7 @@ public function getModelName() public const REASON_DECLINED_BY_TRANSACTION_RULE = 'declinedByTransactionRule'; public const REASON_ERROR = 'error'; public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; + public const REASON_PENDING_APPROVAL = 'pendingApproval'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; @@ -399,6 +400,7 @@ public function getModelName() public const TYPE_BALANCE_ROLLOVER = 'balanceRollover'; public const TYPE_BANK_DIRECT_DEBIT = 'bankDirectDebit'; public const TYPE_BANK_TRANSFER = 'bankTransfer'; + public const TYPE_CAPITAL_FUNDS_COLLECTION = 'capitalFundsCollection'; public const TYPE_CAPTURE = 'capture'; public const TYPE_CAPTURE_REVERSAL = 'captureReversal'; public const TYPE_CARD_TRANSFER = 'cardTransfer'; @@ -475,6 +477,7 @@ public function getReasonAllowableValues() self::REASON_DECLINED_BY_TRANSACTION_RULE, self::REASON_ERROR, self::REASON_NOT_ENOUGH_BALANCE, + self::REASON_PENDING_APPROVAL, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, @@ -571,6 +574,7 @@ public function getTypeAllowableValues() self::TYPE_BALANCE_ROLLOVER, self::TYPE_BANK_DIRECT_DEBIT, self::TYPE_BANK_TRANSFER, + self::TYPE_CAPITAL_FUNDS_COLLECTION, self::TYPE_CAPTURE, self::TYPE_CAPTURE_REVERSAL, self::TYPE_CARD_TRANSFER, diff --git a/src/Adyen/Model/Transfers/TransferData.php b/src/Adyen/Model/Transfers/TransferData.php index 23788da1a..0868cab88 100644 --- a/src/Adyen/Model/Transfers/TransferData.php +++ b/src/Adyen/Model/Transfers/TransferData.php @@ -63,7 +63,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'referenceForBeneficiary' => 'string', 'sequenceNumber' => 'int', 'status' => 'string', - 'tracking' => '\Adyen\Model\Transfers\TransferNotificationTransferTracking', + 'tracking' => '\Adyen\Model\Transfers\TransferDataTracking', 'transactionRulesResult' => '\Adyen\Model\Transfers\TransactionRulesResult', 'type' => 'string' ]; @@ -359,6 +359,7 @@ public function getModelName() public const REASON_DECLINED_BY_TRANSACTION_RULE = 'declinedByTransactionRule'; public const REASON_ERROR = 'error'; public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; + public const REASON_PENDING_APPROVAL = 'pendingApproval'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; @@ -435,6 +436,7 @@ public function getModelName() public const TYPE_BALANCE_ROLLOVER = 'balanceRollover'; public const TYPE_BANK_DIRECT_DEBIT = 'bankDirectDebit'; public const TYPE_BANK_TRANSFER = 'bankTransfer'; + public const TYPE_CAPITAL_FUNDS_COLLECTION = 'capitalFundsCollection'; public const TYPE_CAPTURE = 'capture'; public const TYPE_CAPTURE_REVERSAL = 'captureReversal'; public const TYPE_CARD_TRANSFER = 'cardTransfer'; @@ -511,6 +513,7 @@ public function getReasonAllowableValues() self::REASON_DECLINED_BY_TRANSACTION_RULE, self::REASON_ERROR, self::REASON_NOT_ENOUGH_BALANCE, + self::REASON_PENDING_APPROVAL, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, @@ -607,6 +610,7 @@ public function getTypeAllowableValues() self::TYPE_BALANCE_ROLLOVER, self::TYPE_BANK_DIRECT_DEBIT, self::TYPE_BANK_TRANSFER, + self::TYPE_CAPITAL_FUNDS_COLLECTION, self::TYPE_CAPTURE, self::TYPE_CAPTURE_REVERSAL, self::TYPE_CARD_TRANSFER, @@ -1327,7 +1331,7 @@ public function setStatus($status) /** * Gets tracking * - * @return \Adyen\Model\Transfers\TransferNotificationTransferTracking|null + * @return \Adyen\Model\Transfers\TransferDataTracking|null */ public function getTracking() { @@ -1337,7 +1341,7 @@ public function getTracking() /** * Sets tracking * - * @param \Adyen\Model\Transfers\TransferNotificationTransferTracking|null $tracking tracking + * @param \Adyen\Model\Transfers\TransferDataTracking|null $tracking tracking * * @return self */ diff --git a/src/Adyen/Model/Transfers/TransferDataTracking.php b/src/Adyen/Model/Transfers/TransferDataTracking.php new file mode 100644 index 000000000..876e49902 --- /dev/null +++ b/src/Adyen/Model/Transfers/TransferDataTracking.php @@ -0,0 +1,524 @@ + + */ +class TransferDataTracking implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferData_tracking'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'type' => 'string', + 'estimatedArrivalTime' => '\DateTime', + 'reason' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'type' => null, + 'estimatedArrivalTime' => 'date-time', + 'reason' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'status' => false, + 'type' => false, + 'estimatedArrivalTime' => false, + 'reason' => 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 = [ + 'status' => 'status', + 'type' => 'type', + 'estimatedArrivalTime' => 'estimatedArrivalTime', + 'reason' => 'reason' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'type' => 'setType', + 'estimatedArrivalTime' => 'setEstimatedArrivalTime', + 'reason' => 'setReason' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'type' => 'getType', + 'estimatedArrivalTime' => 'getEstimatedArrivalTime', + 'reason' => 'getReason' + ]; + + /** + * 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('status', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('estimatedArrivalTime', $data ?? [], null); + $this->setIfExists('reason', $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['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + + if ($this->container['estimatedArrivalTime'] === null) { + $invalidProperties[] = "'estimatedArrivalTime' 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 status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Possible values: - **pending**: Transfer is under internal review. - **failed**: Transfer failed to pass internal review. See field **reason** for details. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **internalReview** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets estimatedArrivalTime + * + * @return \DateTime + */ + public function getEstimatedArrivalTime() + { + return $this->container['estimatedArrivalTime']; + } + + /** + * Sets estimatedArrivalTime + * + * @param \DateTime $estimatedArrivalTime The estimated time the beneficiary should have access to the funds. + * + * @return self + */ + public function setEstimatedArrivalTime($estimatedArrivalTime) + { + if (is_null($estimatedArrivalTime)) { + throw new \InvalidArgumentException('non-nullable estimatedArrivalTime cannot be null'); + } + $this->container['estimatedArrivalTime'] = $estimatedArrivalTime; + + return $this; + } + + /** + * Gets reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason Possible values: - **refusedForRegulatoryReasons**. + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $this->container['reason'] = $reason; + + 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/Transfers/TransferEvent.php b/src/Adyen/Model/Transfers/TransferEvent.php index b4885738a..f95a41d1f 100644 --- a/src/Adyen/Model/Transfers/TransferEvent.php +++ b/src/Adyen/Model/Transfers/TransferEvent.php @@ -48,12 +48,14 @@ class TransferEvent implements ModelInterface, ArrayAccess, \JsonSerializable 'amountAdjustments' => '\Adyen\Model\Transfers\AmountAdjustment[]', 'bookingDate' => '\DateTime', 'estimatedArrivalTime' => '\DateTime', + 'externalReason' => '\Adyen\Model\Transfers\ExternalReason', 'id' => 'string', 'modification' => '\Adyen\Model\Transfers\Modification', 'mutations' => '\Adyen\Model\Transfers\BalanceMutation[]', 'originalAmount' => '\Adyen\Model\Transfers\Amount', 'reason' => 'string', 'status' => 'string', + 'trackingData' => '\Adyen\Model\Transfers\TransferEventTrackingData', 'transactionId' => 'string', 'type' => 'string', 'updateDate' => '\DateTime', @@ -72,12 +74,14 @@ class TransferEvent implements ModelInterface, ArrayAccess, \JsonSerializable 'amountAdjustments' => null, 'bookingDate' => 'date-time', 'estimatedArrivalTime' => 'date-time', + 'externalReason' => null, 'id' => null, 'modification' => null, 'mutations' => null, 'originalAmount' => null, 'reason' => null, 'status' => null, + 'trackingData' => null, 'transactionId' => null, 'type' => null, 'updateDate' => 'date-time', @@ -94,12 +98,14 @@ class TransferEvent implements ModelInterface, ArrayAccess, \JsonSerializable 'amountAdjustments' => false, 'bookingDate' => false, 'estimatedArrivalTime' => false, + 'externalReason' => false, 'id' => false, 'modification' => false, 'mutations' => false, 'originalAmount' => false, 'reason' => false, 'status' => false, + 'trackingData' => false, 'transactionId' => false, 'type' => false, 'updateDate' => false, @@ -196,12 +202,14 @@ public function isNullableSetToNull(string $property): bool 'amountAdjustments' => 'amountAdjustments', 'bookingDate' => 'bookingDate', 'estimatedArrivalTime' => 'estimatedArrivalTime', + 'externalReason' => 'externalReason', 'id' => 'id', 'modification' => 'modification', 'mutations' => 'mutations', 'originalAmount' => 'originalAmount', 'reason' => 'reason', 'status' => 'status', + 'trackingData' => 'trackingData', 'transactionId' => 'transactionId', 'type' => 'type', 'updateDate' => 'updateDate', @@ -218,12 +226,14 @@ public function isNullableSetToNull(string $property): bool 'amountAdjustments' => 'setAmountAdjustments', 'bookingDate' => 'setBookingDate', 'estimatedArrivalTime' => 'setEstimatedArrivalTime', + 'externalReason' => 'setExternalReason', 'id' => 'setId', 'modification' => 'setModification', 'mutations' => 'setMutations', 'originalAmount' => 'setOriginalAmount', 'reason' => 'setReason', 'status' => 'setStatus', + 'trackingData' => 'setTrackingData', 'transactionId' => 'setTransactionId', 'type' => 'setType', 'updateDate' => 'setUpdateDate', @@ -240,12 +250,14 @@ public function isNullableSetToNull(string $property): bool 'amountAdjustments' => 'getAmountAdjustments', 'bookingDate' => 'getBookingDate', 'estimatedArrivalTime' => 'getEstimatedArrivalTime', + 'externalReason' => 'getExternalReason', 'id' => 'getId', 'modification' => 'getModification', 'mutations' => 'getMutations', 'originalAmount' => 'getOriginalAmount', 'reason' => 'getReason', 'status' => 'getStatus', + 'trackingData' => 'getTrackingData', 'transactionId' => 'getTransactionId', 'type' => 'getType', 'updateDate' => 'getUpdateDate', @@ -305,6 +317,7 @@ public function getModelName() public const REASON_DECLINED_BY_TRANSACTION_RULE = 'declinedByTransactionRule'; public const REASON_ERROR = 'error'; public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; + public const REASON_PENDING_APPROVAL = 'pendingApproval'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; @@ -397,6 +410,7 @@ public function getReasonAllowableValues() self::REASON_DECLINED_BY_TRANSACTION_RULE, self::REASON_ERROR, self::REASON_NOT_ENOUGH_BALANCE, + self::REASON_PENDING_APPROVAL, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, @@ -509,12 +523,14 @@ public function __construct(array $data = null) $this->setIfExists('amountAdjustments', $data ?? [], null); $this->setIfExists('bookingDate', $data ?? [], null); $this->setIfExists('estimatedArrivalTime', $data ?? [], null); + $this->setIfExists('externalReason', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('modification', $data ?? [], null); $this->setIfExists('mutations', $data ?? [], null); $this->setIfExists('originalAmount', $data ?? [], null); $this->setIfExists('reason', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('trackingData', $data ?? [], null); $this->setIfExists('transactionId', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('updateDate', $data ?? [], null); @@ -675,6 +691,7 @@ public function setBookingDate($bookingDate) * Gets estimatedArrivalTime * * @return \DateTime|null + * @deprecated */ public function getEstimatedArrivalTime() { @@ -687,6 +704,7 @@ public function getEstimatedArrivalTime() * @param \DateTime|null $estimatedArrivalTime The estimated time the beneficiary should have access to the funds. * * @return self + * @deprecated */ public function setEstimatedArrivalTime($estimatedArrivalTime) { @@ -698,6 +716,33 @@ public function setEstimatedArrivalTime($estimatedArrivalTime) return $this; } + /** + * Gets externalReason + * + * @return \Adyen\Model\Transfers\ExternalReason|null + */ + public function getExternalReason() + { + return $this->container['externalReason']; + } + + /** + * Sets externalReason + * + * @param \Adyen\Model\Transfers\ExternalReason|null $externalReason externalReason + * + * @return self + */ + public function setExternalReason($externalReason) + { + if (is_null($externalReason)) { + throw new \InvalidArgumentException('non-nullable externalReason cannot be null'); + } + $this->container['externalReason'] = $externalReason; + + return $this; + } + /** * Gets id * @@ -880,6 +925,33 @@ public function setStatus($status) return $this; } + /** + * Gets trackingData + * + * @return \Adyen\Model\Transfers\TransferEventTrackingData|null + */ + public function getTrackingData() + { + return $this->container['trackingData']; + } + + /** + * Sets trackingData + * + * @param \Adyen\Model\Transfers\TransferEventTrackingData|null $trackingData trackingData + * + * @return self + */ + public function setTrackingData($trackingData) + { + if (is_null($trackingData)) { + throw new \InvalidArgumentException('non-nullable trackingData cannot be null'); + } + $this->container['trackingData'] = $trackingData; + + return $this; + } + /** * Gets transactionId * diff --git a/src/Adyen/Model/Transfers/TransferEventTrackingData.php b/src/Adyen/Model/Transfers/TransferEventTrackingData.php new file mode 100644 index 000000000..b993d3f25 --- /dev/null +++ b/src/Adyen/Model/Transfers/TransferEventTrackingData.php @@ -0,0 +1,524 @@ + + */ +class TransferEventTrackingData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferEvent_trackingData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'type' => 'string', + 'estimatedArrivalTime' => '\DateTime', + 'reason' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'type' => null, + 'estimatedArrivalTime' => 'date-time', + 'reason' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'status' => false, + 'type' => false, + 'estimatedArrivalTime' => false, + 'reason' => 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 = [ + 'status' => 'status', + 'type' => 'type', + 'estimatedArrivalTime' => 'estimatedArrivalTime', + 'reason' => 'reason' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'type' => 'setType', + 'estimatedArrivalTime' => 'setEstimatedArrivalTime', + 'reason' => 'setReason' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'type' => 'getType', + 'estimatedArrivalTime' => 'getEstimatedArrivalTime', + 'reason' => 'getReason' + ]; + + /** + * 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('status', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('estimatedArrivalTime', $data ?? [], null); + $this->setIfExists('reason', $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['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + + if ($this->container['estimatedArrivalTime'] === null) { + $invalidProperties[] = "'estimatedArrivalTime' 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 status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Possible values: - **pending**: Transfer is under internal review. - **failed**: Transfer failed to pass internal review. See field **reason** for details. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **internalReview** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets estimatedArrivalTime + * + * @return \DateTime + */ + public function getEstimatedArrivalTime() + { + return $this->container['estimatedArrivalTime']; + } + + /** + * Sets estimatedArrivalTime + * + * @param \DateTime $estimatedArrivalTime The estimated time the beneficiary should have access to the funds. + * + * @return self + */ + public function setEstimatedArrivalTime($estimatedArrivalTime) + { + if (is_null($estimatedArrivalTime)) { + throw new \InvalidArgumentException('non-nullable estimatedArrivalTime cannot be null'); + } + $this->container['estimatedArrivalTime'] = $estimatedArrivalTime; + + return $this; + } + + /** + * Gets reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason Possible values: - **refusedForRegulatoryReasons**. + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $this->container['reason'] = $reason; + + 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/Transfers/TransferNotificationCounterParty.php b/src/Adyen/Model/Transfers/TransferNotificationCounterParty.php index 02b65039a..7dba673dd 100644 --- a/src/Adyen/Model/Transfers/TransferNotificationCounterParty.php +++ b/src/Adyen/Model/Transfers/TransferNotificationCounterParty.php @@ -310,7 +310,7 @@ public function getBalanceAccountId() /** * Sets balanceAccountId * - * @param string|null $balanceAccountId Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). + * @param string|null $balanceAccountId The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). * * @return self */ @@ -391,7 +391,7 @@ public function getTransferInstrumentId() /** * Sets transferInstrumentId * - * @param string|null $transferInstrumentId Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * @param string|null $transferInstrumentId The unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). * * @return self */ diff --git a/src/Adyen/Model/Transfers/TransferView.php b/src/Adyen/Model/Transfers/TransferView.php index 438236db4..0d76753c1 100644 --- a/src/Adyen/Model/Transfers/TransferView.php +++ b/src/Adyen/Model/Transfers/TransferView.php @@ -44,6 +44,7 @@ class TransferView implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'categoryData' => '\Adyen\Model\Transfers\TransferCategoryData', 'id' => 'string', 'reference' => 'string' ]; @@ -56,6 +57,7 @@ class TransferView implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'categoryData' => null, 'id' => null, 'reference' => null ]; @@ -66,6 +68,7 @@ class TransferView implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ + 'categoryData' => false, 'id' => false, 'reference' => false ]; @@ -156,6 +159,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'categoryData' => 'categoryData', 'id' => 'id', 'reference' => 'reference' ]; @@ -166,6 +170,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'categoryData' => 'setCategoryData', 'id' => 'setId', 'reference' => 'setReference' ]; @@ -176,6 +181,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'categoryData' => 'getCategoryData', 'id' => 'getId', 'reference' => 'getReference' ]; @@ -237,6 +243,7 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('categoryData', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); } @@ -286,6 +293,33 @@ public function valid() } + /** + * Gets categoryData + * + * @return \Adyen\Model\Transfers\TransferCategoryData|null + */ + public function getCategoryData() + { + return $this->container['categoryData']; + } + + /** + * Sets categoryData + * + * @param \Adyen\Model\Transfers\TransferCategoryData|null $categoryData categoryData + * + * @return self + */ + public function setCategoryData($categoryData) + { + if (is_null($categoryData)) { + throw new \InvalidArgumentException('non-nullable categoryData cannot be null'); + } + $this->container['categoryData'] = $categoryData; + + return $this; + } + /** * Gets id * diff --git a/src/Adyen/Model/Transfers/UKLocalAccountIdentification.php b/src/Adyen/Model/Transfers/UKLocalAccountIdentification.php index 2e93b788f..0b91b793b 100644 --- a/src/Adyen/Model/Transfers/UKLocalAccountIdentification.php +++ b/src/Adyen/Model/Transfers/UKLocalAccountIdentification.php @@ -45,7 +45,6 @@ class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'accountNumber' => 'string', - 'formFactor' => 'string', 'sortCode' => 'string', 'type' => 'string' ]; @@ -59,7 +58,6 @@ class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'accountNumber' => null, - 'formFactor' => null, 'sortCode' => null, 'type' => null ]; @@ -71,7 +69,6 @@ class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'accountNumber' => false, - 'formFactor' => true, 'sortCode' => false, 'type' => false ]; @@ -163,7 +160,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountNumber' => 'accountNumber', - 'formFactor' => 'formFactor', 'sortCode' => 'sortCode', 'type' => 'type' ]; @@ -175,7 +171,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountNumber' => 'setAccountNumber', - 'formFactor' => 'setFormFactor', 'sortCode' => 'setSortCode', 'type' => 'setType' ]; @@ -187,7 +182,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountNumber' => 'getAccountNumber', - 'formFactor' => 'getFormFactor', 'sortCode' => 'getSortCode', 'type' => 'getType' ]; @@ -262,7 +256,6 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('sortCode', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -354,40 +347,6 @@ public function setAccountNumber($accountNumber) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets sortCode * diff --git a/src/Adyen/Model/Transfers/USLocalAccountIdentification.php b/src/Adyen/Model/Transfers/USLocalAccountIdentification.php index 2edb4cae5..0c0d823b8 100644 --- a/src/Adyen/Model/Transfers/USLocalAccountIdentification.php +++ b/src/Adyen/Model/Transfers/USLocalAccountIdentification.php @@ -46,7 +46,6 @@ class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'accountNumber' => 'string', 'accountType' => 'string', - 'formFactor' => 'string', 'routingNumber' => 'string', 'type' => 'string' ]; @@ -61,7 +60,6 @@ class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'accountNumber' => null, 'accountType' => null, - 'formFactor' => null, 'routingNumber' => null, 'type' => null ]; @@ -74,7 +72,6 @@ class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'accountNumber' => false, 'accountType' => false, - 'formFactor' => true, 'routingNumber' => false, 'type' => false ]; @@ -167,7 +164,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'accountType' => 'accountType', - 'formFactor' => 'formFactor', 'routingNumber' => 'routingNumber', 'type' => 'type' ]; @@ -180,7 +176,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'accountType' => 'setAccountType', - 'formFactor' => 'setFormFactor', 'routingNumber' => 'setRoutingNumber', 'type' => 'setType' ]; @@ -193,7 +188,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'accountType' => 'getAccountType', - 'formFactor' => 'getFormFactor', 'routingNumber' => 'getRoutingNumber', 'type' => 'getType' ]; @@ -283,7 +277,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('accountType', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('routingNumber', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -421,40 +414,6 @@ public function setAccountType($accountType) return $this; } - /** - * Gets formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - /** * Gets routingNumber * diff --git a/src/Adyen/Model/Transfers/UltimatePartyIdentification.php b/src/Adyen/Model/Transfers/UltimatePartyIdentification.php index aff742002..68a90fd07 100644 --- a/src/Adyen/Model/Transfers/UltimatePartyIdentification.php +++ b/src/Adyen/Model/Transfers/UltimatePartyIdentification.php @@ -413,7 +413,7 @@ public function getFirstName() /** * Sets firstName * - * @param string|null $firstName First name of the individual. Allowed only when `type` is **individual**. + * @param string|null $firstName First name of the individual. Allowed only when `type` is **individual**. Supported characters: [a-z] [A-Z] - . / — and Space. * * @return self */ @@ -440,7 +440,7 @@ public function getFullName() /** * Sets fullName * - * @param string $fullName The name of the entity. + * @param string $fullName The name of the entity. Supported characters: [a-z] [A-Z] [0-9] , . ; : - — / \\ + & ! ? @ ( ) \" ' and Space. * * @return self */ @@ -467,7 +467,7 @@ public function getLastName() /** * Sets lastName * - * @param string|null $lastName Last name of the individual. Allowed only when `type` is **individual**. + * @param string|null $lastName Last name of the individual. Allowed only when `type` is **individual**. Supported characters: [a-z] [A-Z] - . / — and Space. * * @return self */ diff --git a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php index 980edd95b..bcb0276b3 100644 --- a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php +++ b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php @@ -76,13 +76,14 @@ public function createSweep(string $balanceAccountId, \Adyen\Model\BalancePlatfo * @param string $balanceAccountId * @param string $sweepId * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteSweep(string $balanceAccountId, string $sweepId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php index c61143563..99bc3b6bd 100644 --- a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php +++ b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php @@ -44,12 +44,13 @@ public function __construct(Client $client) * * @param \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function validateBankAccountIdentification(\Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest, array $requestOptions = null) { $endpoint = $this->baseURL . "/validateBankAccountIdentification"; $this->requestHttp($endpoint, strtolower('POST'), (array) $bankAccountIdentificationValidationRequest->jsonSerialize(), $requestOptions); + } } diff --git a/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php b/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php new file mode 100644 index 000000000..50ba91f10 --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php @@ -0,0 +1,101 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Complete the registration of an SCA device + * + * @param string $id + * @param \Adyen\Model\BalancePlatform\RegisterSCARequest $registerSCARequest + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\RegisterSCAFinalResponse + * @throws AdyenException + */ + public function completeRegistrationOfScaDevice(string $id, \Adyen\Model\BalancePlatform\RegisterSCARequest $registerSCARequest, array $requestOptions = null): \Adyen\Model\BalancePlatform\RegisterSCAFinalResponse + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/registeredDevices/{id}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $registerSCARequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\RegisterSCAFinalResponse::class); + } + + /** + * Delete a registration of an SCA device + * + * @param string $id + * @param array|null $requestOptions ['queryParams' => ['paymentInstrumentId'=> string]] + + * @throws AdyenException + */ + public function deleteRegistrationOfScaDevice(string $id, array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/registeredDevices/{id}"); + $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + + } + + /** + * Initiate the registration of an SCA device + * + * @param \Adyen\Model\BalancePlatform\RegisterSCARequest $registerSCARequest + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\RegisterSCAResponse + * @throws AdyenException + */ + public function initiateRegistrationOfScaDevice(\Adyen\Model\BalancePlatform\RegisterSCARequest $registerSCARequest, array $requestOptions = null): \Adyen\Model\BalancePlatform\RegisterSCAResponse + { + $endpoint = $this->baseURL . "/registeredDevices"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $registerSCARequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\RegisterSCAResponse::class); + } + + /** + * Get a list of registered SCA devices + * + * @param array|null $requestOptions ['queryParams' => ['paymentInstrumentId'=> string, 'pageNumber'=> int, 'pageSize'=> int]] + * @return \Adyen\Model\BalancePlatform\SearchRegisteredDevicesResponse + * @throws AdyenException + */ + public function listRegisteredScaDevices(array $requestOptions = null): \Adyen\Model\BalancePlatform\SearchRegisteredDevicesResponse + { + $endpoint = $this->baseURL . "/registeredDevices"; + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\SearchRegisteredDevicesResponse::class); + } +} diff --git a/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php b/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php index ad86f1206..2e704599b 100644 --- a/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php +++ b/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php @@ -60,12 +60,13 @@ public function getNetworkToken(string $networkTokenId, array $requestOptions = * @param string $networkTokenId * @param \Adyen\Model\BalancePlatform\UpdateNetworkTokenRequest $updateNetworkTokenRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function updateNetworkToken(string $networkTokenId, \Adyen\Model\BalancePlatform\UpdateNetworkTokenRequest $updateNetworkTokenRequest, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{networkTokenId}'], [$networkTokenId], "/networkTokens/{networkTokenId}"); $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateNetworkTokenRequest->jsonSerialize(), $requestOptions); + } } diff --git a/src/Adyen/Service/Checkout/RecurringApi.php b/src/Adyen/Service/Checkout/RecurringApi.php index 233c09180..72b257fdc 100644 --- a/src/Adyen/Service/Checkout/RecurringApi.php +++ b/src/Adyen/Service/Checkout/RecurringApi.php @@ -44,13 +44,14 @@ public function __construct(Client $client) * * @param string $storedPaymentMethodId * @param array|null $requestOptions ['queryParams' => ['shopperReference'=> string, 'merchantAccount'=> string]] - + * @throws AdyenException */ public function deleteTokenForStoredPaymentDetails(string $storedPaymentMethodId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{storedPaymentMethodId}'], [$storedPaymentMethodId], "/storedPaymentMethods/{storedPaymentMethodId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php b/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php index f94b39ed9..2551bbc54 100644 --- a/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php +++ b/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php @@ -59,13 +59,14 @@ public function createBusinessLine(\Adyen\Model\LegalEntityManagement\BusinessLi * * @param string $id * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteBusinessLine(string $id, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/businessLines/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php b/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php index d834bf550..9a6ea1756 100644 --- a/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php +++ b/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php @@ -44,13 +44,14 @@ public function __construct(Client $client) * * @param string $id * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteDocument(string $id, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/documents/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php b/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php index 70c2e0769..3bf8aeaa4 100644 --- a/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php +++ b/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php @@ -59,13 +59,14 @@ public function createTransferInstrument(\Adyen\Model\LegalEntityManagement\Tran * * @param string $id * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteTransferInstrument(string $id, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/transferInstruments/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/Management/AllowedOriginsCompanyLevelApi.php b/src/Adyen/Service/Management/AllowedOriginsCompanyLevelApi.php index c2557d39d..608130253 100644 --- a/src/Adyen/Service/Management/AllowedOriginsCompanyLevelApi.php +++ b/src/Adyen/Service/Management/AllowedOriginsCompanyLevelApi.php @@ -63,13 +63,14 @@ public function createAllowedOrigin(string $companyId, string $apiCredentialId, * @param string $apiCredentialId * @param string $originId * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteAllowedOrigin(string $companyId, string $apiCredentialId, string $originId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{companyId}', '{apiCredentialId}', '{originId}'], [$companyId, $apiCredentialId, $originId], "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/Management/AllowedOriginsMerchantLevelApi.php b/src/Adyen/Service/Management/AllowedOriginsMerchantLevelApi.php index 1b40d271f..ec0d042af 100644 --- a/src/Adyen/Service/Management/AllowedOriginsMerchantLevelApi.php +++ b/src/Adyen/Service/Management/AllowedOriginsMerchantLevelApi.php @@ -63,13 +63,14 @@ public function createAllowedOrigin(string $merchantId, string $apiCredentialId, * @param string $apiCredentialId * @param string $originId * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteAllowedOrigin(string $merchantId, string $apiCredentialId, string $originId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{merchantId}', '{apiCredentialId}', '{originId}'], [$merchantId, $apiCredentialId, $originId], "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/Management/MyAPICredentialApi.php b/src/Adyen/Service/Management/MyAPICredentialApi.php index 54005b35b..65cdadc59 100644 --- a/src/Adyen/Service/Management/MyAPICredentialApi.php +++ b/src/Adyen/Service/Management/MyAPICredentialApi.php @@ -116,12 +116,13 @@ public function getApiCredentialDetails(array $requestOptions = null): \Adyen\Mo * * @param string $originId * @param array|null $requestOptions - + * @throws AdyenException */ public function removeAllowedOrigin(string $originId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{originId}'], [$originId], "/me/allowedOrigins/{originId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } } diff --git a/src/Adyen/Service/Management/PaymentMethodsMerchantLevelApi.php b/src/Adyen/Service/Management/PaymentMethodsMerchantLevelApi.php index f8b7cc0b0..4f955b8ba 100644 --- a/src/Adyen/Service/Management/PaymentMethodsMerchantLevelApi.php +++ b/src/Adyen/Service/Management/PaymentMethodsMerchantLevelApi.php @@ -46,13 +46,14 @@ public function __construct(Client $client) * @param string $paymentMethodId * @param \Adyen\Model\Management\ApplePayInfo $applePayInfo * @param array|null $requestOptions - + * @throws AdyenException */ public function addApplePayDomain(string $merchantId, string $paymentMethodId, \Adyen\Model\Management\ApplePayInfo $applePayInfo, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{merchantId}', '{paymentMethodId}'], [$merchantId, $paymentMethodId], "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/addApplePayDomains"); $this->requestHttp($endpoint, strtolower('POST'), (array) $applePayInfo->jsonSerialize(), $requestOptions); + } /** diff --git a/src/Adyen/Service/Management/PayoutSettingsMerchantLevelApi.php b/src/Adyen/Service/Management/PayoutSettingsMerchantLevelApi.php index efff80b67..499e78957 100644 --- a/src/Adyen/Service/Management/PayoutSettingsMerchantLevelApi.php +++ b/src/Adyen/Service/Management/PayoutSettingsMerchantLevelApi.php @@ -61,13 +61,14 @@ public function addPayoutSetting(string $merchantId, \Adyen\Model\Management\Pay * @param string $merchantId * @param string $payoutSettingsId * @param array|null $requestOptions - + * @throws AdyenException */ public function deletePayoutSetting(string $merchantId, string $payoutSettingsId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{merchantId}', '{payoutSettingsId}'], [$merchantId, $payoutSettingsId], "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php b/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php index 8a7c5e731..8b6d78c7f 100644 --- a/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php +++ b/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php @@ -59,12 +59,13 @@ public function listTerminals(array $requestOptions = null): \Adyen\Model\Manage * @param string $terminalId * @param \Adyen\Model\Management\TerminalReassignmentRequest $terminalReassignmentRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function reassignTerminal(string $terminalId, \Adyen\Model\Management\TerminalReassignmentRequest $terminalReassignmentRequest, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{terminalId}'], [$terminalId], "/terminals/{terminalId}/reassign"); $this->requestHttp($endpoint, strtolower('POST'), (array) $terminalReassignmentRequest->jsonSerialize(), $requestOptions); + } } diff --git a/src/Adyen/Service/Management/WebhooksCompanyLevelApi.php b/src/Adyen/Service/Management/WebhooksCompanyLevelApi.php index cfe85a383..6caa292a6 100644 --- a/src/Adyen/Service/Management/WebhooksCompanyLevelApi.php +++ b/src/Adyen/Service/Management/WebhooksCompanyLevelApi.php @@ -92,13 +92,14 @@ public function listAllWebhooks(string $companyId, array $requestOptions = null) * @param string $companyId * @param string $webhookId * @param array|null $requestOptions - + * @throws AdyenException */ public function removeWebhook(string $companyId, string $webhookId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{companyId}', '{webhookId}'], [$companyId, $webhookId], "/companies/{companyId}/webhooks/{webhookId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/Management/WebhooksMerchantLevelApi.php b/src/Adyen/Service/Management/WebhooksMerchantLevelApi.php index 968e9c614..7113c9c39 100644 --- a/src/Adyen/Service/Management/WebhooksMerchantLevelApi.php +++ b/src/Adyen/Service/Management/WebhooksMerchantLevelApi.php @@ -92,13 +92,14 @@ public function listAllWebhooks(string $merchantId, array $requestOptions = null * @param string $merchantId * @param string $webhookId * @param array|null $requestOptions - + * @throws AdyenException */ public function removeWebhook(string $merchantId, string $webhookId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{merchantId}', '{webhookId}'], [$merchantId, $webhookId], "/merchants/{merchantId}/webhooks/{webhookId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/PosMobileApi.php b/src/Adyen/Service/PosMobileApi.php new file mode 100644 index 000000000..6e794d20c --- /dev/null +++ b/src/Adyen/Service/PosMobileApi.php @@ -0,0 +1,56 @@ +baseURL = $this->createBaseUrl("https://checkout-test.adyen.com/checkout/possdk/v68"); + } + + /** + * Create a communication session + * + * @param \Adyen\Model\PosMobile\CreateSessionRequest $createSessionRequest + * @param array|null $requestOptions + * @return \Adyen\Model\PosMobile\CreateSessionResponse + * @throws AdyenException + */ + public function createCommunicationSession(\Adyen\Model\PosMobile\CreateSessionRequest $createSessionRequest, array $requestOptions = null): \Adyen\Model\PosMobile\CreateSessionResponse + { + $endpoint = $this->baseURL . "/sessions"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createSessionRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\PosMobile\CreateSessionResponse::class); + } +} From d3141e31aad0ec8d82921db7071e323f9bbe4b9f Mon Sep 17 00:00:00 2001 From: AdyenAutomationBot Date: Thu, 16 May 2024 07:41:44 +0000 Subject: [PATCH 2/3] style(fmt): code formatted --- src/Adyen/Model/AcsWebhooks/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/BalanceControl/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/BalancePlatform/CapabilitySettings.php | 8 ++++---- src/Adyen/Model/BalancePlatform/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/BinLookup/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/Checkout/CheckoutPaymentMethod.php | 4 ++-- src/Adyen/Model/Checkout/MbwayDetails.php | 4 ++-- src/Adyen/Model/Checkout/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/Checkout/VippsDetails.php | 2 +- .../Model/ConfigurationWebhooks/CapabilitySettings.php | 8 ++++---- .../Model/ConfigurationWebhooks/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/DataProtection/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/Disputes/ObjectSerializer.php | 9 +++++---- .../Model/LegalEntityManagement/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/Management/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/ManagementWebhooks/ObjectSerializer.php | 9 +++++---- .../Model/POSTerminalManagement/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/Payments/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/Payout/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/PosMobile/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/Recurring/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/ReportWebhooks/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/StoredValue/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/TransactionWebhooks/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/TransferWebhooks/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/Transfers/ObjectSerializer.php | 9 +++++---- src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php | 3 +-- .../Service/BalancePlatform/BankAccountValidationApi.php | 3 +-- .../Service/BalancePlatform/ManageSCADevicesApi.php | 3 +-- src/Adyen/Service/BalancePlatform/NetworkTokensApi.php | 3 +-- src/Adyen/Service/Checkout/RecurringApi.php | 3 +-- .../Service/LegalEntityManagement/BusinessLinesApi.php | 3 +-- src/Adyen/Service/LegalEntityManagement/DocumentsApi.php | 3 +-- .../LegalEntityManagement/TransferInstrumentsApi.php | 3 +-- .../Service/Management/AllowedOriginsCompanyLevelApi.php | 3 +-- .../Management/AllowedOriginsMerchantLevelApi.php | 3 +-- src/Adyen/Service/Management/MyAPICredentialApi.php | 3 +-- .../Management/PaymentMethodsMerchantLevelApi.php | 3 +-- .../Management/PayoutSettingsMerchantLevelApi.php | 3 +-- .../Service/Management/TerminalsTerminalLevelApi.php | 3 +-- src/Adyen/Service/Management/WebhooksCompanyLevelApi.php | 3 +-- .../Service/Management/WebhooksMerchantLevelApi.php | 3 +-- 42 files changed, 134 insertions(+), 129 deletions(-) diff --git a/src/Adyen/Model/AcsWebhooks/ObjectSerializer.php b/src/Adyen/Model/AcsWebhooks/ObjectSerializer.php index e14421342..755ed1ce8 100644 --- a/src/Adyen/Model/AcsWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/AcsWebhooks/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/BalanceControl/ObjectSerializer.php b/src/Adyen/Model/BalanceControl/ObjectSerializer.php index 2ed0eb3a0..b5ae3313d 100644 --- a/src/Adyen/Model/BalanceControl/ObjectSerializer.php +++ b/src/Adyen/Model/BalanceControl/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/BalancePlatform/CapabilitySettings.php b/src/Adyen/Model/BalancePlatform/CapabilitySettings.php index c1302d647..95ce38222 100644 --- a/src/Adyen/Model/BalancePlatform/CapabilitySettings.php +++ b/src/Adyen/Model/BalancePlatform/CapabilitySettings.php @@ -358,7 +358,7 @@ public function getAmountPerIndustry() /** * Sets amountPerIndustry * - * @param array|null $amountPerIndustry + * @param array|null $amountPerIndustry * * @return self */ @@ -385,7 +385,7 @@ public function getAuthorizedCardUsers() /** * Sets authorizedCardUsers * - * @param bool|null $authorizedCardUsers + * @param bool|null $authorizedCardUsers * * @return self */ @@ -412,7 +412,7 @@ public function getFundingSource() /** * Sets fundingSource * - * @param string[]|null $fundingSource + * @param string[]|null $fundingSource * * @return self */ @@ -448,7 +448,7 @@ public function getInterval() /** * Sets interval * - * @param string|null $interval + * @param string|null $interval * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php index fa9af7e82..141ec623e 100644 --- a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php +++ b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/BinLookup/ObjectSerializer.php b/src/Adyen/Model/BinLookup/ObjectSerializer.php index 09437b7d8..4bdfceeda 100644 --- a/src/Adyen/Model/BinLookup/ObjectSerializer.php +++ b/src/Adyen/Model/BinLookup/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php index 463b3ef5f..cb856866a 100644 --- a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php +++ b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php @@ -1852,7 +1852,7 @@ public function getShopperEmail() /** * Sets shopperEmail * - * @param string $shopperEmail + * @param string $shopperEmail * * @return self */ @@ -1879,7 +1879,7 @@ public function getTelephoneNumber() /** * Sets telephoneNumber * - * @param string $telephoneNumber + * @param string $telephoneNumber * * @return self */ diff --git a/src/Adyen/Model/Checkout/MbwayDetails.php b/src/Adyen/Model/Checkout/MbwayDetails.php index feec9e45a..b55de8e2f 100644 --- a/src/Adyen/Model/Checkout/MbwayDetails.php +++ b/src/Adyen/Model/Checkout/MbwayDetails.php @@ -364,7 +364,7 @@ public function getShopperEmail() /** * Sets shopperEmail * - * @param string $shopperEmail + * @param string $shopperEmail * * @return self */ @@ -391,7 +391,7 @@ public function getTelephoneNumber() /** * Sets telephoneNumber * - * @param string $telephoneNumber + * @param string $telephoneNumber * * @return self */ diff --git a/src/Adyen/Model/Checkout/ObjectSerializer.php b/src/Adyen/Model/Checkout/ObjectSerializer.php index 628f63adc..2b682c18f 100644 --- a/src/Adyen/Model/Checkout/ObjectSerializer.php +++ b/src/Adyen/Model/Checkout/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Checkout/VippsDetails.php b/src/Adyen/Model/Checkout/VippsDetails.php index 25819f922..143c331a7 100644 --- a/src/Adyen/Model/Checkout/VippsDetails.php +++ b/src/Adyen/Model/Checkout/VippsDetails.php @@ -424,7 +424,7 @@ public function getTelephoneNumber() /** * Sets telephoneNumber * - * @param string $telephoneNumber + * @param string $telephoneNumber * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php b/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php index e89f34bd5..f8fd8bc67 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php @@ -358,7 +358,7 @@ public function getAmountPerIndustry() /** * Sets amountPerIndustry * - * @param array|null $amountPerIndustry + * @param array|null $amountPerIndustry * * @return self */ @@ -385,7 +385,7 @@ public function getAuthorizedCardUsers() /** * Sets authorizedCardUsers * - * @param bool|null $authorizedCardUsers + * @param bool|null $authorizedCardUsers * * @return self */ @@ -412,7 +412,7 @@ public function getFundingSource() /** * Sets fundingSource * - * @param string[]|null $fundingSource + * @param string[]|null $fundingSource * * @return self */ @@ -448,7 +448,7 @@ public function getInterval() /** * Sets interval * - * @param string|null $interval + * @param string|null $interval * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php b/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php index 2d912cd58..6629bee4b 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/DataProtection/ObjectSerializer.php b/src/Adyen/Model/DataProtection/ObjectSerializer.php index fe8491817..1b86733ae 100644 --- a/src/Adyen/Model/DataProtection/ObjectSerializer.php +++ b/src/Adyen/Model/DataProtection/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Disputes/ObjectSerializer.php b/src/Adyen/Model/Disputes/ObjectSerializer.php index d363f9e2a..5ef9f66af 100644 --- a/src/Adyen/Model/Disputes/ObjectSerializer.php +++ b/src/Adyen/Model/Disputes/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php b/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php index 66642b915..d25ad19d7 100644 --- a/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php +++ b/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Management/ObjectSerializer.php b/src/Adyen/Model/Management/ObjectSerializer.php index 2ff0b7ef6..cc5272bf9 100644 --- a/src/Adyen/Model/Management/ObjectSerializer.php +++ b/src/Adyen/Model/Management/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/ManagementWebhooks/ObjectSerializer.php b/src/Adyen/Model/ManagementWebhooks/ObjectSerializer.php index a3626e45d..9c73e94b9 100644 --- a/src/Adyen/Model/ManagementWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/ManagementWebhooks/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/POSTerminalManagement/ObjectSerializer.php b/src/Adyen/Model/POSTerminalManagement/ObjectSerializer.php index b6a5027ee..8032f208b 100644 --- a/src/Adyen/Model/POSTerminalManagement/ObjectSerializer.php +++ b/src/Adyen/Model/POSTerminalManagement/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Payments/ObjectSerializer.php b/src/Adyen/Model/Payments/ObjectSerializer.php index ae7a870cb..4e217461d 100644 --- a/src/Adyen/Model/Payments/ObjectSerializer.php +++ b/src/Adyen/Model/Payments/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Payout/ObjectSerializer.php b/src/Adyen/Model/Payout/ObjectSerializer.php index 0d50f4363..ad1c991ab 100644 --- a/src/Adyen/Model/Payout/ObjectSerializer.php +++ b/src/Adyen/Model/Payout/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/PosMobile/ObjectSerializer.php b/src/Adyen/Model/PosMobile/ObjectSerializer.php index ba0e91ceb..ae87baef9 100644 --- a/src/Adyen/Model/PosMobile/ObjectSerializer.php +++ b/src/Adyen/Model/PosMobile/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Recurring/ObjectSerializer.php b/src/Adyen/Model/Recurring/ObjectSerializer.php index 3b2a857bf..7adbf8e59 100644 --- a/src/Adyen/Model/Recurring/ObjectSerializer.php +++ b/src/Adyen/Model/Recurring/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/ReportWebhooks/ObjectSerializer.php b/src/Adyen/Model/ReportWebhooks/ObjectSerializer.php index a8a265ce9..97f670389 100644 --- a/src/Adyen/Model/ReportWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/ReportWebhooks/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/StoredValue/ObjectSerializer.php b/src/Adyen/Model/StoredValue/ObjectSerializer.php index 934975452..ed3372fb3 100644 --- a/src/Adyen/Model/StoredValue/ObjectSerializer.php +++ b/src/Adyen/Model/StoredValue/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/TransactionWebhooks/ObjectSerializer.php b/src/Adyen/Model/TransactionWebhooks/ObjectSerializer.php index 9ccc67586..6592bf84d 100644 --- a/src/Adyen/Model/TransactionWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/TransactionWebhooks/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/TransferWebhooks/ObjectSerializer.php b/src/Adyen/Model/TransferWebhooks/ObjectSerializer.php index d05b26906..01b25bf23 100644 --- a/src/Adyen/Model/TransferWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/TransferWebhooks/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Transfers/ObjectSerializer.php b/src/Adyen/Model/Transfers/ObjectSerializer.php index 349b367b3..b9cbe36bf 100644 --- a/src/Adyen/Model/Transfers/ObjectSerializer.php +++ b/src/Adyen/Model/Transfers/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php index bcb0276b3..980edd95b 100644 --- a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php +++ b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php @@ -76,14 +76,13 @@ public function createSweep(string $balanceAccountId, \Adyen\Model\BalancePlatfo * @param string $balanceAccountId * @param string $sweepId * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteSweep(string $balanceAccountId, string $sweepId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php index 99bc3b6bd..c61143563 100644 --- a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php +++ b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php @@ -44,13 +44,12 @@ public function __construct(Client $client) * * @param \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function validateBankAccountIdentification(\Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest, array $requestOptions = null) { $endpoint = $this->baseURL . "/validateBankAccountIdentification"; $this->requestHttp($endpoint, strtolower('POST'), (array) $bankAccountIdentificationValidationRequest->jsonSerialize(), $requestOptions); - } } diff --git a/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php b/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php index 50ba91f10..df3b7a28a 100644 --- a/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php +++ b/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php @@ -60,14 +60,13 @@ public function completeRegistrationOfScaDevice(string $id, \Adyen\Model\Balance * * @param string $id * @param array|null $requestOptions ['queryParams' => ['paymentInstrumentId'=> string]] - + * @throws AdyenException */ public function deleteRegistrationOfScaDevice(string $id, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/registeredDevices/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php b/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php index 2e704599b..ad86f1206 100644 --- a/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php +++ b/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php @@ -60,13 +60,12 @@ public function getNetworkToken(string $networkTokenId, array $requestOptions = * @param string $networkTokenId * @param \Adyen\Model\BalancePlatform\UpdateNetworkTokenRequest $updateNetworkTokenRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function updateNetworkToken(string $networkTokenId, \Adyen\Model\BalancePlatform\UpdateNetworkTokenRequest $updateNetworkTokenRequest, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{networkTokenId}'], [$networkTokenId], "/networkTokens/{networkTokenId}"); $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateNetworkTokenRequest->jsonSerialize(), $requestOptions); - } } diff --git a/src/Adyen/Service/Checkout/RecurringApi.php b/src/Adyen/Service/Checkout/RecurringApi.php index 72b257fdc..233c09180 100644 --- a/src/Adyen/Service/Checkout/RecurringApi.php +++ b/src/Adyen/Service/Checkout/RecurringApi.php @@ -44,14 +44,13 @@ public function __construct(Client $client) * * @param string $storedPaymentMethodId * @param array|null $requestOptions ['queryParams' => ['shopperReference'=> string, 'merchantAccount'=> string]] - + * @throws AdyenException */ public function deleteTokenForStoredPaymentDetails(string $storedPaymentMethodId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{storedPaymentMethodId}'], [$storedPaymentMethodId], "/storedPaymentMethods/{storedPaymentMethodId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php b/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php index 2551bbc54..f94b39ed9 100644 --- a/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php +++ b/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php @@ -59,14 +59,13 @@ public function createBusinessLine(\Adyen\Model\LegalEntityManagement\BusinessLi * * @param string $id * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteBusinessLine(string $id, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/businessLines/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php b/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php index 9a6ea1756..d834bf550 100644 --- a/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php +++ b/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php @@ -44,14 +44,13 @@ public function __construct(Client $client) * * @param string $id * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteDocument(string $id, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/documents/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php b/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php index 3bf8aeaa4..70c2e0769 100644 --- a/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php +++ b/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php @@ -59,14 +59,13 @@ public function createTransferInstrument(\Adyen\Model\LegalEntityManagement\Tran * * @param string $id * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteTransferInstrument(string $id, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/transferInstruments/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/Management/AllowedOriginsCompanyLevelApi.php b/src/Adyen/Service/Management/AllowedOriginsCompanyLevelApi.php index 608130253..c2557d39d 100644 --- a/src/Adyen/Service/Management/AllowedOriginsCompanyLevelApi.php +++ b/src/Adyen/Service/Management/AllowedOriginsCompanyLevelApi.php @@ -63,14 +63,13 @@ public function createAllowedOrigin(string $companyId, string $apiCredentialId, * @param string $apiCredentialId * @param string $originId * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteAllowedOrigin(string $companyId, string $apiCredentialId, string $originId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{companyId}', '{apiCredentialId}', '{originId}'], [$companyId, $apiCredentialId, $originId], "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/Management/AllowedOriginsMerchantLevelApi.php b/src/Adyen/Service/Management/AllowedOriginsMerchantLevelApi.php index ec0d042af..1b40d271f 100644 --- a/src/Adyen/Service/Management/AllowedOriginsMerchantLevelApi.php +++ b/src/Adyen/Service/Management/AllowedOriginsMerchantLevelApi.php @@ -63,14 +63,13 @@ public function createAllowedOrigin(string $merchantId, string $apiCredentialId, * @param string $apiCredentialId * @param string $originId * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteAllowedOrigin(string $merchantId, string $apiCredentialId, string $originId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{merchantId}', '{apiCredentialId}', '{originId}'], [$merchantId, $apiCredentialId, $originId], "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/Management/MyAPICredentialApi.php b/src/Adyen/Service/Management/MyAPICredentialApi.php index 65cdadc59..54005b35b 100644 --- a/src/Adyen/Service/Management/MyAPICredentialApi.php +++ b/src/Adyen/Service/Management/MyAPICredentialApi.php @@ -116,13 +116,12 @@ public function getApiCredentialDetails(array $requestOptions = null): \Adyen\Mo * * @param string $originId * @param array|null $requestOptions - + * @throws AdyenException */ public function removeAllowedOrigin(string $originId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{originId}'], [$originId], "/me/allowedOrigins/{originId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } } diff --git a/src/Adyen/Service/Management/PaymentMethodsMerchantLevelApi.php b/src/Adyen/Service/Management/PaymentMethodsMerchantLevelApi.php index 4f955b8ba..f8b7cc0b0 100644 --- a/src/Adyen/Service/Management/PaymentMethodsMerchantLevelApi.php +++ b/src/Adyen/Service/Management/PaymentMethodsMerchantLevelApi.php @@ -46,14 +46,13 @@ public function __construct(Client $client) * @param string $paymentMethodId * @param \Adyen\Model\Management\ApplePayInfo $applePayInfo * @param array|null $requestOptions - + * @throws AdyenException */ public function addApplePayDomain(string $merchantId, string $paymentMethodId, \Adyen\Model\Management\ApplePayInfo $applePayInfo, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{merchantId}', '{paymentMethodId}'], [$merchantId, $paymentMethodId], "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/addApplePayDomains"); $this->requestHttp($endpoint, strtolower('POST'), (array) $applePayInfo->jsonSerialize(), $requestOptions); - } /** diff --git a/src/Adyen/Service/Management/PayoutSettingsMerchantLevelApi.php b/src/Adyen/Service/Management/PayoutSettingsMerchantLevelApi.php index 499e78957..efff80b67 100644 --- a/src/Adyen/Service/Management/PayoutSettingsMerchantLevelApi.php +++ b/src/Adyen/Service/Management/PayoutSettingsMerchantLevelApi.php @@ -61,14 +61,13 @@ public function addPayoutSetting(string $merchantId, \Adyen\Model\Management\Pay * @param string $merchantId * @param string $payoutSettingsId * @param array|null $requestOptions - + * @throws AdyenException */ public function deletePayoutSetting(string $merchantId, string $payoutSettingsId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{merchantId}', '{payoutSettingsId}'], [$merchantId, $payoutSettingsId], "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php b/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php index 8b6d78c7f..8a7c5e731 100644 --- a/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php +++ b/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php @@ -59,13 +59,12 @@ public function listTerminals(array $requestOptions = null): \Adyen\Model\Manage * @param string $terminalId * @param \Adyen\Model\Management\TerminalReassignmentRequest $terminalReassignmentRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function reassignTerminal(string $terminalId, \Adyen\Model\Management\TerminalReassignmentRequest $terminalReassignmentRequest, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{terminalId}'], [$terminalId], "/terminals/{terminalId}/reassign"); $this->requestHttp($endpoint, strtolower('POST'), (array) $terminalReassignmentRequest->jsonSerialize(), $requestOptions); - } } diff --git a/src/Adyen/Service/Management/WebhooksCompanyLevelApi.php b/src/Adyen/Service/Management/WebhooksCompanyLevelApi.php index 6caa292a6..cfe85a383 100644 --- a/src/Adyen/Service/Management/WebhooksCompanyLevelApi.php +++ b/src/Adyen/Service/Management/WebhooksCompanyLevelApi.php @@ -92,14 +92,13 @@ public function listAllWebhooks(string $companyId, array $requestOptions = null) * @param string $companyId * @param string $webhookId * @param array|null $requestOptions - + * @throws AdyenException */ public function removeWebhook(string $companyId, string $webhookId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{companyId}', '{webhookId}'], [$companyId, $webhookId], "/companies/{companyId}/webhooks/{webhookId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/Management/WebhooksMerchantLevelApi.php b/src/Adyen/Service/Management/WebhooksMerchantLevelApi.php index 7113c9c39..968e9c614 100644 --- a/src/Adyen/Service/Management/WebhooksMerchantLevelApi.php +++ b/src/Adyen/Service/Management/WebhooksMerchantLevelApi.php @@ -92,14 +92,13 @@ public function listAllWebhooks(string $merchantId, array $requestOptions = null * @param string $merchantId * @param string $webhookId * @param array|null $requestOptions - + * @throws AdyenException */ public function removeWebhook(string $merchantId, string $webhookId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{merchantId}', '{webhookId}'], [$merchantId, $webhookId], "/merchants/{merchantId}/webhooks/{webhookId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** From d840d5772317cd4cdbba91a2a38ab15f415d07b1 Mon Sep 17 00:00:00 2001 From: Djoyke Reijans <115019123+DjoykeAbyah@users.noreply.github.com> Date: Thu, 16 May 2024 11:16:18 +0200 Subject: [PATCH 3/3] Update unittest (#657) * updated Mobile to mobile * changed Active to active --- tests/Unit/NotificationTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Unit/NotificationTest.php b/tests/Unit/NotificationTest.php index 18326313a..807906dba 100644 --- a/tests/Unit/NotificationTest.php +++ b/tests/Unit/NotificationTest.php @@ -264,7 +264,7 @@ public static function successNotificationTestProvider() public function testBankingWebhookParser() { - $jsonString = '{ "data": {"balancePlatform":"YOUR_BALANCE_PLATFORM","accountHolder":{"contactDetails":{"address":{"country":"NL","houseNumberOrName":"274","postalCode":"1020CD","street":"Brannan Street"},"email": "s.hopper@example.com","phone": {"number": "+315551231234","type": "Mobile"}},"description": "S.Hopper - Staff 123","id": "AH00000000000000000000001","status": "Active"}},"environment": "test","type": "balancePlatform.accountHolder.created"}'; + $jsonString = '{ "data": {"balancePlatform":"YOUR_BALANCE_PLATFORM","accountHolder":{"contactDetails":{"address":{"country":"NL","houseNumberOrName":"274","postalCode":"1020CD","street":"Brannan Street"},"email": "s.hopper@example.com","phone": {"number": "+315551231234","type": "mobile"}},"description": "S.Hopper - Staff 123","id": "AH00000000000000000000001","status": "active"}},"environment": "test","type": "balancePlatform.accountHolder.created"}'; $webhookParser = new BankingWebhookParser($jsonString); $result = $webhookParser->getAccountHolderNotificationRequest(); self::assertEquals("test", $result->getEnvironment());