From 22327790e1173374cb8f90bcf325489466bf8efd Mon Sep 17 00:00:00 2001 From: Adyen Automation Date: Tue, 15 Oct 2024 12:45:08 +0000 Subject: [PATCH 1/2] [reformat][adyen-sdk-automation] automated change --- .../Model/AcsWebhooks/ObjectSerializer.php | 9 +- .../Model/BalanceControl/ObjectSerializer.php | 9 +- .../BalancePlatform/BankAccountDetails.php | 31 + .../BalancePlatform/CapabilitySettings.php | 8 +- .../CreateSweepConfigurationV2.php | 8 + .../BalancePlatform/ObjectSerializer.php | 9 +- .../PlatformPaymentConfiguration.php | 2 +- .../BalancePlatform/RegisterSCARequest.php | 31 + .../BalancePlatform/SweepConfigurationV2.php | 8 + .../Model/BalancePlatform/TransactionRule.php | 2 +- .../BalancePlatform/TransactionRuleInfo.php | 2 +- .../UpdateSweepConfigurationV2.php | 8 + .../BalancePlatform/VerificationDeadline.php | 2 + .../BalancePlatform/VerificationError.php | 2 + .../VerificationErrorRecursive.php | 2 + .../Model/BinLookup/ObjectSerializer.php | 9 +- .../Model/Checkout/CardDetailsResponse.php | 62 ++ .../Model/Checkout/CheckoutPaymentMethod.php | 4 +- .../Model/Checkout/CreateOrderRequest.php | 2 +- src/Adyen/Model/Checkout/FundRecipient.php | 82 ++- src/Adyen/Model/Checkout/MbwayDetails.php | 4 +- src/Adyen/Model/Checkout/ObjectSerializer.php | 9 +- src/Adyen/Model/Checkout/PayToDetails.php | 64 +++ src/Adyen/Model/Checkout/Split.php | 2 +- src/Adyen/Model/Checkout/VippsDetails.php | 2 +- .../BankAccountDetails.php | 31 + .../CapabilitySettings.php | 8 +- .../ObjectSerializer.php | 9 +- .../PlatformPaymentConfiguration.php | 2 +- .../SweepConfigurationV2.php | 8 + .../VerificationDeadline.php | 2 + .../VerificationError.php | 2 + .../VerificationErrorRecursive.php | 2 + .../Model/DataProtection/ObjectSerializer.php | 9 +- src/Adyen/Model/Disputes/ObjectSerializer.php | 9 +- .../BusinessLineInfoUpdate.php | 163 ------ ...ckTaxElectronicDeliveryConsentResponse.php | 407 +++++++++++++ .../ObjectSerializer.php | 9 +- .../OnboardingLinkSettings.php | 31 - ...SetTaxElectronicDeliveryConsentRequest.php | 407 +++++++++++++ src/Adyen/Model/Management/Configuration.php | 35 +- src/Adyen/Model/Management/Currency.php | 31 + src/Adyen/Model/Management/JCBInfo.php | 536 ++++++++++++++++++ .../Model/Management/ObjectSerializer.php | 9 +- src/Adyen/Model/Management/PaymentMethod.php | 6 +- .../Management/PaymentMethodSetupInfo.php | 6 +- .../Model/Management/SplitConfiguration.php | 43 +- src/Adyen/Model/Management/Surcharge.php | 2 +- .../ManagementWebhooks/ObjectSerializer.php | 9 +- .../ObjectSerializer.php | 9 +- src/Adyen/Model/Payments/ObjectSerializer.php | 9 +- src/Adyen/Model/Payments/Split.php | 2 +- .../Model/PaymentsApp/ObjectSerializer.php | 9 +- src/Adyen/Model/Payout/ObjectSerializer.php | 9 +- .../Model/PosMobile/ObjectSerializer.php | 9 +- .../Model/Recurring/ObjectSerializer.php | 9 +- .../Model/ReportWebhooks/ObjectSerializer.php | 9 +- .../ReportWebhooks/ReportNotificationData.php | 2 +- .../Model/StoredValue/ObjectSerializer.php | 9 +- .../TransactionWebhooks/ObjectSerializer.php | 9 +- .../DirectDebitInformation.php | 500 ++++++++++++++++ .../Model/TransferWebhooks/Modification.php | 2 + .../TransferWebhooks/ObjectSerializer.php | 9 +- .../Model/TransferWebhooks/TransferData.php | 72 +++ .../Model/TransferWebhooks/TransferEvent.php | 10 + .../Model/TransferWebhooks/TransferReview.php | 504 ++++++++++++++++ .../Transfers/ApproveTransfersRequest.php | 407 +++++++++++++ .../Transfers/CancelTransfersRequest.php | 407 +++++++++++++ .../Transfers/DirectDebitInformation.php | 500 ++++++++++++++++ src/Adyen/Model/Transfers/Modification.php | 2 + .../Model/Transfers/ObjectSerializer.php | 9 +- src/Adyen/Model/Transfers/Transfer.php | 72 +++ src/Adyen/Model/Transfers/TransferData.php | 72 +++ src/Adyen/Model/Transfers/TransferEvent.php | 10 + src/Adyen/Model/Transfers/TransferInfo.php | 31 + .../Model/Transfers/TransferRequestReview.php | 438 ++++++++++++++ src/Adyen/Model/Transfers/TransferReview.php | 504 ++++++++++++++++ .../BalancePlatform/BalanceAccountsApi.php | 3 +- .../BankAccountValidationApi.php | 3 +- .../BalancePlatform/ManageSCADevicesApi.php | 3 +- .../BalancePlatform/NetworkTokensApi.php | 3 +- src/Adyen/Service/Checkout/RecurringApi.php | 3 +- .../BusinessLinesApi.php | 3 +- .../LegalEntityManagement/DocumentsApi.php | 3 +- .../TaxEDeliveryConsentApi.php | 72 +++ .../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/Transfers/TransfersApi.php | 30 + 95 files changed, 5540 insertions(+), 393 deletions(-) create mode 100644 src/Adyen/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.php create mode 100644 src/Adyen/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.php create mode 100644 src/Adyen/Model/Management/JCBInfo.php create mode 100644 src/Adyen/Model/TransferWebhooks/DirectDebitInformation.php create mode 100644 src/Adyen/Model/TransferWebhooks/TransferReview.php create mode 100644 src/Adyen/Model/Transfers/ApproveTransfersRequest.php create mode 100644 src/Adyen/Model/Transfers/CancelTransfersRequest.php create mode 100644 src/Adyen/Model/Transfers/DirectDebitInformation.php create mode 100644 src/Adyen/Model/Transfers/TransferRequestReview.php create mode 100644 src/Adyen/Model/Transfers/TransferReview.php create mode 100644 src/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentApi.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/BankAccountDetails.php b/src/Adyen/Model/BalancePlatform/BankAccountDetails.php index 355ea1d5a..493bf073a 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountDetails.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountDetails.php @@ -46,6 +46,7 @@ class BankAccountDetails implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPITypes = [ 'accountNumber' => 'string', 'accountType' => 'string', + 'branchNumber' => 'string', 'formFactor' => 'string', 'iban' => 'string', 'routingNumber' => 'string', @@ -63,6 +64,7 @@ class BankAccountDetails implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPIFormats = [ 'accountNumber' => null, 'accountType' => null, + 'branchNumber' => null, 'formFactor' => null, 'iban' => null, 'routingNumber' => null, @@ -78,6 +80,7 @@ class BankAccountDetails implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPINullables = [ 'accountNumber' => false, 'accountType' => false, + 'branchNumber' => false, 'formFactor' => false, 'iban' => false, 'routingNumber' => false, @@ -173,6 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'accountType' => 'accountType', + 'branchNumber' => 'branchNumber', 'formFactor' => 'formFactor', 'iban' => 'iban', 'routingNumber' => 'routingNumber', @@ -188,6 +192,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'accountType' => 'setAccountType', + 'branchNumber' => 'setBranchNumber', 'formFactor' => 'setFormFactor', 'iban' => 'setIban', 'routingNumber' => 'setRoutingNumber', @@ -203,6 +208,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'accountType' => 'getAccountType', + 'branchNumber' => 'getBranchNumber', 'formFactor' => 'getFormFactor', 'iban' => 'getIban', 'routingNumber' => 'getRoutingNumber', @@ -269,6 +275,7 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('accountType', $data ?? [], null); + $this->setIfExists('branchNumber', $data ?? [], null); $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); $this->setIfExists('routingNumber', $data ?? [], null); @@ -369,6 +376,30 @@ public function setAccountType($accountType) return $this; } + /** + * Gets branchNumber + * + * @return string|null + */ + public function getBranchNumber() + { + return $this->container['branchNumber']; + } + + /** + * Sets branchNumber + * + * @param string|null $branchNumber The bank account branch number, without separators or whitespace + * + * @return self + */ + public function setBranchNumber($branchNumber) + { + $this->container['branchNumber'] = $branchNumber; + + return $this; + } + /** * Gets formFactor * diff --git a/src/Adyen/Model/BalancePlatform/CapabilitySettings.php b/src/Adyen/Model/BalancePlatform/CapabilitySettings.php index 67e88b5f9..ada0db0b3 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 */ @@ -382,7 +382,7 @@ public function getAuthorizedCardUsers() /** * Sets authorizedCardUsers * - * @param bool|null $authorizedCardUsers + * @param bool|null $authorizedCardUsers * * @return self */ @@ -406,7 +406,7 @@ public function getFundingSource() /** * Sets fundingSource * - * @param string[]|null $fundingSource + * @param string[]|null $fundingSource * * @return self */ @@ -439,7 +439,7 @@ public function getInterval() /** * Sets interval * - * @param string|null $interval + * @param string|null $interval * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.php index 4e763381d..41a441268 100644 --- a/src/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.php +++ b/src/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.php @@ -302,6 +302,7 @@ public function getModelName() public const PRIORITIES_INTERNAL = 'internal'; public const PRIORITIES_REGULAR = 'regular'; public const PRIORITIES_WIRE = 'wire'; + public const REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE = 'accountHierarchyNotActive'; public const REASON_AMOUNT_LIMIT_EXCEEDED = 'amountLimitExceeded'; public const REASON_APPROVED = 'approved'; public const REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE = 'balanceAccountTemporarilyBlockedByTransactionRule'; @@ -313,12 +314,15 @@ public function getModelName() public const REASON_COUNTERPARTY_BANK_UNAVAILABLE = 'counterpartyBankUnavailable'; public const REASON_DECLINED = 'declined'; public const REASON_DECLINED_BY_TRANSACTION_RULE = 'declinedByTransactionRule'; + public const REASON_DIRECT_DEBIT_NOT_SUPPORTED = 'directDebitNotSupported'; public const REASON_ERROR = 'error'; public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; public const REASON_PENDING_APPROVAL = 'pendingApproval'; + public const REASON_PENDING_EXECUTION = 'pendingExecution'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; + public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; public const REASON_UNKNOWN = 'unknown'; public const STATUS_ACTIVE = 'active'; public const STATUS_INACTIVE = 'inactive'; @@ -362,6 +366,7 @@ public function getPrioritiesAllowableValues() public function getReasonAllowableValues() { return [ + self::REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE, self::REASON_AMOUNT_LIMIT_EXCEEDED, self::REASON_APPROVED, self::REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE, @@ -373,12 +378,15 @@ public function getReasonAllowableValues() self::REASON_COUNTERPARTY_BANK_UNAVAILABLE, self::REASON_DECLINED, self::REASON_DECLINED_BY_TRANSACTION_RULE, + self::REASON_DIRECT_DEBIT_NOT_SUPPORTED, self::REASON_ERROR, self::REASON_NOT_ENOUGH_BALANCE, self::REASON_PENDING_APPROVAL, + self::REASON_PENDING_EXECUTION, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, + self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, self::REASON_UNKNOWN, ]; } 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/PlatformPaymentConfiguration.php b/src/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.php index 91c1665d8..ceaed7ef4 100644 --- a/src/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.php +++ b/src/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.php @@ -320,7 +320,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/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**. + * @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: **1** 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/RegisterSCARequest.php b/src/Adyen/Model/BalancePlatform/RegisterSCARequest.php index 0dd69e72e..ca8b78889 100644 --- a/src/Adyen/Model/BalancePlatform/RegisterSCARequest.php +++ b/src/Adyen/Model/BalancePlatform/RegisterSCARequest.php @@ -44,6 +44,7 @@ class RegisterSCARequest implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ + 'name' => 'string', 'paymentInstrumentId' => 'string', 'strongCustomerAuthentication' => '\Adyen\Model\BalancePlatform\DelegatedAuthenticationData' ]; @@ -56,6 +57,7 @@ class RegisterSCARequest implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ + 'name' => null, 'paymentInstrumentId' => null, 'strongCustomerAuthentication' => null ]; @@ -66,6 +68,7 @@ class RegisterSCARequest implements ModelInterface, ArrayAccess, \JsonSerializab * @var boolean[] */ protected static $openAPINullables = [ + 'name' => false, 'paymentInstrumentId' => false, 'strongCustomerAuthentication' => false ]; @@ -156,6 +159,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'name' => 'name', 'paymentInstrumentId' => 'paymentInstrumentId', 'strongCustomerAuthentication' => 'strongCustomerAuthentication' ]; @@ -166,6 +170,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'name' => 'setName', 'paymentInstrumentId' => 'setPaymentInstrumentId', 'strongCustomerAuthentication' => 'setStrongCustomerAuthentication' ]; @@ -176,6 +181,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'name' => 'getName', 'paymentInstrumentId' => 'getPaymentInstrumentId', 'strongCustomerAuthentication' => 'getStrongCustomerAuthentication' ]; @@ -237,6 +243,7 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('name', $data ?? [], null); $this->setIfExists('paymentInstrumentId', $data ?? [], null); $this->setIfExists('strongCustomerAuthentication', $data ?? [], null); } @@ -289,6 +296,30 @@ public function valid() } + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the SCA device that you are registering. You can use it to help your users identify the device. If you do not specify a `name`, Adyen automatically generates one. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + /** * Gets paymentInstrumentId * diff --git a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php index 694a97516..36bf58710 100644 --- a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php +++ b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php @@ -308,6 +308,7 @@ public function getModelName() public const PRIORITIES_INTERNAL = 'internal'; public const PRIORITIES_REGULAR = 'regular'; public const PRIORITIES_WIRE = 'wire'; + public const REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE = 'accountHierarchyNotActive'; public const REASON_AMOUNT_LIMIT_EXCEEDED = 'amountLimitExceeded'; public const REASON_APPROVED = 'approved'; public const REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE = 'balanceAccountTemporarilyBlockedByTransactionRule'; @@ -319,12 +320,15 @@ public function getModelName() public const REASON_COUNTERPARTY_BANK_UNAVAILABLE = 'counterpartyBankUnavailable'; public const REASON_DECLINED = 'declined'; public const REASON_DECLINED_BY_TRANSACTION_RULE = 'declinedByTransactionRule'; + public const REASON_DIRECT_DEBIT_NOT_SUPPORTED = 'directDebitNotSupported'; public const REASON_ERROR = 'error'; public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; public const REASON_PENDING_APPROVAL = 'pendingApproval'; + public const REASON_PENDING_EXECUTION = 'pendingExecution'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; + public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; public const REASON_UNKNOWN = 'unknown'; public const STATUS_ACTIVE = 'active'; public const STATUS_INACTIVE = 'inactive'; @@ -368,6 +372,7 @@ public function getPrioritiesAllowableValues() public function getReasonAllowableValues() { return [ + self::REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE, self::REASON_AMOUNT_LIMIT_EXCEEDED, self::REASON_APPROVED, self::REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE, @@ -379,12 +384,15 @@ public function getReasonAllowableValues() self::REASON_COUNTERPARTY_BANK_UNAVAILABLE, self::REASON_DECLINED, self::REASON_DECLINED_BY_TRANSACTION_RULE, + self::REASON_DIRECT_DEBIT_NOT_SUPPORTED, self::REASON_ERROR, self::REASON_NOT_ENOUGH_BALANCE, self::REASON_PENDING_APPROVAL, + self::REASON_PENDING_EXECUTION, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, + self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, self::REASON_UNKNOWN, ]; } diff --git a/src/Adyen/Model/BalancePlatform/TransactionRule.php b/src/Adyen/Model/BalancePlatform/TransactionRule.php index 480359969..fb8e4cbe9 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRule.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRule.php @@ -646,7 +646,7 @@ public function getOutcomeType() /** * Sets outcomeType * - * @param string|null $outcomeType The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. If not provided, by default, this is set to **hardBlock**. Possible values: * **hardBlock**: the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, the transaction is declined. + * @param string|null $outcomeType The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. Possible values: * **hardBlock**: the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, declines the Transaction. Default value: **hardBlock**. > **scoreBased** is not allowed when `requestType` is **bankTransfer**. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php index d2c0087ee..9c235f5f8 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php @@ -615,7 +615,7 @@ public function getOutcomeType() /** * Sets outcomeType * - * @param string|null $outcomeType The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. If not provided, by default, this is set to **hardBlock**. Possible values: * **hardBlock**: the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, the transaction is declined. + * @param string|null $outcomeType The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. Possible values: * **hardBlock**: the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, declines the Transaction. Default value: **hardBlock**. > **scoreBased** is not allowed when `requestType` is **bankTransfer**. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.php index 0b13837b9..84e78e5f3 100644 --- a/src/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.php +++ b/src/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.php @@ -308,6 +308,7 @@ public function getModelName() public const PRIORITIES_INTERNAL = 'internal'; public const PRIORITIES_REGULAR = 'regular'; public const PRIORITIES_WIRE = 'wire'; + public const REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE = 'accountHierarchyNotActive'; public const REASON_AMOUNT_LIMIT_EXCEEDED = 'amountLimitExceeded'; public const REASON_APPROVED = 'approved'; public const REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE = 'balanceAccountTemporarilyBlockedByTransactionRule'; @@ -319,12 +320,15 @@ public function getModelName() public const REASON_COUNTERPARTY_BANK_UNAVAILABLE = 'counterpartyBankUnavailable'; public const REASON_DECLINED = 'declined'; public const REASON_DECLINED_BY_TRANSACTION_RULE = 'declinedByTransactionRule'; + public const REASON_DIRECT_DEBIT_NOT_SUPPORTED = 'directDebitNotSupported'; public const REASON_ERROR = 'error'; public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; public const REASON_PENDING_APPROVAL = 'pendingApproval'; + public const REASON_PENDING_EXECUTION = 'pendingExecution'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; + public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; public const REASON_UNKNOWN = 'unknown'; public const STATUS_ACTIVE = 'active'; public const STATUS_INACTIVE = 'inactive'; @@ -368,6 +372,7 @@ public function getPrioritiesAllowableValues() public function getReasonAllowableValues() { return [ + self::REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE, self::REASON_AMOUNT_LIMIT_EXCEEDED, self::REASON_APPROVED, self::REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE, @@ -379,12 +384,15 @@ public function getReasonAllowableValues() self::REASON_COUNTERPARTY_BANK_UNAVAILABLE, self::REASON_DECLINED, self::REASON_DECLINED_BY_TRANSACTION_RULE, + self::REASON_DIRECT_DEBIT_NOT_SUPPORTED, self::REASON_ERROR, self::REASON_NOT_ENOUGH_BALANCE, self::REASON_PENDING_APPROVAL, + self::REASON_PENDING_EXECUTION, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, + self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, self::REASON_UNKNOWN, ]; } diff --git a/src/Adyen/Model/BalancePlatform/VerificationDeadline.php b/src/Adyen/Model/BalancePlatform/VerificationDeadline.php index 04926e2e9..84065d015 100644 --- a/src/Adyen/Model/BalancePlatform/VerificationDeadline.php +++ b/src/Adyen/Model/BalancePlatform/VerificationDeadline.php @@ -248,6 +248,7 @@ public function getModelName() public const CAPABILITIES_ISSUE_CARD = 'issueCard'; public const CAPABILITIES_ISSUE_CARD_COMMERCIAL = 'issueCardCommercial'; public const CAPABILITIES_ISSUE_CARD_CONSUMER = 'issueCardConsumer'; + public const CAPABILITIES_ISSUE_CREDIT_LIMIT = 'issueCreditLimit'; public const CAPABILITIES_LOCAL_ACCEPTANCE = 'localAcceptance'; public const CAPABILITIES_PAYOUT = 'payout'; public const CAPABILITIES_PAYOUT_TO_TRANSFER_INSTRUMENT = 'payoutToTransferInstrument'; @@ -307,6 +308,7 @@ public function getCapabilitiesAllowableValues() self::CAPABILITIES_ISSUE_CARD, self::CAPABILITIES_ISSUE_CARD_COMMERCIAL, self::CAPABILITIES_ISSUE_CARD_CONSUMER, + self::CAPABILITIES_ISSUE_CREDIT_LIMIT, self::CAPABILITIES_LOCAL_ACCEPTANCE, self::CAPABILITIES_PAYOUT, self::CAPABILITIES_PAYOUT_TO_TRANSFER_INSTRUMENT, diff --git a/src/Adyen/Model/BalancePlatform/VerificationError.php b/src/Adyen/Model/BalancePlatform/VerificationError.php index ac30758cb..6b1691b09 100644 --- a/src/Adyen/Model/BalancePlatform/VerificationError.php +++ b/src/Adyen/Model/BalancePlatform/VerificationError.php @@ -266,6 +266,7 @@ public function getModelName() public const CAPABILITIES_ISSUE_CARD = 'issueCard'; public const CAPABILITIES_ISSUE_CARD_COMMERCIAL = 'issueCardCommercial'; public const CAPABILITIES_ISSUE_CARD_CONSUMER = 'issueCardConsumer'; + public const CAPABILITIES_ISSUE_CREDIT_LIMIT = 'issueCreditLimit'; public const CAPABILITIES_LOCAL_ACCEPTANCE = 'localAcceptance'; public const CAPABILITIES_PAYOUT = 'payout'; public const CAPABILITIES_PAYOUT_TO_TRANSFER_INSTRUMENT = 'payoutToTransferInstrument'; @@ -328,6 +329,7 @@ public function getCapabilitiesAllowableValues() self::CAPABILITIES_ISSUE_CARD, self::CAPABILITIES_ISSUE_CARD_COMMERCIAL, self::CAPABILITIES_ISSUE_CARD_CONSUMER, + self::CAPABILITIES_ISSUE_CREDIT_LIMIT, self::CAPABILITIES_LOCAL_ACCEPTANCE, self::CAPABILITIES_PAYOUT, self::CAPABILITIES_PAYOUT_TO_TRANSFER_INSTRUMENT, diff --git a/src/Adyen/Model/BalancePlatform/VerificationErrorRecursive.php b/src/Adyen/Model/BalancePlatform/VerificationErrorRecursive.php index d64fc74ca..628eca789 100644 --- a/src/Adyen/Model/BalancePlatform/VerificationErrorRecursive.php +++ b/src/Adyen/Model/BalancePlatform/VerificationErrorRecursive.php @@ -260,6 +260,7 @@ public function getModelName() public const CAPABILITIES_ISSUE_CARD = 'issueCard'; public const CAPABILITIES_ISSUE_CARD_COMMERCIAL = 'issueCardCommercial'; public const CAPABILITIES_ISSUE_CARD_CONSUMER = 'issueCardConsumer'; + public const CAPABILITIES_ISSUE_CREDIT_LIMIT = 'issueCreditLimit'; public const CAPABILITIES_LOCAL_ACCEPTANCE = 'localAcceptance'; public const CAPABILITIES_PAYOUT = 'payout'; public const CAPABILITIES_PAYOUT_TO_TRANSFER_INSTRUMENT = 'payoutToTransferInstrument'; @@ -322,6 +323,7 @@ public function getCapabilitiesAllowableValues() self::CAPABILITIES_ISSUE_CARD, self::CAPABILITIES_ISSUE_CARD_COMMERCIAL, self::CAPABILITIES_ISSUE_CARD_CONSUMER, + self::CAPABILITIES_ISSUE_CREDIT_LIMIT, self::CAPABILITIES_LOCAL_ACCEPTANCE, self::CAPABILITIES_PAYOUT, self::CAPABILITIES_PAYOUT_TO_TRANSFER_INSTRUMENT, 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/CardDetailsResponse.php b/src/Adyen/Model/Checkout/CardDetailsResponse.php index d052d2ec0..8b1fb1265 100644 --- a/src/Adyen/Model/Checkout/CardDetailsResponse.php +++ b/src/Adyen/Model/Checkout/CardDetailsResponse.php @@ -45,6 +45,8 @@ class CardDetailsResponse implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPITypes = [ 'brands' => '\Adyen\Model\Checkout\CardBrandDetails[]', + 'fundingSource' => 'string', + 'isCardCommercial' => 'bool', 'issuingCountryCode' => 'string' ]; @@ -57,6 +59,8 @@ class CardDetailsResponse implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPIFormats = [ 'brands' => null, + 'fundingSource' => null, + 'isCardCommercial' => null, 'issuingCountryCode' => null ]; @@ -67,6 +71,8 @@ class CardDetailsResponse implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPINullables = [ 'brands' => false, + 'fundingSource' => false, + 'isCardCommercial' => false, 'issuingCountryCode' => false ]; @@ -157,6 +163,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'brands' => 'brands', + 'fundingSource' => 'fundingSource', + 'isCardCommercial' => 'isCardCommercial', 'issuingCountryCode' => 'issuingCountryCode' ]; @@ -167,6 +175,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'brands' => 'setBrands', + 'fundingSource' => 'setFundingSource', + 'isCardCommercial' => 'setIsCardCommercial', 'issuingCountryCode' => 'setIssuingCountryCode' ]; @@ -177,6 +187,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'brands' => 'getBrands', + 'fundingSource' => 'getFundingSource', + 'isCardCommercial' => 'getIsCardCommercial', 'issuingCountryCode' => 'getIssuingCountryCode' ]; @@ -238,6 +250,8 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('brands', $data ?? [], null); + $this->setIfExists('fundingSource', $data ?? [], null); + $this->setIfExists('isCardCommercial', $data ?? [], null); $this->setIfExists('issuingCountryCode', $data ?? [], null); } @@ -307,6 +321,54 @@ public function setBrands($brands) return $this; } + /** + * Gets fundingSource + * + * @return string|null + */ + public function getFundingSource() + { + return $this->container['fundingSource']; + } + + /** + * Sets fundingSource + * + * @param string|null $fundingSource The funding source of the card, for example **DEBIT**, **CREDIT**, or **PREPAID**. + * + * @return self + */ + public function setFundingSource($fundingSource) + { + $this->container['fundingSource'] = $fundingSource; + + return $this; + } + + /** + * Gets isCardCommercial + * + * @return bool|null + */ + public function getIsCardCommercial() + { + return $this->container['isCardCommercial']; + } + + /** + * Sets isCardCommercial + * + * @param bool|null $isCardCommercial Indicates if this is a commercial card or a consumer card. If **true**, it is a commercial card. If **false**, it is a consumer card. + * + * @return self + */ + public function setIsCardCommercial($isCardCommercial) + { + $this->container['isCardCommercial'] = $isCardCommercial; + + return $this; + } + /** * Gets issuingCountryCode * diff --git a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php index c5efe3d95..7d317f1ee 100644 --- a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php +++ b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php @@ -1922,7 +1922,7 @@ public function getShopperEmail() /** * Sets shopperEmail * - * @param string $shopperEmail + * @param string $shopperEmail * * @return self */ @@ -1946,7 +1946,7 @@ public function getTelephoneNumber() /** * Sets telephoneNumber * - * @param string $telephoneNumber + * @param string $telephoneNumber * * @return self */ diff --git a/src/Adyen/Model/Checkout/CreateOrderRequest.php b/src/Adyen/Model/Checkout/CreateOrderRequest.php index e406fd322..8831ea19b 100644 --- a/src/Adyen/Model/Checkout/CreateOrderRequest.php +++ b/src/Adyen/Model/Checkout/CreateOrderRequest.php @@ -343,7 +343,7 @@ public function getExpiresAt() /** * Sets expiresAt * - * @param string|null $expiresAt The date that order expires; e.g. 2019-03-23T12:25:28Z. If not provided, the default expiry duration is 1 day. + * @param string|null $expiresAt The date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. * * @return self */ diff --git a/src/Adyen/Model/Checkout/FundRecipient.php b/src/Adyen/Model/Checkout/FundRecipient.php index 8856a7e2e..5770a299f 100644 --- a/src/Adyen/Model/Checkout/FundRecipient.php +++ b/src/Adyen/Model/Checkout/FundRecipient.php @@ -54,7 +54,8 @@ class FundRecipient implements ModelInterface, ArrayAccess, \JsonSerializable 'subMerchant' => '\Adyen\Model\Checkout\SubMerchant', 'telephoneNumber' => 'string', 'walletIdentifier' => 'string', - 'walletOwnerTaxId' => 'string' + 'walletOwnerTaxId' => 'string', + 'walletPurpose' => 'string' ]; /** @@ -75,7 +76,8 @@ class FundRecipient implements ModelInterface, ArrayAccess, \JsonSerializable 'subMerchant' => null, 'telephoneNumber' => null, 'walletIdentifier' => null, - 'walletOwnerTaxId' => null + 'walletOwnerTaxId' => null, + 'walletPurpose' => null ]; /** @@ -94,7 +96,8 @@ class FundRecipient implements ModelInterface, ArrayAccess, \JsonSerializable 'subMerchant' => false, 'telephoneNumber' => false, 'walletIdentifier' => false, - 'walletOwnerTaxId' => false + 'walletOwnerTaxId' => false, + 'walletPurpose' => false ]; /** @@ -193,7 +196,8 @@ public function isNullableSetToNull(string $property): bool 'subMerchant' => 'subMerchant', 'telephoneNumber' => 'telephoneNumber', 'walletIdentifier' => 'walletIdentifier', - 'walletOwnerTaxId' => 'walletOwnerTaxId' + 'walletOwnerTaxId' => 'walletOwnerTaxId', + 'walletPurpose' => 'walletPurpose' ]; /** @@ -212,7 +216,8 @@ public function isNullableSetToNull(string $property): bool 'subMerchant' => 'setSubMerchant', 'telephoneNumber' => 'setTelephoneNumber', 'walletIdentifier' => 'setWalletIdentifier', - 'walletOwnerTaxId' => 'setWalletOwnerTaxId' + 'walletOwnerTaxId' => 'setWalletOwnerTaxId', + 'walletPurpose' => 'setWalletPurpose' ]; /** @@ -231,7 +236,8 @@ public function isNullableSetToNull(string $property): bool 'subMerchant' => 'getSubMerchant', 'telephoneNumber' => 'getTelephoneNumber', 'walletIdentifier' => 'getWalletIdentifier', - 'walletOwnerTaxId' => 'getWalletOwnerTaxId' + 'walletOwnerTaxId' => 'getWalletOwnerTaxId', + 'walletPurpose' => 'getWalletPurpose' ]; /** @@ -275,7 +281,27 @@ public function getModelName() return self::$openAPIModelName; } + public const WALLET_PURPOSE_IDENTIFIED_BOLETO = 'identifiedBoleto'; + public const WALLET_PURPOSE_TRANSFER_DIFFERENT_WALLET = 'transferDifferentWallet'; + public const WALLET_PURPOSE_TRANSFER_OWN_WALLET = 'transferOwnWallet'; + public const WALLET_PURPOSE_TRANSFER_SAME_WALLET = 'transferSameWallet'; + public const WALLET_PURPOSE_UNIDENTIFIED_BOLETO = 'unidentifiedBoleto'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getWalletPurposeAllowableValues() + { + return [ + self::WALLET_PURPOSE_IDENTIFIED_BOLETO, + self::WALLET_PURPOSE_TRANSFER_DIFFERENT_WALLET, + self::WALLET_PURPOSE_TRANSFER_OWN_WALLET, + self::WALLET_PURPOSE_TRANSFER_SAME_WALLET, + self::WALLET_PURPOSE_UNIDENTIFIED_BOLETO, + ]; + } /** * Associative array for storing property values * @@ -302,6 +328,7 @@ public function __construct(array $data = null) $this->setIfExists('telephoneNumber', $data ?? [], null); $this->setIfExists('walletIdentifier', $data ?? [], null); $this->setIfExists('walletOwnerTaxId', $data ?? [], null); + $this->setIfExists('walletPurpose', $data ?? [], null); } /** @@ -331,6 +358,15 @@ public function listInvalidProperties() { $invalidProperties = []; + $allowedValues = $this->getWalletPurposeAllowableValues(); + if (!is_null($this->container['walletPurpose']) && !in_array($this->container['walletPurpose'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'walletPurpose', must be one of '%s'", + $this->container['walletPurpose'], + implode("', '", $allowedValues) + ); + } + return $invalidProperties; } @@ -609,6 +645,40 @@ public function setWalletOwnerTaxId($walletOwnerTaxId) 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) + { + $allowedValues = $this->getWalletPurposeAllowableValues(); + if (!in_array($walletPurpose, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'walletPurpose', must be one of '%s'", + $walletPurpose, + implode("', '", $allowedValues) + ) + ); + } + $this->container['walletPurpose'] = $walletPurpose; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Checkout/MbwayDetails.php b/src/Adyen/Model/Checkout/MbwayDetails.php index dc73d3c30..becc716f0 100644 --- a/src/Adyen/Model/Checkout/MbwayDetails.php +++ b/src/Adyen/Model/Checkout/MbwayDetails.php @@ -361,7 +361,7 @@ public function getShopperEmail() /** * Sets shopperEmail * - * @param string $shopperEmail + * @param string $shopperEmail * * @return self */ @@ -385,7 +385,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/PayToDetails.php b/src/Adyen/Model/Checkout/PayToDetails.php index 076f7a8f4..378919bc8 100644 --- a/src/Adyen/Model/Checkout/PayToDetails.php +++ b/src/Adyen/Model/Checkout/PayToDetails.php @@ -45,7 +45,9 @@ class PayToDetails implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'checkoutAttemptId' => 'string', + 'recurringDetailReference' => 'string', 'shopperAccountIdentifier' => 'string', + 'storedPaymentMethodId' => 'string', 'type' => 'string' ]; @@ -58,7 +60,9 @@ class PayToDetails implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'checkoutAttemptId' => null, + 'recurringDetailReference' => null, 'shopperAccountIdentifier' => null, + 'storedPaymentMethodId' => null, 'type' => null ]; @@ -69,7 +73,9 @@ class PayToDetails implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'checkoutAttemptId' => false, + 'recurringDetailReference' => false, 'shopperAccountIdentifier' => false, + 'storedPaymentMethodId' => false, 'type' => false ]; @@ -160,7 +166,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'checkoutAttemptId' => 'checkoutAttemptId', + 'recurringDetailReference' => 'recurringDetailReference', 'shopperAccountIdentifier' => 'shopperAccountIdentifier', + 'storedPaymentMethodId' => 'storedPaymentMethodId', 'type' => 'type' ]; @@ -171,7 +179,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'checkoutAttemptId' => 'setCheckoutAttemptId', + 'recurringDetailReference' => 'setRecurringDetailReference', 'shopperAccountIdentifier' => 'setShopperAccountIdentifier', + 'storedPaymentMethodId' => 'setStoredPaymentMethodId', 'type' => 'setType' ]; @@ -182,7 +192,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'checkoutAttemptId' => 'getCheckoutAttemptId', + 'recurringDetailReference' => 'getRecurringDetailReference', 'shopperAccountIdentifier' => 'getShopperAccountIdentifier', + 'storedPaymentMethodId' => 'getStoredPaymentMethodId', 'type' => 'getType' ]; @@ -256,7 +268,9 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('checkoutAttemptId', $data ?? [], null); + $this->setIfExists('recurringDetailReference', $data ?? [], null); $this->setIfExists('shopperAccountIdentifier', $data ?? [], null); + $this->setIfExists('storedPaymentMethodId', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -335,6 +349,32 @@ public function setCheckoutAttemptId($checkoutAttemptId) return $this; } + /** + * Gets recurringDetailReference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurringDetailReference']; + } + + /** + * Sets recurringDetailReference + * + * @param string|null $recurringDetailReference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurringDetailReference) + { + $this->container['recurringDetailReference'] = $recurringDetailReference; + + return $this; + } + /** * Gets shopperAccountIdentifier * @@ -359,6 +399,30 @@ public function setShopperAccountIdentifier($shopperAccountIdentifier) return $this; } + /** + * Gets storedPaymentMethodId + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['storedPaymentMethodId']; + } + + /** + * Sets storedPaymentMethodId + * + * @param string|null $storedPaymentMethodId This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($storedPaymentMethodId) + { + $this->container['storedPaymentMethodId'] = $storedPaymentMethodId; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/Checkout/Split.php b/src/Adyen/Model/Checkout/Split.php index 9459a92dc..cb8a04d24 100644 --- a/src/Adyen/Model/Checkout/Split.php +++ b/src/Adyen/Model/Checkout/Split.php @@ -465,7 +465,7 @@ public function getType() /** * Sets type * - * @param string $type The part of the payment you want to book to the specified `account`. Possible values for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books part of the payment (specified in `amount`) to the specified `account`. * Transaction fees types that you can book to the specified `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the transaction fees due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the transaction fees due to Adyen under [Interchange ++ pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: your platform's commission on the payment (specified in `amount`), booked to your liable balance account. * **Remainder**: the amount left over after a currency conversion, booked to the specified `account`. * **TopUp**: allows you and your users to top up balance accounts using direct debit, card payments, or other payment methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms liable balance account. * **Commission**: your platform's commission (specified in `amount`) on the payment, booked to your liable balance account. * **Default**: in very specific use cases, allows you to book the specified `amount` to the specified `account`. For more information, contact Adyen support. Possible values for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, **Marketplace**, **PaymentFee**, **VAT**. + * @param string $type The part of the payment you want to book to the specified `account`. Possible values for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books part of the payment (specified in `amount`) to the specified `account`. * Transaction fees types that you can book to the specified `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the transaction fees due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the transaction fees due to Adyen under [Interchange ++ pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: your platform's commission on the payment (specified in `amount`), booked to your liable balance account. * **Remainder**: the amount left over after a currency conversion, booked to the specified `account`. * **TopUp**: allows you and your users to top up balance accounts using direct debit, card payments, or other payment methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms liable balance account. * **Commission**: your platform's commission (specified in `amount`) on the payment, booked to your liable balance account. * **Default**: in very specific use cases, allows you to book the specified `amount` to the specified `account`. For more information, contact Adyen support. Possible values for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. * * @return self */ diff --git a/src/Adyen/Model/Checkout/VippsDetails.php b/src/Adyen/Model/Checkout/VippsDetails.php index 6787fd034..a5087a929 100644 --- a/src/Adyen/Model/Checkout/VippsDetails.php +++ b/src/Adyen/Model/Checkout/VippsDetails.php @@ -415,7 +415,7 @@ public function getTelephoneNumber() /** * Sets telephoneNumber * - * @param string $telephoneNumber + * @param string $telephoneNumber * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/BankAccountDetails.php b/src/Adyen/Model/ConfigurationWebhooks/BankAccountDetails.php index cd2a501b2..41f22b06d 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/BankAccountDetails.php +++ b/src/Adyen/Model/ConfigurationWebhooks/BankAccountDetails.php @@ -46,6 +46,7 @@ class BankAccountDetails implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPITypes = [ 'accountNumber' => 'string', 'accountType' => 'string', + 'branchNumber' => 'string', 'formFactor' => 'string', 'iban' => 'string', 'routingNumber' => 'string', @@ -63,6 +64,7 @@ class BankAccountDetails implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPIFormats = [ 'accountNumber' => null, 'accountType' => null, + 'branchNumber' => null, 'formFactor' => null, 'iban' => null, 'routingNumber' => null, @@ -78,6 +80,7 @@ class BankAccountDetails implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPINullables = [ 'accountNumber' => false, 'accountType' => false, + 'branchNumber' => false, 'formFactor' => false, 'iban' => false, 'routingNumber' => false, @@ -173,6 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountNumber' => 'accountNumber', 'accountType' => 'accountType', + 'branchNumber' => 'branchNumber', 'formFactor' => 'formFactor', 'iban' => 'iban', 'routingNumber' => 'routingNumber', @@ -188,6 +192,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountNumber' => 'setAccountNumber', 'accountType' => 'setAccountType', + 'branchNumber' => 'setBranchNumber', 'formFactor' => 'setFormFactor', 'iban' => 'setIban', 'routingNumber' => 'setRoutingNumber', @@ -203,6 +208,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountNumber' => 'getAccountNumber', 'accountType' => 'getAccountType', + 'branchNumber' => 'getBranchNumber', 'formFactor' => 'getFormFactor', 'iban' => 'getIban', 'routingNumber' => 'getRoutingNumber', @@ -269,6 +275,7 @@ public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('accountType', $data ?? [], null); + $this->setIfExists('branchNumber', $data ?? [], null); $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); $this->setIfExists('routingNumber', $data ?? [], null); @@ -369,6 +376,30 @@ public function setAccountType($accountType) return $this; } + /** + * Gets branchNumber + * + * @return string|null + */ + public function getBranchNumber() + { + return $this->container['branchNumber']; + } + + /** + * Sets branchNumber + * + * @param string|null $branchNumber The bank account branch number, without separators or whitespace + * + * @return self + */ + public function setBranchNumber($branchNumber) + { + $this->container['branchNumber'] = $branchNumber; + + return $this; + } + /** * Gets formFactor * diff --git a/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php b/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php index 77bba385d..478ff8914 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 */ @@ -382,7 +382,7 @@ public function getAuthorizedCardUsers() /** * Sets authorizedCardUsers * - * @param bool|null $authorizedCardUsers + * @param bool|null $authorizedCardUsers * * @return self */ @@ -406,7 +406,7 @@ public function getFundingSource() /** * Sets fundingSource * - * @param string[]|null $fundingSource + * @param string[]|null $fundingSource * * @return self */ @@ -439,7 +439,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 6629bee4b..2d912cd58 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,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/PlatformPaymentConfiguration.php b/src/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.php index 7c7a9b8c4..873f92859 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.php +++ b/src/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.php @@ -320,7 +320,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/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**. + * @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: **1** 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/SweepConfigurationV2.php b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.php index 0ed91b9b5..f8ed5cacc 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.php +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.php @@ -308,6 +308,7 @@ public function getModelName() public const PRIORITIES_INTERNAL = 'internal'; public const PRIORITIES_REGULAR = 'regular'; public const PRIORITIES_WIRE = 'wire'; + public const REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE = 'accountHierarchyNotActive'; public const REASON_AMOUNT_LIMIT_EXCEEDED = 'amountLimitExceeded'; public const REASON_APPROVED = 'approved'; public const REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE = 'balanceAccountTemporarilyBlockedByTransactionRule'; @@ -319,12 +320,15 @@ public function getModelName() public const REASON_COUNTERPARTY_BANK_UNAVAILABLE = 'counterpartyBankUnavailable'; public const REASON_DECLINED = 'declined'; public const REASON_DECLINED_BY_TRANSACTION_RULE = 'declinedByTransactionRule'; + public const REASON_DIRECT_DEBIT_NOT_SUPPORTED = 'directDebitNotSupported'; public const REASON_ERROR = 'error'; public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; public const REASON_PENDING_APPROVAL = 'pendingApproval'; + public const REASON_PENDING_EXECUTION = 'pendingExecution'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; + public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; public const REASON_UNKNOWN = 'unknown'; public const STATUS_ACTIVE = 'active'; public const STATUS_INACTIVE = 'inactive'; @@ -368,6 +372,7 @@ public function getPrioritiesAllowableValues() public function getReasonAllowableValues() { return [ + self::REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE, self::REASON_AMOUNT_LIMIT_EXCEEDED, self::REASON_APPROVED, self::REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE, @@ -379,12 +384,15 @@ public function getReasonAllowableValues() self::REASON_COUNTERPARTY_BANK_UNAVAILABLE, self::REASON_DECLINED, self::REASON_DECLINED_BY_TRANSACTION_RULE, + self::REASON_DIRECT_DEBIT_NOT_SUPPORTED, self::REASON_ERROR, self::REASON_NOT_ENOUGH_BALANCE, self::REASON_PENDING_APPROVAL, + self::REASON_PENDING_EXECUTION, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, + self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, self::REASON_UNKNOWN, ]; } diff --git a/src/Adyen/Model/ConfigurationWebhooks/VerificationDeadline.php b/src/Adyen/Model/ConfigurationWebhooks/VerificationDeadline.php index 2a1bbe660..1443cedfc 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/VerificationDeadline.php +++ b/src/Adyen/Model/ConfigurationWebhooks/VerificationDeadline.php @@ -248,6 +248,7 @@ public function getModelName() public const CAPABILITIES_ISSUE_CARD = 'issueCard'; public const CAPABILITIES_ISSUE_CARD_COMMERCIAL = 'issueCardCommercial'; public const CAPABILITIES_ISSUE_CARD_CONSUMER = 'issueCardConsumer'; + public const CAPABILITIES_ISSUE_CREDIT_LIMIT = 'issueCreditLimit'; public const CAPABILITIES_LOCAL_ACCEPTANCE = 'localAcceptance'; public const CAPABILITIES_PAYOUT = 'payout'; public const CAPABILITIES_PAYOUT_TO_TRANSFER_INSTRUMENT = 'payoutToTransferInstrument'; @@ -307,6 +308,7 @@ public function getCapabilitiesAllowableValues() self::CAPABILITIES_ISSUE_CARD, self::CAPABILITIES_ISSUE_CARD_COMMERCIAL, self::CAPABILITIES_ISSUE_CARD_CONSUMER, + self::CAPABILITIES_ISSUE_CREDIT_LIMIT, self::CAPABILITIES_LOCAL_ACCEPTANCE, self::CAPABILITIES_PAYOUT, self::CAPABILITIES_PAYOUT_TO_TRANSFER_INSTRUMENT, diff --git a/src/Adyen/Model/ConfigurationWebhooks/VerificationError.php b/src/Adyen/Model/ConfigurationWebhooks/VerificationError.php index ab1e03e77..7e0529e13 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/VerificationError.php +++ b/src/Adyen/Model/ConfigurationWebhooks/VerificationError.php @@ -266,6 +266,7 @@ public function getModelName() public const CAPABILITIES_ISSUE_CARD = 'issueCard'; public const CAPABILITIES_ISSUE_CARD_COMMERCIAL = 'issueCardCommercial'; public const CAPABILITIES_ISSUE_CARD_CONSUMER = 'issueCardConsumer'; + public const CAPABILITIES_ISSUE_CREDIT_LIMIT = 'issueCreditLimit'; public const CAPABILITIES_LOCAL_ACCEPTANCE = 'localAcceptance'; public const CAPABILITIES_PAYOUT = 'payout'; public const CAPABILITIES_PAYOUT_TO_TRANSFER_INSTRUMENT = 'payoutToTransferInstrument'; @@ -328,6 +329,7 @@ public function getCapabilitiesAllowableValues() self::CAPABILITIES_ISSUE_CARD, self::CAPABILITIES_ISSUE_CARD_COMMERCIAL, self::CAPABILITIES_ISSUE_CARD_CONSUMER, + self::CAPABILITIES_ISSUE_CREDIT_LIMIT, self::CAPABILITIES_LOCAL_ACCEPTANCE, self::CAPABILITIES_PAYOUT, self::CAPABILITIES_PAYOUT_TO_TRANSFER_INSTRUMENT, diff --git a/src/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.php b/src/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.php index 1bed524ec..1cd8c4537 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.php +++ b/src/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.php @@ -260,6 +260,7 @@ public function getModelName() public const CAPABILITIES_ISSUE_CARD = 'issueCard'; public const CAPABILITIES_ISSUE_CARD_COMMERCIAL = 'issueCardCommercial'; public const CAPABILITIES_ISSUE_CARD_CONSUMER = 'issueCardConsumer'; + public const CAPABILITIES_ISSUE_CREDIT_LIMIT = 'issueCreditLimit'; public const CAPABILITIES_LOCAL_ACCEPTANCE = 'localAcceptance'; public const CAPABILITIES_PAYOUT = 'payout'; public const CAPABILITIES_PAYOUT_TO_TRANSFER_INSTRUMENT = 'payoutToTransferInstrument'; @@ -322,6 +323,7 @@ public function getCapabilitiesAllowableValues() self::CAPABILITIES_ISSUE_CARD, self::CAPABILITIES_ISSUE_CARD_COMMERCIAL, self::CAPABILITIES_ISSUE_CARD_CONSUMER, + self::CAPABILITIES_ISSUE_CREDIT_LIMIT, self::CAPABILITIES_LOCAL_ACCEPTANCE, self::CAPABILITIES_PAYOUT, self::CAPABILITIES_PAYOUT_TO_TRANSFER_INSTRUMENT, 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/BusinessLineInfoUpdate.php b/src/Adyen/Model/LegalEntityManagement/BusinessLineInfoUpdate.php index 9f0d83fe1..e01229910 100644 --- a/src/Adyen/Model/LegalEntityManagement/BusinessLineInfoUpdate.php +++ b/src/Adyen/Model/LegalEntityManagement/BusinessLineInfoUpdate.php @@ -44,11 +44,8 @@ class BusinessLineInfoUpdate implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $openAPITypes = [ - 'capability' => 'string', 'industryCode' => 'string', - 'legalEntityId' => 'string', 'salesChannels' => 'string[]', - 'service' => 'string', 'sourceOfFunds' => '\Adyen\Model\LegalEntityManagement\SourceOfFunds', 'webData' => '\Adyen\Model\LegalEntityManagement\WebData[]', 'webDataExemption' => '\Adyen\Model\LegalEntityManagement\WebDataExemption' @@ -62,11 +59,8 @@ class BusinessLineInfoUpdate implements ModelInterface, ArrayAccess, \JsonSerial * @psalm-var array */ protected static $openAPIFormats = [ - 'capability' => null, 'industryCode' => null, - 'legalEntityId' => null, 'salesChannels' => null, - 'service' => null, 'sourceOfFunds' => null, 'webData' => null, 'webDataExemption' => null @@ -78,11 +72,8 @@ class BusinessLineInfoUpdate implements ModelInterface, ArrayAccess, \JsonSerial * @var boolean[] */ protected static $openAPINullables = [ - 'capability' => false, 'industryCode' => false, - 'legalEntityId' => false, 'salesChannels' => false, - 'service' => false, 'sourceOfFunds' => false, 'webData' => false, 'webDataExemption' => false @@ -174,11 +165,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'capability' => 'capability', 'industryCode' => 'industryCode', - 'legalEntityId' => 'legalEntityId', 'salesChannels' => 'salesChannels', - 'service' => 'service', 'sourceOfFunds' => 'sourceOfFunds', 'webData' => 'webData', 'webDataExemption' => 'webDataExemption' @@ -190,11 +178,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'capability' => 'setCapability', 'industryCode' => 'setIndustryCode', - 'legalEntityId' => 'setLegalEntityId', 'salesChannels' => 'setSalesChannels', - 'service' => 'setService', 'sourceOfFunds' => 'setSourceOfFunds', 'webData' => 'setWebData', 'webDataExemption' => 'setWebDataExemption' @@ -206,11 +191,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'capability' => 'getCapability', 'industryCode' => 'getIndustryCode', - 'legalEntityId' => 'getLegalEntityId', 'salesChannels' => 'getSalesChannels', - 'service' => 'getService', 'sourceOfFunds' => 'getSourceOfFunds', 'webData' => 'getWebData', 'webDataExemption' => 'getWebDataExemption' @@ -257,37 +239,7 @@ public function getModelName() return self::$openAPIModelName; } - public const CAPABILITY_RECEIVE_PAYMENTS = 'receivePayments'; - public const CAPABILITY_RECEIVE_FROM_PLATFORM_PAYMENTS = 'receiveFromPlatformPayments'; - public const CAPABILITY_ISSUE_BANK_ACCOUNT = 'issueBankAccount'; - public const SERVICE_PAYMENT_PROCESSING = 'paymentProcessing'; - public const SERVICE_BANKING = 'banking'; - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getCapabilityAllowableValues() - { - return [ - self::CAPABILITY_RECEIVE_PAYMENTS, - self::CAPABILITY_RECEIVE_FROM_PLATFORM_PAYMENTS, - self::CAPABILITY_ISSUE_BANK_ACCOUNT, - ]; - } - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getServiceAllowableValues() - { - return [ - self::SERVICE_PAYMENT_PROCESSING, - self::SERVICE_BANKING, - ]; - } /** * Associative array for storing property values * @@ -303,11 +255,8 @@ public function getServiceAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('capability', $data ?? [], null); $this->setIfExists('industryCode', $data ?? [], null); - $this->setIfExists('legalEntityId', $data ?? [], null); $this->setIfExists('salesChannels', $data ?? [], null); - $this->setIfExists('service', $data ?? [], null); $this->setIfExists('sourceOfFunds', $data ?? [], null); $this->setIfExists('webData', $data ?? [], null); $this->setIfExists('webDataExemption', $data ?? [], null); @@ -340,24 +289,6 @@ public function listInvalidProperties() { $invalidProperties = []; - $allowedValues = $this->getCapabilityAllowableValues(); - if (!is_null($this->container['capability']) && !in_array($this->container['capability'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'capability', must be one of '%s'", - $this->container['capability'], - implode("', '", $allowedValues) - ); - } - - $allowedValues = $this->getServiceAllowableValues(); - if (!is_null($this->container['service']) && !in_array($this->container['service'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'service', must be one of '%s'", - $this->container['service'], - implode("', '", $allowedValues) - ); - } - return $invalidProperties; } @@ -373,42 +304,6 @@ public function valid() } - /** - * Gets capability - * - * @return string|null - * @deprecated - */ - public function getCapability() - { - return $this->container['capability']; - } - - /** - * Sets capability - * - * @param string|null $capability The capability for which you are creating the business line. For example, **receivePayments**. - * - * @return self - * @deprecated - */ - public function setCapability($capability) - { - $allowedValues = $this->getCapabilityAllowableValues(); - if (!in_array($capability, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'capability', must be one of '%s'", - $capability, - implode("', '", $allowedValues) - ) - ); - } - $this->container['capability'] = $capability; - - return $this; - } - /** * Gets industryCode * @@ -433,30 +328,6 @@ public function setIndustryCode($industryCode) return $this; } - /** - * Gets legalEntityId - * - * @return string|null - */ - public function getLegalEntityId() - { - return $this->container['legalEntityId']; - } - - /** - * Sets legalEntityId - * - * @param string|null $legalEntityId Unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities__resParam_id) that owns the business line. - * - * @return self - */ - public function setLegalEntityId($legalEntityId) - { - $this->container['legalEntityId'] = $legalEntityId; - - return $this; - } - /** * Gets salesChannels * @@ -481,40 +352,6 @@ public function setSalesChannels($salesChannels) return $this; } - /** - * Gets service - * - * @return string|null - */ - public function getService() - { - return $this->container['service']; - } - - /** - * Sets service - * - * @param string|null $service The service for which you are creating the business line. Possible values: * **paymentProcessing** * **banking** - * - * @return self - */ - public function setService($service) - { - $allowedValues = $this->getServiceAllowableValues(); - if (!in_array($service, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'service', must be one of '%s'", - $service, - implode("', '", $allowedValues) - ) - ); - } - $this->container['service'] = $service; - - return $this; - } - /** * Gets sourceOfFunds * diff --git a/src/Adyen/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.php b/src/Adyen/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.php new file mode 100644 index 000000000..e88fadd54 --- /dev/null +++ b/src/Adyen/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.php @@ -0,0 +1,407 @@ + + */ +class CheckTaxElectronicDeliveryConsentResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckTaxElectronicDeliveryConsentResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'uS1099k' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'uS1099k' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'uS1099k' => 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 = [ + 'uS1099k' => 'US1099k' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'uS1099k' => 'setUS1099k' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'uS1099k' => 'getUS1099k' + ]; + + /** + * 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('uS1099k', $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 uS1099k + * + * @return bool|null + */ + public function getUS1099k() + { + return $this->container['uS1099k']; + } + + /** + * Sets uS1099k + * + * @param bool|null $uS1099k Consent to electronically deliver tax form US1099-K. + * + * @return self + */ + public function setUS1099k($uS1099k) + { + $this->container['uS1099k'] = $uS1099k; + + 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/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/OnboardingLinkSettings.php b/src/Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.php index 1c137ef4e..23fcae758 100644 --- a/src/Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.php +++ b/src/Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.php @@ -46,7 +46,6 @@ class OnboardingLinkSettings implements ModelInterface, ArrayAccess, \JsonSerial protected static $openAPITypes = [ 'acceptedCountries' => 'string[]', 'allowBankAccountFormatSelection' => 'bool', - 'allowDebugUi' => 'bool', 'allowIntraRegionCrossBorderPayout' => 'bool', 'changeLegalEntityType' => 'bool', 'editPrefilledCountry' => 'bool', @@ -72,7 +71,6 @@ class OnboardingLinkSettings implements ModelInterface, ArrayAccess, \JsonSerial protected static $openAPIFormats = [ 'acceptedCountries' => null, 'allowBankAccountFormatSelection' => null, - 'allowDebugUi' => null, 'allowIntraRegionCrossBorderPayout' => null, 'changeLegalEntityType' => null, 'editPrefilledCountry' => null, @@ -96,7 +94,6 @@ class OnboardingLinkSettings implements ModelInterface, ArrayAccess, \JsonSerial protected static $openAPINullables = [ 'acceptedCountries' => false, 'allowBankAccountFormatSelection' => false, - 'allowDebugUi' => false, 'allowIntraRegionCrossBorderPayout' => false, 'changeLegalEntityType' => false, 'editPrefilledCountry' => false, @@ -200,7 +197,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'acceptedCountries' => 'acceptedCountries', 'allowBankAccountFormatSelection' => 'allowBankAccountFormatSelection', - 'allowDebugUi' => 'allowDebugUi', 'allowIntraRegionCrossBorderPayout' => 'allowIntraRegionCrossBorderPayout', 'changeLegalEntityType' => 'changeLegalEntityType', 'editPrefilledCountry' => 'editPrefilledCountry', @@ -224,7 +220,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'acceptedCountries' => 'setAcceptedCountries', 'allowBankAccountFormatSelection' => 'setAllowBankAccountFormatSelection', - 'allowDebugUi' => 'setAllowDebugUi', 'allowIntraRegionCrossBorderPayout' => 'setAllowIntraRegionCrossBorderPayout', 'changeLegalEntityType' => 'setChangeLegalEntityType', 'editPrefilledCountry' => 'setEditPrefilledCountry', @@ -248,7 +243,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'acceptedCountries' => 'getAcceptedCountries', 'allowBankAccountFormatSelection' => 'getAllowBankAccountFormatSelection', - 'allowDebugUi' => 'getAllowDebugUi', 'allowIntraRegionCrossBorderPayout' => 'getAllowIntraRegionCrossBorderPayout', 'changeLegalEntityType' => 'getChangeLegalEntityType', 'editPrefilledCountry' => 'getEditPrefilledCountry', @@ -323,7 +317,6 @@ public function __construct(array $data = null) { $this->setIfExists('acceptedCountries', $data ?? [], null); $this->setIfExists('allowBankAccountFormatSelection', $data ?? [], null); - $this->setIfExists('allowDebugUi', $data ?? [], null); $this->setIfExists('allowIntraRegionCrossBorderPayout', $data ?? [], null); $this->setIfExists('changeLegalEntityType', $data ?? [], null); $this->setIfExists('editPrefilledCountry', $data ?? [], null); @@ -429,30 +422,6 @@ public function setAllowBankAccountFormatSelection($allowBankAccountFormatSelect return $this; } - /** - * Gets allowDebugUi - * - * @return bool|null - */ - public function getAllowDebugUi() - { - return $this->container['allowDebugUi']; - } - - /** - * Sets allowDebugUi - * - * @param bool|null $allowDebugUi Default value: **true** Indicates if the user may press a hidden key combination to open the HO debugging UI. - * - * @return self - */ - public function setAllowDebugUi($allowDebugUi) - { - $this->container['allowDebugUi'] = $allowDebugUi; - - return $this; - } - /** * Gets allowIntraRegionCrossBorderPayout * diff --git a/src/Adyen/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.php b/src/Adyen/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.php new file mode 100644 index 000000000..f3eaf51b7 --- /dev/null +++ b/src/Adyen/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.php @@ -0,0 +1,407 @@ + + */ +class SetTaxElectronicDeliveryConsentRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SetTaxElectronicDeliveryConsentRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'uS1099k' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'uS1099k' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'uS1099k' => 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 = [ + 'uS1099k' => 'US1099k' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'uS1099k' => 'setUS1099k' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'uS1099k' => 'getUS1099k' + ]; + + /** + * 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('uS1099k', $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 uS1099k + * + * @return bool|null + */ + public function getUS1099k() + { + return $this->container['uS1099k']; + } + + /** + * Sets uS1099k + * + * @param bool|null $uS1099k Consent to electronically deliver tax form US1099-K. + * + * @return self + */ + public function setUS1099k($uS1099k) + { + $this->container['uS1099k'] = $uS1099k; + + 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/Management/Configuration.php b/src/Adyen/Model/Management/Configuration.php index 95e562435..1a26cf6ff 100644 --- a/src/Adyen/Model/Management/Configuration.php +++ b/src/Adyen/Model/Management/Configuration.php @@ -45,6 +45,7 @@ class Configuration implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'brand' => 'string', + 'commercial' => 'bool', 'country' => 'string[]', 'currencies' => '\Adyen\Model\Management\Currency[]', 'sources' => 'string[]' @@ -59,6 +60,7 @@ class Configuration implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'brand' => null, + 'commercial' => null, 'country' => null, 'currencies' => null, 'sources' => null @@ -71,6 +73,7 @@ class Configuration implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'brand' => false, + 'commercial' => false, 'country' => false, 'currencies' => false, 'sources' => false @@ -163,6 +166,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'brand' => 'brand', + 'commercial' => 'commercial', 'country' => 'country', 'currencies' => 'currencies', 'sources' => 'sources' @@ -175,6 +179,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'brand' => 'setBrand', + 'commercial' => 'setCommercial', 'country' => 'setCountry', 'currencies' => 'setCurrencies', 'sources' => 'setSources' @@ -187,6 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'brand' => 'getBrand', + 'commercial' => 'getCommercial', 'country' => 'getCountry', 'currencies' => 'getCurrencies', 'sources' => 'getSources' @@ -250,6 +256,7 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('brand', $data ?? [], null); + $this->setIfExists('commercial', $data ?? [], null); $this->setIfExists('country', $data ?? [], null); $this->setIfExists('currencies', $data ?? [], null); $this->setIfExists('sources', $data ?? [], null); @@ -327,6 +334,30 @@ public function setBrand($brand) return $this; } + /** + * Gets commercial + * + * @return bool|null + */ + public function getCommercial() + { + return $this->container['commercial']; + } + + /** + * Sets commercial + * + * @param bool|null $commercial Set to **true** to apply surcharges only to commercial/business cards. + * + * @return self + */ + public function setCommercial($commercial) + { + $this->container['commercial'] = $commercial; + + return $this; + } + /** * Gets country * @@ -340,7 +371,7 @@ public function getCountry() /** * Sets country * - * @param string[]|null $country Countries, to filter different surcharge amounts for domestic or international cards. + * @param string[]|null $country The country/region of the card issuer. If used, the surcharge settings only apply to the card issued in that country/region. * * @return self */ @@ -364,7 +395,7 @@ public function getCurrencies() /** * Sets currencies * - * @param \Adyen\Model\Management\Currency[] $currencies Currency, and surcharge percentage or amount. + * @param \Adyen\Model\Management\Currency[] $currencies Currency and percentage or amount of the surcharge. * * @return self */ diff --git a/src/Adyen/Model/Management/Currency.php b/src/Adyen/Model/Management/Currency.php index 26b981e4e..776e248fd 100644 --- a/src/Adyen/Model/Management/Currency.php +++ b/src/Adyen/Model/Management/Currency.php @@ -46,6 +46,7 @@ class Currency implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'amount' => 'int', 'currencyCode' => 'string', + 'maxAmount' => 'int', 'percentage' => 'double' ]; @@ -59,6 +60,7 @@ class Currency implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'amount' => 'int32', 'currencyCode' => null, + 'maxAmount' => 'int32', 'percentage' => 'double' ]; @@ -70,6 +72,7 @@ class Currency implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPINullables = [ 'amount' => true, 'currencyCode' => false, + 'maxAmount' => true, 'percentage' => false ]; @@ -161,6 +164,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'amount' => 'amount', 'currencyCode' => 'currencyCode', + 'maxAmount' => 'maxAmount', 'percentage' => 'percentage' ]; @@ -172,6 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'amount' => 'setAmount', 'currencyCode' => 'setCurrencyCode', + 'maxAmount' => 'setMaxAmount', 'percentage' => 'setPercentage' ]; @@ -183,6 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'amount' => 'getAmount', 'currencyCode' => 'getCurrencyCode', + 'maxAmount' => 'getMaxAmount', 'percentage' => 'getPercentage' ]; @@ -245,6 +251,7 @@ public function __construct(array $data = null) { $this->setIfExists('amount', $data ?? [], null); $this->setIfExists('currencyCode', $data ?? [], null); + $this->setIfExists('maxAmount', $data ?? [], null); $this->setIfExists('percentage', $data ?? [], null); } @@ -341,6 +348,30 @@ public function setCurrencyCode($currencyCode) return $this; } + /** + * Gets maxAmount + * + * @return int|null + */ + public function getMaxAmount() + { + return $this->container['maxAmount']; + } + + /** + * Sets maxAmount + * + * @param int|null $maxAmount The maximum surcharge amount per transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setMaxAmount($maxAmount) + { + $this->container['maxAmount'] = $maxAmount; + + return $this; + } + /** * Gets percentage * diff --git a/src/Adyen/Model/Management/JCBInfo.php b/src/Adyen/Model/Management/JCBInfo.php new file mode 100644 index 000000000..ee0d0678e --- /dev/null +++ b/src/Adyen/Model/Management/JCBInfo.php @@ -0,0 +1,536 @@ + + */ +class JCBInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'JCBInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'midNumber' => 'string', + 'reuseMidNumber' => 'bool', + 'serviceLevel' => 'string', + 'transactionDescription' => '\Adyen\Model\Management\TransactionDescriptionInfo' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'midNumber' => null, + 'reuseMidNumber' => null, + 'serviceLevel' => null, + 'transactionDescription' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'midNumber' => false, + 'reuseMidNumber' => false, + 'serviceLevel' => false, + 'transactionDescription' => 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 = [ + 'midNumber' => 'midNumber', + 'reuseMidNumber' => 'reuseMidNumber', + 'serviceLevel' => 'serviceLevel', + 'transactionDescription' => 'transactionDescription' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'midNumber' => 'setMidNumber', + 'reuseMidNumber' => 'setReuseMidNumber', + 'serviceLevel' => 'setServiceLevel', + 'transactionDescription' => 'setTransactionDescription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'midNumber' => 'getMidNumber', + 'reuseMidNumber' => 'getReuseMidNumber', + 'serviceLevel' => 'getServiceLevel', + 'transactionDescription' => 'getTransactionDescription' + ]; + + /** + * 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 SERVICE_LEVEL_NO_CONTRACT = 'noContract'; + public const SERVICE_LEVEL_GATEWAY_CONTRACT = 'gatewayContract'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getServiceLevelAllowableValues() + { + return [ + self::SERVICE_LEVEL_NO_CONTRACT, + self::SERVICE_LEVEL_GATEWAY_CONTRACT, + ]; + } + /** + * 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('midNumber', $data ?? [], null); + $this->setIfExists('reuseMidNumber', $data ?? [], null); + $this->setIfExists('serviceLevel', $data ?? [], null); + $this->setIfExists('transactionDescription', $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['serviceLevel'] === null) { + $invalidProperties[] = "'serviceLevel' can't be null"; + } + $allowedValues = $this->getServiceLevelAllowableValues(); + if (!is_null($this->container['serviceLevel']) && !in_array($this->container['serviceLevel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'serviceLevel', must be one of '%s'", + $this->container['serviceLevel'], + 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 midNumber + * + * @return string|null + */ + public function getMidNumber() + { + return $this->container['midNumber']; + } + + /** + * Sets midNumber + * + * @param string|null $midNumber MID (Merchant ID) number. Format: 10 numeric characters. Must be provided for both `noContract` and `gatewayContract` service levels. + * + * @return self + */ + public function setMidNumber($midNumber) + { + $this->container['midNumber'] = $midNumber; + + return $this; + } + + /** + * Gets reuseMidNumber + * + * @return bool|null + */ + public function getReuseMidNumber() + { + return $this->container['reuseMidNumber']; + } + + /** + * Sets reuseMidNumber + * + * @param bool|null $reuseMidNumber Indicates whether the JCB Merchant ID is reused from a previously setup JCB payment method. This is applicable for both `noContract` and `gatewayContract` service levels. The default value is `false`. + * + * @return self + */ + public function setReuseMidNumber($reuseMidNumber) + { + $this->container['reuseMidNumber'] = $reuseMidNumber; + + return $this; + } + + /** + * Gets serviceLevel + * + * @return string + */ + public function getServiceLevel() + { + return $this->container['serviceLevel']; + } + + /** + * Sets serviceLevel + * + * @param string $serviceLevel Specifies the service level (settlement type) of this payment method. Possible values: * **noContract** — Adyen holds the contract with JCB. * **gatewayContract** — JCB receives the settlement and handles disputes. They then pay out to the merchant directly. + * + * @return self + */ + public function setServiceLevel($serviceLevel) + { + $allowedValues = $this->getServiceLevelAllowableValues(); + if (!in_array($serviceLevel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'serviceLevel', must be one of '%s'", + $serviceLevel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['serviceLevel'] = $serviceLevel; + + return $this; + } + + /** + * Gets transactionDescription + * + * @return \Adyen\Model\Management\TransactionDescriptionInfo|null + */ + public function getTransactionDescription() + { + return $this->container['transactionDescription']; + } + + /** + * Sets transactionDescription + * + * @param \Adyen\Model\Management\TransactionDescriptionInfo|null $transactionDescription transactionDescription + * + * @return self + */ + public function setTransactionDescription($transactionDescription) + { + $this->container['transactionDescription'] = $transactionDescription; + + 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/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/PaymentMethod.php b/src/Adyen/Model/Management/PaymentMethod.php index c5ca5810b..8e0695acb 100644 --- a/src/Adyen/Model/Management/PaymentMethod.php +++ b/src/Adyen/Model/Management/PaymentMethod.php @@ -67,7 +67,7 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'string', 'ideal' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'interacCard' => '\Adyen\Model\Management\GenericPmWithTdiInfo', - 'jcb' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'jcb' => '\Adyen\Model\Management\JCBInfo', 'klarna' => '\Adyen\Model\Management\KlarnaInfo', 'maestro' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'mc' => '\Adyen\Model\Management\GenericPmWithTdiInfo', @@ -1183,7 +1183,7 @@ public function setInteracCard($interacCard) /** * Gets jcb * - * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + * @return \Adyen\Model\Management\JCBInfo|null */ public function getJcb() { @@ -1193,7 +1193,7 @@ public function getJcb() /** * Sets jcb * - * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $jcb jcb + * @param \Adyen\Model\Management\JCBInfo|null $jcb jcb * * @return self */ diff --git a/src/Adyen/Model/Management/PaymentMethodSetupInfo.php b/src/Adyen/Model/Management/PaymentMethodSetupInfo.php index 130cb4341..43abf3320 100644 --- a/src/Adyen/Model/Management/PaymentMethodSetupInfo.php +++ b/src/Adyen/Model/Management/PaymentMethodSetupInfo.php @@ -64,7 +64,7 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'googlePay' => '\Adyen\Model\Management\GooglePayInfo', 'ideal' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'interacCard' => '\Adyen\Model\Management\GenericPmWithTdiInfo', - 'jcb' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'jcb' => '\Adyen\Model\Management\JCBInfo', 'klarna' => '\Adyen\Model\Management\KlarnaInfo', 'maestro' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'mc' => '\Adyen\Model\Management\GenericPmWithTdiInfo', @@ -1246,7 +1246,7 @@ public function setInteracCard($interacCard) /** * Gets jcb * - * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + * @return \Adyen\Model\Management\JCBInfo|null */ public function getJcb() { @@ -1256,7 +1256,7 @@ public function getJcb() /** * Sets jcb * - * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $jcb jcb + * @param \Adyen\Model\Management\JCBInfo|null $jcb jcb * * @return self */ diff --git a/src/Adyen/Model/Management/SplitConfiguration.php b/src/Adyen/Model/Management/SplitConfiguration.php index 1881b181c..9c009d5ad 100644 --- a/src/Adyen/Model/Management/SplitConfiguration.php +++ b/src/Adyen/Model/Management/SplitConfiguration.php @@ -46,8 +46,7 @@ class SplitConfiguration implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPITypes = [ 'description' => 'string', 'rules' => '\Adyen\Model\Management\SplitConfigurationRule[]', - 'splitConfigurationId' => 'string', - 'stores' => 'string[]' + 'splitConfigurationId' => 'string' ]; /** @@ -60,8 +59,7 @@ class SplitConfiguration implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPIFormats = [ 'description' => null, 'rules' => null, - 'splitConfigurationId' => null, - 'stores' => null + 'splitConfigurationId' => null ]; /** @@ -72,8 +70,7 @@ class SplitConfiguration implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPINullables = [ 'description' => false, 'rules' => false, - 'splitConfigurationId' => false, - 'stores' => false + 'splitConfigurationId' => false ]; /** @@ -164,8 +161,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'description' => 'description', 'rules' => 'rules', - 'splitConfigurationId' => 'splitConfigurationId', - 'stores' => 'stores' + 'splitConfigurationId' => 'splitConfigurationId' ]; /** @@ -176,8 +172,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'description' => 'setDescription', 'rules' => 'setRules', - 'splitConfigurationId' => 'setSplitConfigurationId', - 'stores' => 'setStores' + 'splitConfigurationId' => 'setSplitConfigurationId' ]; /** @@ -188,8 +183,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'description' => 'getDescription', 'rules' => 'getRules', - 'splitConfigurationId' => 'getSplitConfigurationId', - 'stores' => 'getStores' + 'splitConfigurationId' => 'getSplitConfigurationId' ]; /** @@ -252,7 +246,6 @@ public function __construct(array $data = null) $this->setIfExists('description', $data ?? [], null); $this->setIfExists('rules', $data ?? [], null); $this->setIfExists('splitConfigurationId', $data ?? [], null); - $this->setIfExists('stores', $data ?? [], null); } /** @@ -374,30 +367,6 @@ public function setSplitConfigurationId($splitConfigurationId) return $this; } - - /** - * Gets stores - * - * @return string[]|null - */ - public function getStores() - { - return $this->container['stores']; - } - - /** - * Sets stores - * - * @param string[]|null $stores List of stores to which the split configuration applies. - * - * @return self - */ - public function setStores($stores) - { - $this->container['stores'] = $stores; - - return $this; - } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Management/Surcharge.php b/src/Adyen/Model/Management/Surcharge.php index d9dd59824..3c7edb019 100644 --- a/src/Adyen/Model/Management/Surcharge.php +++ b/src/Adyen/Model/Management/Surcharge.php @@ -320,7 +320,7 @@ public function getConfigurations() /** * Sets configurations * - * @param \Adyen\Model\Management\Configuration[]|null $configurations Surcharge fees or percentages for specific payment methods, funding sources (credit or debit), and currencies. + * @param \Adyen\Model\Management\Configuration[]|null $configurations Surcharge fees or percentages for specific cards, funding sources (credit or debit), and currencies. * * @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/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/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/Payments/Split.php b/src/Adyen/Model/Payments/Split.php index 15895a7e3..13c6b6c52 100644 --- a/src/Adyen/Model/Payments/Split.php +++ b/src/Adyen/Model/Payments/Split.php @@ -465,7 +465,7 @@ public function getType() /** * Sets type * - * @param string $type The part of the payment you want to book to the specified `account`. Possible values for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books part of the payment (specified in `amount`) to the specified `account`. * Transaction fees types that you can book to the specified `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the transaction fees due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the transaction fees due to Adyen under [Interchange ++ pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: your platform's commission on the payment (specified in `amount`), booked to your liable balance account. * **Remainder**: the amount left over after a currency conversion, booked to the specified `account`. * **TopUp**: allows you and your users to top up balance accounts using direct debit, card payments, or other payment methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms liable balance account. * **Commission**: your platform's commission (specified in `amount`) on the payment, booked to your liable balance account. * **Default**: in very specific use cases, allows you to book the specified `amount` to the specified `account`. For more information, contact Adyen support. Possible values for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, **Marketplace**, **PaymentFee**, **VAT**. + * @param string $type The part of the payment you want to book to the specified `account`. Possible values for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books part of the payment (specified in `amount`) to the specified `account`. * Transaction fees types that you can book to the specified `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the transaction fees due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the transaction fees due to Adyen under [Interchange ++ pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: your platform's commission on the payment (specified in `amount`), booked to your liable balance account. * **Remainder**: the amount left over after a currency conversion, booked to the specified `account`. * **TopUp**: allows you and your users to top up balance accounts using direct debit, card payments, or other payment methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms liable balance account. * **Commission**: your platform's commission (specified in `amount`) on the payment, booked to your liable balance account. * **Default**: in very specific use cases, allows you to book the specified `amount` to the specified `account`. For more information, contact Adyen support. Possible values for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. * * @return self */ diff --git a/src/Adyen/Model/PaymentsApp/ObjectSerializer.php b/src/Adyen/Model/PaymentsApp/ObjectSerializer.php index b900dc2bd..56c51256a 100644 --- a/src/Adyen/Model/PaymentsApp/ObjectSerializer.php +++ b/src/Adyen/Model/PaymentsApp/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/ObjectSerializer.php b/src/Adyen/Model/PosMobile/ObjectSerializer.php index ae87baef9..ba0e91ceb 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,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/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/ReportWebhooks/ReportNotificationData.php b/src/Adyen/Model/ReportWebhooks/ReportNotificationData.php index a64f86a99..897e96b86 100644 --- a/src/Adyen/Model/ReportWebhooks/ReportNotificationData.php +++ b/src/Adyen/Model/ReportWebhooks/ReportNotificationData.php @@ -484,7 +484,7 @@ public function getReportType() /** * Sets reportType * - * @param string $reportType Type of report. + * @param string $reportType The type of report. Possible values: - `balanceplatform_accounting_interactive_report` - `balanceplatform_accounting_report` - `balanceplatform_balance_report` - `balanceplatform_fee_report` - `balanceplatform_payment_instrument_report` - `balanceplatform_payout_report` - `balanceplatform_statement_report` * * @return self */ 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/DirectDebitInformation.php b/src/Adyen/Model/TransferWebhooks/DirectDebitInformation.php new file mode 100644 index 000000000..85df4239b --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/DirectDebitInformation.php @@ -0,0 +1,500 @@ + + */ +class DirectDebitInformation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DirectDebitInformation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'dateOfSignature' => '\DateTime', + 'dueDate' => '\DateTime', + 'mandateId' => 'string', + 'sequenceType' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'dateOfSignature' => 'date-time', + 'dueDate' => 'date-time', + 'mandateId' => null, + 'sequenceType' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'dateOfSignature' => false, + 'dueDate' => false, + 'mandateId' => false, + 'sequenceType' => 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 = [ + 'dateOfSignature' => 'dateOfSignature', + 'dueDate' => 'dueDate', + 'mandateId' => 'mandateId', + 'sequenceType' => 'sequenceType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'dateOfSignature' => 'setDateOfSignature', + 'dueDate' => 'setDueDate', + 'mandateId' => 'setMandateId', + 'sequenceType' => 'setSequenceType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'dateOfSignature' => 'getDateOfSignature', + 'dueDate' => 'getDueDate', + 'mandateId' => 'getMandateId', + 'sequenceType' => 'getSequenceType' + ]; + + /** + * 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('dateOfSignature', $data ?? [], null); + $this->setIfExists('dueDate', $data ?? [], null); + $this->setIfExists('mandateId', $data ?? [], null); + $this->setIfExists('sequenceType', $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 dateOfSignature + * + * @return \DateTime|null + */ + public function getDateOfSignature() + { + return $this->container['dateOfSignature']; + } + + /** + * Sets dateOfSignature + * + * @param \DateTime|null $dateOfSignature The date when the direct debit mandate was accepted by your user, in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. + * + * @return self + */ + public function setDateOfSignature($dateOfSignature) + { + $this->container['dateOfSignature'] = $dateOfSignature; + + return $this; + } + + /** + * Gets dueDate + * + * @return \DateTime|null + */ + public function getDueDate() + { + return $this->container['dueDate']; + } + + /** + * Sets dueDate + * + * @param \DateTime|null $dueDate The date when the funds are deducted from your user's balance account. + * + * @return self + */ + public function setDueDate($dueDate) + { + $this->container['dueDate'] = $dueDate; + + return $this; + } + + /** + * Gets mandateId + * + * @return string|null + */ + public function getMandateId() + { + return $this->container['mandateId']; + } + + /** + * Sets mandateId + * + * @param string|null $mandateId Your unique identifier for the direct debit mandate. + * + * @return self + */ + public function setMandateId($mandateId) + { + $this->container['mandateId'] = $mandateId; + + return $this; + } + + /** + * Gets sequenceType + * + * @return string|null + */ + public function getSequenceType() + { + return $this->container['sequenceType']; + } + + /** + * Sets sequenceType + * + * @param string|null $sequenceType Identifies the direct debit transfer's type. Possible values: **OneOff**, **First**, **Recurring**, **Final**. + * + * @return self + */ + public function setSequenceType($sequenceType) + { + $this->container['sequenceType'] = $sequenceType; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/Modification.php b/src/Adyen/Model/TransferWebhooks/Modification.php index b91226ec7..2509641a7 100644 --- a/src/Adyen/Model/TransferWebhooks/Modification.php +++ b/src/Adyen/Model/TransferWebhooks/Modification.php @@ -291,6 +291,7 @@ public function getModelName() public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; public const STATUS_PENDING_APPROVAL = 'pendingApproval'; + public const STATUS_PENDING_EXECUTION = 'pendingExecution'; public const STATUS_RECEIVED = 'received'; public const STATUS_REFUND_PENDING = 'refundPending'; public const STATUS_REFUND_REVERSAL_PENDING = 'refundReversalPending'; @@ -366,6 +367,7 @@ public function getStatusAllowableValues() self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, self::STATUS_PENDING_APPROVAL, + self::STATUS_PENDING_EXECUTION, self::STATUS_RECEIVED, self::STATUS_REFUND_PENDING, self::STATUS_REFUND_REVERSAL_PENDING, 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/TransferData.php b/src/Adyen/Model/TransferWebhooks/TransferData.php index 311e60ce0..226fccfb8 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferData.php +++ b/src/Adyen/Model/TransferWebhooks/TransferData.php @@ -54,6 +54,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'counterparty' => '\Adyen\Model\TransferWebhooks\TransferNotificationCounterParty', 'creationDate' => '\DateTime', 'description' => 'string', + 'directDebitInformation' => '\Adyen\Model\TransferWebhooks\DirectDebitInformation', 'direction' => 'string', 'events' => '\Adyen\Model\TransferWebhooks\TransferEvent[]', 'id' => 'string', @@ -61,6 +62,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'reason' => 'string', 'reference' => 'string', 'referenceForBeneficiary' => 'string', + 'review' => '\Adyen\Model\TransferWebhooks\TransferReview', 'sequenceNumber' => 'int', 'status' => 'string', 'tracking' => '\Adyen\Model\TransferWebhooks\TransferDataTracking', @@ -86,6 +88,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'counterparty' => null, 'creationDate' => 'date-time', 'description' => null, + 'directDebitInformation' => null, 'direction' => null, 'events' => null, 'id' => null, @@ -93,6 +96,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'reason' => null, 'reference' => null, 'referenceForBeneficiary' => null, + 'review' => null, 'sequenceNumber' => 'int32', 'status' => null, 'tracking' => null, @@ -116,6 +120,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'counterparty' => false, 'creationDate' => false, 'description' => false, + 'directDebitInformation' => false, 'direction' => false, 'events' => false, 'id' => false, @@ -123,6 +128,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'reason' => false, 'reference' => false, 'referenceForBeneficiary' => false, + 'review' => false, 'sequenceNumber' => true, 'status' => false, 'tracking' => false, @@ -226,6 +232,7 @@ public function isNullableSetToNull(string $property): bool 'counterparty' => 'counterparty', 'creationDate' => 'creationDate', 'description' => 'description', + 'directDebitInformation' => 'directDebitInformation', 'direction' => 'direction', 'events' => 'events', 'id' => 'id', @@ -233,6 +240,7 @@ public function isNullableSetToNull(string $property): bool 'reason' => 'reason', 'reference' => 'reference', 'referenceForBeneficiary' => 'referenceForBeneficiary', + 'review' => 'review', 'sequenceNumber' => 'sequenceNumber', 'status' => 'status', 'tracking' => 'tracking', @@ -256,6 +264,7 @@ public function isNullableSetToNull(string $property): bool 'counterparty' => 'setCounterparty', 'creationDate' => 'setCreationDate', 'description' => 'setDescription', + 'directDebitInformation' => 'setDirectDebitInformation', 'direction' => 'setDirection', 'events' => 'setEvents', 'id' => 'setId', @@ -263,6 +272,7 @@ public function isNullableSetToNull(string $property): bool 'reason' => 'setReason', 'reference' => 'setReference', 'referenceForBeneficiary' => 'setReferenceForBeneficiary', + 'review' => 'setReview', 'sequenceNumber' => 'setSequenceNumber', 'status' => 'setStatus', 'tracking' => 'setTracking', @@ -286,6 +296,7 @@ public function isNullableSetToNull(string $property): bool 'counterparty' => 'getCounterparty', 'creationDate' => 'getCreationDate', 'description' => 'getDescription', + 'directDebitInformation' => 'getDirectDebitInformation', 'direction' => 'getDirection', 'events' => 'getEvents', 'id' => 'getId', @@ -293,6 +304,7 @@ public function isNullableSetToNull(string $property): bool 'reason' => 'getReason', 'reference' => 'getReference', 'referenceForBeneficiary' => 'getReferenceForBeneficiary', + 'review' => 'getReview', 'sequenceNumber' => 'getSequenceNumber', 'status' => 'getStatus', 'tracking' => 'getTracking', @@ -348,6 +360,7 @@ public function getModelName() public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; public const DIRECTION_INCOMING = 'incoming'; public const DIRECTION_OUTGOING = 'outgoing'; + public const REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE = 'accountHierarchyNotActive'; public const REASON_AMOUNT_LIMIT_EXCEEDED = 'amountLimitExceeded'; public const REASON_APPROVED = 'approved'; public const REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE = 'balanceAccountTemporarilyBlockedByTransactionRule'; @@ -359,12 +372,15 @@ public function getModelName() public const REASON_COUNTERPARTY_BANK_UNAVAILABLE = 'counterpartyBankUnavailable'; public const REASON_DECLINED = 'declined'; public const REASON_DECLINED_BY_TRANSACTION_RULE = 'declinedByTransactionRule'; + public const REASON_DIRECT_DEBIT_NOT_SUPPORTED = 'directDebitNotSupported'; public const REASON_ERROR = 'error'; public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; public const REASON_PENDING_APPROVAL = 'pendingApproval'; + public const REASON_PENDING_EXECUTION = 'pendingExecution'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; + public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; public const REASON_UNKNOWN = 'unknown'; public const STATUS_APPROVAL_PENDING = 'approvalPending'; public const STATUS_ATM_WITHDRAWAL = 'atmWithdrawal'; @@ -418,6 +434,7 @@ public function getModelName() public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; public const STATUS_PENDING_APPROVAL = 'pendingApproval'; + public const STATUS_PENDING_EXECUTION = 'pendingExecution'; public const STATUS_RECEIVED = 'received'; public const STATUS_REFUND_PENDING = 'refundPending'; public const STATUS_REFUND_REVERSAL_PENDING = 'refundReversalPending'; @@ -506,6 +523,7 @@ public function getDirectionAllowableValues() public function getReasonAllowableValues() { return [ + self::REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE, self::REASON_AMOUNT_LIMIT_EXCEEDED, self::REASON_APPROVED, self::REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE, @@ -517,12 +535,15 @@ public function getReasonAllowableValues() self::REASON_COUNTERPARTY_BANK_UNAVAILABLE, self::REASON_DECLINED, self::REASON_DECLINED_BY_TRANSACTION_RULE, + self::REASON_DIRECT_DEBIT_NOT_SUPPORTED, self::REASON_ERROR, self::REASON_NOT_ENOUGH_BALANCE, self::REASON_PENDING_APPROVAL, + self::REASON_PENDING_EXECUTION, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, + self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, self::REASON_UNKNOWN, ]; } @@ -586,6 +607,7 @@ public function getStatusAllowableValues() self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, self::STATUS_PENDING_APPROVAL, + self::STATUS_PENDING_EXECUTION, self::STATUS_RECEIVED, self::STATUS_REFUND_PENDING, self::STATUS_REFUND_REVERSAL_PENDING, @@ -675,6 +697,7 @@ public function __construct(array $data = null) $this->setIfExists('counterparty', $data ?? [], null); $this->setIfExists('creationDate', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('directDebitInformation', $data ?? [], null); $this->setIfExists('direction', $data ?? [], null); $this->setIfExists('events', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); @@ -682,6 +705,7 @@ public function __construct(array $data = null) $this->setIfExists('reason', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('referenceForBeneficiary', $data ?? [], null); + $this->setIfExists('review', $data ?? [], null); $this->setIfExists('sequenceNumber', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('tracking', $data ?? [], null); @@ -1035,6 +1059,30 @@ public function setDescription($description) return $this; } + /** + * Gets directDebitInformation + * + * @return \Adyen\Model\TransferWebhooks\DirectDebitInformation|null + */ + public function getDirectDebitInformation() + { + return $this->container['directDebitInformation']; + } + + /** + * Sets directDebitInformation + * + * @param \Adyen\Model\TransferWebhooks\DirectDebitInformation|null $directDebitInformation directDebitInformation + * + * @return self + */ + public function setDirectDebitInformation($directDebitInformation) + { + $this->container['directDebitInformation'] = $directDebitInformation; + + return $this; + } + /** * Gets direction * @@ -1223,6 +1271,30 @@ public function setReferenceForBeneficiary($referenceForBeneficiary) return $this; } + /** + * Gets review + * + * @return \Adyen\Model\TransferWebhooks\TransferReview|null + */ + public function getReview() + { + return $this->container['review']; + } + + /** + * Sets review + * + * @param \Adyen\Model\TransferWebhooks\TransferReview|null $review review + * + * @return self + */ + public function setReview($review) + { + $this->container['review'] = $review; + + return $this; + } + /** * Gets sequenceNumber * diff --git a/src/Adyen/Model/TransferWebhooks/TransferEvent.php b/src/Adyen/Model/TransferWebhooks/TransferEvent.php index 12d52e12d..8577559cc 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferEvent.php +++ b/src/Adyen/Model/TransferWebhooks/TransferEvent.php @@ -311,6 +311,7 @@ public function getModelName() return self::$openAPIModelName; } + public const REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE = 'accountHierarchyNotActive'; public const REASON_AMOUNT_LIMIT_EXCEEDED = 'amountLimitExceeded'; public const REASON_APPROVED = 'approved'; public const REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE = 'balanceAccountTemporarilyBlockedByTransactionRule'; @@ -322,12 +323,15 @@ public function getModelName() public const REASON_COUNTERPARTY_BANK_UNAVAILABLE = 'counterpartyBankUnavailable'; public const REASON_DECLINED = 'declined'; public const REASON_DECLINED_BY_TRANSACTION_RULE = 'declinedByTransactionRule'; + public const REASON_DIRECT_DEBIT_NOT_SUPPORTED = 'directDebitNotSupported'; public const REASON_ERROR = 'error'; public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; public const REASON_PENDING_APPROVAL = 'pendingApproval'; + public const REASON_PENDING_EXECUTION = 'pendingExecution'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; + public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; public const REASON_UNKNOWN = 'unknown'; public const STATUS_APPROVAL_PENDING = 'approvalPending'; public const STATUS_ATM_WITHDRAWAL = 'atmWithdrawal'; @@ -381,6 +385,7 @@ public function getModelName() public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; public const STATUS_PENDING_APPROVAL = 'pendingApproval'; + public const STATUS_PENDING_EXECUTION = 'pendingExecution'; public const STATUS_RECEIVED = 'received'; public const STATUS_REFUND_PENDING = 'refundPending'; public const STATUS_REFUND_REVERSAL_PENDING = 'refundReversalPending'; @@ -406,6 +411,7 @@ public function getModelName() public function getReasonAllowableValues() { return [ + self::REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE, self::REASON_AMOUNT_LIMIT_EXCEEDED, self::REASON_APPROVED, self::REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE, @@ -417,12 +423,15 @@ public function getReasonAllowableValues() self::REASON_COUNTERPARTY_BANK_UNAVAILABLE, self::REASON_DECLINED, self::REASON_DECLINED_BY_TRANSACTION_RULE, + self::REASON_DIRECT_DEBIT_NOT_SUPPORTED, self::REASON_ERROR, self::REASON_NOT_ENOUGH_BALANCE, self::REASON_PENDING_APPROVAL, + self::REASON_PENDING_EXECUTION, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, + self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, self::REASON_UNKNOWN, ]; } @@ -486,6 +495,7 @@ public function getStatusAllowableValues() self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, self::STATUS_PENDING_APPROVAL, + self::STATUS_PENDING_EXECUTION, self::STATUS_RECEIVED, self::STATUS_REFUND_PENDING, self::STATUS_REFUND_REVERSAL_PENDING, diff --git a/src/Adyen/Model/TransferWebhooks/TransferReview.php b/src/Adyen/Model/TransferWebhooks/TransferReview.php new file mode 100644 index 000000000..0a5e192ba --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/TransferReview.php @@ -0,0 +1,504 @@ + + */ +class TransferReview implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferReview'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'numberOfApprovalsCompleted' => 'int', + 'numberOfApprovalsRequired' => 'int', + 'scaOnApproval' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'numberOfApprovalsCompleted' => 'int32', + 'numberOfApprovalsRequired' => 'int32', + 'scaOnApproval' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'numberOfApprovalsCompleted' => true, + 'numberOfApprovalsRequired' => true, + 'scaOnApproval' => 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 = [ + 'numberOfApprovalsCompleted' => 'numberOfApprovalsCompleted', + 'numberOfApprovalsRequired' => 'numberOfApprovalsRequired', + 'scaOnApproval' => 'scaOnApproval' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'numberOfApprovalsCompleted' => 'setNumberOfApprovalsCompleted', + 'numberOfApprovalsRequired' => 'setNumberOfApprovalsRequired', + 'scaOnApproval' => 'setScaOnApproval' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'numberOfApprovalsCompleted' => 'getNumberOfApprovalsCompleted', + 'numberOfApprovalsRequired' => 'getNumberOfApprovalsRequired', + 'scaOnApproval' => 'getScaOnApproval' + ]; + + /** + * 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 SCA_ON_APPROVAL_COMPLETED = 'completed'; + public const SCA_ON_APPROVAL_NOT_APPLICABLE = 'notApplicable'; + public const SCA_ON_APPROVAL_REQUIRED = 'required'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getScaOnApprovalAllowableValues() + { + return [ + self::SCA_ON_APPROVAL_COMPLETED, + self::SCA_ON_APPROVAL_NOT_APPLICABLE, + self::SCA_ON_APPROVAL_REQUIRED, + ]; + } + /** + * 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('numberOfApprovalsCompleted', $data ?? [], null); + $this->setIfExists('numberOfApprovalsRequired', $data ?? [], null); + $this->setIfExists('scaOnApproval', $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->getScaOnApprovalAllowableValues(); + if (!is_null($this->container['scaOnApproval']) && !in_array($this->container['scaOnApproval'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'scaOnApproval', must be one of '%s'", + $this->container['scaOnApproval'], + 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 numberOfApprovalsCompleted + * + * @return int|null + */ + public function getNumberOfApprovalsCompleted() + { + return $this->container['numberOfApprovalsCompleted']; + } + + /** + * Sets numberOfApprovalsCompleted + * + * @param int|null $numberOfApprovalsCompleted Shows the number of approvals completed for the transfer. + * + * @return self + */ + public function setNumberOfApprovalsCompleted($numberOfApprovalsCompleted) + { + $this->container['numberOfApprovalsCompleted'] = $numberOfApprovalsCompleted; + + return $this; + } + + /** + * Gets numberOfApprovalsRequired + * + * @return int|null + */ + public function getNumberOfApprovalsRequired() + { + return $this->container['numberOfApprovalsRequired']; + } + + /** + * Sets numberOfApprovalsRequired + * + * @param int|null $numberOfApprovalsRequired Shows the number of [approvals](https://docs.adyen.com/api-explorer/transfers/latest/post/transfers/approve) required to process the transfer. + * + * @return self + */ + public function setNumberOfApprovalsRequired($numberOfApprovalsRequired) + { + $this->container['numberOfApprovalsRequired'] = $numberOfApprovalsRequired; + + return $this; + } + + /** + * Gets scaOnApproval + * + * @return string|null + */ + public function getScaOnApproval() + { + return $this->container['scaOnApproval']; + } + + /** + * Sets scaOnApproval + * + * @param string|null $scaOnApproval Shows the status of the Strong Customer Authentication (SCA) process. Possible values: **required**, **completed**, **notApplicable**. + * + * @return self + */ + public function setScaOnApproval($scaOnApproval) + { + $allowedValues = $this->getScaOnApprovalAllowableValues(); + if (!in_array($scaOnApproval, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'scaOnApproval', must be one of '%s'", + $scaOnApproval, + implode("', '", $allowedValues) + ) + ); + } + $this->container['scaOnApproval'] = $scaOnApproval; + + 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/ApproveTransfersRequest.php b/src/Adyen/Model/Transfers/ApproveTransfersRequest.php new file mode 100644 index 000000000..0d815a5b5 --- /dev/null +++ b/src/Adyen/Model/Transfers/ApproveTransfersRequest.php @@ -0,0 +1,407 @@ + + */ +class ApproveTransfersRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ApproveTransfersRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'transferIds' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'transferIds' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'transferIds' => 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 = [ + 'transferIds' => 'transferIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'transferIds' => 'setTransferIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'transferIds' => 'getTransferIds' + ]; + + /** + * 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('transferIds', $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 transferIds + * + * @return string[]|null + */ + public function getTransferIds() + { + return $this->container['transferIds']; + } + + /** + * Sets transferIds + * + * @param string[]|null $transferIds Contains the unique identifiers of the transfers that you want to approve. + * + * @return self + */ + public function setTransferIds($transferIds) + { + $this->container['transferIds'] = $transferIds; + + 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/CancelTransfersRequest.php b/src/Adyen/Model/Transfers/CancelTransfersRequest.php new file mode 100644 index 000000000..85d2062cb --- /dev/null +++ b/src/Adyen/Model/Transfers/CancelTransfersRequest.php @@ -0,0 +1,407 @@ + + */ +class CancelTransfersRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CancelTransfersRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'transferIds' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'transferIds' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'transferIds' => 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 = [ + 'transferIds' => 'transferIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'transferIds' => 'setTransferIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'transferIds' => 'getTransferIds' + ]; + + /** + * 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('transferIds', $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 transferIds + * + * @return string[]|null + */ + public function getTransferIds() + { + return $this->container['transferIds']; + } + + /** + * Sets transferIds + * + * @param string[]|null $transferIds Contains the unique identifiers of the transfers that you want to cancel. + * + * @return self + */ + public function setTransferIds($transferIds) + { + $this->container['transferIds'] = $transferIds; + + 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/DirectDebitInformation.php b/src/Adyen/Model/Transfers/DirectDebitInformation.php new file mode 100644 index 000000000..7b1ce3fcd --- /dev/null +++ b/src/Adyen/Model/Transfers/DirectDebitInformation.php @@ -0,0 +1,500 @@ + + */ +class DirectDebitInformation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DirectDebitInformation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'dateOfSignature' => '\DateTime', + 'dueDate' => '\DateTime', + 'mandateId' => 'string', + 'sequenceType' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'dateOfSignature' => 'date-time', + 'dueDate' => 'date-time', + 'mandateId' => null, + 'sequenceType' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'dateOfSignature' => false, + 'dueDate' => false, + 'mandateId' => false, + 'sequenceType' => 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 = [ + 'dateOfSignature' => 'dateOfSignature', + 'dueDate' => 'dueDate', + 'mandateId' => 'mandateId', + 'sequenceType' => 'sequenceType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'dateOfSignature' => 'setDateOfSignature', + 'dueDate' => 'setDueDate', + 'mandateId' => 'setMandateId', + 'sequenceType' => 'setSequenceType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'dateOfSignature' => 'getDateOfSignature', + 'dueDate' => 'getDueDate', + 'mandateId' => 'getMandateId', + 'sequenceType' => 'getSequenceType' + ]; + + /** + * 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('dateOfSignature', $data ?? [], null); + $this->setIfExists('dueDate', $data ?? [], null); + $this->setIfExists('mandateId', $data ?? [], null); + $this->setIfExists('sequenceType', $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 dateOfSignature + * + * @return \DateTime|null + */ + public function getDateOfSignature() + { + return $this->container['dateOfSignature']; + } + + /** + * Sets dateOfSignature + * + * @param \DateTime|null $dateOfSignature The date when the direct debit mandate was accepted by your user, in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. + * + * @return self + */ + public function setDateOfSignature($dateOfSignature) + { + $this->container['dateOfSignature'] = $dateOfSignature; + + return $this; + } + + /** + * Gets dueDate + * + * @return \DateTime|null + */ + public function getDueDate() + { + return $this->container['dueDate']; + } + + /** + * Sets dueDate + * + * @param \DateTime|null $dueDate The date when the funds are deducted from your user's balance account. + * + * @return self + */ + public function setDueDate($dueDate) + { + $this->container['dueDate'] = $dueDate; + + return $this; + } + + /** + * Gets mandateId + * + * @return string|null + */ + public function getMandateId() + { + return $this->container['mandateId']; + } + + /** + * Sets mandateId + * + * @param string|null $mandateId Your unique identifier for the direct debit mandate. + * + * @return self + */ + public function setMandateId($mandateId) + { + $this->container['mandateId'] = $mandateId; + + return $this; + } + + /** + * Gets sequenceType + * + * @return string|null + */ + public function getSequenceType() + { + return $this->container['sequenceType']; + } + + /** + * Sets sequenceType + * + * @param string|null $sequenceType Identifies the direct debit transfer's type. Possible values: **OneOff**, **First**, **Recurring**, **Final**. + * + * @return self + */ + public function setSequenceType($sequenceType) + { + $this->container['sequenceType'] = $sequenceType; + + 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/Modification.php b/src/Adyen/Model/Transfers/Modification.php index 21d73423f..2b21fe03b 100644 --- a/src/Adyen/Model/Transfers/Modification.php +++ b/src/Adyen/Model/Transfers/Modification.php @@ -291,6 +291,7 @@ public function getModelName() public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; public const STATUS_PENDING_APPROVAL = 'pendingApproval'; + public const STATUS_PENDING_EXECUTION = 'pendingExecution'; public const STATUS_RECEIVED = 'received'; public const STATUS_REFUND_PENDING = 'refundPending'; public const STATUS_REFUND_REVERSAL_PENDING = 'refundReversalPending'; @@ -366,6 +367,7 @@ public function getStatusAllowableValues() self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, self::STATUS_PENDING_APPROVAL, + self::STATUS_PENDING_EXECUTION, self::STATUS_RECEIVED, self::STATUS_REFUND_PENDING, self::STATUS_REFUND_REVERSAL_PENDING, 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/Transfer.php b/src/Adyen/Model/Transfers/Transfer.php index 5de58ad67..1dc98acdd 100644 --- a/src/Adyen/Model/Transfers/Transfer.php +++ b/src/Adyen/Model/Transfers/Transfer.php @@ -52,12 +52,14 @@ class Transfer implements ModelInterface, ArrayAccess, \JsonSerializable 'counterparty' => '\Adyen\Model\Transfers\CounterpartyV3', 'creationDate' => '\DateTime', 'description' => 'string', + 'directDebitInformation' => '\Adyen\Model\Transfers\DirectDebitInformation', 'direction' => 'string', 'id' => 'string', 'paymentInstrument' => '\Adyen\Model\Transfers\PaymentInstrument', 'reason' => 'string', 'reference' => 'string', 'referenceForBeneficiary' => 'string', + 'review' => '\Adyen\Model\Transfers\TransferReview', 'status' => 'string', 'type' => 'string' ]; @@ -78,12 +80,14 @@ class Transfer implements ModelInterface, ArrayAccess, \JsonSerializable 'counterparty' => null, 'creationDate' => 'date-time', 'description' => null, + 'directDebitInformation' => null, 'direction' => null, 'id' => null, 'paymentInstrument' => null, 'reason' => null, 'reference' => null, 'referenceForBeneficiary' => null, + 'review' => null, 'status' => null, 'type' => null ]; @@ -102,12 +106,14 @@ class Transfer implements ModelInterface, ArrayAccess, \JsonSerializable 'counterparty' => false, 'creationDate' => false, 'description' => false, + 'directDebitInformation' => false, 'direction' => false, 'id' => false, 'paymentInstrument' => false, 'reason' => false, 'reference' => false, 'referenceForBeneficiary' => false, + 'review' => false, 'status' => false, 'type' => false ]; @@ -206,12 +212,14 @@ public function isNullableSetToNull(string $property): bool 'counterparty' => 'counterparty', 'creationDate' => 'creationDate', 'description' => 'description', + 'directDebitInformation' => 'directDebitInformation', 'direction' => 'direction', 'id' => 'id', 'paymentInstrument' => 'paymentInstrument', 'reason' => 'reason', 'reference' => 'reference', 'referenceForBeneficiary' => 'referenceForBeneficiary', + 'review' => 'review', 'status' => 'status', 'type' => 'type' ]; @@ -230,12 +238,14 @@ public function isNullableSetToNull(string $property): bool 'counterparty' => 'setCounterparty', 'creationDate' => 'setCreationDate', 'description' => 'setDescription', + 'directDebitInformation' => 'setDirectDebitInformation', 'direction' => 'setDirection', 'id' => 'setId', 'paymentInstrument' => 'setPaymentInstrument', 'reason' => 'setReason', 'reference' => 'setReference', 'referenceForBeneficiary' => 'setReferenceForBeneficiary', + 'review' => 'setReview', 'status' => 'setStatus', 'type' => 'setType' ]; @@ -254,12 +264,14 @@ public function isNullableSetToNull(string $property): bool 'counterparty' => 'getCounterparty', 'creationDate' => 'getCreationDate', 'description' => 'getDescription', + 'directDebitInformation' => 'getDirectDebitInformation', 'direction' => 'getDirection', 'id' => 'getId', 'paymentInstrument' => 'getPaymentInstrument', 'reason' => 'getReason', 'reference' => 'getReference', 'referenceForBeneficiary' => 'getReferenceForBeneficiary', + 'review' => 'getReview', 'status' => 'getStatus', 'type' => 'getType' ]; @@ -312,6 +324,7 @@ public function getModelName() public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; public const DIRECTION_INCOMING = 'incoming'; public const DIRECTION_OUTGOING = 'outgoing'; + public const REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE = 'accountHierarchyNotActive'; public const REASON_AMOUNT_LIMIT_EXCEEDED = 'amountLimitExceeded'; public const REASON_APPROVED = 'approved'; public const REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE = 'balanceAccountTemporarilyBlockedByTransactionRule'; @@ -323,12 +336,15 @@ public function getModelName() public const REASON_COUNTERPARTY_BANK_UNAVAILABLE = 'counterpartyBankUnavailable'; public const REASON_DECLINED = 'declined'; public const REASON_DECLINED_BY_TRANSACTION_RULE = 'declinedByTransactionRule'; + public const REASON_DIRECT_DEBIT_NOT_SUPPORTED = 'directDebitNotSupported'; public const REASON_ERROR = 'error'; public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; public const REASON_PENDING_APPROVAL = 'pendingApproval'; + public const REASON_PENDING_EXECUTION = 'pendingExecution'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; + public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; public const REASON_UNKNOWN = 'unknown'; public const STATUS_APPROVAL_PENDING = 'approvalPending'; public const STATUS_ATM_WITHDRAWAL = 'atmWithdrawal'; @@ -382,6 +398,7 @@ public function getModelName() public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; public const STATUS_PENDING_APPROVAL = 'pendingApproval'; + public const STATUS_PENDING_EXECUTION = 'pendingExecution'; public const STATUS_RECEIVED = 'received'; public const STATUS_REFUND_PENDING = 'refundPending'; public const STATUS_REFUND_REVERSAL_PENDING = 'refundReversalPending'; @@ -470,6 +487,7 @@ public function getDirectionAllowableValues() public function getReasonAllowableValues() { return [ + self::REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE, self::REASON_AMOUNT_LIMIT_EXCEEDED, self::REASON_APPROVED, self::REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE, @@ -481,12 +499,15 @@ public function getReasonAllowableValues() self::REASON_COUNTERPARTY_BANK_UNAVAILABLE, self::REASON_DECLINED, self::REASON_DECLINED_BY_TRANSACTION_RULE, + self::REASON_DIRECT_DEBIT_NOT_SUPPORTED, self::REASON_ERROR, self::REASON_NOT_ENOUGH_BALANCE, self::REASON_PENDING_APPROVAL, + self::REASON_PENDING_EXECUTION, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, + self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, self::REASON_UNKNOWN, ]; } @@ -550,6 +571,7 @@ public function getStatusAllowableValues() self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, self::STATUS_PENDING_APPROVAL, + self::STATUS_PENDING_EXECUTION, self::STATUS_RECEIVED, self::STATUS_REFUND_PENDING, self::STATUS_REFUND_REVERSAL_PENDING, @@ -637,12 +659,14 @@ public function __construct(array $data = null) $this->setIfExists('counterparty', $data ?? [], null); $this->setIfExists('creationDate', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('directDebitInformation', $data ?? [], null); $this->setIfExists('direction', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('paymentInstrument', $data ?? [], null); $this->setIfExists('reason', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('referenceForBeneficiary', $data ?? [], null); + $this->setIfExists('review', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -948,6 +972,30 @@ public function setDescription($description) return $this; } + /** + * Gets directDebitInformation + * + * @return \Adyen\Model\Transfers\DirectDebitInformation|null + */ + public function getDirectDebitInformation() + { + return $this->container['directDebitInformation']; + } + + /** + * Sets directDebitInformation + * + * @param \Adyen\Model\Transfers\DirectDebitInformation|null $directDebitInformation directDebitInformation + * + * @return self + */ + public function setDirectDebitInformation($directDebitInformation) + { + $this->container['directDebitInformation'] = $directDebitInformation; + + return $this; + } + /** * Gets direction * @@ -1112,6 +1160,30 @@ public function setReferenceForBeneficiary($referenceForBeneficiary) return $this; } + /** + * Gets review + * + * @return \Adyen\Model\Transfers\TransferReview|null + */ + public function getReview() + { + return $this->container['review']; + } + + /** + * Sets review + * + * @param \Adyen\Model\Transfers\TransferReview|null $review review + * + * @return self + */ + public function setReview($review) + { + $this->container['review'] = $review; + + return $this; + } + /** * Gets status * diff --git a/src/Adyen/Model/Transfers/TransferData.php b/src/Adyen/Model/Transfers/TransferData.php index 2e50d0f39..e969f985a 100644 --- a/src/Adyen/Model/Transfers/TransferData.php +++ b/src/Adyen/Model/Transfers/TransferData.php @@ -54,6 +54,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'counterparty' => '\Adyen\Model\Transfers\TransferNotificationCounterParty', 'creationDate' => '\DateTime', 'description' => 'string', + 'directDebitInformation' => '\Adyen\Model\Transfers\DirectDebitInformation', 'direction' => 'string', 'events' => '\Adyen\Model\Transfers\TransferEvent[]', 'id' => 'string', @@ -61,6 +62,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'reason' => 'string', 'reference' => 'string', 'referenceForBeneficiary' => 'string', + 'review' => '\Adyen\Model\Transfers\TransferReview', 'sequenceNumber' => 'int', 'status' => 'string', 'tracking' => '\Adyen\Model\Transfers\TransferDataTracking', @@ -86,6 +88,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'counterparty' => null, 'creationDate' => 'date-time', 'description' => null, + 'directDebitInformation' => null, 'direction' => null, 'events' => null, 'id' => null, @@ -93,6 +96,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'reason' => null, 'reference' => null, 'referenceForBeneficiary' => null, + 'review' => null, 'sequenceNumber' => 'int32', 'status' => null, 'tracking' => null, @@ -116,6 +120,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'counterparty' => false, 'creationDate' => false, 'description' => false, + 'directDebitInformation' => false, 'direction' => false, 'events' => false, 'id' => false, @@ -123,6 +128,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'reason' => false, 'reference' => false, 'referenceForBeneficiary' => false, + 'review' => false, 'sequenceNumber' => true, 'status' => false, 'tracking' => false, @@ -226,6 +232,7 @@ public function isNullableSetToNull(string $property): bool 'counterparty' => 'counterparty', 'creationDate' => 'creationDate', 'description' => 'description', + 'directDebitInformation' => 'directDebitInformation', 'direction' => 'direction', 'events' => 'events', 'id' => 'id', @@ -233,6 +240,7 @@ public function isNullableSetToNull(string $property): bool 'reason' => 'reason', 'reference' => 'reference', 'referenceForBeneficiary' => 'referenceForBeneficiary', + 'review' => 'review', 'sequenceNumber' => 'sequenceNumber', 'status' => 'status', 'tracking' => 'tracking', @@ -256,6 +264,7 @@ public function isNullableSetToNull(string $property): bool 'counterparty' => 'setCounterparty', 'creationDate' => 'setCreationDate', 'description' => 'setDescription', + 'directDebitInformation' => 'setDirectDebitInformation', 'direction' => 'setDirection', 'events' => 'setEvents', 'id' => 'setId', @@ -263,6 +272,7 @@ public function isNullableSetToNull(string $property): bool 'reason' => 'setReason', 'reference' => 'setReference', 'referenceForBeneficiary' => 'setReferenceForBeneficiary', + 'review' => 'setReview', 'sequenceNumber' => 'setSequenceNumber', 'status' => 'setStatus', 'tracking' => 'setTracking', @@ -286,6 +296,7 @@ public function isNullableSetToNull(string $property): bool 'counterparty' => 'getCounterparty', 'creationDate' => 'getCreationDate', 'description' => 'getDescription', + 'directDebitInformation' => 'getDirectDebitInformation', 'direction' => 'getDirection', 'events' => 'getEvents', 'id' => 'getId', @@ -293,6 +304,7 @@ public function isNullableSetToNull(string $property): bool 'reason' => 'getReason', 'reference' => 'getReference', 'referenceForBeneficiary' => 'getReferenceForBeneficiary', + 'review' => 'getReview', 'sequenceNumber' => 'getSequenceNumber', 'status' => 'getStatus', 'tracking' => 'getTracking', @@ -348,6 +360,7 @@ public function getModelName() public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; public const DIRECTION_INCOMING = 'incoming'; public const DIRECTION_OUTGOING = 'outgoing'; + public const REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE = 'accountHierarchyNotActive'; public const REASON_AMOUNT_LIMIT_EXCEEDED = 'amountLimitExceeded'; public const REASON_APPROVED = 'approved'; public const REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE = 'balanceAccountTemporarilyBlockedByTransactionRule'; @@ -359,12 +372,15 @@ public function getModelName() public const REASON_COUNTERPARTY_BANK_UNAVAILABLE = 'counterpartyBankUnavailable'; public const REASON_DECLINED = 'declined'; public const REASON_DECLINED_BY_TRANSACTION_RULE = 'declinedByTransactionRule'; + public const REASON_DIRECT_DEBIT_NOT_SUPPORTED = 'directDebitNotSupported'; public const REASON_ERROR = 'error'; public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; public const REASON_PENDING_APPROVAL = 'pendingApproval'; + public const REASON_PENDING_EXECUTION = 'pendingExecution'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; + public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; public const REASON_UNKNOWN = 'unknown'; public const STATUS_APPROVAL_PENDING = 'approvalPending'; public const STATUS_ATM_WITHDRAWAL = 'atmWithdrawal'; @@ -418,6 +434,7 @@ public function getModelName() public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; public const STATUS_PENDING_APPROVAL = 'pendingApproval'; + public const STATUS_PENDING_EXECUTION = 'pendingExecution'; public const STATUS_RECEIVED = 'received'; public const STATUS_REFUND_PENDING = 'refundPending'; public const STATUS_REFUND_REVERSAL_PENDING = 'refundReversalPending'; @@ -506,6 +523,7 @@ public function getDirectionAllowableValues() public function getReasonAllowableValues() { return [ + self::REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE, self::REASON_AMOUNT_LIMIT_EXCEEDED, self::REASON_APPROVED, self::REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE, @@ -517,12 +535,15 @@ public function getReasonAllowableValues() self::REASON_COUNTERPARTY_BANK_UNAVAILABLE, self::REASON_DECLINED, self::REASON_DECLINED_BY_TRANSACTION_RULE, + self::REASON_DIRECT_DEBIT_NOT_SUPPORTED, self::REASON_ERROR, self::REASON_NOT_ENOUGH_BALANCE, self::REASON_PENDING_APPROVAL, + self::REASON_PENDING_EXECUTION, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, + self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, self::REASON_UNKNOWN, ]; } @@ -586,6 +607,7 @@ public function getStatusAllowableValues() self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, self::STATUS_PENDING_APPROVAL, + self::STATUS_PENDING_EXECUTION, self::STATUS_RECEIVED, self::STATUS_REFUND_PENDING, self::STATUS_REFUND_REVERSAL_PENDING, @@ -675,6 +697,7 @@ public function __construct(array $data = null) $this->setIfExists('counterparty', $data ?? [], null); $this->setIfExists('creationDate', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('directDebitInformation', $data ?? [], null); $this->setIfExists('direction', $data ?? [], null); $this->setIfExists('events', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); @@ -682,6 +705,7 @@ public function __construct(array $data = null) $this->setIfExists('reason', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('referenceForBeneficiary', $data ?? [], null); + $this->setIfExists('review', $data ?? [], null); $this->setIfExists('sequenceNumber', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('tracking', $data ?? [], null); @@ -1035,6 +1059,30 @@ public function setDescription($description) return $this; } + /** + * Gets directDebitInformation + * + * @return \Adyen\Model\Transfers\DirectDebitInformation|null + */ + public function getDirectDebitInformation() + { + return $this->container['directDebitInformation']; + } + + /** + * Sets directDebitInformation + * + * @param \Adyen\Model\Transfers\DirectDebitInformation|null $directDebitInformation directDebitInformation + * + * @return self + */ + public function setDirectDebitInformation($directDebitInformation) + { + $this->container['directDebitInformation'] = $directDebitInformation; + + return $this; + } + /** * Gets direction * @@ -1223,6 +1271,30 @@ public function setReferenceForBeneficiary($referenceForBeneficiary) return $this; } + /** + * Gets review + * + * @return \Adyen\Model\Transfers\TransferReview|null + */ + public function getReview() + { + return $this->container['review']; + } + + /** + * Sets review + * + * @param \Adyen\Model\Transfers\TransferReview|null $review review + * + * @return self + */ + public function setReview($review) + { + $this->container['review'] = $review; + + return $this; + } + /** * Gets sequenceNumber * diff --git a/src/Adyen/Model/Transfers/TransferEvent.php b/src/Adyen/Model/Transfers/TransferEvent.php index f2a140d43..b892a6ad3 100644 --- a/src/Adyen/Model/Transfers/TransferEvent.php +++ b/src/Adyen/Model/Transfers/TransferEvent.php @@ -311,6 +311,7 @@ public function getModelName() return self::$openAPIModelName; } + public const REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE = 'accountHierarchyNotActive'; public const REASON_AMOUNT_LIMIT_EXCEEDED = 'amountLimitExceeded'; public const REASON_APPROVED = 'approved'; public const REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE = 'balanceAccountTemporarilyBlockedByTransactionRule'; @@ -322,12 +323,15 @@ public function getModelName() public const REASON_COUNTERPARTY_BANK_UNAVAILABLE = 'counterpartyBankUnavailable'; public const REASON_DECLINED = 'declined'; public const REASON_DECLINED_BY_TRANSACTION_RULE = 'declinedByTransactionRule'; + public const REASON_DIRECT_DEBIT_NOT_SUPPORTED = 'directDebitNotSupported'; public const REASON_ERROR = 'error'; public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; public const REASON_PENDING_APPROVAL = 'pendingApproval'; + public const REASON_PENDING_EXECUTION = 'pendingExecution'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; + public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; public const REASON_UNKNOWN = 'unknown'; public const STATUS_APPROVAL_PENDING = 'approvalPending'; public const STATUS_ATM_WITHDRAWAL = 'atmWithdrawal'; @@ -381,6 +385,7 @@ public function getModelName() public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; public const STATUS_PENDING_APPROVAL = 'pendingApproval'; + public const STATUS_PENDING_EXECUTION = 'pendingExecution'; public const STATUS_RECEIVED = 'received'; public const STATUS_REFUND_PENDING = 'refundPending'; public const STATUS_REFUND_REVERSAL_PENDING = 'refundReversalPending'; @@ -406,6 +411,7 @@ public function getModelName() public function getReasonAllowableValues() { return [ + self::REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE, self::REASON_AMOUNT_LIMIT_EXCEEDED, self::REASON_APPROVED, self::REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE, @@ -417,12 +423,15 @@ public function getReasonAllowableValues() self::REASON_COUNTERPARTY_BANK_UNAVAILABLE, self::REASON_DECLINED, self::REASON_DECLINED_BY_TRANSACTION_RULE, + self::REASON_DIRECT_DEBIT_NOT_SUPPORTED, self::REASON_ERROR, self::REASON_NOT_ENOUGH_BALANCE, self::REASON_PENDING_APPROVAL, + self::REASON_PENDING_EXECUTION, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, + self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, self::REASON_UNKNOWN, ]; } @@ -486,6 +495,7 @@ public function getStatusAllowableValues() self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, self::STATUS_PENDING_APPROVAL, + self::STATUS_PENDING_EXECUTION, self::STATUS_RECEIVED, self::STATUS_REFUND_PENDING, self::STATUS_REFUND_REVERSAL_PENDING, diff --git a/src/Adyen/Model/Transfers/TransferInfo.php b/src/Adyen/Model/Transfers/TransferInfo.php index cf46c0f11..27069bfa6 100644 --- a/src/Adyen/Model/Transfers/TransferInfo.php +++ b/src/Adyen/Model/Transfers/TransferInfo.php @@ -54,6 +54,7 @@ class TransferInfo implements ModelInterface, ArrayAccess, \JsonSerializable 'priority' => 'string', 'reference' => 'string', 'referenceForBeneficiary' => 'string', + 'review' => '\Adyen\Model\Transfers\TransferRequestReview', 'type' => 'string', 'ultimateParty' => '\Adyen\Model\Transfers\UltimatePartyIdentification' ]; @@ -76,6 +77,7 @@ class TransferInfo implements ModelInterface, ArrayAccess, \JsonSerializable 'priority' => null, 'reference' => null, 'referenceForBeneficiary' => null, + 'review' => null, 'type' => null, 'ultimateParty' => null ]; @@ -96,6 +98,7 @@ class TransferInfo implements ModelInterface, ArrayAccess, \JsonSerializable 'priority' => false, 'reference' => false, 'referenceForBeneficiary' => false, + 'review' => false, 'type' => false, 'ultimateParty' => false ]; @@ -196,6 +199,7 @@ public function isNullableSetToNull(string $property): bool 'priority' => 'priority', 'reference' => 'reference', 'referenceForBeneficiary' => 'referenceForBeneficiary', + 'review' => 'review', 'type' => 'type', 'ultimateParty' => 'ultimateParty' ]; @@ -216,6 +220,7 @@ public function isNullableSetToNull(string $property): bool 'priority' => 'setPriority', 'reference' => 'setReference', 'referenceForBeneficiary' => 'setReferenceForBeneficiary', + 'review' => 'setReview', 'type' => 'setType', 'ultimateParty' => 'setUltimateParty' ]; @@ -236,6 +241,7 @@ public function isNullableSetToNull(string $property): bool 'priority' => 'getPriority', 'reference' => 'getReference', 'referenceForBeneficiary' => 'getReferenceForBeneficiary', + 'review' => 'getReview', 'type' => 'getType', 'ultimateParty' => 'getUltimateParty' ]; @@ -387,6 +393,7 @@ public function __construct(array $data = null) $this->setIfExists('priority', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('referenceForBeneficiary', $data ?? [], null); + $this->setIfExists('review', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('ultimateParty', $data ?? [], null); } @@ -738,6 +745,30 @@ public function setReferenceForBeneficiary($referenceForBeneficiary) return $this; } + /** + * Gets review + * + * @return \Adyen\Model\Transfers\TransferRequestReview|null + */ + public function getReview() + { + return $this->container['review']; + } + + /** + * Sets review + * + * @param \Adyen\Model\Transfers\TransferRequestReview|null $review review + * + * @return self + */ + public function setReview($review) + { + $this->container['review'] = $review; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/Transfers/TransferRequestReview.php b/src/Adyen/Model/Transfers/TransferRequestReview.php new file mode 100644 index 000000000..27009aa31 --- /dev/null +++ b/src/Adyen/Model/Transfers/TransferRequestReview.php @@ -0,0 +1,438 @@ + + */ +class TransferRequestReview implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferRequestReview'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'numberOfApprovalsRequired' => 'int', + 'scaOnApproval' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'numberOfApprovalsRequired' => 'int32', + 'scaOnApproval' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'numberOfApprovalsRequired' => true, + 'scaOnApproval' => 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 = [ + 'numberOfApprovalsRequired' => 'numberOfApprovalsRequired', + 'scaOnApproval' => 'scaOnApproval' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'numberOfApprovalsRequired' => 'setNumberOfApprovalsRequired', + 'scaOnApproval' => 'setScaOnApproval' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'numberOfApprovalsRequired' => 'getNumberOfApprovalsRequired', + 'scaOnApproval' => 'getScaOnApproval' + ]; + + /** + * 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('numberOfApprovalsRequired', $data ?? [], null); + $this->setIfExists('scaOnApproval', $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 numberOfApprovalsRequired + * + * @return int|null + */ + public function getNumberOfApprovalsRequired() + { + return $this->container['numberOfApprovalsRequired']; + } + + /** + * Sets numberOfApprovalsRequired + * + * @param int|null $numberOfApprovalsRequired Specifies the number of [approvals](https://docs.adyen.com/api-explorer/transfers/latest/post/transfers/approve) required to process the transfer. + * + * @return self + */ + public function setNumberOfApprovalsRequired($numberOfApprovalsRequired) + { + $this->container['numberOfApprovalsRequired'] = $numberOfApprovalsRequired; + + return $this; + } + + /** + * Gets scaOnApproval + * + * @return bool|null + */ + public function getScaOnApproval() + { + return $this->container['scaOnApproval']; + } + + /** + * Sets scaOnApproval + * + * @param bool|null $scaOnApproval Specifies whether you will initiate Strong Customer Authentication (SCA) in thePOST [/transfers/approve](https://docs.adyen.com/api-explorer/transfers/latest/post/transfers/approve) request. Only applies to transfers made with an Adyen [business account](https://docs.adyen.com/platforms/business-accounts). + * + * @return self + */ + public function setScaOnApproval($scaOnApproval) + { + $this->container['scaOnApproval'] = $scaOnApproval; + + 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/TransferReview.php b/src/Adyen/Model/Transfers/TransferReview.php new file mode 100644 index 000000000..15bc6bfed --- /dev/null +++ b/src/Adyen/Model/Transfers/TransferReview.php @@ -0,0 +1,504 @@ + + */ +class TransferReview implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferReview'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'numberOfApprovalsCompleted' => 'int', + 'numberOfApprovalsRequired' => 'int', + 'scaOnApproval' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'numberOfApprovalsCompleted' => 'int32', + 'numberOfApprovalsRequired' => 'int32', + 'scaOnApproval' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'numberOfApprovalsCompleted' => true, + 'numberOfApprovalsRequired' => true, + 'scaOnApproval' => 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 = [ + 'numberOfApprovalsCompleted' => 'numberOfApprovalsCompleted', + 'numberOfApprovalsRequired' => 'numberOfApprovalsRequired', + 'scaOnApproval' => 'scaOnApproval' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'numberOfApprovalsCompleted' => 'setNumberOfApprovalsCompleted', + 'numberOfApprovalsRequired' => 'setNumberOfApprovalsRequired', + 'scaOnApproval' => 'setScaOnApproval' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'numberOfApprovalsCompleted' => 'getNumberOfApprovalsCompleted', + 'numberOfApprovalsRequired' => 'getNumberOfApprovalsRequired', + 'scaOnApproval' => 'getScaOnApproval' + ]; + + /** + * 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 SCA_ON_APPROVAL_COMPLETED = 'completed'; + public const SCA_ON_APPROVAL_NOT_APPLICABLE = 'notApplicable'; + public const SCA_ON_APPROVAL_REQUIRED = 'required'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getScaOnApprovalAllowableValues() + { + return [ + self::SCA_ON_APPROVAL_COMPLETED, + self::SCA_ON_APPROVAL_NOT_APPLICABLE, + self::SCA_ON_APPROVAL_REQUIRED, + ]; + } + /** + * 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('numberOfApprovalsCompleted', $data ?? [], null); + $this->setIfExists('numberOfApprovalsRequired', $data ?? [], null); + $this->setIfExists('scaOnApproval', $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->getScaOnApprovalAllowableValues(); + if (!is_null($this->container['scaOnApproval']) && !in_array($this->container['scaOnApproval'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'scaOnApproval', must be one of '%s'", + $this->container['scaOnApproval'], + 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 numberOfApprovalsCompleted + * + * @return int|null + */ + public function getNumberOfApprovalsCompleted() + { + return $this->container['numberOfApprovalsCompleted']; + } + + /** + * Sets numberOfApprovalsCompleted + * + * @param int|null $numberOfApprovalsCompleted Shows the number of approvals completed for the transfer. + * + * @return self + */ + public function setNumberOfApprovalsCompleted($numberOfApprovalsCompleted) + { + $this->container['numberOfApprovalsCompleted'] = $numberOfApprovalsCompleted; + + return $this; + } + + /** + * Gets numberOfApprovalsRequired + * + * @return int|null + */ + public function getNumberOfApprovalsRequired() + { + return $this->container['numberOfApprovalsRequired']; + } + + /** + * Sets numberOfApprovalsRequired + * + * @param int|null $numberOfApprovalsRequired Shows the number of [approvals](https://docs.adyen.com/api-explorer/transfers/latest/post/transfers/approve) required to process the transfer. + * + * @return self + */ + public function setNumberOfApprovalsRequired($numberOfApprovalsRequired) + { + $this->container['numberOfApprovalsRequired'] = $numberOfApprovalsRequired; + + return $this; + } + + /** + * Gets scaOnApproval + * + * @return string|null + */ + public function getScaOnApproval() + { + return $this->container['scaOnApproval']; + } + + /** + * Sets scaOnApproval + * + * @param string|null $scaOnApproval Shows the status of the Strong Customer Authentication (SCA) process. Possible values: **required**, **completed**, **notApplicable**. + * + * @return self + */ + public function setScaOnApproval($scaOnApproval) + { + $allowedValues = $this->getScaOnApprovalAllowableValues(); + if (!in_array($scaOnApproval, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'scaOnApproval', must be one of '%s'", + $scaOnApproval, + implode("', '", $allowedValues) + ) + ); + } + $this->container['scaOnApproval'] = $scaOnApproval; + + 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/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 index df3b7a28a..50ba91f10 100644 --- a/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php +++ b/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php @@ -60,13 +60,14 @@ 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 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/TaxEDeliveryConsentApi.php b/src/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentApi.php new file mode 100644 index 000000000..714550af5 --- /dev/null +++ b/src/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentApi.php @@ -0,0 +1,72 @@ +baseURL = $this->createBaseUrl("https://kyc-test.adyen.com/lem/v3"); + } + + /** + * Check the status of consent for electronic delivery of tax forms + * + * @param string $id + * @param array|null $requestOptions + * @return \Adyen\Model\LegalEntityManagement\CheckTaxElectronicDeliveryConsentResponse + * @throws AdyenException + */ + public function checkStatusOfConsentForElectronicDeliveryOfTaxForms(string $id, array $requestOptions = null): \Adyen\Model\LegalEntityManagement\CheckTaxElectronicDeliveryConsentResponse + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/legalEntities/{id}/checkTaxElectronicDeliveryConsent"); + $response = $this->requestHttp($endpoint, strtolower('POST'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\LegalEntityManagement\CheckTaxElectronicDeliveryConsentResponse::class); + } + + /** + * Set the consent status for electronic delivery of tax forms + * + * @param string $id + * @param \Adyen\Model\LegalEntityManagement\SetTaxElectronicDeliveryConsentRequest $setTaxElectronicDeliveryConsentRequest + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function setConsentStatusForElectronicDeliveryOfTaxForms(string $id, \Adyen\Model\LegalEntityManagement\SetTaxElectronicDeliveryConsentRequest $setTaxElectronicDeliveryConsentRequest, array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/legalEntities/{id}/setTaxElectronicDeliveryConsent"); + $this->requestHttp($endpoint, strtolower('POST'), (array) $setTaxElectronicDeliveryConsentRequest->jsonSerialize(), $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/Transfers/TransfersApi.php b/src/Adyen/Service/Transfers/TransfersApi.php index 7cd563a88..7b62cec32 100644 --- a/src/Adyen/Service/Transfers/TransfersApi.php +++ b/src/Adyen/Service/Transfers/TransfersApi.php @@ -39,6 +39,36 @@ public function __construct(Client $client) $this->baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/btl/v4"); } + /** + * Approve initiated transfers + * + * @param \Adyen\Model\Transfers\ApproveTransfersRequest $approveTransfersRequest + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function approveInitiatedTransfers(\Adyen\Model\Transfers\ApproveTransfersRequest $approveTransfersRequest, array $requestOptions = null) + { + $endpoint = $this->baseURL . "/transfers/approve"; + $this->requestHttp($endpoint, strtolower('POST'), (array) $approveTransfersRequest->jsonSerialize(), $requestOptions); + + } + + /** + * Cancel initiated transfers + * + * @param \Adyen\Model\Transfers\CancelTransfersRequest $cancelTransfersRequest + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function cancelInitiatedTransfers(\Adyen\Model\Transfers\CancelTransfersRequest $cancelTransfersRequest, array $requestOptions = null) + { + $endpoint = $this->baseURL . "/transfers/cancel"; + $this->requestHttp($endpoint, strtolower('POST'), (array) $cancelTransfersRequest->jsonSerialize(), $requestOptions); + + } + /** * Get all transfers * From c94eca874a01d165c59ac771c3597c4c9d919495 Mon Sep 17 00:00:00 2001 From: AdyenAutomationBot Date: Tue, 15 Oct 2024 12:49:06 +0000 Subject: [PATCH 2/2] 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/PaymentsApp/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/TaxEDeliveryConsentApi.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 +-- src/Adyen/Service/Transfers/TransfersApi.php | 6 ++---- 45 files changed, 142 insertions(+), 139 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 ada0db0b3..67e88b5f9 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 */ @@ -382,7 +382,7 @@ public function getAuthorizedCardUsers() /** * Sets authorizedCardUsers * - * @param bool|null $authorizedCardUsers + * @param bool|null $authorizedCardUsers * * @return self */ @@ -406,7 +406,7 @@ public function getFundingSource() /** * Sets fundingSource * - * @param string[]|null $fundingSource + * @param string[]|null $fundingSource * * @return self */ @@ -439,7 +439,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 7d317f1ee..c5efe3d95 100644 --- a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php +++ b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php @@ -1922,7 +1922,7 @@ public function getShopperEmail() /** * Sets shopperEmail * - * @param string $shopperEmail + * @param string $shopperEmail * * @return self */ @@ -1946,7 +1946,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 becc716f0..dc73d3c30 100644 --- a/src/Adyen/Model/Checkout/MbwayDetails.php +++ b/src/Adyen/Model/Checkout/MbwayDetails.php @@ -361,7 +361,7 @@ public function getShopperEmail() /** * Sets shopperEmail * - * @param string $shopperEmail + * @param string $shopperEmail * * @return self */ @@ -385,7 +385,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 a5087a929..6787fd034 100644 --- a/src/Adyen/Model/Checkout/VippsDetails.php +++ b/src/Adyen/Model/Checkout/VippsDetails.php @@ -415,7 +415,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 478ff8914..77bba385d 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 */ @@ -382,7 +382,7 @@ public function getAuthorizedCardUsers() /** * Sets authorizedCardUsers * - * @param bool|null $authorizedCardUsers + * @param bool|null $authorizedCardUsers * * @return self */ @@ -406,7 +406,7 @@ public function getFundingSource() /** * Sets fundingSource * - * @param string[]|null $fundingSource + * @param string[]|null $fundingSource * * @return self */ @@ -439,7 +439,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/PaymentsApp/ObjectSerializer.php b/src/Adyen/Model/PaymentsApp/ObjectSerializer.php index 56c51256a..b900dc2bd 100644 --- a/src/Adyen/Model/PaymentsApp/ObjectSerializer.php +++ b/src/Adyen/Model/PaymentsApp/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/TaxEDeliveryConsentApi.php b/src/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentApi.php index 714550af5..b61d2b239 100644 --- a/src/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentApi.php +++ b/src/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentApi.php @@ -60,13 +60,12 @@ public function checkStatusOfConsentForElectronicDeliveryOfTaxForms(string $id, * @param string $id * @param \Adyen\Model\LegalEntityManagement\SetTaxElectronicDeliveryConsentRequest $setTaxElectronicDeliveryConsentRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function setConsentStatusForElectronicDeliveryOfTaxForms(string $id, \Adyen\Model\LegalEntityManagement\SetTaxElectronicDeliveryConsentRequest $setTaxElectronicDeliveryConsentRequest, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/legalEntities/{id}/setTaxElectronicDeliveryConsent"); $this->requestHttp($endpoint, strtolower('POST'), (array) $setTaxElectronicDeliveryConsentRequest->jsonSerialize(), $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); - } /** diff --git a/src/Adyen/Service/Transfers/TransfersApi.php b/src/Adyen/Service/Transfers/TransfersApi.php index 7b62cec32..869e9d604 100644 --- a/src/Adyen/Service/Transfers/TransfersApi.php +++ b/src/Adyen/Service/Transfers/TransfersApi.php @@ -44,14 +44,13 @@ public function __construct(Client $client) * * @param \Adyen\Model\Transfers\ApproveTransfersRequest $approveTransfersRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function approveInitiatedTransfers(\Adyen\Model\Transfers\ApproveTransfersRequest $approveTransfersRequest, array $requestOptions = null) { $endpoint = $this->baseURL . "/transfers/approve"; $this->requestHttp($endpoint, strtolower('POST'), (array) $approveTransfersRequest->jsonSerialize(), $requestOptions); - } /** @@ -59,14 +58,13 @@ public function approveInitiatedTransfers(\Adyen\Model\Transfers\ApproveTransfer * * @param \Adyen\Model\Transfers\CancelTransfersRequest $cancelTransfersRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function cancelInitiatedTransfers(\Adyen\Model\Transfers\CancelTransfersRequest $cancelTransfersRequest, array $requestOptions = null) { $endpoint = $this->baseURL . "/transfers/cancel"; $this->requestHttp($endpoint, strtolower('POST'), (array) $cancelTransfersRequest->jsonSerialize(), $requestOptions); - } /**