diff --git a/src/Adyen/Model/BalanceWebhooks/BalanceAccountBalanceNotificationRequest.php b/src/Adyen/Model/BalanceWebhooks/BalanceAccountBalanceNotificationRequest.php index 97650eac6..82e8e8752 100644 --- a/src/Adyen/Model/BalanceWebhooks/BalanceAccountBalanceNotificationRequest.php +++ b/src/Adyen/Model/BalanceWebhooks/BalanceAccountBalanceNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\BalanceWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\BalanceWebhooks\ObjectSerializer; /** * BalanceAccountBalanceNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class BalanceAccountBalanceNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -417,11 +417,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/BalanceWebhooks/BalanceNotificationData.php b/src/Adyen/Model/BalanceWebhooks/BalanceNotificationData.php index 036c6e5f3..c4213b090 100644 --- a/src/Adyen/Model/BalanceWebhooks/BalanceNotificationData.php +++ b/src/Adyen/Model/BalanceWebhooks/BalanceNotificationData.php @@ -15,14 +15,14 @@ namespace Adyen\Model\BalanceWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\BalanceWebhooks\ObjectSerializer; /** * BalanceNotificationData Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class BalanceNotificationData implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -412,7 +412,7 @@ public function getCreationDate() /** * Sets creationDate * - * @param \DateTime|null $creationDate The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + * @param \DateTime|null $creationDate The date and time when the event was triggered, in ISO 8601 extended format. For example, **2025-03-19T10:15:30+01:00**. * * @return self */ @@ -436,7 +436,7 @@ public function getCurrency() /** * Sets currency * - * @param string $currency TThe three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). * * @return self */ diff --git a/src/Adyen/Model/BalanceWebhooks/BalancePlatformNotificationResponse.php b/src/Adyen/Model/BalanceWebhooks/BalancePlatformNotificationResponse.php index 9c51a42d4..45e579dfe 100644 --- a/src/Adyen/Model/BalanceWebhooks/BalancePlatformNotificationResponse.php +++ b/src/Adyen/Model/BalanceWebhooks/BalancePlatformNotificationResponse.php @@ -15,14 +15,14 @@ namespace Adyen\Model\BalanceWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\BalanceWebhooks\ObjectSerializer; /** * BalancePlatformNotificationResponse Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class BalancePlatformNotificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -286,7 +286,7 @@ public function getNotificationResponse() /** * Sets notificationResponse * - * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks/#accept-webhooks). * * @return self */ diff --git a/src/Adyen/Model/BalanceWebhooks/Balances.php b/src/Adyen/Model/BalanceWebhooks/Balances.php index 31a41173b..cba34d39a 100644 --- a/src/Adyen/Model/BalanceWebhooks/Balances.php +++ b/src/Adyen/Model/BalanceWebhooks/Balances.php @@ -15,14 +15,14 @@ namespace Adyen\Model\BalanceWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\BalanceWebhooks\ObjectSerializer; /** * Balances Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class Balances implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/BalanceWebhooks/ObjectSerializer.php b/src/Adyen/Model/BalanceWebhooks/ObjectSerializer.php index ae31b9d30..0f6e3af93 100644 --- a/src/Adyen/Model/BalanceWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/BalanceWebhooks/ObjectSerializer.php @@ -237,30 +237,6 @@ public static function deserialize($data, $class, $httpHeaders = null) } } - if ($class === '\SplFileObject') { - $data = Utils::streamFor($data); - - /** @var \Psr\Http\Message\StreamInterface $data */ - - // determine file name - if (is_array($httpHeaders) - && array_key_exists('Content-Disposition', $httpHeaders) - && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) - ) { - $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); - } else { - $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); - } - - $file = fopen($filename, 'w'); - while ($chunk = $data->read(200)) { - fwrite($file, $chunk); - } - fclose($file); - - return new \SplFileObject($filename, 'r'); - } - /** @psalm-suppress ParadoxicalCondition */ if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { settype($data, $class); diff --git a/src/Adyen/Model/ConfigurationWebhooks/AccountHolder.php b/src/Adyen/Model/ConfigurationWebhooks/AccountHolder.php index bda0ad96d..f1a873bdd 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/AccountHolder.php +++ b/src/Adyen/Model/ConfigurationWebhooks/AccountHolder.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * AccountHolder Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class AccountHolder implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -651,11 +651,11 @@ public function setStatus($status) { $allowedValues = $this->getStatusAllowableValues(); if (!in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", + "status: unexpected enum value '%s' - Supported values are [%s]", $status, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.php b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.php index 30ef227dc..7e1971c03 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.php +++ b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * AccountHolderCapability Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class AccountHolderCapability implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -462,11 +462,11 @@ public function setAllowedLevel($allowedLevel) { $allowedValues = $this->getAllowedLevelAllowableValues(); if (!in_array($allowedLevel, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'allowedLevel', must be one of '%s'", + "allowedLevel: unexpected enum value '%s' - Supported values are [%s]", $allowedLevel, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -592,11 +592,11 @@ public function setRequestedLevel($requestedLevel) { $allowedValues = $this->getRequestedLevelAllowableValues(); if (!in_array($requestedLevel, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'requestedLevel', must be one of '%s'", + "requestedLevel: unexpected enum value '%s' - Supported values are [%s]", $requestedLevel, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -674,11 +674,11 @@ public function setVerificationStatus($verificationStatus) { $allowedValues = $this->getVerificationStatusAllowableValues(); if (!in_array($verificationStatus, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'verificationStatus', must be one of '%s'", + "verificationStatus: unexpected enum value '%s' - Supported values are [%s]", $verificationStatus, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.php b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.php index c46725521..a15cbbf4a 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.php +++ b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * AccountHolderNotificationData Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class AccountHolderNotificationData implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.php index dd8c39701..bab1b5854 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.php +++ b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * AccountHolderNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class AccountHolderNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -419,11 +419,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.php b/src/Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.php index b0207e6cd..0bb8ab7bc 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.php +++ b/src/Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * AccountSupportingEntityCapability Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class AccountSupportingEntityCapability implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -441,11 +441,11 @@ public function setAllowedLevel($allowedLevel) { $allowedValues = $this->getAllowedLevelAllowableValues(); if (!in_array($allowedLevel, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'allowedLevel', must be one of '%s'", + "allowedLevel: unexpected enum value '%s' - Supported values are [%s]", $allowedLevel, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -547,11 +547,11 @@ public function setRequestedLevel($requestedLevel) { $allowedValues = $this->getRequestedLevelAllowableValues(); if (!in_array($requestedLevel, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'requestedLevel', must be one of '%s'", + "requestedLevel: unexpected enum value '%s' - Supported values are [%s]", $requestedLevel, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -581,11 +581,11 @@ public function setVerificationStatus($verificationStatus) { $allowedValues = $this->getVerificationStatusAllowableValues(); if (!in_array($verificationStatus, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'verificationStatus', must be one of '%s'", + "verificationStatus: unexpected enum value '%s' - Supported values are [%s]", $verificationStatus, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/Address.php b/src/Adyen/Model/ConfigurationWebhooks/Address.php index 0e1b2fc81..8c2e4feac 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Address.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Address.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * Address Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class Address implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/Amount.php b/src/Adyen/Model/ConfigurationWebhooks/Amount.php index db941f4db..9010d2adf 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Amount.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Amount.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * Amount Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class Amount implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/Authentication.php b/src/Adyen/Model/ConfigurationWebhooks/Authentication.php index 4e7b43edf..03fc0fc70 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Authentication.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Authentication.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * Authentication Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class Authentication implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/Balance.php b/src/Adyen/Model/ConfigurationWebhooks/Balance.php index aa32baa98..f4d45b73e 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Balance.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Balance.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * Balance Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class Balance implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/BalanceAccount.php b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccount.php index faab78250..d55a0cfa9 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/BalanceAccount.php +++ b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccount.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * BalanceAccount Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class BalanceAccount implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -389,7 +389,7 @@ public function getAccountHolderId() /** * Sets accountHolderId * - * @param string $accountHolderId The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. + * @param string $accountHolderId The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/accountHolders#responses-200-id) associated with the balance account. * * @return self */ @@ -613,11 +613,11 @@ public function setStatus($status) { $allowedValues = $this->getStatusAllowableValues(); if (!in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", + "status: unexpected enum value '%s' - Supported values are [%s]", $status, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.php b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.php index 075d8b651..8a8f67dfb 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.php +++ b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * BalanceAccountNotificationData Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class BalanceAccountNotificationData implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.php index 3300f2155..0232cf8e9 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.php +++ b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * BalanceAccountNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class BalanceAccountNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -419,11 +419,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.php b/src/Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.php index d9c0f31c2..73a195ea2 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.php +++ b/src/Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * BalancePlatformNotificationResponse Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class BalancePlatformNotificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -286,7 +286,7 @@ public function getNotificationResponse() /** * Sets notificationResponse * - * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks/#accept-webhooks). * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/BankAccountDetails.php b/src/Adyen/Model/ConfigurationWebhooks/BankAccountDetails.php index 3c6f1b316..42659e086 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/BankAccountDetails.php +++ b/src/Adyen/Model/ConfigurationWebhooks/BankAccountDetails.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * BankAccountDetails Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class BankAccountDetails implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/BankScoreSignalTriggeredData.php b/src/Adyen/Model/ConfigurationWebhooks/BankScoreSignalTriggeredData.php new file mode 100644 index 000000000..04b43c1e3 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/BankScoreSignalTriggeredData.php @@ -0,0 +1,652 @@ + + */ +class BankScoreSignalTriggeredData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BankScoreSignalTriggeredData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountHolder' => '\Adyen\Model\ConfigurationWebhooks\ResourceReference', + 'accountHolderStatus' => 'string', + 'automatedActions' => 'string[]', + 'balancePlatform' => 'string', + 'creationDate' => '\DateTime', + 'id' => 'string', + 'riskScore' => 'int', + 'scoreSignalsTriggered' => 'string[]', + 'signalSourceTypes' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountHolder' => null, + 'accountHolderStatus' => null, + 'automatedActions' => null, + 'balancePlatform' => null, + 'creationDate' => 'date-time', + 'id' => null, + 'riskScore' => 'int32', + 'scoreSignalsTriggered' => null, + 'signalSourceTypes' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountHolder' => false, + 'accountHolderStatus' => false, + 'automatedActions' => false, + 'balancePlatform' => false, + 'creationDate' => false, + 'id' => false, + 'riskScore' => true, + 'scoreSignalsTriggered' => false, + 'signalSourceTypes' => 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 = [ + 'accountHolder' => 'accountHolder', + 'accountHolderStatus' => 'accountHolderStatus', + 'automatedActions' => 'automatedActions', + 'balancePlatform' => 'balancePlatform', + 'creationDate' => 'creationDate', + 'id' => 'id', + 'riskScore' => 'riskScore', + 'scoreSignalsTriggered' => 'scoreSignalsTriggered', + 'signalSourceTypes' => 'signalSourceTypes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountHolder' => 'setAccountHolder', + 'accountHolderStatus' => 'setAccountHolderStatus', + 'automatedActions' => 'setAutomatedActions', + 'balancePlatform' => 'setBalancePlatform', + 'creationDate' => 'setCreationDate', + 'id' => 'setId', + 'riskScore' => 'setRiskScore', + 'scoreSignalsTriggered' => 'setScoreSignalsTriggered', + 'signalSourceTypes' => 'setSignalSourceTypes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountHolder' => 'getAccountHolder', + 'accountHolderStatus' => 'getAccountHolderStatus', + 'automatedActions' => 'getAutomatedActions', + 'balancePlatform' => 'getBalancePlatform', + 'creationDate' => 'getCreationDate', + 'id' => 'getId', + 'riskScore' => 'getRiskScore', + 'scoreSignalsTriggered' => 'getScoreSignalsTriggered', + 'signalSourceTypes' => 'getSignalSourceTypes' + ]; + + /** + * 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('accountHolder', $data ?? [], null); + $this->setIfExists('accountHolderStatus', $data ?? [], null); + $this->setIfExists('automatedActions', $data ?? [], null); + $this->setIfExists('balancePlatform', $data ?? [], null); + $this->setIfExists('creationDate', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('riskScore', $data ?? [], null); + $this->setIfExists('scoreSignalsTriggered', $data ?? [], null); + $this->setIfExists('signalSourceTypes', $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 accountHolder + * + * @return \Adyen\Model\ConfigurationWebhooks\ResourceReference|null + */ + public function getAccountHolder() + { + return $this->container['accountHolder']; + } + + /** + * Sets accountHolder + * + * @param \Adyen\Model\ConfigurationWebhooks\ResourceReference|null $accountHolder accountHolder + * + * @return self + */ + public function setAccountHolder($accountHolder) + { + $this->container['accountHolder'] = $accountHolder; + + return $this; + } + + /** + * Gets accountHolderStatus + * + * @return string|null + */ + public function getAccountHolderStatus() + { + return $this->container['accountHolderStatus']; + } + + /** + * Sets accountHolderStatus + * + * @param string|null $accountHolderStatus The status of the account holder. + * + * @return self + */ + public function setAccountHolderStatus($accountHolderStatus) + { + $this->container['accountHolderStatus'] = $accountHolderStatus; + + return $this; + } + + /** + * Gets automatedActions + * + * @return string[]|null + */ + public function getAutomatedActions() + { + return $this->container['automatedActions']; + } + + /** + * Sets automatedActions + * + * @param string[]|null $automatedActions The automated action(s) taken as a result of the score signals that were triggered. + * + * @return self + */ + public function setAutomatedActions($automatedActions) + { + $this->container['automatedActions'] = $automatedActions; + + return $this; + } + + /** + * Gets balancePlatform + * + * @return string|null + */ + public function getBalancePlatform() + { + return $this->container['balancePlatform']; + } + + /** + * Sets balancePlatform + * + * @param string|null $balancePlatform The unique identifier of the balance platform. + * + * @return self + */ + public function setBalancePlatform($balancePlatform) + { + $this->container['balancePlatform'] = $balancePlatform; + + return $this; + } + + /** + * Gets creationDate + * + * @return \DateTime|null + */ + public function getCreationDate() + { + return $this->container['creationDate']; + } + + /** + * Sets creationDate + * + * @param \DateTime|null $creationDate The date and time when the event was triggered, in ISO 8601 extended format. For example, **2025-03-19T10:15:30+01:00**. + * + * @return self + */ + public function setCreationDate($creationDate) + { + $this->container['creationDate'] = $creationDate; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The ID of the resource. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets riskScore + * + * @return int|null + */ + public function getRiskScore() + { + return $this->container['riskScore']; + } + + /** + * Sets riskScore + * + * @param int|null $riskScore The score of the identity resulting from the signal(s) that were triggered. + * + * @return self + */ + public function setRiskScore($riskScore) + { + $this->container['riskScore'] = $riskScore; + + return $this; + } + + /** + * Gets scoreSignalsTriggered + * + * @return string[]|null + */ + public function getScoreSignalsTriggered() + { + return $this->container['scoreSignalsTriggered']; + } + + /** + * Sets scoreSignalsTriggered + * + * @param string[]|null $scoreSignalsTriggered The name(s) of the score signals that were triggered. + * + * @return self + */ + public function setScoreSignalsTriggered($scoreSignalsTriggered) + { + $this->container['scoreSignalsTriggered'] = $scoreSignalsTriggered; + + return $this; + } + + /** + * Gets signalSourceTypes + * + * @return string[]|null + */ + public function getSignalSourceTypes() + { + return $this->container['signalSourceTypes']; + } + + /** + * Sets signalSourceTypes + * + * @param string[]|null $signalSourceTypes The type(s) of the score signals that were triggered. + * + * @return self + */ + public function setSignalSourceTypes($signalSourceTypes) + { + $this->container['signalSourceTypes'] = $signalSourceTypes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/BulkAddress.php b/src/Adyen/Model/ConfigurationWebhooks/BulkAddress.php index ef4d0ea23..57bc97172 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/BulkAddress.php +++ b/src/Adyen/Model/ConfigurationWebhooks/BulkAddress.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * BulkAddress Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class BulkAddress implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblem.php b/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblem.php index ae4d8eda6..1b62c6886 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblem.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblem.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * CapabilityProblem Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class CapabilityProblem implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntity.php b/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntity.php index c3a04f5fa..31a3c1ee7 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntity.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntity.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * CapabilityProblemEntity Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class CapabilityProblemEntity implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -412,11 +412,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.php b/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.php index dc195c6f0..333345370 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * CapabilityProblemEntityRecursive Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class CapabilityProblemEntityRecursive implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -381,11 +381,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php b/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php index a57041fb0..c411751db 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * CapabilitySettings Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class CapabilitySettings implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -444,11 +444,11 @@ public function setInterval($interval) { $allowedValues = $this->getIntervalAllowableValues(); if (!in_array($interval, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'interval', must be one of '%s'", + "interval: unexpected enum value '%s' - Supported values are [%s]", $interval, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/Card.php b/src/Adyen/Model/ConfigurationWebhooks/Card.php index 213deb5c2..3efd3fb23 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Card.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Card.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * Card Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class Card implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -53,7 +53,8 @@ class Card implements ModelInterface, ArrayAccess, \JsonSerializable 'formFactor' => 'string', 'lastFour' => 'string', 'number' => 'string', - 'threeDSecure' => 'string' + 'threeDSecure' => 'string', + 'usage' => 'string' ]; /** @@ -76,7 +77,8 @@ class Card implements ModelInterface, ArrayAccess, \JsonSerializable 'formFactor' => null, 'lastFour' => null, 'number' => null, - 'threeDSecure' => null + 'threeDSecure' => null, + 'usage' => null ]; /** @@ -97,7 +99,8 @@ class Card implements ModelInterface, ArrayAccess, \JsonSerializable 'formFactor' => false, 'lastFour' => false, 'number' => false, - 'threeDSecure' => false + 'threeDSecure' => false, + 'usage' => false ]; /** @@ -198,7 +201,8 @@ public function isNullableSetToNull(string $property): bool 'formFactor' => 'formFactor', 'lastFour' => 'lastFour', 'number' => 'number', - 'threeDSecure' => 'threeDSecure' + 'threeDSecure' => 'threeDSecure', + 'usage' => 'usage' ]; /** @@ -219,7 +223,8 @@ public function isNullableSetToNull(string $property): bool 'formFactor' => 'setFormFactor', 'lastFour' => 'setLastFour', 'number' => 'setNumber', - 'threeDSecure' => 'setThreeDSecure' + 'threeDSecure' => 'setThreeDSecure', + 'usage' => 'setUsage' ]; /** @@ -240,7 +245,8 @@ public function isNullableSetToNull(string $property): bool 'formFactor' => 'getFormFactor', 'lastFour' => 'getLastFour', 'number' => 'getNumber', - 'threeDSecure' => 'getThreeDSecure' + 'threeDSecure' => 'getThreeDSecure', + 'usage' => 'getUsage' ]; /** @@ -329,6 +335,7 @@ public function __construct(?array $data = null) $this->setIfExists('lastFour', $data ?? [], null); $this->setIfExists('number', $data ?? [], null); $this->setIfExists('threeDSecure', $data ?? [], null); + $this->setIfExists('usage', $data ?? [], null); } /** @@ -634,11 +641,11 @@ public function setFormFactor($formFactor) { $allowedValues = $this->getFormFactorAllowableValues(); if (!in_array($formFactor, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'formFactor', must be one of '%s'", + "formFactor: unexpected enum value '%s' - Supported values are [%s]", $formFactor, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -708,7 +715,7 @@ public function getThreeDSecure() /** * Sets threeDSecure * - * @param string|null $threeDSecure Allocates a specific product range for either a physical or a virtual card. Possible values: **fullySupported**, **secureCorporate**. >Reach out to your Adyen contact to get the values relevant for your integration. + * @param string|null $threeDSecure The 3DS configuration of the physical or the virtual card. Possible values: **fullySupported**, **secureCorporate**. > Reach out to your Adyen contact to get the values relevant for your integration. * * @return self */ @@ -718,6 +725,30 @@ public function setThreeDSecure($threeDSecure) return $this; } + + /** + * Gets usage + * + * @return string|null + */ + public function getUsage() + { + return $this->container['usage']; + } + + /** + * Sets usage + * + * @param string|null $usage Specifies how many times the card can be used. Possible values: **singleUse**, **multiUse**. > Reach out to your Adyen contact to determine the value relevant for your integration. + * + * @return self + */ + public function setUsage($usage) + { + $this->container['usage'] = $usage; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/ConfigurationWebhooks/CardConfiguration.php b/src/Adyen/Model/ConfigurationWebhooks/CardConfiguration.php index a3e4ee389..950260a09 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CardConfiguration.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CardConfiguration.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * CardConfiguration Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class CardConfiguration implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/CardOrderItem.php b/src/Adyen/Model/ConfigurationWebhooks/CardOrderItem.php index 871d41e6a..d1de3ab2d 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CardOrderItem.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CardOrderItem.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * CardOrderItem Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class CardOrderItem implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -407,7 +407,7 @@ public function getCreationDate() /** * Sets creationDate * - * @param \DateTime|null $creationDate The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + * @param \DateTime|null $creationDate The date and time when the event was triggered, in ISO 8601 extended format. For example, **2025-03-19T10:15:30+01:00**. * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.php b/src/Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.php index 2b4800a92..79f5bacd6 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * CardOrderItemDeliveryStatus Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class CardOrderItemDeliveryStatus implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -367,11 +367,11 @@ public function setStatus($status) { $allowedValues = $this->getStatusAllowableValues(); if (!in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", + "status: unexpected enum value '%s' - Supported values are [%s]", $status, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.php index 25b6bab33..be6df054c 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * CardOrderNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class CardOrderNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -419,11 +419,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/ContactDetails.php b/src/Adyen/Model/ConfigurationWebhooks/ContactDetails.php index cadae277c..011b92c03 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/ContactDetails.php +++ b/src/Adyen/Model/ConfigurationWebhooks/ContactDetails.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * ContactDetails Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class ContactDetails implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/DeliveryAddress.php b/src/Adyen/Model/ConfigurationWebhooks/DeliveryAddress.php index 6c9503290..68ad4f459 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/DeliveryAddress.php +++ b/src/Adyen/Model/ConfigurationWebhooks/DeliveryAddress.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * DeliveryAddress Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class DeliveryAddress implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -475,7 +475,7 @@ public function getStateOrProvince() /** * Sets stateOrProvince * - * @param string|null $stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + * @param string|null $stateOrProvince The state or province code, maximum 3 characters. For example, **CA** for California in the US or **ON** for Ontario in Canada. > Required for the US and Canada. * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/DeliveryContact.php b/src/Adyen/Model/ConfigurationWebhooks/DeliveryContact.php index 5828e74fd..4394caa3e 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/DeliveryContact.php +++ b/src/Adyen/Model/ConfigurationWebhooks/DeliveryContact.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * DeliveryContact Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class DeliveryContact implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/Device.php b/src/Adyen/Model/ConfigurationWebhooks/Device.php new file mode 100644 index 000000000..1a47965c5 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/Device.php @@ -0,0 +1,435 @@ + + */ +class Device implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Device'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'formFactor' => 'string', + 'osName' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'formFactor' => null, + 'osName' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'formFactor' => false, + 'osName' => 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 = [ + 'formFactor' => 'formFactor', + 'osName' => 'osName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'formFactor' => 'setFormFactor', + 'osName' => 'setOsName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'formFactor' => 'getFormFactor', + 'osName' => 'getOsName' + ]; + + /** + * 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('formFactor', $data ?? [], null); + $this->setIfExists('osName', $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 formFactor + * + * @return string|null + */ + public function getFormFactor() + { + return $this->container['formFactor']; + } + + /** + * Sets formFactor + * + * @param string|null $formFactor The type of the device used for provisioning the network token. For example, **phone**, **mobile_phone**, **watch**, **mobilephone_or_tablet**, etc + * + * @return self + */ + public function setFormFactor($formFactor) + { + $this->container['formFactor'] = $formFactor; + + return $this; + } + + /** + * Gets osName + * + * @return string|null + */ + public function getOsName() + { + return $this->container['osName']; + } + + /** + * Sets osName + * + * @param string|null $osName The operating system of the device used for provisioning the network token. + * + * @return self + */ + public function setOsName($osName) + { + $this->container['osName'] = $osName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/Expiry.php b/src/Adyen/Model/ConfigurationWebhooks/Expiry.php index 752337251..26c5e465e 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Expiry.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Expiry.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * Expiry Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class Expiry implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.php b/src/Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.php index 76470c1da..9aad44b20 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.php +++ b/src/Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * IbanAccountIdentification Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -352,11 +352,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/Name.php b/src/Adyen/Model/ConfigurationWebhooks/Name.php index 2f4095112..ec80d7c62 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Name.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Name.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * Name Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class Name implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.php b/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.php new file mode 100644 index 000000000..619b27af1 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.php @@ -0,0 +1,776 @@ + + */ +class NetworkTokenNotificationDataV2 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NetworkTokenNotificationDataV2'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authentication' => '\Adyen\Model\ConfigurationWebhooks\TokenAuthentication', + 'authenticationApplied' => 'bool', + 'balancePlatform' => 'string', + 'decision' => 'string', + 'id' => 'string', + 'paymentInstrumentId' => 'string', + 'status' => 'string', + 'tokenLastFour' => 'string', + 'tokenRequestor' => '\Adyen\Model\ConfigurationWebhooks\NetworkTokenRequestor', + 'transactionRulesResult' => '\Adyen\Model\ConfigurationWebhooks\NetworkTokenTransactionRulesResult', + 'type' => 'string', + 'validationFacts' => '\Adyen\Model\ConfigurationWebhooks\ValidationFacts[]', + 'wallet' => '\Adyen\Model\ConfigurationWebhooks\Wallet' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authentication' => null, + 'authenticationApplied' => null, + 'balancePlatform' => null, + 'decision' => null, + 'id' => null, + 'paymentInstrumentId' => null, + 'status' => null, + 'tokenLastFour' => null, + 'tokenRequestor' => null, + 'transactionRulesResult' => null, + 'type' => null, + 'validationFacts' => null, + 'wallet' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authentication' => false, + 'authenticationApplied' => false, + 'balancePlatform' => false, + 'decision' => false, + 'id' => false, + 'paymentInstrumentId' => false, + 'status' => false, + 'tokenLastFour' => false, + 'tokenRequestor' => false, + 'transactionRulesResult' => false, + 'type' => false, + 'validationFacts' => false, + 'wallet' => 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 = [ + 'authentication' => 'authentication', + 'authenticationApplied' => 'authenticationApplied', + 'balancePlatform' => 'balancePlatform', + 'decision' => 'decision', + 'id' => 'id', + 'paymentInstrumentId' => 'paymentInstrumentId', + 'status' => 'status', + 'tokenLastFour' => 'tokenLastFour', + 'tokenRequestor' => 'tokenRequestor', + 'transactionRulesResult' => 'transactionRulesResult', + 'type' => 'type', + 'validationFacts' => 'validationFacts', + 'wallet' => 'wallet' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authentication' => 'setAuthentication', + 'authenticationApplied' => 'setAuthenticationApplied', + 'balancePlatform' => 'setBalancePlatform', + 'decision' => 'setDecision', + 'id' => 'setId', + 'paymentInstrumentId' => 'setPaymentInstrumentId', + 'status' => 'setStatus', + 'tokenLastFour' => 'setTokenLastFour', + 'tokenRequestor' => 'setTokenRequestor', + 'transactionRulesResult' => 'setTransactionRulesResult', + 'type' => 'setType', + 'validationFacts' => 'setValidationFacts', + 'wallet' => 'setWallet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authentication' => 'getAuthentication', + 'authenticationApplied' => 'getAuthenticationApplied', + 'balancePlatform' => 'getBalancePlatform', + 'decision' => 'getDecision', + 'id' => 'getId', + 'paymentInstrumentId' => 'getPaymentInstrumentId', + 'status' => 'getStatus', + 'tokenLastFour' => 'getTokenLastFour', + 'tokenRequestor' => 'getTokenRequestor', + 'transactionRulesResult' => 'getTransactionRulesResult', + 'type' => 'getType', + 'validationFacts' => 'getValidationFacts', + 'wallet' => 'getWallet' + ]; + + /** + * 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('authentication', $data ?? [], null); + $this->setIfExists('authenticationApplied', $data ?? [], null); + $this->setIfExists('balancePlatform', $data ?? [], null); + $this->setIfExists('decision', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('paymentInstrumentId', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('tokenLastFour', $data ?? [], null); + $this->setIfExists('tokenRequestor', $data ?? [], null); + $this->setIfExists('transactionRulesResult', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('validationFacts', $data ?? [], null); + $this->setIfExists('wallet', $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 authentication + * + * @return \Adyen\Model\ConfigurationWebhooks\TokenAuthentication|null + */ + public function getAuthentication() + { + return $this->container['authentication']; + } + + /** + * Sets authentication + * + * @param \Adyen\Model\ConfigurationWebhooks\TokenAuthentication|null $authentication authentication + * + * @return self + */ + public function setAuthentication($authentication) + { + $this->container['authentication'] = $authentication; + + return $this; + } + + /** + * Gets authenticationApplied + * + * @return bool|null + */ + public function getAuthenticationApplied() + { + return $this->container['authenticationApplied']; + } + + /** + * Sets authenticationApplied + * + * @param bool|null $authenticationApplied Specifies whether the authentication process was triggered during token provisioning. + * + * @return self + */ + public function setAuthenticationApplied($authenticationApplied) + { + $this->container['authenticationApplied'] = $authenticationApplied; + + return $this; + } + + /** + * Gets balancePlatform + * + * @return string|null + */ + public function getBalancePlatform() + { + return $this->container['balancePlatform']; + } + + /** + * Sets balancePlatform + * + * @param string|null $balancePlatform The unique identifier of the balance platform. + * + * @return self + */ + public function setBalancePlatform($balancePlatform) + { + $this->container['balancePlatform'] = $balancePlatform; + + return $this; + } + + /** + * Gets decision + * + * @return string|null + */ + public function getDecision() + { + return $this->container['decision']; + } + + /** + * Sets decision + * + * @param string|null $decision The decision about the network token provisioning. Possible values: **approved**, **declined**, **requiresAuthentication**. + * + * @return self + */ + public function setDecision($decision) + { + $this->container['decision'] = $decision; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the network token. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets paymentInstrumentId + * + * @return string|null + */ + public function getPaymentInstrumentId() + { + return $this->container['paymentInstrumentId']; + } + + /** + * Sets paymentInstrumentId + * + * @param string|null $paymentInstrumentId The unique identifier of the payment instrument to which the network token is associated. + * + * @return self + */ + public function setPaymentInstrumentId($paymentInstrumentId) + { + $this->container['paymentInstrumentId'] = $paymentInstrumentId; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the network token. + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets tokenLastFour + * + * @return string|null + */ + public function getTokenLastFour() + { + return $this->container['tokenLastFour']; + } + + /** + * Sets tokenLastFour + * + * @param string|null $tokenLastFour The last four digits of the network token. Use this value to help your user to identify their network token. + * + * @return self + */ + public function setTokenLastFour($tokenLastFour) + { + $this->container['tokenLastFour'] = $tokenLastFour; + + return $this; + } + + /** + * Gets tokenRequestor + * + * @return \Adyen\Model\ConfigurationWebhooks\NetworkTokenRequestor|null + */ + public function getTokenRequestor() + { + return $this->container['tokenRequestor']; + } + + /** + * Sets tokenRequestor + * + * @param \Adyen\Model\ConfigurationWebhooks\NetworkTokenRequestor|null $tokenRequestor tokenRequestor + * + * @return self + */ + public function setTokenRequestor($tokenRequestor) + { + $this->container['tokenRequestor'] = $tokenRequestor; + + return $this; + } + + /** + * Gets transactionRulesResult + * + * @return \Adyen\Model\ConfigurationWebhooks\NetworkTokenTransactionRulesResult|null + */ + public function getTransactionRulesResult() + { + return $this->container['transactionRulesResult']; + } + + /** + * Sets transactionRulesResult + * + * @param \Adyen\Model\ConfigurationWebhooks\NetworkTokenTransactionRulesResult|null $transactionRulesResult transactionRulesResult + * + * @return self + */ + public function setTransactionRulesResult($transactionRulesResult) + { + $this->container['transactionRulesResult'] = $transactionRulesResult; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of network token. Possible values: **wallet**, **cof**. + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets validationFacts + * + * @return \Adyen\Model\ConfigurationWebhooks\ValidationFacts[]|null + */ + public function getValidationFacts() + { + return $this->container['validationFacts']; + } + + /** + * Sets validationFacts + * + * @param \Adyen\Model\ConfigurationWebhooks\ValidationFacts[]|null $validationFacts The rules used to validate the request for provisioning the network token. + * + * @return self + */ + public function setValidationFacts($validationFacts) + { + $this->container['validationFacts'] = $validationFacts; + + return $this; + } + + /** + * Gets wallet + * + * @return \Adyen\Model\ConfigurationWebhooks\Wallet|null + */ + public function getWallet() + { + return $this->container['wallet']; + } + + /** + * Sets wallet + * + * @param \Adyen\Model\ConfigurationWebhooks\Wallet|null $wallet wallet + * + * @return self + */ + public function setWallet($wallet) + { + $this->container['wallet'] = $wallet; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.php new file mode 100644 index 000000000..f9b1adf46 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.php @@ -0,0 +1,539 @@ + + */ +class NetworkTokenNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NetworkTokenNotificationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\ConfigurationWebhooks\NetworkTokenNotificationDataV2', + 'environment' => 'string', + 'timestamp' => '\DateTime', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'environment' => null, + 'timestamp' => 'date-time', + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false, + 'environment' => false, + 'timestamp' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'environment' => 'environment', + 'timestamp' => 'timestamp', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'environment' => 'setEnvironment', + 'timestamp' => 'setTimestamp', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'environment' => 'getEnvironment', + 'timestamp' => 'getTimestamp', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_CREATED = 'balancePlatform.networkToken.created'; + public const TYPE_UPDATED = 'balancePlatform.networkToken.updated'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CREATED, + self::TYPE_UPDATED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['environment'] === null) { + $invalidProperties[] = "'environment' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\ConfigurationWebhooks\NetworkTokenNotificationDataV2 + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\ConfigurationWebhooks\NetworkTokenNotificationDataV2 $data data + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets environment + * + * @return string + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param string $environment The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @return self + */ + public function setEnvironment($environment) + { + $this->container['environment'] = $environment; + + return $this; + } + + /** + * Gets timestamp + * + * @return \DateTime|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param \DateTime|null $timestamp When the event was queued. + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of webhook. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + error_log( + sprintf( + "type: unexpected enum value '%s' - Supported values are [%s]", + $type, + implode(', ', $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenRequestor.php b/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenRequestor.php new file mode 100644 index 000000000..5e0593531 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenRequestor.php @@ -0,0 +1,435 @@ + + */ +class NetworkTokenRequestor implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NetworkTokenRequestor'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the network token requestor. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the network token requestor. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenRiskRuleData.php b/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenRiskRuleData.php new file mode 100644 index 000000000..a390c643b --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenRiskRuleData.php @@ -0,0 +1,528 @@ + + */ +class NetworkTokenRiskRuleData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NetworkTokenRiskRuleData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'id' => 'string', + 'outcomeType' => 'string', + 'reference' => 'string', + 'score' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'id' => null, + 'outcomeType' => null, + 'reference' => null, + 'score' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'id' => false, + 'outcomeType' => false, + 'reference' => false, + 'score' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'outcomeType' => 'outcomeType', + 'reference' => 'reference', + 'score' => 'score' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'outcomeType' => 'setOutcomeType', + 'reference' => 'setReference', + 'score' => 'setScore' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'outcomeType' => 'getOutcomeType', + 'reference' => 'getReference', + 'score' => 'getScore' + ]; + + /** + * 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('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('outcomeType', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('score', $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 description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the transaction rule. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the transaction rule. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets outcomeType + * + * @return string|null + */ + public function getOutcomeType() + { + return $this->container['outcomeType']; + } + + /** + * Sets outcomeType + * + * @param string|null $outcomeType The outcome type of the transaction rule. + * + * @return self + */ + public function setOutcomeType($outcomeType) + { + $this->container['outcomeType'] = $outcomeType; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The reference for the transaction rule. + * + * @return self + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets score + * + * @return int|null + */ + public function getScore() + { + return $this->container['score']; + } + + /** + * Sets score + * + * @param int|null $score The transaction score determined by the rule. + * + * @return self + */ + public function setScore($score) + { + $this->container['score'] = $score; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenRiskRuleSource.php b/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenRiskRuleSource.php new file mode 100644 index 000000000..b9b5f3548 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenRiskRuleSource.php @@ -0,0 +1,435 @@ + + */ +class NetworkTokenRiskRuleSource implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NetworkTokenRiskRuleSource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the resource to which the transaction rule applies. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Indicates the type of resource for which the transaction rule is defined. Possible values: * **PaymentInstrumentGroup** * **PaymentInstrument** * **BalancePlatform** * **EntityUsageConfiguration** * **PlatformRule**: The transaction rule is a platform-wide rule imposed by Adyen. + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenTransactionRulesResult.php b/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenTransactionRulesResult.php new file mode 100644 index 000000000..30d2ff9a5 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenTransactionRulesResult.php @@ -0,0 +1,497 @@ + + */ +class NetworkTokenTransactionRulesResult implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NetworkTokenTransactionRulesResult'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'advice' => 'string', + 'allHardBlockRulesPassed' => 'bool', + 'score' => 'int', + 'triggeredTransactionRules' => '\Adyen\Model\ConfigurationWebhooks\NetworkTokenTriggeredRiskRule[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'advice' => null, + 'allHardBlockRulesPassed' => null, + 'score' => 'int32', + 'triggeredTransactionRules' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'advice' => false, + 'allHardBlockRulesPassed' => false, + 'score' => true, + 'triggeredTransactionRules' => 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 = [ + 'advice' => 'advice', + 'allHardBlockRulesPassed' => 'allHardBlockRulesPassed', + 'score' => 'score', + 'triggeredTransactionRules' => 'triggeredTransactionRules' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'advice' => 'setAdvice', + 'allHardBlockRulesPassed' => 'setAllHardBlockRulesPassed', + 'score' => 'setScore', + 'triggeredTransactionRules' => 'setTriggeredTransactionRules' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'advice' => 'getAdvice', + 'allHardBlockRulesPassed' => 'getAllHardBlockRulesPassed', + 'score' => 'getScore', + 'triggeredTransactionRules' => 'getTriggeredTransactionRules' + ]; + + /** + * 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('advice', $data ?? [], null); + $this->setIfExists('allHardBlockRulesPassed', $data ?? [], null); + $this->setIfExists('score', $data ?? [], null); + $this->setIfExists('triggeredTransactionRules', $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 advice + * + * @return string|null + */ + public function getAdvice() + { + return $this->container['advice']; + } + + /** + * Sets advice + * + * @param string|null $advice The advice given by the Risk analysis. + * + * @return self + */ + public function setAdvice($advice) + { + $this->container['advice'] = $advice; + + return $this; + } + + /** + * Gets allHardBlockRulesPassed + * + * @return bool|null + */ + public function getAllHardBlockRulesPassed() + { + return $this->container['allHardBlockRulesPassed']; + } + + /** + * Sets allHardBlockRulesPassed + * + * @param bool|null $allHardBlockRulesPassed Indicates whether the transaction passed all rules with `outcomeType` **hardBlock**. + * + * @return self + */ + public function setAllHardBlockRulesPassed($allHardBlockRulesPassed) + { + $this->container['allHardBlockRulesPassed'] = $allHardBlockRulesPassed; + + return $this; + } + + /** + * Gets score + * + * @return int|null + */ + public function getScore() + { + return $this->container['score']; + } + + /** + * Sets score + * + * @param int|null $score The score of the Risk analysis. + * + * @return self + */ + public function setScore($score) + { + $this->container['score'] = $score; + + return $this; + } + + /** + * Gets triggeredTransactionRules + * + * @return \Adyen\Model\ConfigurationWebhooks\NetworkTokenTriggeredRiskRule[]|null + */ + public function getTriggeredTransactionRules() + { + return $this->container['triggeredTransactionRules']; + } + + /** + * Sets triggeredTransactionRules + * + * @param \Adyen\Model\ConfigurationWebhooks\NetworkTokenTriggeredRiskRule[]|null $triggeredTransactionRules Contains a list of all triggered transaction rules and the corresponding data. + * + * @return self + */ + public function setTriggeredTransactionRules($triggeredTransactionRules) + { + $this->container['triggeredTransactionRules'] = $triggeredTransactionRules; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenTriggeredRiskRule.php b/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenTriggeredRiskRule.php new file mode 100644 index 000000000..441a59473 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/NetworkTokenTriggeredRiskRule.php @@ -0,0 +1,466 @@ + + */ +class NetworkTokenTriggeredRiskRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NetworkTokenTriggeredRiskRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'reason' => 'string', + 'transactionRule' => '\Adyen\Model\ConfigurationWebhooks\NetworkTokenRiskRuleData', + 'transactionRuleSource' => '\Adyen\Model\ConfigurationWebhooks\NetworkTokenRiskRuleSource' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'reason' => null, + 'transactionRule' => null, + 'transactionRuleSource' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'reason' => false, + 'transactionRule' => false, + 'transactionRuleSource' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'reason' => 'reason', + 'transactionRule' => 'transactionRule', + 'transactionRuleSource' => 'transactionRuleSource' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'reason' => 'setReason', + 'transactionRule' => 'setTransactionRule', + 'transactionRuleSource' => 'setTransactionRuleSource' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'reason' => 'getReason', + 'transactionRule' => 'getTransactionRule', + 'transactionRuleSource' => 'getTransactionRuleSource' + ]; + + /** + * 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('reason', $data ?? [], null); + $this->setIfExists('transactionRule', $data ?? [], null); + $this->setIfExists('transactionRuleSource', $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 reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason Explains why the transaction rule failed. + * + * @return self + */ + public function setReason($reason) + { + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets transactionRule + * + * @return \Adyen\Model\ConfigurationWebhooks\NetworkTokenRiskRuleData|null + */ + public function getTransactionRule() + { + return $this->container['transactionRule']; + } + + /** + * Sets transactionRule + * + * @param \Adyen\Model\ConfigurationWebhooks\NetworkTokenRiskRuleData|null $transactionRule transactionRule + * + * @return self + */ + public function setTransactionRule($transactionRule) + { + $this->container['transactionRule'] = $transactionRule; + + return $this; + } + + /** + * Gets transactionRuleSource + * + * @return \Adyen\Model\ConfigurationWebhooks\NetworkTokenRiskRuleSource|null + */ + public function getTransactionRuleSource() + { + return $this->container['transactionRuleSource']; + } + + /** + * Sets transactionRuleSource + * + * @param \Adyen\Model\ConfigurationWebhooks\NetworkTokenRiskRuleSource|null $transactionRuleSource transactionRuleSource + * + * @return self + */ + public function setTransactionRuleSource($transactionRuleSource) + { + $this->container['transactionRuleSource'] = $transactionRuleSource; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php b/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php index 6fffb7f42..450c8f930 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php @@ -237,30 +237,6 @@ public static function deserialize($data, $class, $httpHeaders = null) } } - if ($class === '\SplFileObject') { - $data = Utils::streamFor($data); - - /** @var \Psr\Http\Message\StreamInterface $data */ - - // determine file name - if (is_array($httpHeaders) - && array_key_exists('Content-Disposition', $httpHeaders) - && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) - ) { - $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); - } else { - $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); - } - - $file = fopen($filename, 'w'); - while ($chunk = $data->read(200)) { - fwrite($file, $chunk); - } - fclose($file); - - return new \SplFileObject($filename, 'r'); - } - /** @psalm-suppress ParadoxicalCondition */ if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { settype($data, $class); diff --git a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrument.php b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrument.php index f05a1ad04..c1b599679 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrument.php +++ b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrument.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * PaymentInstrument Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class PaymentInstrument implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -757,11 +757,11 @@ public function setStatus($status) { $allowedValues = $this->getStatusAllowableValues(); if (!in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", + "status: unexpected enum value '%s' - Supported values are [%s]", $status, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -815,11 +815,11 @@ public function setStatusReason($statusReason) { $allowedValues = $this->getStatusReasonAllowableValues(); if (!in_array($statusReason, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'statusReason', must be one of '%s'", + "statusReason: unexpected enum value '%s' - Supported values are [%s]", $statusReason, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -849,11 +849,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.php b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.php index 8e6a312af..d40a88695 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.php +++ b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * PaymentInstrumentAdditionalBankAccountIdentificationsInner Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class PaymentInstrumentAdditionalBankAccountIdentificationsInner implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.php b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.php index 23b765ce8..780a7f891 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.php +++ b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * PaymentInstrumentNotificationData Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class PaymentInstrumentNotificationData implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.php index b03c4c127..b433de4ab 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.php +++ b/src/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * PaymentNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class PaymentNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -419,11 +419,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/Phone.php b/src/Adyen/Model/ConfigurationWebhooks/Phone.php index 6c0b58168..bbdd15815 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Phone.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Phone.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * Phone Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class Phone implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -354,11 +354,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/PhoneNumber.php b/src/Adyen/Model/ConfigurationWebhooks/PhoneNumber.php index a30ac88ab..b0c0f78d3 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/PhoneNumber.php +++ b/src/Adyen/Model/ConfigurationWebhooks/PhoneNumber.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * PhoneNumber Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class PhoneNumber implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -383,11 +383,11 @@ public function setPhoneType($phoneType) { $allowedValues = $this->getPhoneTypeAllowableValues(); if (!in_array($phoneType, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'phoneType', must be one of '%s'", + "phoneType: unexpected enum value '%s' - Supported values are [%s]", $phoneType, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.php b/src/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.php index 8f1d2dc64..8b9ed1cbd 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.php +++ b/src/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * PlatformPaymentConfiguration Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class PlatformPaymentConfiguration implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -293,7 +293,7 @@ public function getSalesDayClosingTime() /** * Sets salesDayClosingTime * - * @param string|null $salesDayClosingTime Specifies at what time a [sales day](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement#sales-day) ends for this account. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. + * @param string|null $salesDayClosingTime Specifies at what time a sales day ends for this account. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. * * @return self */ @@ -317,7 +317,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: **1** to **20**, 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 are made available in this balance account. Possible values: **1** to **20**, or **null**. Default value: **null**. * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/RemediatingAction.php b/src/Adyen/Model/ConfigurationWebhooks/RemediatingAction.php index 5c7b6a78e..8556fa383 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/RemediatingAction.php +++ b/src/Adyen/Model/ConfigurationWebhooks/RemediatingAction.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * RemediatingAction Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class RemediatingAction implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/Resource.php b/src/Adyen/Model/ConfigurationWebhooks/Resource.php index c4f5e4f35..d1e17bc7e 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Resource.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Resource.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * Resource Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class Resource implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -324,7 +324,7 @@ public function getCreationDate() /** * Sets creationDate * - * @param \DateTime|null $creationDate The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + * @param \DateTime|null $creationDate The date and time when the event was triggered, in ISO 8601 extended format. For example, **2025-03-19T10:15:30+01:00**. * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/ResourceReference.php b/src/Adyen/Model/ConfigurationWebhooks/ResourceReference.php new file mode 100644 index 000000000..cf8c1a71b --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/ResourceReference.php @@ -0,0 +1,466 @@ + + */ +class ResourceReference implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResourceReference'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'id' => 'string', + 'reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'id' => null, + 'reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'id' => false, + 'reference' => 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 = [ + 'description' => 'description', + 'id' => 'id', + 'reference' => 'reference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'reference' => 'setReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'reference' => 'getReference' + ]; + + /** + * 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('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('reference', $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 description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the resource. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the resource. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The reference for the resource. + * + * @return self + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/ScoreNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/ScoreNotificationRequest.php new file mode 100644 index 000000000..f169beb82 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/ScoreNotificationRequest.php @@ -0,0 +1,537 @@ + + */ +class ScoreNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ScoreNotificationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\ConfigurationWebhooks\BankScoreSignalTriggeredData', + 'environment' => 'string', + 'timestamp' => '\DateTime', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'environment' => null, + 'timestamp' => 'date-time', + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false, + 'environment' => false, + 'timestamp' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'environment' => 'environment', + 'timestamp' => 'timestamp', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'environment' => 'setEnvironment', + 'timestamp' => 'setTimestamp', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'environment' => 'getEnvironment', + 'timestamp' => 'getTimestamp', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_BALANCE_PLATFORM_SCORE_TRIGGERED = 'balancePlatform.score.triggered'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BALANCE_PLATFORM_SCORE_TRIGGERED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['environment'] === null) { + $invalidProperties[] = "'environment' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\ConfigurationWebhooks\BankScoreSignalTriggeredData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\ConfigurationWebhooks\BankScoreSignalTriggeredData $data data + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets environment + * + * @return string + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param string $environment The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @return self + */ + public function setEnvironment($environment) + { + $this->container['environment'] = $environment; + + return $this; + } + + /** + * Gets timestamp + * + * @return \DateTime|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param \DateTime|null $timestamp When the event was queued. + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of webhook. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + error_log( + sprintf( + "type: unexpected enum value '%s' - Supported values are [%s]", + $type, + implode(', ', $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.php b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.php index 2dc478969..3675e5b2d 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.php +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * SweepConfigurationNotificationData Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class SweepConfigurationNotificationData implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.php index 224f15e50..623aadab2 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.php +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * SweepConfigurationNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class SweepConfigurationNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -421,11 +421,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.php b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.php index 0860e85e1..47cfe9ffe 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.php +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * SweepConfigurationV2 Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class SweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -313,6 +313,7 @@ public function getModelName() public const PRIORITIES_WIRE = 'wire'; public const REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE = 'accountHierarchyNotActive'; public const REASON_AMOUNT_LIMIT_EXCEEDED = 'amountLimitExceeded'; + public const REASON_APPROVAL_EXPIRED = 'approvalExpired'; public const REASON_APPROVED = 'approved'; public const REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE = 'balanceAccountTemporarilyBlockedByTransactionRule'; public const REASON_COUNTERPARTY_ACCOUNT_BLOCKED = 'counterpartyAccountBlocked'; @@ -379,6 +380,7 @@ public function getReasonAllowableValues() return [ self::REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE, self::REASON_AMOUNT_LIMIT_EXCEEDED, + self::REASON_APPROVAL_EXPIRED, self::REASON_APPROVED, self::REASON_BALANCE_ACCOUNT_TEMPORARILY_BLOCKED_BY_TRANSACTION_RULE, self::REASON_COUNTERPARTY_ACCOUNT_BLOCKED, @@ -571,11 +573,11 @@ public function setCategory($category) { $allowedValues = $this->getCategoryAllowableValues(); if (!in_array($category, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'category', must be one of '%s'", + "category: unexpected enum value '%s' - Supported values are [%s]", $category, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -693,7 +695,7 @@ public function getPriorities() /** * Sets priorities * - * @param string[]|null $priorities The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities, ordered by your preference. Adyen will try to pay out using the priorities in the given order. If the first priority is not currently supported or enabled for your platform, the system will try the next one, and so on. The request will be accepted as long as **at least one** of the provided priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if you provide `[\"wire\",\"regular\"]`, and `wire` is not supported but `regular` is, the request will still be accepted and processed. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see optional priorities setup for [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) or [platforms](https://docs.adyen.com/platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). + * @param string[]|null $priorities The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities, ordered by your preference. Adyen will try to pay out using the priorities in the given order. If the first priority is not currently supported or enabled for your platform, the system will try the next one, and so on. The request will be accepted as long as **at least one** of the provided priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if you provide `[\"wire\",\"regular\"]`, and `wire` is not supported but `regular` is, the request will still be accepted and processed. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see optional priorities setup for [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) or [platforms](https://docs.adyen.com/platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). * * @return self */ @@ -734,11 +736,11 @@ public function setReason($reason) { $allowedValues = $this->getReasonAllowableValues(); if (!in_array($reason, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'reason', must be one of '%s'", + "reason: unexpected enum value '%s' - Supported values are [%s]", $reason, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -864,11 +866,11 @@ public function setStatus($status) { $allowedValues = $this->getStatusAllowableValues(); if (!in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", + "status: unexpected enum value '%s' - Supported values are [%s]", $status, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -970,11 +972,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/SweepCounterparty.php b/src/Adyen/Model/ConfigurationWebhooks/SweepCounterparty.php index e43821c00..1e924b72e 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/SweepCounterparty.php +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepCounterparty.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * SweepCounterparty Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class SweepCounterparty implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/SweepSchedule.php b/src/Adyen/Model/ConfigurationWebhooks/SweepSchedule.php index ec4e0af78..bc440d19c 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/SweepSchedule.php +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepSchedule.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * SweepSchedule Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class SweepSchedule implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -357,11 +357,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/TokenAuthentication.php b/src/Adyen/Model/ConfigurationWebhooks/TokenAuthentication.php new file mode 100644 index 000000000..20cc3583f --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/TokenAuthentication.php @@ -0,0 +1,435 @@ + + */ +class TokenAuthentication implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TokenAuthentication'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'method' => 'string', + 'result' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'method' => null, + 'result' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'method' => false, + 'result' => 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 = [ + 'method' => 'method', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'method' => 'setMethod', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'method' => 'getMethod', + 'result' => 'getResult' + ]; + + /** + * 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('method', $data ?? [], null); + $this->setIfExists('result', $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 method + * + * @return string|null + */ + public function getMethod() + { + return $this->container['method']; + } + + /** + * Sets method + * + * @param string|null $method The method used to complete the authentication process. Possible values: **sms_OTP**, **email_OTP**. + * + * @return self + */ + public function setMethod($method) + { + $this->container['method'] = $method; + + return $this; + } + + /** + * Gets result + * + * @return string|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param string|null $result The result of the authentication process. + * + * @return self + */ + public function setResult($result) + { + $this->container['result'] = $result; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/ValidationFacts.php b/src/Adyen/Model/ConfigurationWebhooks/ValidationFacts.php new file mode 100644 index 000000000..718d2f666 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/ValidationFacts.php @@ -0,0 +1,503 @@ + + */ +class ValidationFacts implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ValidationFacts'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'reasons' => 'string[]', + 'result' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'reasons' => null, + 'result' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'reasons' => false, + 'result' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'reasons' => 'reasons', + 'result' => 'result', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'reasons' => 'setReasons', + 'result' => 'setResult', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'reasons' => 'getReasons', + 'result' => 'getResult', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const RESULT_INVALID = 'invalid'; + public const RESULT_NOT_APPLICABLE = 'notApplicable'; + public const RESULT_NOT_VALIDATED = 'notValidated'; + public const RESULT_VALID = 'valid'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getResultAllowableValues() + { + return [ + self::RESULT_INVALID, + self::RESULT_NOT_APPLICABLE, + self::RESULT_NOT_VALIDATED, + self::RESULT_VALID, + ]; + } + /** + * 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('reasons', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getResultAllowableValues(); + if (!is_null($this->container['result']) && !in_array($this->container['result'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'result', must be one of '%s'", + $this->container['result'], + 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 reasons + * + * @return string[]|null + */ + public function getReasons() + { + return $this->container['reasons']; + } + + /** + * Sets reasons + * + * @param string[]|null $reasons The reason for the `result` of the validations. This field is only sent for `validationFacts.type` **walletValidation**, when `validationFacts.result` is **invalid**. + * + * @return self + */ + public function setReasons($reasons) + { + $this->container['reasons'] = $reasons; + + return $this; + } + + /** + * Gets result + * + * @return string|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param string|null $result The evaluation result of the validation facts. Possible values: **valid**, **invalid**, **notValidated**, **notApplicable**. + * + * @return self + */ + public function setResult($result) + { + $allowedValues = $this->getResultAllowableValues(); + if (!in_array($result, $allowedValues, true)) { + error_log( + sprintf( + "result: unexpected enum value '%s' - Supported values are [%s]", + $result, + implode(', ', $allowedValues) + ) + ); + } + $this->container['result'] = $result; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the validation fact. + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/VerificationDeadline.php b/src/Adyen/Model/ConfigurationWebhooks/VerificationDeadline.php index 73dcc2aaa..ff5ceafba 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/VerificationDeadline.php +++ b/src/Adyen/Model/ConfigurationWebhooks/VerificationDeadline.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * VerificationDeadline Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class VerificationDeadline implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ConfigurationWebhooks/VerificationError.php b/src/Adyen/Model/ConfigurationWebhooks/VerificationError.php index 8fc6ddc3b..76c61c5af 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/VerificationError.php +++ b/src/Adyen/Model/ConfigurationWebhooks/VerificationError.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * VerificationError Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class VerificationError implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -595,7 +595,7 @@ public function getType() /** * Sets type * - * @param string|null $type The type of error. Possible values: **invalidInput**, **dataMissing**. + * @param string|null $type The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * * @return self */ @@ -603,11 +603,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.php b/src/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.php index 55eddb8bb..6ca45a345 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.php +++ b/src/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ConfigurationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; /** * VerificationErrorRecursive Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class VerificationErrorRecursive implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -540,7 +540,7 @@ public function getType() /** * Sets type * - * @param string|null $type The type of error. Possible values: **invalidInput**, **dataMissing**. + * @param string|null $type The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * * @return self */ @@ -548,11 +548,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ConfigurationWebhooks/Wallet.php b/src/Adyen/Model/ConfigurationWebhooks/Wallet.php new file mode 100644 index 000000000..68dda2106 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/Wallet.php @@ -0,0 +1,662 @@ + + */ +class Wallet implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Wallet'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountScore' => 'string', + 'device' => '\Adyen\Model\ConfigurationWebhooks\Device', + 'deviceScore' => 'string', + 'provisioningMethod' => 'string', + 'recommendationReasons' => 'string[]', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountScore' => null, + 'device' => null, + 'deviceScore' => null, + 'provisioningMethod' => null, + 'recommendationReasons' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountScore' => false, + 'device' => false, + 'deviceScore' => false, + 'provisioningMethod' => false, + 'recommendationReasons' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'accountScore' => 'accountScore', + 'device' => 'device', + 'deviceScore' => 'deviceScore', + 'provisioningMethod' => 'provisioningMethod', + 'recommendationReasons' => 'recommendationReasons', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountScore' => 'setAccountScore', + 'device' => 'setDevice', + 'deviceScore' => 'setDeviceScore', + 'provisioningMethod' => 'setProvisioningMethod', + 'recommendationReasons' => 'setRecommendationReasons', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountScore' => 'getAccountScore', + 'device' => 'getDevice', + 'deviceScore' => 'getDeviceScore', + 'provisioningMethod' => 'getProvisioningMethod', + 'recommendationReasons' => 'getRecommendationReasons', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const RECOMMENDATION_REASONS_ACCOUNT_CARD_TOO_NEW = 'accountCardTooNew'; + public const RECOMMENDATION_REASONS_ACCOUNT_HIGH_RISK = 'accountHighRisk'; + public const RECOMMENDATION_REASONS_ACCOUNT_RECENTLY_CHANGED = 'accountRecentlyChanged'; + public const RECOMMENDATION_REASONS_ACCOUNT_TOO_NEW = 'accountTooNew'; + public const RECOMMENDATION_REASONS_ACCOUNT_TOO_NEW_SINCE_LAUNCH = 'accountTooNewSinceLaunch'; + public const RECOMMENDATION_REASONS_CARDHOLDER_PAN_ASSOCIATED_TO_ACCOUNT_WITHIN_THRESHOLD_DAYS = 'cardholderPanAssociatedToAccountWithinThresholdDays'; + public const RECOMMENDATION_REASONS_CHANGES_MADE_TO_ACCOUNT_DATA_WITHIN_THRESHOLD_DAYS = 'changesMadeToAccountDataWithinThresholdDays'; + public const RECOMMENDATION_REASONS_DEVICE_PROVISIONING_LOCATION_OUTSIDE_OF_CARDHOLDERS_WALLET_ACCOUNT_HOME_COUNTRY = 'deviceProvisioningLocationOutsideOfCardholdersWalletAccountHomeCountry'; + public const RECOMMENDATION_REASONS_DEVICE_RECENTLY_LOST = 'deviceRecentlyLost'; + public const RECOMMENDATION_REASONS_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_BEING_PUSHED_BY_THE_ISSUER_TO_THE_SAME_DEVICE_THAT_ISSUER_APPLICATION_AUTHENTICATED_BUT_WITH_SUCCESSFUL_UPFRONT_AUTHENTICATION = 'encryptedPaymentInstrumentDataIsBeingPushedByTheIssuerToTheSameDeviceThatIssuerApplicationAuthenticatedButWithSuccessfulUpfrontAuthentication'; + public const RECOMMENDATION_REASONS_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_BEING_PUSHED_BY_THE_ISSUER_TO_THE_SAME_DEVICE_THAT_ISSUER_APPLICATION_AUTHENTICATED_BUT_WITHOUT_ANY_UPFRONT_AUTHENTICATION = 'encryptedPaymentInstrumentDataIsBeingPushedByTheIssuerToTheSameDeviceThatIssuerApplicationAuthenticatedButWithoutAnyUpfrontAuthentication'; + public const RECOMMENDATION_REASONS_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_PUSHED_TO_A_DIFFERENT_DEVICE_THAN_THE_ONE_THAT_ISSUER_APPLICATION_AUTHENTICATED = 'encryptedPaymentInstrumentDataIsPushedToADifferentDeviceThanTheOneThatIssuerApplicationAuthenticated'; + public const RECOMMENDATION_REASONS_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_PUSHED_TO_A_DIFFERENT_USER_THAN_THE_CARD_HOLDER = 'encryptedPaymentInstrumentDataIsPushedToADifferentUserThanTheCardHolder'; + public const RECOMMENDATION_REASONS_HAS_SUSPENDED_TOKENS = 'hasSuspendedTokens'; + public const RECOMMENDATION_REASONS_INACTIVE_ACCOUNT = 'inactiveAccount'; + public const RECOMMENDATION_REASONS_ISSUER_DEFERRED_IDV_DECISION = 'issuerDeferredIDVDecision'; + public const RECOMMENDATION_REASONS_ISSUER_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_EXPIRED = 'issuerEncryptedPaymentInstrumentDataExpired'; + public const RECOMMENDATION_REASONS_LOW_ACCOUNT_SCORE = 'lowAccountScore'; + public const RECOMMENDATION_REASONS_LOW_DEVICE_SCORE = 'lowDeviceScore'; + public const RECOMMENDATION_REASONS_LOW_PHONE_NUMBER_SCORE = 'lowPhoneNumberScore'; + public const RECOMMENDATION_REASONS_NUMBER_OF_ACTIVE_TOKENS_GREATER_THAN_THRESHOLD = 'numberOfActiveTokensGreaterThanThreshold'; + public const RECOMMENDATION_REASONS_NUMBER_OF_ACTIVE_TOKENS_ON_ALL_DEVICES_IS_GREATER_THAN_THRESHOLD = 'numberOfActiveTokensOnAllDevicesIsGreaterThanThreshold'; + public const RECOMMENDATION_REASONS_NUMBER_OF_DAYS_SINCE_DEVICE_WAS_LAST_REPORTED_LOST_IS_LESS_THAN_THRESHOLD_DAYS = 'numberOfDaysSinceDeviceWasLastReportedLostIsLessThanThresholdDays'; + public const RECOMMENDATION_REASONS_NUMBER_OF_DEVICES_WITH_SAME_USERID_WITH_TOKEN_IS_GREATER_THAN_THRESHOLD = 'numberOfDevicesWithSameUseridWithTokenIsGreaterThanThreshold'; + public const RECOMMENDATION_REASONS_NUMBER_OF_TRANSACTIONS_IN_LAST12_MONTHS_LESS_THAN_THRESHOLD_NUMBER = 'numberOfTransactionsInLast12MonthsLessThanThresholdNumber'; + public const RECOMMENDATION_REASONS_OUT_SIDE_HOME_TERRITORY = 'outSideHomeTerritory'; + public const RECOMMENDATION_REASONS_SUSPENDED_CARDS_IN_THE_WALLET_ACCOUNT_IS_GREATER_THAN_THRESHOLD = 'suspendedCardsInTheWALLETAccountIsGreaterThanThreshold'; + public const RECOMMENDATION_REASONS_SUSPICIOUS_ACTIVITY = 'suspiciousActivity'; + public const RECOMMENDATION_REASONS_THE_NUMBER_OF_PROVISIONING_ATTEMPTS_ACROSS_ALL_CARDS_ON_THIS_DEVICE_IN_THE_LAST24_HOURS_EXCEEDS_THE_THRESHOLD = 'theNumberOfProvisioningAttemptsAcrossAllCardsOnThisDeviceInTheLast24HoursExceedsTheThreshold'; + public const RECOMMENDATION_REASONS_THE_WALLET_ACCOUNT_INTO_WHICH_THE_CARD_IS_BEING_PROVISIONED_CONTAIN_DISTINCT_NAMES_GREATER_THAN_THRESHOLD = 'theWALLETAccountIntoWhichTheCardIsBeingProvisionedContainDistinctNamesGreaterThanThreshold'; + public const RECOMMENDATION_REASONS_THIS_ACCOUNT_HAS_NOT_HAD_ACTIVITY_WITHIN_THRESHOLD_PERIOD = 'thisAccountHasNotHadActivityWithinThresholdPeriod'; + public const RECOMMENDATION_REASONS_TOO_MANY_DIFFERENT_CARDHOLDERS = 'tooManyDifferentCardholders'; + public const RECOMMENDATION_REASONS_TOO_MANY_RECENT_ATTEMPTS = 'tooManyRecentAttempts'; + public const RECOMMENDATION_REASONS_TOO_MANY_RECENT_TOKENS = 'tooManyRecentTokens'; + public const RECOMMENDATION_REASONS_UNABLE_TO_ASSESS = 'unableToAssess'; + public const RECOMMENDATION_REASONS_UNKNOWN = 'unknown'; + public const RECOMMENDATION_REASONS_USER_ACCOUNT_WAS_CREATED_WITHIN_THRESHOLD_DAYS = 'userAccountWasCreatedWithinThresholdDays'; + public const RECOMMENDATION_REASONS_USER_DEVICE_RECEIVING_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_DIFFERENT_THAN_THE_ONE_THAT_IS_PROVISIONING_THE_TOKEN = 'userDeviceReceivingEncryptedPaymentInstrumentDataIsDifferentThanTheOneThatIsProvisioningTheToken'; + public const RECOMMENDATION_REASONS_USERS_ACCOUNT_ON_DEVICE_LESS_THAN_THRESHOLD_DAYS = 'usersAccountOnDeviceLessThanThresholdDays'; + public const RECOMMENDATION_REASONS_WALLET_ACCOUNT_CREATED_WITHIN_THRESHOLD_DAYS = 'walletAccountCreatedWithinThresholdDays'; + public const RECOMMENDATION_REASONS_WALLET_ACCOUNT_HOLDER_NAME_ON_FILE_DOES_NOT_MATCH_CARDHOLDER_ENTERED_NAME = 'walletAccountHolderNameOnFileDoesNotMatchCardholderEnteredName'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRecommendationReasonsAllowableValues() + { + return [ + self::RECOMMENDATION_REASONS_ACCOUNT_CARD_TOO_NEW, + self::RECOMMENDATION_REASONS_ACCOUNT_HIGH_RISK, + self::RECOMMENDATION_REASONS_ACCOUNT_RECENTLY_CHANGED, + self::RECOMMENDATION_REASONS_ACCOUNT_TOO_NEW, + self::RECOMMENDATION_REASONS_ACCOUNT_TOO_NEW_SINCE_LAUNCH, + self::RECOMMENDATION_REASONS_CARDHOLDER_PAN_ASSOCIATED_TO_ACCOUNT_WITHIN_THRESHOLD_DAYS, + self::RECOMMENDATION_REASONS_CHANGES_MADE_TO_ACCOUNT_DATA_WITHIN_THRESHOLD_DAYS, + self::RECOMMENDATION_REASONS_DEVICE_PROVISIONING_LOCATION_OUTSIDE_OF_CARDHOLDERS_WALLET_ACCOUNT_HOME_COUNTRY, + self::RECOMMENDATION_REASONS_DEVICE_RECENTLY_LOST, + self::RECOMMENDATION_REASONS_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_BEING_PUSHED_BY_THE_ISSUER_TO_THE_SAME_DEVICE_THAT_ISSUER_APPLICATION_AUTHENTICATED_BUT_WITH_SUCCESSFUL_UPFRONT_AUTHENTICATION, + self::RECOMMENDATION_REASONS_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_BEING_PUSHED_BY_THE_ISSUER_TO_THE_SAME_DEVICE_THAT_ISSUER_APPLICATION_AUTHENTICATED_BUT_WITHOUT_ANY_UPFRONT_AUTHENTICATION, + self::RECOMMENDATION_REASONS_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_PUSHED_TO_A_DIFFERENT_DEVICE_THAN_THE_ONE_THAT_ISSUER_APPLICATION_AUTHENTICATED, + self::RECOMMENDATION_REASONS_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_PUSHED_TO_A_DIFFERENT_USER_THAN_THE_CARD_HOLDER, + self::RECOMMENDATION_REASONS_HAS_SUSPENDED_TOKENS, + self::RECOMMENDATION_REASONS_INACTIVE_ACCOUNT, + self::RECOMMENDATION_REASONS_ISSUER_DEFERRED_IDV_DECISION, + self::RECOMMENDATION_REASONS_ISSUER_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_EXPIRED, + self::RECOMMENDATION_REASONS_LOW_ACCOUNT_SCORE, + self::RECOMMENDATION_REASONS_LOW_DEVICE_SCORE, + self::RECOMMENDATION_REASONS_LOW_PHONE_NUMBER_SCORE, + self::RECOMMENDATION_REASONS_NUMBER_OF_ACTIVE_TOKENS_GREATER_THAN_THRESHOLD, + self::RECOMMENDATION_REASONS_NUMBER_OF_ACTIVE_TOKENS_ON_ALL_DEVICES_IS_GREATER_THAN_THRESHOLD, + self::RECOMMENDATION_REASONS_NUMBER_OF_DAYS_SINCE_DEVICE_WAS_LAST_REPORTED_LOST_IS_LESS_THAN_THRESHOLD_DAYS, + self::RECOMMENDATION_REASONS_NUMBER_OF_DEVICES_WITH_SAME_USERID_WITH_TOKEN_IS_GREATER_THAN_THRESHOLD, + self::RECOMMENDATION_REASONS_NUMBER_OF_TRANSACTIONS_IN_LAST12_MONTHS_LESS_THAN_THRESHOLD_NUMBER, + self::RECOMMENDATION_REASONS_OUT_SIDE_HOME_TERRITORY, + self::RECOMMENDATION_REASONS_SUSPENDED_CARDS_IN_THE_WALLET_ACCOUNT_IS_GREATER_THAN_THRESHOLD, + self::RECOMMENDATION_REASONS_SUSPICIOUS_ACTIVITY, + self::RECOMMENDATION_REASONS_THE_NUMBER_OF_PROVISIONING_ATTEMPTS_ACROSS_ALL_CARDS_ON_THIS_DEVICE_IN_THE_LAST24_HOURS_EXCEEDS_THE_THRESHOLD, + self::RECOMMENDATION_REASONS_THE_WALLET_ACCOUNT_INTO_WHICH_THE_CARD_IS_BEING_PROVISIONED_CONTAIN_DISTINCT_NAMES_GREATER_THAN_THRESHOLD, + self::RECOMMENDATION_REASONS_THIS_ACCOUNT_HAS_NOT_HAD_ACTIVITY_WITHIN_THRESHOLD_PERIOD, + self::RECOMMENDATION_REASONS_TOO_MANY_DIFFERENT_CARDHOLDERS, + self::RECOMMENDATION_REASONS_TOO_MANY_RECENT_ATTEMPTS, + self::RECOMMENDATION_REASONS_TOO_MANY_RECENT_TOKENS, + self::RECOMMENDATION_REASONS_UNABLE_TO_ASSESS, + self::RECOMMENDATION_REASONS_UNKNOWN, + self::RECOMMENDATION_REASONS_USER_ACCOUNT_WAS_CREATED_WITHIN_THRESHOLD_DAYS, + self::RECOMMENDATION_REASONS_USER_DEVICE_RECEIVING_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_DIFFERENT_THAN_THE_ONE_THAT_IS_PROVISIONING_THE_TOKEN, + self::RECOMMENDATION_REASONS_USERS_ACCOUNT_ON_DEVICE_LESS_THAN_THRESHOLD_DAYS, + self::RECOMMENDATION_REASONS_WALLET_ACCOUNT_CREATED_WITHIN_THRESHOLD_DAYS, + self::RECOMMENDATION_REASONS_WALLET_ACCOUNT_HOLDER_NAME_ON_FILE_DOES_NOT_MATCH_CARDHOLDER_ENTERED_NAME, + ]; + } + /** + * 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('accountScore', $data ?? [], null); + $this->setIfExists('device', $data ?? [], null); + $this->setIfExists('deviceScore', $data ?? [], null); + $this->setIfExists('provisioningMethod', $data ?? [], null); + $this->setIfExists('recommendationReasons', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets accountScore + * + * @return string|null + */ + public function getAccountScore() + { + return $this->container['accountScore']; + } + + /** + * Sets accountScore + * + * @param string|null $accountScore The confidence score of the wallet account, calculated by the wallet provider. A high score means that account is considered trustworthy. A low score means that the account is considered suspicious. Possible values: **1** to **5**. + * + * @return self + */ + public function setAccountScore($accountScore) + { + $this->container['accountScore'] = $accountScore; + + return $this; + } + + /** + * Gets device + * + * @return \Adyen\Model\ConfigurationWebhooks\Device|null + */ + public function getDevice() + { + return $this->container['device']; + } + + /** + * Sets device + * + * @param \Adyen\Model\ConfigurationWebhooks\Device|null $device device + * + * @return self + */ + public function setDevice($device) + { + $this->container['device'] = $device; + + return $this; + } + + /** + * Gets deviceScore + * + * @return string|null + */ + public function getDeviceScore() + { + return $this->container['deviceScore']; + } + + /** + * Sets deviceScore + * + * @param string|null $deviceScore The confidence score of the device, calculated by the wallet provider. A high score means that device is considered trustworthy. A low score means that the device is considered suspicious. Possible values: **1** to **5**. + * + * @return self + */ + public function setDeviceScore($deviceScore) + { + $this->container['deviceScore'] = $deviceScore; + + return $this; + } + + /** + * Gets provisioningMethod + * + * @return string|null + */ + public function getProvisioningMethod() + { + return $this->container['provisioningMethod']; + } + + /** + * Sets provisioningMethod + * + * @param string|null $provisioningMethod The method used for provisioning the network token. Possible values: **push**, **manual**, **cof**, **unknown**. + * + * @return self + */ + public function setProvisioningMethod($provisioningMethod) + { + $this->container['provisioningMethod'] = $provisioningMethod; + + return $this; + } + + /** + * Gets recommendationReasons + * + * @return string[]|null + */ + public function getRecommendationReasons() + { + return $this->container['recommendationReasons']; + } + + /** + * Sets recommendationReasons + * + * @param string[]|null $recommendationReasons A list of risk indicators triggered at the time of provisioning the network token. Some example values of risk indicators are: * **accountTooNewSinceLaunch** * **tooManyRecentAttempts** * **lowDeviceScore** * **lowAccountScore** + * + * @return self + */ + public function setRecommendationReasons($recommendationReasons) + { + $allowedValues = $this->getRecommendationReasonsAllowableValues(); + if (array_diff($recommendationReasons, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'recommendationReasons', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['recommendationReasons'] = $recommendationReasons; + + return $this; + } + + /** + * Gets type + * + * @return string|null + * @deprecated since Configuration webhooks v2. "Use name of the `tokenRequestor` instead." + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of wallet that the network token is associated with. Possible values: **applePay**, **googlePay**, **garminPay**. + * + * @return self + * @deprecated since Configuration webhooks v2. "Use name of the `tokenRequestor` instead." + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/DisputeWebhooks/Amount.php b/src/Adyen/Model/DisputeWebhooks/Amount.php index 41956e7f2..dac4d1432 100644 --- a/src/Adyen/Model/DisputeWebhooks/Amount.php +++ b/src/Adyen/Model/DisputeWebhooks/Amount.php @@ -15,14 +15,14 @@ namespace Adyen\Model\DisputeWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\DisputeWebhooks\ObjectSerializer; /** * Amount Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class Amount implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/DisputeWebhooks/BalancePlatformNotificationResponse.php b/src/Adyen/Model/DisputeWebhooks/BalancePlatformNotificationResponse.php index d55fcc24e..e68afcd20 100644 --- a/src/Adyen/Model/DisputeWebhooks/BalancePlatformNotificationResponse.php +++ b/src/Adyen/Model/DisputeWebhooks/BalancePlatformNotificationResponse.php @@ -15,14 +15,14 @@ namespace Adyen\Model\DisputeWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\DisputeWebhooks\ObjectSerializer; /** * BalancePlatformNotificationResponse Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class BalancePlatformNotificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/DisputeWebhooks/DisputeEventNotification.php b/src/Adyen/Model/DisputeWebhooks/DisputeEventNotification.php index 14a61b72d..9b44c7caf 100644 --- a/src/Adyen/Model/DisputeWebhooks/DisputeEventNotification.php +++ b/src/Adyen/Model/DisputeWebhooks/DisputeEventNotification.php @@ -15,14 +15,14 @@ namespace Adyen\Model\DisputeWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\DisputeWebhooks\ObjectSerializer; /** * DisputeEventNotification Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class DisputeEventNotification implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -598,11 +598,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/DisputeWebhooks/DisputeNotificationRequest.php b/src/Adyen/Model/DisputeWebhooks/DisputeNotificationRequest.php index 22247870c..2bf20f01a 100644 --- a/src/Adyen/Model/DisputeWebhooks/DisputeNotificationRequest.php +++ b/src/Adyen/Model/DisputeWebhooks/DisputeNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\DisputeWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\DisputeWebhooks\ObjectSerializer; /** * DisputeNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class DisputeNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -354,11 +354,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/DisputeWebhooks/ObjectSerializer.php b/src/Adyen/Model/DisputeWebhooks/ObjectSerializer.php index 4de6f44ab..42303fca0 100644 --- a/src/Adyen/Model/DisputeWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/DisputeWebhooks/ObjectSerializer.php @@ -237,30 +237,6 @@ public static function deserialize($data, $class, $httpHeaders = null) } } - if ($class === '\SplFileObject') { - $data = Utils::streamFor($data); - - /** @var \Psr\Http\Message\StreamInterface $data */ - - // determine file name - if (is_array($httpHeaders) - && array_key_exists('Content-Disposition', $httpHeaders) - && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) - ) { - $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); - } else { - $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); - } - - $file = fopen($filename, 'w'); - while ($chunk = $data->read(200)) { - fwrite($file, $chunk); - } - fclose($file); - - return new \SplFileObject($filename, 'r'); - } - /** @psalm-suppress ParadoxicalCondition */ if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { settype($data, $class); diff --git a/src/Adyen/Model/ManagementWebhooks/AccountCapabilityData.php b/src/Adyen/Model/ManagementWebhooks/AccountCapabilityData.php index 8cbb6fe07..031af66b2 100644 --- a/src/Adyen/Model/ManagementWebhooks/AccountCapabilityData.php +++ b/src/Adyen/Model/ManagementWebhooks/AccountCapabilityData.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * AccountCapabilityData Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class AccountCapabilityData implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ManagementWebhooks/AccountCreateNotificationData.php b/src/Adyen/Model/ManagementWebhooks/AccountCreateNotificationData.php index 784b68251..3f2339340 100644 --- a/src/Adyen/Model/ManagementWebhooks/AccountCreateNotificationData.php +++ b/src/Adyen/Model/ManagementWebhooks/AccountCreateNotificationData.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * AccountCreateNotificationData Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class AccountCreateNotificationData implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ManagementWebhooks/AccountNotificationResponse.php b/src/Adyen/Model/ManagementWebhooks/AccountNotificationResponse.php index e2b75b5da..a27c88c43 100644 --- a/src/Adyen/Model/ManagementWebhooks/AccountNotificationResponse.php +++ b/src/Adyen/Model/ManagementWebhooks/AccountNotificationResponse.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * AccountNotificationResponse Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class AccountNotificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -286,7 +286,7 @@ public function getNotificationResponse() /** * Sets notificationResponse * - * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks/#accept-webhooks). * * @return self */ diff --git a/src/Adyen/Model/ManagementWebhooks/AccountUpdateNotificationData.php b/src/Adyen/Model/ManagementWebhooks/AccountUpdateNotificationData.php index 3c03b4973..73564dfb9 100644 --- a/src/Adyen/Model/ManagementWebhooks/AccountUpdateNotificationData.php +++ b/src/Adyen/Model/ManagementWebhooks/AccountUpdateNotificationData.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * AccountUpdateNotificationData Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class AccountUpdateNotificationData implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ManagementWebhooks/CapabilityProblem.php b/src/Adyen/Model/ManagementWebhooks/CapabilityProblem.php index d4178e0da..d71560eef 100644 --- a/src/Adyen/Model/ManagementWebhooks/CapabilityProblem.php +++ b/src/Adyen/Model/ManagementWebhooks/CapabilityProblem.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * CapabilityProblem Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class CapabilityProblem implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ManagementWebhooks/CapabilityProblemEntity.php b/src/Adyen/Model/ManagementWebhooks/CapabilityProblemEntity.php index 2e0ce05c3..81824bd2e 100644 --- a/src/Adyen/Model/ManagementWebhooks/CapabilityProblemEntity.php +++ b/src/Adyen/Model/ManagementWebhooks/CapabilityProblemEntity.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * CapabilityProblemEntity Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class CapabilityProblemEntity implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -412,11 +412,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.php b/src/Adyen/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.php index 10cb3173d..b1e4806ee 100644 --- a/src/Adyen/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.php +++ b/src/Adyen/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * CapabilityProblemEntityRecursive Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class CapabilityProblemEntityRecursive implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -381,11 +381,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.php b/src/Adyen/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.php index c844b72b0..ce5770d4a 100644 --- a/src/Adyen/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.php +++ b/src/Adyen/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * MerchantCreatedNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class MerchantCreatedNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -420,11 +420,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.php b/src/Adyen/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.php index 5a06463b5..4a32353fd 100644 --- a/src/Adyen/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.php +++ b/src/Adyen/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * MerchantUpdatedNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class MerchantUpdatedNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -420,11 +420,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ManagementWebhooks/MidServiceNotificationData.php b/src/Adyen/Model/ManagementWebhooks/MidServiceNotificationData.php index 425991d8d..e55564c2b 100644 --- a/src/Adyen/Model/ManagementWebhooks/MidServiceNotificationData.php +++ b/src/Adyen/Model/ManagementWebhooks/MidServiceNotificationData.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * MidServiceNotificationData Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class MidServiceNotificationData implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -538,11 +538,11 @@ public function setStatus($status) { $allowedValues = $this->getStatusAllowableValues(); if (!in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", + "status: unexpected enum value '%s' - Supported values are [%s]", $status, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -620,11 +620,11 @@ public function setVerificationStatus($verificationStatus) { $allowedValues = $this->getVerificationStatusAllowableValues(); if (!in_array($verificationStatus, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'verificationStatus', must be one of '%s'", + "verificationStatus: unexpected enum value '%s' - Supported values are [%s]", $verificationStatus, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ManagementWebhooks/ObjectSerializer.php b/src/Adyen/Model/ManagementWebhooks/ObjectSerializer.php index eeb4aa3f5..17248af8e 100644 --- a/src/Adyen/Model/ManagementWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/ManagementWebhooks/ObjectSerializer.php @@ -237,30 +237,6 @@ public static function deserialize($data, $class, $httpHeaders = null) } } - if ($class === '\SplFileObject') { - $data = Utils::streamFor($data); - - /** @var \Psr\Http\Message\StreamInterface $data */ - - // determine file name - if (is_array($httpHeaders) - && array_key_exists('Content-Disposition', $httpHeaders) - && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) - ) { - $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); - } else { - $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); - } - - $file = fopen($filename, 'w'); - while ($chunk = $data->read(200)) { - fwrite($file, $chunk); - } - fclose($file); - - return new \SplFileObject($filename, 'r'); - } - /** @psalm-suppress ParadoxicalCondition */ if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { settype($data, $class); diff --git a/src/Adyen/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.php b/src/Adyen/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.php index 5aad3ca76..fa1bbc5ad 100644 --- a/src/Adyen/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.php +++ b/src/Adyen/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * PaymentMethodCreatedNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class PaymentMethodCreatedNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -420,11 +420,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ManagementWebhooks/PaymentMethodNotificationResponse.php b/src/Adyen/Model/ManagementWebhooks/PaymentMethodNotificationResponse.php index 9ee81a8bc..b0296ffb5 100644 --- a/src/Adyen/Model/ManagementWebhooks/PaymentMethodNotificationResponse.php +++ b/src/Adyen/Model/ManagementWebhooks/PaymentMethodNotificationResponse.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * PaymentMethodNotificationResponse Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class PaymentMethodNotificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -286,7 +286,7 @@ public function getNotificationResponse() /** * Sets notificationResponse * - * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks/#accept-webhooks). * * @return self */ diff --git a/src/Adyen/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.php b/src/Adyen/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.php index 83ee90cab..7c7012e91 100644 --- a/src/Adyen/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.php +++ b/src/Adyen/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * PaymentMethodRequestRemovedNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class PaymentMethodRequestRemovedNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -420,11 +420,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.php b/src/Adyen/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.php index 54e2073a1..1834fe47e 100644 --- a/src/Adyen/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.php +++ b/src/Adyen/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * PaymentMethodScheduledForRemovalNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class PaymentMethodScheduledForRemovalNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -420,11 +420,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ManagementWebhooks/RemediatingAction.php b/src/Adyen/Model/ManagementWebhooks/RemediatingAction.php index c9c2fe3cf..e6a80da86 100644 --- a/src/Adyen/Model/ManagementWebhooks/RemediatingAction.php +++ b/src/Adyen/Model/ManagementWebhooks/RemediatingAction.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * RemediatingAction Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class RemediatingAction implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.php b/src/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.php index 5722bf593..0fca2a7e3 100644 --- a/src/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.php +++ b/src/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * TerminalAssignmentNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class TerminalAssignmentNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.php b/src/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.php index ad5cc73bd..70932f580 100644 --- a/src/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.php +++ b/src/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * TerminalAssignmentNotificationResponse Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class TerminalAssignmentNotificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -286,7 +286,7 @@ public function getNotificationResponse() /** * Sets notificationResponse * - * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks/#accept-webhooks). * * @return self */ diff --git a/src/Adyen/Model/ManagementWebhooks/TerminalBoardingData.php b/src/Adyen/Model/ManagementWebhooks/TerminalBoardingData.php index 2bfd15a57..63932f30a 100644 --- a/src/Adyen/Model/ManagementWebhooks/TerminalBoardingData.php +++ b/src/Adyen/Model/ManagementWebhooks/TerminalBoardingData.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * TerminalBoardingData Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class TerminalBoardingData implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.php b/src/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.php index b2e78c94f..ff0ee571f 100644 --- a/src/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.php +++ b/src/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * TerminalBoardingNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class TerminalBoardingNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -420,11 +420,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.php b/src/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.php index 7d8d09bd8..3c841f253 100644 --- a/src/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.php +++ b/src/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * TerminalBoardingNotificationResponse Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class TerminalBoardingNotificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -286,7 +286,7 @@ public function getNotificationResponse() /** * Sets notificationResponse * - * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks/#accept-webhooks). * * @return self */ diff --git a/src/Adyen/Model/ManagementWebhooks/TerminalSettingsData.php b/src/Adyen/Model/ManagementWebhooks/TerminalSettingsData.php index 58ae5c48c..c804462b6 100644 --- a/src/Adyen/Model/ManagementWebhooks/TerminalSettingsData.php +++ b/src/Adyen/Model/ManagementWebhooks/TerminalSettingsData.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * TerminalSettingsData Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class TerminalSettingsData implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -454,11 +454,11 @@ public function setUpdateSource($updateSource) { $allowedValues = $this->getUpdateSourceAllowableValues(); if (!in_array($updateSource, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'updateSource', must be one of '%s'", + "updateSource: unexpected enum value '%s' - Supported values are [%s]", $updateSource, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.php b/src/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.php index 7f8891021..54c41e75b 100644 --- a/src/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.php +++ b/src/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * TerminalSettingsNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class TerminalSettingsNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -420,11 +420,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.php b/src/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.php index 1dd382790..b80bddce7 100644 --- a/src/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.php +++ b/src/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * TerminalSettingsNotificationResponse Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class TerminalSettingsNotificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -286,7 +286,7 @@ public function getNotificationResponse() /** * Sets notificationResponse * - * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks/#accept-webhooks). * * @return self */ diff --git a/src/Adyen/Model/ManagementWebhooks/VerificationError.php b/src/Adyen/Model/ManagementWebhooks/VerificationError.php index 35102992b..263c9ad04 100644 --- a/src/Adyen/Model/ManagementWebhooks/VerificationError.php +++ b/src/Adyen/Model/ManagementWebhooks/VerificationError.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * VerificationError Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class VerificationError implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -443,11 +443,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/ManagementWebhooks/VerificationErrorRecursive.php b/src/Adyen/Model/ManagementWebhooks/VerificationErrorRecursive.php index ec3a68dc1..5d6d18c76 100644 --- a/src/Adyen/Model/ManagementWebhooks/VerificationErrorRecursive.php +++ b/src/Adyen/Model/ManagementWebhooks/VerificationErrorRecursive.php @@ -15,14 +15,14 @@ namespace Adyen\Model\ManagementWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\ManagementWebhooks\ObjectSerializer; /** * VerificationErrorRecursive Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class VerificationErrorRecursive implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -388,11 +388,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/TokenizationWebhooks/RecurringToken.php b/src/Adyen/Model/TokenizationWebhooks/RecurringToken.php index 81e0ce192..858f34389 100644 --- a/src/Adyen/Model/TokenizationWebhooks/RecurringToken.php +++ b/src/Adyen/Model/TokenizationWebhooks/RecurringToken.php @@ -15,14 +15,14 @@ namespace Adyen\Model\TokenizationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\TokenizationWebhooks\ObjectSerializer; /** * RecurringToken Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class RecurringToken implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/TokenizationWebhooks/RecurringTokenStoreOperation.php b/src/Adyen/Model/TokenizationWebhooks/RecurringTokenStoreOperation.php index 1999e89ee..477d336ea 100644 --- a/src/Adyen/Model/TokenizationWebhooks/RecurringTokenStoreOperation.php +++ b/src/Adyen/Model/TokenizationWebhooks/RecurringTokenStoreOperation.php @@ -15,14 +15,14 @@ namespace Adyen\Model\TokenizationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\TokenizationWebhooks\ObjectSerializer; /** * RecurringTokenStoreOperation Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class RecurringTokenStoreOperation implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/TokenizationWebhooks/TokenizationAlreadyExistingDetailsNotificationRequest.php b/src/Adyen/Model/TokenizationWebhooks/TokenizationAlreadyExistingDetailsNotificationRequest.php index e784e3bdc..e53dec86d 100644 --- a/src/Adyen/Model/TokenizationWebhooks/TokenizationAlreadyExistingDetailsNotificationRequest.php +++ b/src/Adyen/Model/TokenizationWebhooks/TokenizationAlreadyExistingDetailsNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\TokenizationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\TokenizationWebhooks\ObjectSerializer; /** * TokenizationAlreadyExistingDetailsNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class TokenizationAlreadyExistingDetailsNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -436,11 +436,11 @@ public function setEnvironment($environment) { $allowedValues = $this->getEnvironmentAllowableValues(); if (!in_array($environment, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'environment', must be one of '%s'", + "environment: unexpected enum value '%s' - Supported values are [%s]", $environment, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -494,11 +494,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/TokenizationWebhooks/TokenizationCreatedDetailsNotificationRequest.php b/src/Adyen/Model/TokenizationWebhooks/TokenizationCreatedDetailsNotificationRequest.php index c47dd3889..625aa1481 100644 --- a/src/Adyen/Model/TokenizationWebhooks/TokenizationCreatedDetailsNotificationRequest.php +++ b/src/Adyen/Model/TokenizationWebhooks/TokenizationCreatedDetailsNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\TokenizationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\TokenizationWebhooks\ObjectSerializer; /** * TokenizationCreatedDetailsNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class TokenizationCreatedDetailsNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -436,11 +436,11 @@ public function setEnvironment($environment) { $allowedValues = $this->getEnvironmentAllowableValues(); if (!in_array($environment, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'environment', must be one of '%s'", + "environment: unexpected enum value '%s' - Supported values are [%s]", $environment, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -494,11 +494,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/TokenizationWebhooks/TokenizationDisabledDetailsNotificationRequest.php b/src/Adyen/Model/TokenizationWebhooks/TokenizationDisabledDetailsNotificationRequest.php index dd87d541a..2bfaf8122 100644 --- a/src/Adyen/Model/TokenizationWebhooks/TokenizationDisabledDetailsNotificationRequest.php +++ b/src/Adyen/Model/TokenizationWebhooks/TokenizationDisabledDetailsNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\TokenizationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\TokenizationWebhooks\ObjectSerializer; /** * TokenizationDisabledDetailsNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class TokenizationDisabledDetailsNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -436,11 +436,11 @@ public function setEnvironment($environment) { $allowedValues = $this->getEnvironmentAllowableValues(); if (!in_array($environment, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'environment', must be one of '%s'", + "environment: unexpected enum value '%s' - Supported values are [%s]", $environment, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -494,11 +494,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/TokenizationWebhooks/TokenizationNotificationResponse.php b/src/Adyen/Model/TokenizationWebhooks/TokenizationNotificationResponse.php index 3333897cd..652d507cd 100644 --- a/src/Adyen/Model/TokenizationWebhooks/TokenizationNotificationResponse.php +++ b/src/Adyen/Model/TokenizationWebhooks/TokenizationNotificationResponse.php @@ -15,14 +15,14 @@ namespace Adyen\Model\TokenizationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\TokenizationWebhooks\ObjectSerializer; /** * TokenizationNotificationResponse Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class TokenizationNotificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/TokenizationWebhooks/TokenizationUpdatedDetailsNotificationRequest.php b/src/Adyen/Model/TokenizationWebhooks/TokenizationUpdatedDetailsNotificationRequest.php index d00818935..2894cc5dd 100644 --- a/src/Adyen/Model/TokenizationWebhooks/TokenizationUpdatedDetailsNotificationRequest.php +++ b/src/Adyen/Model/TokenizationWebhooks/TokenizationUpdatedDetailsNotificationRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\TokenizationWebhooks; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\TokenizationWebhooks\ObjectSerializer; /** * TokenizationUpdatedDetailsNotificationRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class TokenizationUpdatedDetailsNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -436,11 +436,11 @@ public function setEnvironment($environment) { $allowedValues = $this->getEnvironmentAllowableValues(); if (!in_array($environment, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'environment', must be one of '%s'", + "environment: unexpected enum value '%s' - Supported values are [%s]", $environment, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -494,11 +494,11 @@ public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", + "type: unexpected enum value '%s' - Supported values are [%s]", $type, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Service/BankingWebhookParser.php b/src/Adyen/Service/BankingWebhookParser.php index b1bb89be9..af879e600 100644 --- a/src/Adyen/Service/BankingWebhookParser.php +++ b/src/Adyen/Service/BankingWebhookParser.php @@ -7,8 +7,10 @@ use Adyen\Model\BalanceWebhooks\BalanceAccountBalanceNotificationRequest; use Adyen\Model\ConfigurationWebhooks\AccountHolderNotificationRequest; use Adyen\Model\ConfigurationWebhooks\BalanceAccountNotificationRequest; +use Adyen\Model\ConfigurationWebhooks\NetworkTokenNotificationRequest; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; use Adyen\Model\ConfigurationWebhooks\PaymentNotificationRequest; +use Adyen\Model\ConfigurationWebhooks\ScoreNotificationRequest; use Adyen\Model\ConfigurationWebhooks\SweepConfigurationNotificationRequest; use Adyen\Model\ReportWebhooks\ReportNotificationRequest; use Adyen\Model\TransactionWebhooks\TransactionNotificationRequestV4; @@ -29,7 +31,9 @@ class BankingWebhookParser SweepConfigurationNotificationRequest::class, ReportNotificationRequest::class, TransferNotificationRequest::class, - TransactionNotificationRequestV4::class + TransactionNotificationRequestV4::class, + ScoreNotificationRequest::class, + NetworkTokenNotificationRequest::class ]; public function __construct(string $payload) @@ -120,6 +124,16 @@ public function getTransactionNotificationRequestV4(): TransactionNotificationRe return $this->getWebhookByClass(TransactionNotificationRequestV4::class); } + public function getNetworkTokenNotificationRequest(): NetworkTokenNotificationRequest + { + return $this->getWebhookByClass(NetworkTokenNotificationRequest::class); + } + + public function getScoreNotificationRequest(): ScoreNotificationRequest + { + return $this->getWebhookByClass(ScoreNotificationRequest::class); + } + private function getWebhookByClass(string $expectedClass): object { $webhook = $this->getGenericWebhook();