diff --git a/src/Adyen/Model/BalanceControl/BalanceTransferRequest.php b/src/Adyen/Model/BalanceControl/BalanceTransferRequest.php index 29bde8828..d3f03f31a 100644 --- a/src/Adyen/Model/BalanceControl/BalanceTransferRequest.php +++ b/src/Adyen/Model/BalanceControl/BalanceTransferRequest.php @@ -492,11 +492,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/BalanceControl/BalanceTransferResponse.php b/src/Adyen/Model/BalanceControl/BalanceTransferResponse.php index 206b168ab..e81b9afda 100644 --- a/src/Adyen/Model/BalanceControl/BalanceTransferResponse.php +++ b/src/Adyen/Model/BalanceControl/BalanceTransferResponse.php @@ -573,11 +573,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) ) ); } @@ -631,11 +631,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/Management/AccelInfo.php b/src/Adyen/Model/Management/AccelInfo.php index d39caf506..1927355f5 100644 --- a/src/Adyen/Model/Management/AccelInfo.php +++ b/src/Adyen/Model/Management/AccelInfo.php @@ -329,11 +329,11 @@ public function setProcessingType($processingType) { $allowedValues = $this->getProcessingTypeAllowableValues(); if (!in_array($processingType, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'processingType', must be one of '%s'", + "processingType: unexpected enum value '%s' - Supported values are [%s]", $processingType, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/Management/AdditionalSettings.php b/src/Adyen/Model/Management/AdditionalSettings.php index 872481422..5b00043b7 100644 --- a/src/Adyen/Model/Management/AdditionalSettings.php +++ b/src/Adyen/Model/Management/AdditionalSettings.php @@ -317,7 +317,7 @@ public function getProperties() /** * Sets properties * - * @param array|null $properties Object containing boolean key-value pairs. The key can be any [standard webhook additional setting](https://docs.adyen.com/development-resources/webhooks/additional-settings), and the value indicates if the setting is enabled. For example, `captureDelayHours`: **true** means the standard notifications you get will contain the number of hours remaining until the payment will be captured. + * @param array|null $properties Object containing boolean key-value pairs. The key can be any [standard webhook additional setting](https://docs.adyen.com/development-resources/webhooks/additional-settings), and the value indicates if the setting is enabled. For example, `includeCaptureDelayHours`: **true** means the standard notifications you get will contain the number of hours remaining until the payment will be captured. * * @return self */ diff --git a/src/Adyen/Model/Management/AdditionalSettingsResponse.php b/src/Adyen/Model/Management/AdditionalSettingsResponse.php index b51d157f8..b5d86bb3e 100644 --- a/src/Adyen/Model/Management/AdditionalSettingsResponse.php +++ b/src/Adyen/Model/Management/AdditionalSettingsResponse.php @@ -348,7 +348,7 @@ public function getProperties() /** * Sets properties * - * @param array|null $properties Object containing boolean key-value pairs. The key can be any [standard webhook additional setting](https://docs.adyen.com/development-resources/webhooks/additional-settings), and the value indicates if the setting is enabled. For example, `captureDelayHours`: **true** means the standard notifications you get will contain the number of hours remaining until the payment will be captured. + * @param array|null $properties Object containing boolean key-value pairs. The key can be any [standard webhook additional setting](https://docs.adyen.com/development-resources/webhooks/additional-settings), and the value indicates if the setting is enabled. For example, `includeCaptureDelayHours`: **true** means the standard notifications you get will contain the number of hours remaining until the payment will be captured. * * @return self */ diff --git a/src/Adyen/Model/Management/AffirmInfo.php b/src/Adyen/Model/Management/AffirmInfo.php index b76d63fa1..9a3da23b9 100644 --- a/src/Adyen/Model/Management/AffirmInfo.php +++ b/src/Adyen/Model/Management/AffirmInfo.php @@ -41,6 +41,7 @@ class AffirmInfo implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'pricePlan' => 'string', 'supportEmail' => 'string' ]; @@ -52,6 +53,7 @@ class AffirmInfo implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'pricePlan' => null, 'supportEmail' => null ]; @@ -61,6 +63,7 @@ class AffirmInfo implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ + 'pricePlan' => false, 'supportEmail' => false ]; @@ -150,6 +153,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'pricePlan' => 'pricePlan', 'supportEmail' => 'supportEmail' ]; @@ -159,6 +163,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'pricePlan' => 'setPricePlan', 'supportEmail' => 'setSupportEmail' ]; @@ -168,6 +173,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'pricePlan' => 'getPricePlan', 'supportEmail' => 'getSupportEmail' ]; @@ -212,7 +218,23 @@ public function getModelName() return self::$openAPIModelName; } + public const PRICE_PLAN_BRONZE = 'BRONZE'; + public const PRICE_PLAN_SILVER = 'SILVER'; + public const PRICE_PLAN_GOLD = 'GOLD'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPricePlanAllowableValues() + { + return [ + self::PRICE_PLAN_BRONZE, + self::PRICE_PLAN_SILVER, + self::PRICE_PLAN_GOLD, + ]; + } /** * Associative array for storing property values * @@ -228,6 +250,7 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('pricePlan', $data ?? [], null); $this->setIfExists('supportEmail', $data ?? [], null); } @@ -258,6 +281,15 @@ public function listInvalidProperties() { $invalidProperties = []; + $allowedValues = $this->getPricePlanAllowableValues(); + if (!is_null($this->container['pricePlan']) && !in_array($this->container['pricePlan'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'pricePlan', must be one of '%s'", + $this->container['pricePlan'], + implode("', '", $allowedValues) + ); + } + if ($this->container['supportEmail'] === null) { $invalidProperties[] = "'supportEmail' can't be null"; } @@ -276,6 +308,40 @@ public function valid() } + /** + * Gets pricePlan + * + * @return string|null + */ + public function getPricePlan() + { + return $this->container['pricePlan']; + } + + /** + * Sets pricePlan + * + * @param string|null $pricePlan Merchant price plan + * + * @return self + */ + public function setPricePlan($pricePlan) + { + $allowedValues = $this->getPricePlanAllowableValues(); + if (!in_array($pricePlan, $allowedValues, true)) { + error_log( + sprintf( + "pricePlan: unexpected enum value '%s' - Supported values are [%s]", + $pricePlan, + implode(', ', $allowedValues) + ) + ); + } + $this->container['pricePlan'] = $pricePlan; + + return $this; + } + /** * Gets supportEmail * diff --git a/src/Adyen/Model/Management/AmexInfo.php b/src/Adyen/Model/Management/AmexInfo.php index 8f9caf890..187cce469 100644 --- a/src/Adyen/Model/Management/AmexInfo.php +++ b/src/Adyen/Model/Management/AmexInfo.php @@ -384,11 +384,11 @@ public function setServiceLevel($serviceLevel) { $allowedValues = $this->getServiceLevelAllowableValues(); if (!in_array($serviceLevel, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'serviceLevel', must be one of '%s'", + "serviceLevel: unexpected enum value '%s' - Supported values are [%s]", $serviceLevel, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/Management/Amount.php b/src/Adyen/Model/Management/Amount.php index b54a4db73..0a9096621 100644 --- a/src/Adyen/Model/Management/Amount.php +++ b/src/Adyen/Model/Management/Amount.php @@ -299,7 +299,7 @@ public function getCurrency() /** * Sets currency * - * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the amount. * * @return self */ @@ -323,7 +323,7 @@ public function getValue() /** * Sets value * - * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * @param int $value The numeric value of the amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * * @return self */ diff --git a/src/Adyen/Model/Management/AndroidApp.php b/src/Adyen/Model/Management/AndroidApp.php index ee146162d..efb643349 100644 --- a/src/Adyen/Model/Management/AndroidApp.php +++ b/src/Adyen/Model/Management/AndroidApp.php @@ -531,11 +531,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/Management/CardholderReceipt.php b/src/Adyen/Model/Management/CardholderReceipt.php index e8843f454..214ee05f8 100644 --- a/src/Adyen/Model/Management/CardholderReceipt.php +++ b/src/Adyen/Model/Management/CardholderReceipt.php @@ -286,7 +286,7 @@ public function getHeaderForAuthorizedReceipt() /** * Sets headerForAuthorizedReceipt * - * @param string|null $headerForAuthorizedReceipt A custom header to show on the shopper receipt for an authorised transaction. Allows one or two comma-separated header lines, and blank lines. For example, `header,header,filler` + * @param string|null $headerForAuthorizedReceipt The structure of the header to show on the shopper receipt. You can define the order of one or two header lines and blank lines. For example, **header1,header2,filler**. The text of the header lines is defined in the Customer Area under **In-person payments** > **Terminal settings** > **Receipts** in the **Receipt lines** block. * * @return self */ diff --git a/src/Adyen/Model/Management/Connectivity.php b/src/Adyen/Model/Management/Connectivity.php index c72fb3487..c9d904af9 100644 --- a/src/Adyen/Model/Management/Connectivity.php +++ b/src/Adyen/Model/Management/Connectivity.php @@ -324,11 +324,11 @@ public function setSimcardStatus($simcardStatus) { $allowedValues = $this->getSimcardStatusAllowableValues(); if (!in_array($simcardStatus, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'simcardStatus', must be one of '%s'", + "simcardStatus: unexpected enum value '%s' - Supported values are [%s]", $simcardStatus, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php b/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php index 8bc0eaa60..d1f5fca7b 100644 --- a/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php +++ b/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php @@ -635,11 +635,11 @@ public function setCommunicationFormat($communicationFormat) { $allowedValues = $this->getCommunicationFormatAllowableValues(); if (!in_array($communicationFormat, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'communicationFormat', must be one of '%s'", + "communicationFormat: unexpected enum value '%s' - Supported values are [%s]", $communicationFormat, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -693,11 +693,11 @@ public function setEncryptionProtocol($encryptionProtocol) { $allowedValues = $this->getEncryptionProtocolAllowableValues(); if (!in_array($encryptionProtocol, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'encryptionProtocol', must be one of '%s'", + "encryptionProtocol: unexpected enum value '%s' - Supported values are [%s]", $encryptionProtocol, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -727,11 +727,11 @@ public function setFilterMerchantAccountType($filterMerchantAccountType) { $allowedValues = $this->getFilterMerchantAccountTypeAllowableValues(); if (!in_array($filterMerchantAccountType, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'filterMerchantAccountType', must be one of '%s'", + "filterMerchantAccountType: unexpected enum value '%s' - Supported values are [%s]", $filterMerchantAccountType, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -785,11 +785,11 @@ public function setNetworkType($networkType) { $allowedValues = $this->getNetworkTypeAllowableValues(); if (!in_array($networkType, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'networkType', must be one of '%s'", + "networkType: unexpected enum value '%s' - Supported values are [%s]", $networkType, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php b/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php index a29535b04..2ab80a788 100644 --- a/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php +++ b/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php @@ -590,11 +590,11 @@ public function setCommunicationFormat($communicationFormat) { $allowedValues = $this->getCommunicationFormatAllowableValues(); if (!in_array($communicationFormat, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'communicationFormat', must be one of '%s'", + "communicationFormat: unexpected enum value '%s' - Supported values are [%s]", $communicationFormat, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -648,11 +648,11 @@ public function setEncryptionProtocol($encryptionProtocol) { $allowedValues = $this->getEncryptionProtocolAllowableValues(); if (!in_array($encryptionProtocol, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'encryptionProtocol', must be one of '%s'", + "encryptionProtocol: unexpected enum value '%s' - Supported values are [%s]", $encryptionProtocol, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -682,11 +682,11 @@ public function setNetworkType($networkType) { $allowedValues = $this->getNetworkTypeAllowableValues(); if (!in_array($networkType, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'networkType', must be one of '%s'", + "networkType: unexpected enum value '%s' - Supported values are [%s]", $networkType, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/Management/DinersInfo.php b/src/Adyen/Model/Management/DinersInfo.php index c84e83cfc..4f0ae6765 100644 --- a/src/Adyen/Model/Management/DinersInfo.php +++ b/src/Adyen/Model/Management/DinersInfo.php @@ -389,11 +389,11 @@ public function setServiceLevel($serviceLevel) { $allowedValues = $this->getServiceLevelAllowableValues(); if (!in_array($serviceLevel, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'serviceLevel', must be one of '%s'", + "serviceLevel: unexpected enum value '%s' - Supported values are [%s]", $serviceLevel, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/Management/ForceRebootDetails.php b/src/Adyen/Model/Management/ForceRebootDetails.php new file mode 100644 index 000000000..d8f0ae881 --- /dev/null +++ b/src/Adyen/Model/Management/ForceRebootDetails.php @@ -0,0 +1,435 @@ + + */ +class ForceRebootDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForceRebootDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '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 = [ + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '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_FORCE_REBOOT = 'ForceReboot'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_FORCE_REBOOT, + ]; + } + /** + * 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('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Type of terminal action: Force Reboot. + * + * @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/Management/GivexInfo.php b/src/Adyen/Model/Management/GivexInfo.php new file mode 100644 index 000000000..32e2b3c5e --- /dev/null +++ b/src/Adyen/Model/Management/GivexInfo.php @@ -0,0 +1,542 @@ + + */ +class GivexInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GivexInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currencyCode' => 'string', + 'password' => 'string', + 'paymentFlow' => 'string', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currencyCode' => null, + 'password' => null, + 'paymentFlow' => null, + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currencyCode' => false, + 'password' => false, + 'paymentFlow' => false, + 'username' => 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 = [ + 'currencyCode' => 'currencyCode', + 'password' => 'password', + 'paymentFlow' => 'paymentFlow', + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currencyCode' => 'setCurrencyCode', + 'password' => 'setPassword', + 'paymentFlow' => 'setPaymentFlow', + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currencyCode' => 'getCurrencyCode', + 'password' => 'getPassword', + 'paymentFlow' => 'getPaymentFlow', + 'username' => 'getUsername' + ]; + + /** + * 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 PAYMENT_FLOW_ECOMMERCE = 'Ecommerce'; + public const PAYMENT_FLOW_POS = 'POS'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPaymentFlowAllowableValues() + { + return [ + self::PAYMENT_FLOW_ECOMMERCE, + self::PAYMENT_FLOW_POS, + ]; + } + /** + * 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('currencyCode', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + $this->setIfExists('paymentFlow', $data ?? [], null); + $this->setIfExists('username', $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['currencyCode'] === null) { + $invalidProperties[] = "'currencyCode' can't be null"; + } + if ($this->container['password'] === null) { + $invalidProperties[] = "'password' can't be null"; + } + if ($this->container['paymentFlow'] === null) { + $invalidProperties[] = "'paymentFlow' can't be null"; + } + $allowedValues = $this->getPaymentFlowAllowableValues(); + if (!is_null($this->container['paymentFlow']) && !in_array($this->container['paymentFlow'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'paymentFlow', must be one of '%s'", + $this->container['paymentFlow'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['username'] === null) { + $invalidProperties[] = "'username' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currencyCode + * + * @return string + */ + public function getCurrencyCode() + { + return $this->container['currencyCode']; + } + + /** + * Sets currencyCode + * + * @param string $currencyCode The three-character ISO currency code, such as **EUR**. + * + * @return self + */ + public function setCurrencyCode($currencyCode) + { + $this->container['currencyCode'] = $currencyCode; + + return $this; + } + + /** + * Gets password + * + * @return string + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string $password The password provided by the acquirer. + * + * @return self + */ + public function setPassword($password) + { + $this->container['password'] = $password; + + return $this; + } + + /** + * Gets paymentFlow + * + * @return string + */ + public function getPaymentFlow() + { + return $this->container['paymentFlow']; + } + + /** + * Sets paymentFlow + * + * @param string $paymentFlow The sales channel used for the payment. + * + * @return self + */ + public function setPaymentFlow($paymentFlow) + { + $allowedValues = $this->getPaymentFlowAllowableValues(); + if (!in_array($paymentFlow, $allowedValues, true)) { + error_log( + sprintf( + "paymentFlow: unexpected enum value '%s' - Supported values are [%s]", + $paymentFlow, + implode(', ', $allowedValues) + ) + ); + } + $this->container['paymentFlow'] = $paymentFlow; + + return $this; + } + + /** + * Gets username + * + * @return string + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string $username The username provided by the acquirer. + * + * @return self + */ + public function setUsername($username) + { + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/InstallAndroidAppDetails.php b/src/Adyen/Model/Management/InstallAndroidAppDetails.php index f6524c1a4..2dd112e80 100644 --- a/src/Adyen/Model/Management/InstallAndroidAppDetails.php +++ b/src/Adyen/Model/Management/InstallAndroidAppDetails.php @@ -346,11 +346,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/Management/InstallAndroidCertificateDetails.php b/src/Adyen/Model/Management/InstallAndroidCertificateDetails.php index 4ebdbcba9..e35b981ca 100644 --- a/src/Adyen/Model/Management/InstallAndroidCertificateDetails.php +++ b/src/Adyen/Model/Management/InstallAndroidCertificateDetails.php @@ -346,11 +346,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/Management/JCBInfo.php b/src/Adyen/Model/Management/JCBInfo.php index a46491089..aeeb5d15f 100644 --- a/src/Adyen/Model/Management/JCBInfo.php +++ b/src/Adyen/Model/Management/JCBInfo.php @@ -388,11 +388,11 @@ public function setServiceLevel($serviceLevel) { $allowedValues = $this->getServiceLevelAllowableValues(); if (!in_array($serviceLevel, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'serviceLevel', must be one of '%s'", + "serviceLevel: unexpected enum value '%s' - Supported values are [%s]", $serviceLevel, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/Management/Key.php b/src/Adyen/Model/Management/Key.php index cb172d1b8..be6cd467a 100644 --- a/src/Adyen/Model/Management/Key.php +++ b/src/Adyen/Model/Management/Key.php @@ -324,7 +324,7 @@ public function getPassphrase() /** * Sets passphrase * - * @param string|null $passphrase The secure passphrase to protect the shared key. Must consist of: * At least 12 characters. * At least 1 uppercase letter: `[A-Z]`. * At least 1 lowercase letter: `[a-z]`. * At least 1 digit: `[0-9]`. * At least 1 special character. Limited to the following: `~`, `@`, `$`, `%`, `^`, `&`, `*`, `(`, `)`, `_`, `+`, `=`, `}`, `{`, `]`, `[`, `;`, `:`, `?`, `.`, `,`, `>`, `<`. + * @param string|null $passphrase The secure passphrase to protect the shared key. Must consist of: * At least 12 characters. * At least 1 uppercase letter: `[A-Z]`. * At least 1 lowercase letter: `[a-z]`. * At least 1 digit: `[0-9]`. * At least 1 special character. Limited to the following: `~`, `!`, `@`, `#`, `$`, `%`, `^`, `&`, `*`, `(`, `)`, `_`, `+`, `=`, `}`, `{`, `]`, `[`, `;`, `:`, `?`, `.`, `,`, `>`, `<`. * * @return self */ diff --git a/src/Adyen/Model/Management/KlarnaInfo.php b/src/Adyen/Model/Management/KlarnaInfo.php index e3c2b097c..20250f531 100644 --- a/src/Adyen/Model/Management/KlarnaInfo.php +++ b/src/Adyen/Model/Management/KlarnaInfo.php @@ -399,11 +399,11 @@ public function setRegion($region) { $allowedValues = $this->getRegionAllowableValues(); if (!in_array($region, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'region', must be one of '%s'", + "region: unexpected enum value '%s' - Supported values are [%s]", $region, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/Management/Moto.php b/src/Adyen/Model/Management/Moto.php new file mode 100644 index 000000000..c22a5d890 --- /dev/null +++ b/src/Adyen/Model/Management/Moto.php @@ -0,0 +1,435 @@ + + */ +class Moto implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Moto'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enableMoto' => 'bool', + 'maxAmount' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enableMoto' => null, + 'maxAmount' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'enableMoto' => false, + 'maxAmount' => 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 = [ + 'enableMoto' => 'enableMoto', + 'maxAmount' => 'maxAmount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enableMoto' => 'setEnableMoto', + 'maxAmount' => 'setMaxAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enableMoto' => 'getEnableMoto', + 'maxAmount' => 'getMaxAmount' + ]; + + /** + * 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('enableMoto', $data ?? [], null); + $this->setIfExists('maxAmount', $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 enableMoto + * + * @return bool|null + */ + public function getEnableMoto() + { + return $this->container['enableMoto']; + } + + /** + * Sets enableMoto + * + * @param bool|null $enableMoto Enable MOTO transactions. + * + * @return self + */ + public function setEnableMoto($enableMoto) + { + $this->container['enableMoto'] = $enableMoto; + + return $this; + } + + /** + * Gets maxAmount + * + * @return int|null + */ + public function getMaxAmount() + { + return $this->container['maxAmount']; + } + + /** + * Sets maxAmount + * + * @param int|null $maxAmount The maximum amount for MOTO transactions. You need to set the currency for this amount using the [`standalone.currencyCode`](https://docs.adyen.com/api-explorer/Management/1/patch/companies/(companyId)/terminalSettings#request-standalone-currencyCode) parameter. Do not enable standalone, unless you are using a standalone solution. + * + * @return self + */ + public function setMaxAmount($maxAmount) + { + $this->container['maxAmount'] = $maxAmount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Notification.php b/src/Adyen/Model/Management/Notification.php index 38aaeba32..148e75bc5 100644 --- a/src/Adyen/Model/Management/Notification.php +++ b/src/Adyen/Model/Management/Notification.php @@ -347,11 +347,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) ) ); } diff --git a/src/Adyen/Model/Management/NyceInfo.php b/src/Adyen/Model/Management/NyceInfo.php index 156774b11..5e701ac69 100644 --- a/src/Adyen/Model/Management/NyceInfo.php +++ b/src/Adyen/Model/Management/NyceInfo.php @@ -329,11 +329,11 @@ public function setProcessingType($processingType) { $allowedValues = $this->getProcessingTypeAllowableValues(); if (!in_array($processingType, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'processingType', must be one of '%s'", + "processingType: unexpected enum value '%s' - Supported values are [%s]", $processingType, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/Management/PayAtTable.php b/src/Adyen/Model/Management/PayAtTable.php index 56cfdd044..a909b1fff 100644 --- a/src/Adyen/Model/Management/PayAtTable.php +++ b/src/Adyen/Model/Management/PayAtTable.php @@ -354,11 +354,11 @@ public function setAuthenticationMethod($authenticationMethod) { $allowedValues = $this->getAuthenticationMethodAllowableValues(); if (!in_array($authenticationMethod, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'authenticationMethod', must be one of '%s'", + "authenticationMethod: unexpected enum value '%s' - Supported values are [%s]", $authenticationMethod, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -422,11 +422,11 @@ public function setPaymentInstrument($paymentInstrument) } $allowedValues = $this->getPaymentInstrumentAllowableValues(); if (!is_null($paymentInstrument) && !in_array($paymentInstrument, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'paymentInstrument', must be one of '%s'", + "paymentInstrument: unexpected enum value '%s' - Supported values are [%s]", $paymentInstrument, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/Management/PayByBankPlaidInfo.php b/src/Adyen/Model/Management/PayByBankPlaidInfo.php index c9985ad57..310cc4831 100644 --- a/src/Adyen/Model/Management/PayByBankPlaidInfo.php +++ b/src/Adyen/Model/Management/PayByBankPlaidInfo.php @@ -29,70 +29,49 @@ class PayByBankPlaidInfo implements ModelInterface, ArrayAccess, \JsonSerializab public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'PayByBankPlaidInfo'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ - 'countryCode' => 'string', 'logo' => 'string', - 'merchantCity' => 'string', - 'merchantLegalName' => 'string', - 'merchantShopUrl' => 'string', - 'merchantStateProvince' => 'string', - 'merchantStreetAddress' => 'string', - 'transactionDescription' => '\Adyen\Model\Management\TransactionDescriptionInfo', - 'zipCode' => 'string' + 'transactionDescription' => '\Adyen\Model\Management\TransactionDescriptionInfo' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ - 'countryCode' => null, 'logo' => null, - 'merchantCity' => null, - 'merchantLegalName' => null, - 'merchantShopUrl' => null, - 'merchantStateProvince' => null, - 'merchantStreetAddress' => null, - 'transactionDescription' => null, - 'zipCode' => null + 'transactionDescription' => null ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static $openAPINullables = [ - 'countryCode' => false, 'logo' => false, - 'merchantCity' => false, - 'merchantLegalName' => false, - 'merchantShopUrl' => false, - 'merchantStateProvince' => false, - 'merchantStreetAddress' => false, - 'transactionDescription' => false, - 'zipCode' => false + 'transactionDescription' => false ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected $openAPINullablesSetToNull = []; /** @@ -174,15 +153,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'countryCode' => 'countryCode', 'logo' => 'logo', - 'merchantCity' => 'merchantCity', - 'merchantLegalName' => 'merchantLegalName', - 'merchantShopUrl' => 'merchantShopUrl', - 'merchantStateProvince' => 'merchantStateProvince', - 'merchantStreetAddress' => 'merchantStreetAddress', - 'transactionDescription' => 'transactionDescription', - 'zipCode' => 'zipCode' + 'transactionDescription' => 'transactionDescription' ]; /** @@ -191,15 +163,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'countryCode' => 'setCountryCode', 'logo' => 'setLogo', - 'merchantCity' => 'setMerchantCity', - 'merchantLegalName' => 'setMerchantLegalName', - 'merchantShopUrl' => 'setMerchantShopUrl', - 'merchantStateProvince' => 'setMerchantStateProvince', - 'merchantStreetAddress' => 'setMerchantStreetAddress', - 'transactionDescription' => 'setTransactionDescription', - 'zipCode' => 'setZipCode' + 'transactionDescription' => 'setTransactionDescription' ]; /** @@ -208,15 +173,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'countryCode' => 'getCountryCode', 'logo' => 'getLogo', - 'merchantCity' => 'getMerchantCity', - 'merchantLegalName' => 'getMerchantLegalName', - 'merchantShopUrl' => 'getMerchantShopUrl', - 'merchantStateProvince' => 'getMerchantStateProvince', - 'merchantStreetAddress' => 'getMerchantStreetAddress', - 'transactionDescription' => 'getTransactionDescription', - 'zipCode' => 'getZipCode' + 'transactionDescription' => 'getTransactionDescription' ]; /** @@ -276,26 +234,19 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('countryCode', $data ?? [], null); $this->setIfExists('logo', $data ?? [], null); - $this->setIfExists('merchantCity', $data ?? [], null); - $this->setIfExists('merchantLegalName', $data ?? [], null); - $this->setIfExists('merchantShopUrl', $data ?? [], null); - $this->setIfExists('merchantStateProvince', $data ?? [], null); - $this->setIfExists('merchantStreetAddress', $data ?? [], null); $this->setIfExists('transactionDescription', $data ?? [], null); - $this->setIfExists('zipCode', $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 - */ + * 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])) { @@ -329,30 +280,6 @@ public function valid() } - /** - * Gets countryCode - * - * @return string|null - */ - public function getCountryCode() - { - return $this->container['countryCode']; - } - - /** - * Sets countryCode - * - * @param string|null $countryCode Country Code. - * - * @return self - */ - public function setCountryCode($countryCode) - { - $this->container['countryCode'] = $countryCode; - - return $this; - } - /** * Gets logo * @@ -377,126 +304,6 @@ public function setLogo($logo) return $this; } - /** - * Gets merchantCity - * - * @return string|null - */ - public function getMerchantCity() - { - return $this->container['merchantCity']; - } - - /** - * Sets merchantCity - * - * @param string|null $merchantCity The city the merchant is doing business in. - * - * @return self - */ - public function setMerchantCity($merchantCity) - { - $this->container['merchantCity'] = $merchantCity; - - return $this; - } - - /** - * Gets merchantLegalName - * - * @return string|null - */ - public function getMerchantLegalName() - { - return $this->container['merchantLegalName']; - } - - /** - * Sets merchantLegalName - * - * @param string|null $merchantLegalName Legal Business Name of the Merchant. - * - * @return self - */ - public function setMerchantLegalName($merchantLegalName) - { - $this->container['merchantLegalName'] = $merchantLegalName; - - return $this; - } - - /** - * Gets merchantShopUrl - * - * @return string|null - */ - public function getMerchantShopUrl() - { - return $this->container['merchantShopUrl']; - } - - /** - * Sets merchantShopUrl - * - * @param string|null $merchantShopUrl Merchant shop url. - * - * @return self - */ - public function setMerchantShopUrl($merchantShopUrl) - { - $this->container['merchantShopUrl'] = $merchantShopUrl; - - return $this; - } - - /** - * Gets merchantStateProvince - * - * @return string|null - */ - public function getMerchantStateProvince() - { - return $this->container['merchantStateProvince']; - } - - /** - * Sets merchantStateProvince - * - * @param string|null $merchantStateProvince The state/province of the merchant. - * - * @return self - */ - public function setMerchantStateProvince($merchantStateProvince) - { - $this->container['merchantStateProvince'] = $merchantStateProvince; - - return $this; - } - - /** - * Gets merchantStreetAddress - * - * @return string|null - */ - public function getMerchantStreetAddress() - { - return $this->container['merchantStreetAddress']; - } - - /** - * Sets merchantStreetAddress - * - * @param string|null $merchantStreetAddress The street address of the merchant. - * - * @return self - */ - public function setMerchantStreetAddress($merchantStreetAddress) - { - $this->container['merchantStreetAddress'] = $merchantStreetAddress; - - return $this; - } - /** * Gets transactionDescription * @@ -520,30 +327,6 @@ public function setTransactionDescription($transactionDescription) return $this; } - - /** - * Gets zipCode - * - * @return string|null - */ - public function getZipCode() - { - return $this->container['zipCode']; - } - - /** - * Sets zipCode - * - * @param string|null $zipCode The zip code of the account. - * - * @return self - */ - public function setZipCode($zipCode) - { - $this->container['zipCode'] = $zipCode; - - return $this; - } /** * Returns true if offset exists. False otherwise. * @@ -620,10 +403,10 @@ public function toArray(): array // 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 + // 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 + // 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; diff --git a/src/Adyen/Model/Management/Payment.php b/src/Adyen/Model/Management/Payment.php index 55fb199f0..ac1a9f8a7 100644 --- a/src/Adyen/Model/Management/Payment.php +++ b/src/Adyen/Model/Management/Payment.php @@ -293,7 +293,7 @@ public function getContactlessCurrency() /** * Sets contactlessCurrency * - * @param string|null $contactlessCurrency The default currency for contactless payments on the payment terminal, as the three-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. + * @param string|null $contactlessCurrency The default currency for contactless payments on the payment terminal, in three-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code format. Contact Adyen before you update this setting for the first time. To enable you to change the contactless currency, we first need to check if you meet the compliance requirements. * * @return self */ diff --git a/src/Adyen/Model/Management/PaymentMethod.php b/src/Adyen/Model/Management/PaymentMethod.php index e3e2152a9..74ad88266 100644 --- a/src/Adyen/Model/Management/PaymentMethod.php +++ b/src/Adyen/Model/Management/PaymentMethod.php @@ -62,6 +62,7 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'eftposAustralia' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'enabled' => 'bool', 'girocard' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'givex' => '\Adyen\Model\Management\GivexInfo', 'googlePay' => '\Adyen\Model\Management\GooglePayInfo', 'id' => 'string', 'ideal' => '\Adyen\Model\Management\GenericPmWithTdiInfo', @@ -85,10 +86,12 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'sofort' => '\Adyen\Model\Management\SofortInfo', 'star' => '\Adyen\Model\Management\StarInfo', 'storeIds' => 'string[]', + 'svs' => '\Adyen\Model\Management\SvsInfo', 'swish' => '\Adyen\Model\Management\SwishInfo', 'ticket' => '\Adyen\Model\Management\TicketInfo', 'twint' => '\Adyen\Model\Management\TwintInfo', 'type' => 'string', + 'valuelink' => '\Adyen\Model\Management\ValuelinkInfo', 'verificationStatus' => 'string', 'vipps' => '\Adyen\Model\Management\VippsInfo', 'visa' => '\Adyen\Model\Management\GenericPmWithTdiInfo', @@ -125,6 +128,7 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'eftposAustralia' => null, 'enabled' => null, 'girocard' => null, + 'givex' => null, 'googlePay' => null, 'id' => null, 'ideal' => null, @@ -148,10 +152,12 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'sofort' => null, 'star' => null, 'storeIds' => null, + 'svs' => null, 'swish' => null, 'ticket' => null, 'twint' => null, 'type' => null, + 'valuelink' => null, 'verificationStatus' => null, 'vipps' => null, 'visa' => null, @@ -186,6 +192,7 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'eftposAustralia' => false, 'enabled' => false, 'girocard' => false, + 'givex' => false, 'googlePay' => false, 'id' => false, 'ideal' => false, @@ -209,10 +216,12 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'sofort' => false, 'star' => false, 'storeIds' => false, + 'svs' => false, 'swish' => false, 'ticket' => false, 'twint' => false, 'type' => false, + 'valuelink' => false, 'verificationStatus' => false, 'vipps' => false, 'visa' => false, @@ -327,6 +336,7 @@ public function isNullableSetToNull(string $property): bool 'eftposAustralia' => 'eftpos_australia', 'enabled' => 'enabled', 'girocard' => 'girocard', + 'givex' => 'givex', 'googlePay' => 'googlePay', 'id' => 'id', 'ideal' => 'ideal', @@ -350,10 +360,12 @@ public function isNullableSetToNull(string $property): bool 'sofort' => 'sofort', 'star' => 'star', 'storeIds' => 'storeIds', + 'svs' => 'svs', 'swish' => 'swish', 'ticket' => 'ticket', 'twint' => 'twint', 'type' => 'type', + 'valuelink' => 'valuelink', 'verificationStatus' => 'verificationStatus', 'vipps' => 'vipps', 'visa' => 'visa', @@ -388,6 +400,7 @@ public function isNullableSetToNull(string $property): bool 'eftposAustralia' => 'setEftposAustralia', 'enabled' => 'setEnabled', 'girocard' => 'setGirocard', + 'givex' => 'setGivex', 'googlePay' => 'setGooglePay', 'id' => 'setId', 'ideal' => 'setIdeal', @@ -411,10 +424,12 @@ public function isNullableSetToNull(string $property): bool 'sofort' => 'setSofort', 'star' => 'setStar', 'storeIds' => 'setStoreIds', + 'svs' => 'setSvs', 'swish' => 'setSwish', 'ticket' => 'setTicket', 'twint' => 'setTwint', 'type' => 'setType', + 'valuelink' => 'setValuelink', 'verificationStatus' => 'setVerificationStatus', 'vipps' => 'setVipps', 'visa' => 'setVisa', @@ -449,6 +464,7 @@ public function isNullableSetToNull(string $property): bool 'eftposAustralia' => 'getEftposAustralia', 'enabled' => 'getEnabled', 'girocard' => 'getGirocard', + 'givex' => 'getGivex', 'googlePay' => 'getGooglePay', 'id' => 'getId', 'ideal' => 'getIdeal', @@ -472,10 +488,12 @@ public function isNullableSetToNull(string $property): bool 'sofort' => 'getSofort', 'star' => 'getStar', 'storeIds' => 'getStoreIds', + 'svs' => 'getSvs', 'swish' => 'getSwish', 'ticket' => 'getTicket', 'twint' => 'getTwint', 'type' => 'getType', + 'valuelink' => 'getValuelink', 'verificationStatus' => 'getVerificationStatus', 'vipps' => 'getVipps', 'visa' => 'getVisa', @@ -579,6 +597,7 @@ public function __construct(?array $data = null) $this->setIfExists('eftposAustralia', $data ?? [], null); $this->setIfExists('enabled', $data ?? [], null); $this->setIfExists('girocard', $data ?? [], null); + $this->setIfExists('givex', $data ?? [], null); $this->setIfExists('googlePay', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('ideal', $data ?? [], null); @@ -602,10 +621,12 @@ public function __construct(?array $data = null) $this->setIfExists('sofort', $data ?? [], null); $this->setIfExists('star', $data ?? [], null); $this->setIfExists('storeIds', $data ?? [], null); + $this->setIfExists('svs', $data ?? [], null); $this->setIfExists('swish', $data ?? [], null); $this->setIfExists('ticket', $data ?? [], null); $this->setIfExists('twint', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('valuelink', $data ?? [], null); $this->setIfExists('verificationStatus', $data ?? [], null); $this->setIfExists('vipps', $data ?? [], null); $this->setIfExists('visa', $data ?? [], null); @@ -1171,6 +1192,30 @@ public function setGirocard($girocard) return $this; } + /** + * Gets givex + * + * @return \Adyen\Model\Management\GivexInfo|null + */ + public function getGivex() + { + return $this->container['givex']; + } + + /** + * Sets givex + * + * @param \Adyen\Model\Management\GivexInfo|null $givex givex + * + * @return self + */ + public function setGivex($givex) + { + $this->container['givex'] = $givex; + + return $this; + } + /** * Gets googlePay * @@ -1723,6 +1768,30 @@ public function setStoreIds($storeIds) return $this; } + /** + * Gets svs + * + * @return \Adyen\Model\Management\SvsInfo|null + */ + public function getSvs() + { + return $this->container['svs']; + } + + /** + * Sets svs + * + * @param \Adyen\Model\Management\SvsInfo|null $svs svs + * + * @return self + */ + public function setSvs($svs) + { + $this->container['svs'] = $svs; + + return $this; + } + /** * Gets swish * @@ -1819,6 +1888,30 @@ public function setType($type) return $this; } + /** + * Gets valuelink + * + * @return \Adyen\Model\Management\ValuelinkInfo|null + */ + public function getValuelink() + { + return $this->container['valuelink']; + } + + /** + * Sets valuelink + * + * @param \Adyen\Model\Management\ValuelinkInfo|null $valuelink valuelink + * + * @return self + */ + public function setValuelink($valuelink) + { + $this->container['valuelink'] = $valuelink; + + return $this; + } + /** * Gets verificationStatus * @@ -1840,11 +1933,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/Management/PaymentMethodResponse.php b/src/Adyen/Model/Management/PaymentMethodResponse.php index e2c94078c..10b2781f6 100644 --- a/src/Adyen/Model/Management/PaymentMethodResponse.php +++ b/src/Adyen/Model/Management/PaymentMethodResponse.php @@ -260,6 +260,8 @@ public function getModelName() public const TYPES_WITH_ERRORS_BANESE_CARD_PREPAID = 'banese_card_prepaid'; public const TYPES_WITH_ERRORS_BCMC = 'bcmc'; public const TYPES_WITH_ERRORS_BLIK = 'blik'; + public const TYPES_WITH_ERRORS_BLIK_POS = 'blik_pos'; + public const TYPES_WITH_ERRORS_BR_SCHEMES = 'br_schemes'; public const TYPES_WITH_ERRORS_CARTEBANCAIRE = 'cartebancaire'; public const TYPES_WITH_ERRORS_CLEARPAY = 'clearpay'; public const TYPES_WITH_ERRORS_CLICKTOPAY = 'clicktopay'; @@ -285,6 +287,7 @@ public function getModelName() public const TYPES_WITH_ERRORS_ELOCREDIT = 'elocredit'; public const TYPES_WITH_ERRORS_ELODEBIT = 'elodebit'; public const TYPES_WITH_ERRORS_GIROCARD = 'girocard'; + public const TYPES_WITH_ERRORS_GIVEX = 'givex'; public const TYPES_WITH_ERRORS_GOOGLEPAY = 'googlepay'; public const TYPES_WITH_ERRORS_GREEN_CARD = 'green_card'; public const TYPES_WITH_ERRORS_GREEN_CARD_CREDIT = 'green_card_credit'; @@ -299,6 +302,7 @@ public function getModelName() public const TYPES_WITH_ERRORS_JCB = 'jcb'; public const TYPES_WITH_ERRORS_KLARNA = 'klarna'; public const TYPES_WITH_ERRORS_KLARNA_ACCOUNT = 'klarna_account'; + public const TYPES_WITH_ERRORS_KLARNA_B2B = 'klarna_b2b'; public const TYPES_WITH_ERRORS_KLARNA_PAYNOW = 'klarna_paynow'; public const TYPES_WITH_ERRORS_LE_CARD = 'le_card'; public const TYPES_WITH_ERRORS_LE_CARD_CREDIT = 'le_card_credit'; @@ -340,6 +344,7 @@ public function getModelName() public const TYPES_WITH_ERRORS_SEPADIRECTDEBIT = 'sepadirectdebit'; public const TYPES_WITH_ERRORS_SODEXO = 'sodexo'; public const TYPES_WITH_ERRORS_STAR = 'star'; + public const TYPES_WITH_ERRORS_SVS = 'svs'; public const TYPES_WITH_ERRORS_SWISH = 'swish'; public const TYPES_WITH_ERRORS_TICKET = 'ticket'; public const TYPES_WITH_ERRORS_TODO_GIFTCARD = 'todo_giftcard'; @@ -352,6 +357,7 @@ public function getModelName() public const TYPES_WITH_ERRORS_UP_BRAZIL_PREPAID = 'up_brazil_prepaid'; public const TYPES_WITH_ERRORS_VALE_REFEICAO = 'vale_refeicao'; public const TYPES_WITH_ERRORS_VALE_REFEICAO_PREPAID = 'vale_refeicao_prepaid'; + public const TYPES_WITH_ERRORS_VALUELINK = 'valuelink'; public const TYPES_WITH_ERRORS_VEGAS_CARD = 'vegas_card'; public const TYPES_WITH_ERRORS_VEGAS_CARD_CREDIT = 'vegas_card_credit'; public const TYPES_WITH_ERRORS_VEGAS_CARD_DEBIT = 'vegas_card_debit'; @@ -398,6 +404,8 @@ public function getTypesWithErrorsAllowableValues() self::TYPES_WITH_ERRORS_BANESE_CARD_PREPAID, self::TYPES_WITH_ERRORS_BCMC, self::TYPES_WITH_ERRORS_BLIK, + self::TYPES_WITH_ERRORS_BLIK_POS, + self::TYPES_WITH_ERRORS_BR_SCHEMES, self::TYPES_WITH_ERRORS_CARTEBANCAIRE, self::TYPES_WITH_ERRORS_CLEARPAY, self::TYPES_WITH_ERRORS_CLICKTOPAY, @@ -423,6 +431,7 @@ public function getTypesWithErrorsAllowableValues() self::TYPES_WITH_ERRORS_ELOCREDIT, self::TYPES_WITH_ERRORS_ELODEBIT, self::TYPES_WITH_ERRORS_GIROCARD, + self::TYPES_WITH_ERRORS_GIVEX, self::TYPES_WITH_ERRORS_GOOGLEPAY, self::TYPES_WITH_ERRORS_GREEN_CARD, self::TYPES_WITH_ERRORS_GREEN_CARD_CREDIT, @@ -437,6 +446,7 @@ public function getTypesWithErrorsAllowableValues() self::TYPES_WITH_ERRORS_JCB, self::TYPES_WITH_ERRORS_KLARNA, self::TYPES_WITH_ERRORS_KLARNA_ACCOUNT, + self::TYPES_WITH_ERRORS_KLARNA_B2B, self::TYPES_WITH_ERRORS_KLARNA_PAYNOW, self::TYPES_WITH_ERRORS_LE_CARD, self::TYPES_WITH_ERRORS_LE_CARD_CREDIT, @@ -478,6 +488,7 @@ public function getTypesWithErrorsAllowableValues() self::TYPES_WITH_ERRORS_SEPADIRECTDEBIT, self::TYPES_WITH_ERRORS_SODEXO, self::TYPES_WITH_ERRORS_STAR, + self::TYPES_WITH_ERRORS_SVS, self::TYPES_WITH_ERRORS_SWISH, self::TYPES_WITH_ERRORS_TICKET, self::TYPES_WITH_ERRORS_TODO_GIFTCARD, @@ -490,6 +501,7 @@ public function getTypesWithErrorsAllowableValues() self::TYPES_WITH_ERRORS_UP_BRAZIL_PREPAID, self::TYPES_WITH_ERRORS_VALE_REFEICAO, self::TYPES_WITH_ERRORS_VALE_REFEICAO_PREPAID, + self::TYPES_WITH_ERRORS_VALUELINK, self::TYPES_WITH_ERRORS_VEGAS_CARD, self::TYPES_WITH_ERRORS_VEGAS_CARD_CREDIT, self::TYPES_WITH_ERRORS_VEGAS_CARD_DEBIT, diff --git a/src/Adyen/Model/Management/PaymentMethodSetupInfo.php b/src/Adyen/Model/Management/PaymentMethodSetupInfo.php index c2ec6ebbc..70f871812 100644 --- a/src/Adyen/Model/Management/PaymentMethodSetupInfo.php +++ b/src/Adyen/Model/Management/PaymentMethodSetupInfo.php @@ -60,6 +60,7 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'eftDirectdebitCA' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'eftposAustralia' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'girocard' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'givex' => '\Adyen\Model\Management\GivexInfo', 'googlePay' => '\Adyen\Model\Management\GooglePayInfo', 'ideal' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'interacCard' => '\Adyen\Model\Management\GenericPmWithTdiInfo', @@ -82,10 +83,12 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'sofort' => '\Adyen\Model\Management\SofortInfo', 'star' => '\Adyen\Model\Management\StarInfo', 'storeIds' => 'string[]', + 'svs' => '\Adyen\Model\Management\SvsInfo', 'swish' => '\Adyen\Model\Management\SwishInfo', 'ticket' => '\Adyen\Model\Management\TicketInfo', 'twint' => '\Adyen\Model\Management\TwintInfo', 'type' => 'string', + 'valuelink' => '\Adyen\Model\Management\ValuelinkInfo', 'vipps' => '\Adyen\Model\Management\VippsInfo', 'visa' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'wechatpay' => '\Adyen\Model\Management\WeChatPayInfo', @@ -119,6 +122,7 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'eftDirectdebitCA' => null, 'eftposAustralia' => null, 'girocard' => null, + 'givex' => null, 'googlePay' => null, 'ideal' => null, 'interacCard' => null, @@ -141,10 +145,12 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'sofort' => null, 'star' => null, 'storeIds' => null, + 'svs' => null, 'swish' => null, 'ticket' => null, 'twint' => null, 'type' => null, + 'valuelink' => null, 'vipps' => null, 'visa' => null, 'wechatpay' => null, @@ -176,6 +182,7 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'eftDirectdebitCA' => false, 'eftposAustralia' => false, 'girocard' => false, + 'givex' => false, 'googlePay' => false, 'ideal' => false, 'interacCard' => false, @@ -198,10 +205,12 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'sofort' => false, 'star' => false, 'storeIds' => false, + 'svs' => false, 'swish' => false, 'ticket' => false, 'twint' => false, 'type' => false, + 'valuelink' => false, 'vipps' => false, 'visa' => false, 'wechatpay' => false, @@ -313,6 +322,7 @@ public function isNullableSetToNull(string $property): bool 'eftDirectdebitCA' => 'eft_directdebit_CA', 'eftposAustralia' => 'eftpos_australia', 'girocard' => 'girocard', + 'givex' => 'givex', 'googlePay' => 'googlePay', 'ideal' => 'ideal', 'interacCard' => 'interac_card', @@ -335,10 +345,12 @@ public function isNullableSetToNull(string $property): bool 'sofort' => 'sofort', 'star' => 'star', 'storeIds' => 'storeIds', + 'svs' => 'svs', 'swish' => 'swish', 'ticket' => 'ticket', 'twint' => 'twint', 'type' => 'type', + 'valuelink' => 'valuelink', 'vipps' => 'vipps', 'visa' => 'visa', 'wechatpay' => 'wechatpay', @@ -370,6 +382,7 @@ public function isNullableSetToNull(string $property): bool 'eftDirectdebitCA' => 'setEftDirectdebitCA', 'eftposAustralia' => 'setEftposAustralia', 'girocard' => 'setGirocard', + 'givex' => 'setGivex', 'googlePay' => 'setGooglePay', 'ideal' => 'setIdeal', 'interacCard' => 'setInteracCard', @@ -392,10 +405,12 @@ public function isNullableSetToNull(string $property): bool 'sofort' => 'setSofort', 'star' => 'setStar', 'storeIds' => 'setStoreIds', + 'svs' => 'setSvs', 'swish' => 'setSwish', 'ticket' => 'setTicket', 'twint' => 'setTwint', 'type' => 'setType', + 'valuelink' => 'setValuelink', 'vipps' => 'setVipps', 'visa' => 'setVisa', 'wechatpay' => 'setWechatpay', @@ -427,6 +442,7 @@ public function isNullableSetToNull(string $property): bool 'eftDirectdebitCA' => 'getEftDirectdebitCA', 'eftposAustralia' => 'getEftposAustralia', 'girocard' => 'getGirocard', + 'givex' => 'getGivex', 'googlePay' => 'getGooglePay', 'ideal' => 'getIdeal', 'interacCard' => 'getInteracCard', @@ -449,10 +465,12 @@ public function isNullableSetToNull(string $property): bool 'sofort' => 'getSofort', 'star' => 'getStar', 'storeIds' => 'getStoreIds', + 'svs' => 'getSvs', 'swish' => 'getSwish', 'ticket' => 'getTicket', 'twint' => 'getTwint', 'type' => 'getType', + 'valuelink' => 'getValuelink', 'vipps' => 'getVipps', 'visa' => 'getVisa', 'wechatpay' => 'getWechatpay', @@ -528,6 +546,8 @@ public function getModelName() public const TYPE_BANESE_CARD_PREPAID = 'banese_card_prepaid'; public const TYPE_BCMC = 'bcmc'; public const TYPE_BLIK = 'blik'; + public const TYPE_BLIK_POS = 'blik_pos'; + public const TYPE_BR_SCHEMES = 'br_schemes'; public const TYPE_CARTEBANCAIRE = 'cartebancaire'; public const TYPE_CLEARPAY = 'clearpay'; public const TYPE_CLICKTOPAY = 'clicktopay'; @@ -553,6 +573,7 @@ public function getModelName() public const TYPE_ELOCREDIT = 'elocredit'; public const TYPE_ELODEBIT = 'elodebit'; public const TYPE_GIROCARD = 'girocard'; + public const TYPE_GIVEX = 'givex'; public const TYPE_GOOGLEPAY = 'googlepay'; public const TYPE_GREEN_CARD = 'green_card'; public const TYPE_GREEN_CARD_CREDIT = 'green_card_credit'; @@ -567,6 +588,7 @@ public function getModelName() public const TYPE_JCB = 'jcb'; public const TYPE_KLARNA = 'klarna'; public const TYPE_KLARNA_ACCOUNT = 'klarna_account'; + public const TYPE_KLARNA_B2B = 'klarna_b2b'; public const TYPE_KLARNA_PAYNOW = 'klarna_paynow'; public const TYPE_LE_CARD = 'le_card'; public const TYPE_LE_CARD_CREDIT = 'le_card_credit'; @@ -608,6 +630,7 @@ public function getModelName() public const TYPE_SEPADIRECTDEBIT = 'sepadirectdebit'; public const TYPE_SODEXO = 'sodexo'; public const TYPE_STAR = 'star'; + public const TYPE_SVS = 'svs'; public const TYPE_SWISH = 'swish'; public const TYPE_TICKET = 'ticket'; public const TYPE_TODO_GIFTCARD = 'todo_giftcard'; @@ -620,6 +643,7 @@ public function getModelName() public const TYPE_UP_BRAZIL_PREPAID = 'up_brazil_prepaid'; public const TYPE_VALE_REFEICAO = 'vale_refeicao'; public const TYPE_VALE_REFEICAO_PREPAID = 'vale_refeicao_prepaid'; + public const TYPE_VALUELINK = 'valuelink'; public const TYPE_VEGAS_CARD = 'vegas_card'; public const TYPE_VEGAS_CARD_CREDIT = 'vegas_card_credit'; public const TYPE_VEGAS_CARD_DEBIT = 'vegas_card_debit'; @@ -680,6 +704,8 @@ public function getTypeAllowableValues() self::TYPE_BANESE_CARD_PREPAID, self::TYPE_BCMC, self::TYPE_BLIK, + self::TYPE_BLIK_POS, + self::TYPE_BR_SCHEMES, self::TYPE_CARTEBANCAIRE, self::TYPE_CLEARPAY, self::TYPE_CLICKTOPAY, @@ -705,6 +731,7 @@ public function getTypeAllowableValues() self::TYPE_ELOCREDIT, self::TYPE_ELODEBIT, self::TYPE_GIROCARD, + self::TYPE_GIVEX, self::TYPE_GOOGLEPAY, self::TYPE_GREEN_CARD, self::TYPE_GREEN_CARD_CREDIT, @@ -719,6 +746,7 @@ public function getTypeAllowableValues() self::TYPE_JCB, self::TYPE_KLARNA, self::TYPE_KLARNA_ACCOUNT, + self::TYPE_KLARNA_B2B, self::TYPE_KLARNA_PAYNOW, self::TYPE_LE_CARD, self::TYPE_LE_CARD_CREDIT, @@ -760,6 +788,7 @@ public function getTypeAllowableValues() self::TYPE_SEPADIRECTDEBIT, self::TYPE_SODEXO, self::TYPE_STAR, + self::TYPE_SVS, self::TYPE_SWISH, self::TYPE_TICKET, self::TYPE_TODO_GIFTCARD, @@ -772,6 +801,7 @@ public function getTypeAllowableValues() self::TYPE_UP_BRAZIL_PREPAID, self::TYPE_VALE_REFEICAO, self::TYPE_VALE_REFEICAO_PREPAID, + self::TYPE_VALUELINK, self::TYPE_VEGAS_CARD, self::TYPE_VEGAS_CARD_CREDIT, self::TYPE_VEGAS_CARD_DEBIT, @@ -821,6 +851,7 @@ public function __construct(?array $data = null) $this->setIfExists('eftDirectdebitCA', $data ?? [], null); $this->setIfExists('eftposAustralia', $data ?? [], null); $this->setIfExists('girocard', $data ?? [], null); + $this->setIfExists('givex', $data ?? [], null); $this->setIfExists('googlePay', $data ?? [], null); $this->setIfExists('ideal', $data ?? [], null); $this->setIfExists('interacCard', $data ?? [], null); @@ -843,10 +874,12 @@ public function __construct(?array $data = null) $this->setIfExists('sofort', $data ?? [], null); $this->setIfExists('star', $data ?? [], null); $this->setIfExists('storeIds', $data ?? [], null); + $this->setIfExists('svs', $data ?? [], null); $this->setIfExists('swish', $data ?? [], null); $this->setIfExists('ticket', $data ?? [], null); $this->setIfExists('twint', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('valuelink', $data ?? [], null); $this->setIfExists('vipps', $data ?? [], null); $this->setIfExists('visa', $data ?? [], null); $this->setIfExists('wechatpay', $data ?? [], null); @@ -1372,6 +1405,30 @@ public function setGirocard($girocard) return $this; } + /** + * Gets givex + * + * @return \Adyen\Model\Management\GivexInfo|null + */ + public function getGivex() + { + return $this->container['givex']; + } + + /** + * Sets givex + * + * @param \Adyen\Model\Management\GivexInfo|null $givex givex + * + * @return self + */ + public function setGivex($givex) + { + $this->container['givex'] = $givex; + + return $this; + } + /** * Gets googlePay * @@ -1801,11 +1858,11 @@ public function setShopperInteraction($shopperInteraction) { $allowedValues = $this->getShopperInteractionAllowableValues(); if (!in_array($shopperInteraction, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'shopperInteraction', must be one of '%s'", + "shopperInteraction: unexpected enum value '%s' - Supported values are [%s]", $shopperInteraction, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -1910,6 +1967,30 @@ public function setStoreIds($storeIds) return $this; } + /** + * Gets svs + * + * @return \Adyen\Model\Management\SvsInfo|null + */ + public function getSvs() + { + return $this->container['svs']; + } + + /** + * Sets svs + * + * @param \Adyen\Model\Management\SvsInfo|null $svs svs + * + * @return self + */ + public function setSvs($svs) + { + $this->container['svs'] = $svs; + + return $this; + } + /** * Gets swish * @@ -2003,11 +2084,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) ) ); } @@ -2016,6 +2097,30 @@ public function setType($type) return $this; } + /** + * Gets valuelink + * + * @return \Adyen\Model\Management\ValuelinkInfo|null + */ + public function getValuelink() + { + return $this->container['valuelink']; + } + + /** + * Sets valuelink + * + * @param \Adyen\Model\Management\ValuelinkInfo|null $valuelink valuelink + * + * @return self + */ + public function setValuelink($valuelink) + { + $this->container['valuelink'] = $valuelink; + + return $this; + } + /** * Gets vipps * diff --git a/src/Adyen/Model/Management/PayoutSettings.php b/src/Adyen/Model/Management/PayoutSettings.php index db4952c52..c327597b2 100644 --- a/src/Adyen/Model/Management/PayoutSettings.php +++ b/src/Adyen/Model/Management/PayoutSettings.php @@ -490,11 +490,11 @@ public function setPriority($priority) { $allowedValues = $this->getPriorityAllowableValues(); if (!in_array($priority, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'priority', must be one of '%s'", + "priority: unexpected enum value '%s' - Supported values are [%s]", $priority, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -548,11 +548,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/Management/PulseInfo.php b/src/Adyen/Model/Management/PulseInfo.php index 06a526dad..55e3d29b4 100644 --- a/src/Adyen/Model/Management/PulseInfo.php +++ b/src/Adyen/Model/Management/PulseInfo.php @@ -329,11 +329,11 @@ public function setProcessingType($processingType) { $allowedValues = $this->getProcessingTypeAllowableValues(); if (!in_array($processingType, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'processingType', must be one of '%s'", + "processingType: unexpected enum value '%s' - Supported values are [%s]", $processingType, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/Management/Refunds.php b/src/Adyen/Model/Management/Refunds.php index b2961f402..5e6efdea7 100644 --- a/src/Adyen/Model/Management/Refunds.php +++ b/src/Adyen/Model/Management/Refunds.php @@ -41,7 +41,8 @@ class Refunds implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'referenced' => '\Adyen\Model\Management\Referenced' + 'referenced' => '\Adyen\Model\Management\Referenced', + 'unreferenced' => '\Adyen\Model\Management\Unreferenced' ]; /** @@ -52,7 +53,8 @@ class Refunds implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'referenced' => null + 'referenced' => null, + 'unreferenced' => null ]; /** @@ -61,7 +63,8 @@ class Refunds implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ - 'referenced' => false + 'referenced' => false, + 'unreferenced' => false ]; /** @@ -150,7 +153,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'referenced' => 'referenced' + 'referenced' => 'referenced', + 'unreferenced' => 'unreferenced' ]; /** @@ -159,7 +163,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'referenced' => 'setReferenced' + 'referenced' => 'setReferenced', + 'unreferenced' => 'setUnreferenced' ]; /** @@ -168,7 +173,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'referenced' => 'getReferenced' + 'referenced' => 'getReferenced', + 'unreferenced' => 'getUnreferenced' ]; /** @@ -229,6 +235,7 @@ public function getModelName() public function __construct(?array $data = null) { $this->setIfExists('referenced', $data ?? [], null); + $this->setIfExists('unreferenced', $data ?? [], null); } /** @@ -296,6 +303,30 @@ public function setReferenced($referenced) return $this; } + + /** + * Gets unreferenced + * + * @return \Adyen\Model\Management\Unreferenced|null + */ + public function getUnreferenced() + { + return $this->container['unreferenced']; + } + + /** + * Sets unreferenced + * + * @param \Adyen\Model\Management\Unreferenced|null $unreferenced unreferenced + * + * @return self + */ + public function setUnreferenced($unreferenced) + { + $this->container['unreferenced'] = $unreferenced; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Management/ReleaseUpdateDetails.php b/src/Adyen/Model/Management/ReleaseUpdateDetails.php index 90b0cee3f..918b1fd68 100644 --- a/src/Adyen/Model/Management/ReleaseUpdateDetails.php +++ b/src/Adyen/Model/Management/ReleaseUpdateDetails.php @@ -322,11 +322,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/Management/ScheduleTerminalActionsRequestActionDetails.php b/src/Adyen/Model/Management/ScheduleTerminalActionsRequestActionDetails.php index 87795b23d..d591b126d 100644 --- a/src/Adyen/Model/Management/ScheduleTerminalActionsRequestActionDetails.php +++ b/src/Adyen/Model/Management/ScheduleTerminalActionsRequestActionDetails.php @@ -43,8 +43,8 @@ class ScheduleTerminalActionsRequestActionDetails implements ModelInterface, Arr * @var string[] */ protected static $openAPITypes = [ - 'appId' => 'string', 'type' => 'string', + 'appId' => 'string', 'certificateId' => 'string', 'updateAtFirstMaintenanceCall' => 'bool' ]; @@ -57,8 +57,8 @@ class ScheduleTerminalActionsRequestActionDetails implements ModelInterface, Arr * @psalm-var array */ protected static $openAPIFormats = [ - 'appId' => null, 'type' => null, + 'appId' => null, 'certificateId' => null, 'updateAtFirstMaintenanceCall' => null ]; @@ -69,8 +69,8 @@ class ScheduleTerminalActionsRequestActionDetails implements ModelInterface, Arr * @var boolean[] */ protected static $openAPINullables = [ - 'appId' => false, 'type' => false, + 'appId' => false, 'certificateId' => false, 'updateAtFirstMaintenanceCall' => false ]; @@ -161,8 +161,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'appId' => 'appId', 'type' => 'type', + 'appId' => 'appId', 'certificateId' => 'certificateId', 'updateAtFirstMaintenanceCall' => 'updateAtFirstMaintenanceCall' ]; @@ -173,8 +173,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'appId' => 'setAppId', 'type' => 'setType', + 'appId' => 'setAppId', 'certificateId' => 'setCertificateId', 'updateAtFirstMaintenanceCall' => 'setUpdateAtFirstMaintenanceCall' ]; @@ -185,8 +185,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'appId' => 'getAppId', 'type' => 'getType', + 'appId' => 'getAppId', 'certificateId' => 'getCertificateId', 'updateAtFirstMaintenanceCall' => 'getUpdateAtFirstMaintenanceCall' ]; @@ -247,8 +247,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('appId', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('appId', $data ?? [], null); $this->setIfExists('certificateId', $data ?? [], null); $this->setIfExists('updateAtFirstMaintenanceCall', $data ?? [], null); } @@ -297,49 +297,49 @@ public function valid() /** - * Gets appId + * Gets type * * @return string|null */ - public function getAppId() + public function getType() { - return $this->container['appId']; + return $this->container['type']; } /** - * Sets appId + * Sets type * - * @param string|null $appId The unique identifier of the app to be uninstalled. + * @param string|null $type Type of terminal action: Uninstall an Android certificate. * * @return self */ - public function setAppId($appId) + public function setType($type) { - $this->container['appId'] = $appId; + $this->container['type'] = $type; return $this; } /** - * Gets type + * Gets appId * * @return string|null */ - public function getType() + public function getAppId() { - return $this->container['type']; + return $this->container['appId']; } /** - * Sets type + * Sets appId * - * @param string|null $type Type of terminal action: Uninstall an Android certificate. + * @param string|null $appId The unique identifier of the app to be uninstalled. * * @return self */ - public function setType($type) + public function setAppId($appId) { - $this->container['type'] = $type; + $this->container['appId'] = $appId; return $this; } diff --git a/src/Adyen/Model/Management/SplitConfigurationLogic.php b/src/Adyen/Model/Management/SplitConfigurationLogic.php index 1927cb47e..f0b90ccdc 100644 --- a/src/Adyen/Model/Management/SplitConfigurationLogic.php +++ b/src/Adyen/Model/Management/SplitConfigurationLogic.php @@ -735,11 +735,11 @@ public function setAcquiringFees($acquiringFees) { $allowedValues = $this->getAcquiringFeesAllowableValues(); if (!in_array($acquiringFees, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'acquiringFees', must be one of '%s'", + "acquiringFees: unexpected enum value '%s' - Supported values are [%s]", $acquiringFees, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -793,11 +793,11 @@ public function setAdyenCommission($adyenCommission) { $allowedValues = $this->getAdyenCommissionAllowableValues(); if (!in_array($adyenCommission, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'adyenCommission', must be one of '%s'", + "adyenCommission: unexpected enum value '%s' - Supported values are [%s]", $adyenCommission, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -827,11 +827,11 @@ public function setAdyenFees($adyenFees) { $allowedValues = $this->getAdyenFeesAllowableValues(); if (!in_array($adyenFees, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'adyenFees', must be one of '%s'", + "adyenFees: unexpected enum value '%s' - Supported values are [%s]", $adyenFees, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -861,11 +861,11 @@ public function setAdyenMarkup($adyenMarkup) { $allowedValues = $this->getAdyenMarkupAllowableValues(); if (!in_array($adyenMarkup, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'adyenMarkup', must be one of '%s'", + "adyenMarkup: unexpected enum value '%s' - Supported values are [%s]", $adyenMarkup, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -895,11 +895,11 @@ public function setChargeback($chargeback) { $allowedValues = $this->getChargebackAllowableValues(); if (!in_array($chargeback, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'chargeback', must be one of '%s'", + "chargeback: unexpected enum value '%s' - Supported values are [%s]", $chargeback, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -929,11 +929,11 @@ public function setChargebackCostAllocation($chargebackCostAllocation) { $allowedValues = $this->getChargebackCostAllocationAllowableValues(); if (!in_array($chargebackCostAllocation, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'chargebackCostAllocation', must be one of '%s'", + "chargebackCostAllocation: unexpected enum value '%s' - Supported values are [%s]", $chargebackCostAllocation, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -987,11 +987,11 @@ public function setInterchange($interchange) { $allowedValues = $this->getInterchangeAllowableValues(); if (!in_array($interchange, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'interchange', must be one of '%s'", + "interchange: unexpected enum value '%s' - Supported values are [%s]", $interchange, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -1021,11 +1021,11 @@ public function setPaymentFee($paymentFee) { $allowedValues = $this->getPaymentFeeAllowableValues(); if (!in_array($paymentFee, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'paymentFee', must be one of '%s'", + "paymentFee: unexpected enum value '%s' - Supported values are [%s]", $paymentFee, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -1055,11 +1055,11 @@ public function setRefund($refund) { $allowedValues = $this->getRefundAllowableValues(); if (!in_array($refund, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'refund', must be one of '%s'", + "refund: unexpected enum value '%s' - Supported values are [%s]", $refund, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -1089,11 +1089,11 @@ public function setRefundCostAllocation($refundCostAllocation) { $allowedValues = $this->getRefundCostAllocationAllowableValues(); if (!in_array($refundCostAllocation, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'refundCostAllocation', must be one of '%s'", + "refundCostAllocation: unexpected enum value '%s' - Supported values are [%s]", $refundCostAllocation, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -1123,11 +1123,11 @@ public function setRemainder($remainder) { $allowedValues = $this->getRemainderAllowableValues(); if (!in_array($remainder, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'remainder', must be one of '%s'", + "remainder: unexpected enum value '%s' - Supported values are [%s]", $remainder, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -1157,11 +1157,11 @@ public function setSchemeFee($schemeFee) { $allowedValues = $this->getSchemeFeeAllowableValues(); if (!in_array($schemeFee, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'schemeFee', must be one of '%s'", + "schemeFee: unexpected enum value '%s' - Supported values are [%s]", $schemeFee, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -1215,11 +1215,11 @@ public function setSurcharge($surcharge) { $allowedValues = $this->getSurchargeAllowableValues(); if (!in_array($surcharge, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'surcharge', must be one of '%s'", + "surcharge: unexpected enum value '%s' - Supported values are [%s]", $surcharge, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -1249,11 +1249,11 @@ public function setTip($tip) { $allowedValues = $this->getTipAllowableValues(); if (!in_array($tip, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'tip', must be one of '%s'", + "tip: unexpected enum value '%s' - Supported values are [%s]", $tip, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/Management/SplitConfigurationRule.php b/src/Adyen/Model/Management/SplitConfigurationRule.php index 35a0cdcab..6cde1cb29 100644 --- a/src/Adyen/Model/Management/SplitConfigurationRule.php +++ b/src/Adyen/Model/Management/SplitConfigurationRule.php @@ -29,18 +29,19 @@ class SplitConfigurationRule implements ModelInterface, ArrayAccess, \JsonSerial public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SplitConfigurationRule'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ + 'cardRegion' => 'string', 'currency' => 'string', 'fundingSource' => 'string', 'paymentMethod' => 'string', @@ -50,13 +51,14 @@ class SplitConfigurationRule implements ModelInterface, ArrayAccess, \JsonSerial ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ + 'cardRegion' => null, 'currency' => null, 'fundingSource' => null, 'paymentMethod' => null, @@ -66,11 +68,12 @@ class SplitConfigurationRule implements ModelInterface, ArrayAccess, \JsonSerial ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static $openAPINullables = [ + 'cardRegion' => false, 'currency' => false, 'fundingSource' => false, 'paymentMethod' => false, @@ -80,10 +83,10 @@ class SplitConfigurationRule implements ModelInterface, ArrayAccess, \JsonSerial ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected $openAPINullablesSetToNull = []; /** @@ -165,6 +168,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'cardRegion' => 'cardRegion', 'currency' => 'currency', 'fundingSource' => 'fundingSource', 'paymentMethod' => 'paymentMethod', @@ -179,6 +183,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'cardRegion' => 'setCardRegion', 'currency' => 'setCurrency', 'fundingSource' => 'setFundingSource', 'paymentMethod' => 'setPaymentMethod', @@ -193,6 +198,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'cardRegion' => 'getCardRegion', 'currency' => 'getCurrency', 'fundingSource' => 'getFundingSource', 'paymentMethod' => 'getPaymentMethod', @@ -242,6 +248,11 @@ public function getModelName() return self::$openAPIModelName; } + public const CARD_REGION_INTERNATIONAL = 'international'; + public const CARD_REGION_INTRA_REGIONAL = 'intraRegional'; + public const CARD_REGION_INTER_REGIONAL = 'interRegional'; + public const CARD_REGION_DOMESTIC = 'domestic'; + public const CARD_REGION_ANY = 'ANY'; public const FUNDING_SOURCE_CHARGED = 'charged'; public const FUNDING_SOURCE_CREDIT = 'credit'; public const FUNDING_SOURCE_DEBIT = 'debit'; @@ -254,6 +265,21 @@ public function getModelName() public const SHOPPER_INTERACTION_POS = 'POS'; public const SHOPPER_INTERACTION_ANY = 'ANY'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCardRegionAllowableValues() + { + return [ + self::CARD_REGION_INTERNATIONAL, + self::CARD_REGION_INTRA_REGIONAL, + self::CARD_REGION_INTER_REGIONAL, + self::CARD_REGION_DOMESTIC, + self::CARD_REGION_ANY, + ]; + } /** * Gets allowable values of the enum * @@ -300,6 +326,7 @@ public function getShopperInteractionAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('cardRegion', $data ?? [], null); $this->setIfExists('currency', $data ?? [], null); $this->setIfExists('fundingSource', $data ?? [], null); $this->setIfExists('paymentMethod', $data ?? [], null); @@ -309,14 +336,14 @@ public function __construct(?array $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 - */ + * 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])) { @@ -335,9 +362,21 @@ public function listInvalidProperties() { $invalidProperties = []; + $allowedValues = $this->getCardRegionAllowableValues(); + if (!is_null($this->container['cardRegion']) && !in_array($this->container['cardRegion'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'cardRegion', must be one of '%s'", + $this->container['cardRegion'], + implode("', '", $allowedValues) + ); + } + if ($this->container['currency'] === null) { $invalidProperties[] = "'currency' can't be null"; } + if ($this->container['fundingSource'] === null) { + $invalidProperties[] = "'fundingSource' can't be null"; + } $allowedValues = $this->getFundingSourceAllowableValues(); if (!is_null($this->container['fundingSource']) && !in_array($this->container['fundingSource'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -380,6 +419,40 @@ public function valid() } + /** + * Gets cardRegion + * + * @return string|null + */ + public function getCardRegion() + { + return $this->container['cardRegion']; + } + + /** + * Sets cardRegion + * + * @param string|null $cardRegion The card region condition that determines whether the [split logic](https://docs.adyen.com/api-explorer/Management/latest/post/merchants/(merchantId)/splitConfigurations#request-rules-splitLogic) applies to the transaction. > This condition is in pilot phase, and not yet available for all platforms. Possible values: * **domestic**: The card issuer and the store where the transaction is processed are registered in the same country. * **international**: The card issuer and the store where the transaction is processed are registered in different countries or regions. Includes all **interRegional** and **intraRegional** transactions. * **interRegional**: The card issuer and the store where the transaction is processed are registered in different regions. * **intraRegional**: The card issuer and the store where the transaction is processed are registered in different countries, but in the same region. * **ANY**: Applies to all transactions, regardless of the processing and issuing country/region. + * + * @return self + */ + public function setCardRegion($cardRegion) + { + $allowedValues = $this->getCardRegionAllowableValues(); + if (!in_array($cardRegion, $allowedValues, true)) { + error_log( + sprintf( + "cardRegion: unexpected enum value '%s' - Supported values are [%s]", + $cardRegion, + implode(', ', $allowedValues) + ) + ); + } + $this->container['cardRegion'] = $cardRegion; + + return $this; + } + /** * Gets currency * @@ -407,7 +480,7 @@ public function setCurrency($currency) /** * Gets fundingSource * - * @return string|null + * @return string */ public function getFundingSource() { @@ -417,7 +490,7 @@ public function getFundingSource() /** * Sets fundingSource * - * @param string|null $fundingSource The funding source of the payment method. This only applies to card transactions. Possible values: * **credit** * **debit** * **prepaid** * **deferred_debit** * **charged** * **ANY** + * @param string $fundingSource The funding source of the payment method. Possible values: * **credit** * **debit** * **prepaid** * **deferred_debit** * **charged** * **ANY** * * @return self */ @@ -425,11 +498,11 @@ public function setFundingSource($fundingSource) { $allowedValues = $this->getFundingSourceAllowableValues(); if (!in_array($fundingSource, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'fundingSource', must be one of '%s'", + "fundingSource: unexpected enum value '%s' - Supported values are [%s]", $fundingSource, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -507,11 +580,11 @@ public function setShopperInteraction($shopperInteraction) { $allowedValues = $this->getShopperInteractionAllowableValues(); if (!in_array($shopperInteraction, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'shopperInteraction', must be one of '%s'", + "shopperInteraction: unexpected enum value '%s' - Supported values are [%s]", $shopperInteraction, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -619,10 +692,10 @@ public function toArray(): array // 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 + // 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 + // 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; diff --git a/src/Adyen/Model/Management/StarInfo.php b/src/Adyen/Model/Management/StarInfo.php index bbf43eacb..784491826 100644 --- a/src/Adyen/Model/Management/StarInfo.php +++ b/src/Adyen/Model/Management/StarInfo.php @@ -329,11 +329,11 @@ public function setProcessingType($processingType) { $allowedValues = $this->getProcessingTypeAllowableValues(); if (!in_array($processingType, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'processingType', must be one of '%s'", + "processingType: unexpected enum value '%s' - Supported values are [%s]", $processingType, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/Management/Store.php b/src/Adyen/Model/Management/Store.php index c94f3e23c..4f8000e7f 100644 --- a/src/Adyen/Model/Management/Store.php +++ b/src/Adyen/Model/Management/Store.php @@ -667,11 +667,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/Management/SvsInfo.php b/src/Adyen/Model/Management/SvsInfo.php new file mode 100644 index 000000000..8b63b9a07 --- /dev/null +++ b/src/Adyen/Model/Management/SvsInfo.php @@ -0,0 +1,441 @@ + + */ +class SvsInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SvsInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authorisationMid' => 'string', + 'currencyCode' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authorisationMid' => null, + 'currencyCode' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authorisationMid' => false, + 'currencyCode' => 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 = [ + 'authorisationMid' => 'authorisationMid', + 'currencyCode' => 'currencyCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authorisationMid' => 'setAuthorisationMid', + 'currencyCode' => 'setCurrencyCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authorisationMid' => 'getAuthorisationMid', + 'currencyCode' => 'getCurrencyCode' + ]; + + /** + * 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('authorisationMid', $data ?? [], null); + $this->setIfExists('currencyCode', $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['authorisationMid'] === null) { + $invalidProperties[] = "'authorisationMid' can't be null"; + } + if ($this->container['currencyCode'] === null) { + $invalidProperties[] = "'currencyCode' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets authorisationMid + * + * @return string + */ + public function getAuthorisationMid() + { + return $this->container['authorisationMid']; + } + + /** + * Sets authorisationMid + * + * @param string $authorisationMid The merchant ID (MID) that the acquirer recognizes you by. + * + * @return self + */ + public function setAuthorisationMid($authorisationMid) + { + $this->container['authorisationMid'] = $authorisationMid; + + return $this; + } + + /** + * Gets currencyCode + * + * @return string + */ + public function getCurrencyCode() + { + return $this->container['currencyCode']; + } + + /** + * Sets currencyCode + * + * @param string $currencyCode The three-character ISO currency code, example **USD** + * + * @return self + */ + public function setCurrencyCode($currencyCode) + { + $this->container['currencyCode'] = $currencyCode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/TerminalAssignment.php b/src/Adyen/Model/Management/TerminalAssignment.php index a8dc67a66..13ccac446 100644 --- a/src/Adyen/Model/Management/TerminalAssignment.php +++ b/src/Adyen/Model/Management/TerminalAssignment.php @@ -427,11 +427,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/Management/TerminalConnectivityCellular.php b/src/Adyen/Model/Management/TerminalConnectivityCellular.php index 3ec7113c6..b9faac991 100644 --- a/src/Adyen/Model/Management/TerminalConnectivityCellular.php +++ b/src/Adyen/Model/Management/TerminalConnectivityCellular.php @@ -385,11 +385,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/Management/TerminalSettings.php b/src/Adyen/Model/Management/TerminalSettings.php index 0a070bdd9..02cafcd03 100644 --- a/src/Adyen/Model/Management/TerminalSettings.php +++ b/src/Adyen/Model/Management/TerminalSettings.php @@ -46,6 +46,7 @@ class TerminalSettings implements ModelInterface, ArrayAccess, \JsonSerializable 'gratuities' => '\Adyen\Model\Management\Gratuity[]', 'hardware' => '\Adyen\Model\Management\Hardware', 'localization' => '\Adyen\Model\Management\Localization', + 'moto' => '\Adyen\Model\Management\Moto', 'nexo' => '\Adyen\Model\Management\Nexo', 'offlineProcessing' => '\Adyen\Model\Management\OfflineProcessing', 'opi' => '\Adyen\Model\Management\Opi', @@ -78,6 +79,7 @@ class TerminalSettings implements ModelInterface, ArrayAccess, \JsonSerializable 'gratuities' => null, 'hardware' => null, 'localization' => null, + 'moto' => null, 'nexo' => null, 'offlineProcessing' => null, 'opi' => null, @@ -108,6 +110,7 @@ class TerminalSettings implements ModelInterface, ArrayAccess, \JsonSerializable 'gratuities' => true, 'hardware' => false, 'localization' => false, + 'moto' => false, 'nexo' => false, 'offlineProcessing' => false, 'opi' => false, @@ -218,6 +221,7 @@ public function isNullableSetToNull(string $property): bool 'gratuities' => 'gratuities', 'hardware' => 'hardware', 'localization' => 'localization', + 'moto' => 'moto', 'nexo' => 'nexo', 'offlineProcessing' => 'offlineProcessing', 'opi' => 'opi', @@ -248,6 +252,7 @@ public function isNullableSetToNull(string $property): bool 'gratuities' => 'setGratuities', 'hardware' => 'setHardware', 'localization' => 'setLocalization', + 'moto' => 'setMoto', 'nexo' => 'setNexo', 'offlineProcessing' => 'setOfflineProcessing', 'opi' => 'setOpi', @@ -278,6 +283,7 @@ public function isNullableSetToNull(string $property): bool 'gratuities' => 'getGratuities', 'hardware' => 'getHardware', 'localization' => 'getLocalization', + 'moto' => 'getMoto', 'nexo' => 'getNexo', 'offlineProcessing' => 'getOfflineProcessing', 'opi' => 'getOpi', @@ -359,6 +365,7 @@ public function __construct(?array $data = null) $this->setIfExists('gratuities', $data ?? [], null); $this->setIfExists('hardware', $data ?? [], null); $this->setIfExists('localization', $data ?? [], null); + $this->setIfExists('moto', $data ?? [], null); $this->setIfExists('nexo', $data ?? [], null); $this->setIfExists('offlineProcessing', $data ?? [], null); $this->setIfExists('opi', $data ?? [], null); @@ -550,6 +557,30 @@ public function setLocalization($localization) return $this; } + /** + * Gets moto + * + * @return \Adyen\Model\Management\Moto|null + */ + public function getMoto() + { + return $this->container['moto']; + } + + /** + * Sets moto + * + * @param \Adyen\Model\Management\Moto|null $moto moto + * + * @return self + */ + public function setMoto($moto) + { + $this->container['moto'] = $moto; + + return $this; + } + /** * Gets nexo * diff --git a/src/Adyen/Model/Management/TransactionDescriptionInfo.php b/src/Adyen/Model/Management/TransactionDescriptionInfo.php index a6bc85f8d..783fe7d2c 100644 --- a/src/Adyen/Model/Management/TransactionDescriptionInfo.php +++ b/src/Adyen/Model/Management/TransactionDescriptionInfo.php @@ -350,11 +350,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/Management/UninstallAndroidAppDetails.php b/src/Adyen/Model/Management/UninstallAndroidAppDetails.php index 1216b1efb..ef467f002 100644 --- a/src/Adyen/Model/Management/UninstallAndroidAppDetails.php +++ b/src/Adyen/Model/Management/UninstallAndroidAppDetails.php @@ -346,11 +346,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/Management/UninstallAndroidCertificateDetails.php b/src/Adyen/Model/Management/UninstallAndroidCertificateDetails.php index f3bf1c3c4..bb0a4db32 100644 --- a/src/Adyen/Model/Management/UninstallAndroidCertificateDetails.php +++ b/src/Adyen/Model/Management/UninstallAndroidCertificateDetails.php @@ -346,11 +346,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/Management/Unreferenced.php b/src/Adyen/Model/Management/Unreferenced.php new file mode 100644 index 000000000..eed8fd899 --- /dev/null +++ b/src/Adyen/Model/Management/Unreferenced.php @@ -0,0 +1,404 @@ + + */ +class Unreferenced implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Unreferenced'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enableUnreferencedRefunds' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enableUnreferencedRefunds' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'enableUnreferencedRefunds' => 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 = [ + 'enableUnreferencedRefunds' => 'enableUnreferencedRefunds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enableUnreferencedRefunds' => 'setEnableUnreferencedRefunds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enableUnreferencedRefunds' => 'getEnableUnreferencedRefunds' + ]; + + /** + * 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('enableUnreferencedRefunds', $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 enableUnreferencedRefunds + * + * @return bool|null + */ + public function getEnableUnreferencedRefunds() + { + return $this->container['enableUnreferencedRefunds']; + } + + /** + * Sets enableUnreferencedRefunds + * + * @param bool|null $enableUnreferencedRefunds Indicates whether unreferenced refunds are enabled on the terminal. + * + * @return self + */ + public function setEnableUnreferencedRefunds($enableUnreferencedRefunds) + { + $this->container['enableUnreferencedRefunds'] = $enableUnreferencedRefunds; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/UpdateCompanyWebhookRequest.php b/src/Adyen/Model/Management/UpdateCompanyWebhookRequest.php index 156cf3b55..ce313f7b8 100644 --- a/src/Adyen/Model/Management/UpdateCompanyWebhookRequest.php +++ b/src/Adyen/Model/Management/UpdateCompanyWebhookRequest.php @@ -610,11 +610,11 @@ public function setCommunicationFormat($communicationFormat) { $allowedValues = $this->getCommunicationFormatAllowableValues(); if (!in_array($communicationFormat, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'communicationFormat', must be one of '%s'", + "communicationFormat: unexpected enum value '%s' - Supported values are [%s]", $communicationFormat, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -668,11 +668,11 @@ public function setEncryptionProtocol($encryptionProtocol) { $allowedValues = $this->getEncryptionProtocolAllowableValues(); if (!in_array($encryptionProtocol, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'encryptionProtocol', must be one of '%s'", + "encryptionProtocol: unexpected enum value '%s' - Supported values are [%s]", $encryptionProtocol, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -702,11 +702,11 @@ public function setFilterMerchantAccountType($filterMerchantAccountType) { $allowedValues = $this->getFilterMerchantAccountTypeAllowableValues(); if (!in_array($filterMerchantAccountType, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'filterMerchantAccountType', must be one of '%s'", + "filterMerchantAccountType: unexpected enum value '%s' - Supported values are [%s]", $filterMerchantAccountType, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -760,11 +760,11 @@ public function setNetworkType($networkType) { $allowedValues = $this->getNetworkTypeAllowableValues(); if (!in_array($networkType, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'networkType', must be one of '%s'", + "networkType: unexpected enum value '%s' - Supported values are [%s]", $networkType, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/Management/UpdateMerchantWebhookRequest.php b/src/Adyen/Model/Management/UpdateMerchantWebhookRequest.php index 25a0e1a52..0eed0278a 100644 --- a/src/Adyen/Model/Management/UpdateMerchantWebhookRequest.php +++ b/src/Adyen/Model/Management/UpdateMerchantWebhookRequest.php @@ -571,11 +571,11 @@ public function setCommunicationFormat($communicationFormat) { $allowedValues = $this->getCommunicationFormatAllowableValues(); if (!in_array($communicationFormat, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'communicationFormat', must be one of '%s'", + "communicationFormat: unexpected enum value '%s' - Supported values are [%s]", $communicationFormat, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -629,11 +629,11 @@ public function setEncryptionProtocol($encryptionProtocol) { $allowedValues = $this->getEncryptionProtocolAllowableValues(); if (!in_array($encryptionProtocol, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'encryptionProtocol', must be one of '%s'", + "encryptionProtocol: unexpected enum value '%s' - Supported values are [%s]", $encryptionProtocol, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -663,11 +663,11 @@ public function setNetworkType($networkType) { $allowedValues = $this->getNetworkTypeAllowableValues(); if (!in_array($networkType, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'networkType', must be one of '%s'", + "networkType: unexpected enum value '%s' - Supported values are [%s]", $networkType, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/Management/UpdateSplitConfigurationLogicRequest.php b/src/Adyen/Model/Management/UpdateSplitConfigurationLogicRequest.php index 0aad886fd..1bfc59092 100644 --- a/src/Adyen/Model/Management/UpdateSplitConfigurationLogicRequest.php +++ b/src/Adyen/Model/Management/UpdateSplitConfigurationLogicRequest.php @@ -735,11 +735,11 @@ public function setAcquiringFees($acquiringFees) { $allowedValues = $this->getAcquiringFeesAllowableValues(); if (!in_array($acquiringFees, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'acquiringFees', must be one of '%s'", + "acquiringFees: unexpected enum value '%s' - Supported values are [%s]", $acquiringFees, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -793,11 +793,11 @@ public function setAdyenCommission($adyenCommission) { $allowedValues = $this->getAdyenCommissionAllowableValues(); if (!in_array($adyenCommission, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'adyenCommission', must be one of '%s'", + "adyenCommission: unexpected enum value '%s' - Supported values are [%s]", $adyenCommission, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -827,11 +827,11 @@ public function setAdyenFees($adyenFees) { $allowedValues = $this->getAdyenFeesAllowableValues(); if (!in_array($adyenFees, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'adyenFees', must be one of '%s'", + "adyenFees: unexpected enum value '%s' - Supported values are [%s]", $adyenFees, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -861,11 +861,11 @@ public function setAdyenMarkup($adyenMarkup) { $allowedValues = $this->getAdyenMarkupAllowableValues(); if (!in_array($adyenMarkup, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'adyenMarkup', must be one of '%s'", + "adyenMarkup: unexpected enum value '%s' - Supported values are [%s]", $adyenMarkup, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -895,11 +895,11 @@ public function setChargeback($chargeback) { $allowedValues = $this->getChargebackAllowableValues(); if (!in_array($chargeback, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'chargeback', must be one of '%s'", + "chargeback: unexpected enum value '%s' - Supported values are [%s]", $chargeback, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -929,11 +929,11 @@ public function setChargebackCostAllocation($chargebackCostAllocation) { $allowedValues = $this->getChargebackCostAllocationAllowableValues(); if (!in_array($chargebackCostAllocation, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'chargebackCostAllocation', must be one of '%s'", + "chargebackCostAllocation: unexpected enum value '%s' - Supported values are [%s]", $chargebackCostAllocation, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -987,11 +987,11 @@ public function setInterchange($interchange) { $allowedValues = $this->getInterchangeAllowableValues(); if (!in_array($interchange, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'interchange', must be one of '%s'", + "interchange: unexpected enum value '%s' - Supported values are [%s]", $interchange, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -1021,11 +1021,11 @@ public function setPaymentFee($paymentFee) { $allowedValues = $this->getPaymentFeeAllowableValues(); if (!in_array($paymentFee, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'paymentFee', must be one of '%s'", + "paymentFee: unexpected enum value '%s' - Supported values are [%s]", $paymentFee, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -1055,11 +1055,11 @@ public function setRefund($refund) { $allowedValues = $this->getRefundAllowableValues(); if (!in_array($refund, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'refund', must be one of '%s'", + "refund: unexpected enum value '%s' - Supported values are [%s]", $refund, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -1089,11 +1089,11 @@ public function setRefundCostAllocation($refundCostAllocation) { $allowedValues = $this->getRefundCostAllocationAllowableValues(); if (!in_array($refundCostAllocation, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'refundCostAllocation', must be one of '%s'", + "refundCostAllocation: unexpected enum value '%s' - Supported values are [%s]", $refundCostAllocation, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -1123,11 +1123,11 @@ public function setRemainder($remainder) { $allowedValues = $this->getRemainderAllowableValues(); if (!in_array($remainder, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'remainder', must be one of '%s'", + "remainder: unexpected enum value '%s' - Supported values are [%s]", $remainder, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -1157,11 +1157,11 @@ public function setSchemeFee($schemeFee) { $allowedValues = $this->getSchemeFeeAllowableValues(); if (!in_array($schemeFee, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'schemeFee', must be one of '%s'", + "schemeFee: unexpected enum value '%s' - Supported values are [%s]", $schemeFee, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -1215,11 +1215,11 @@ public function setSurcharge($surcharge) { $allowedValues = $this->getSurchargeAllowableValues(); if (!in_array($surcharge, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'surcharge', must be one of '%s'", + "surcharge: unexpected enum value '%s' - Supported values are [%s]", $surcharge, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -1249,11 +1249,11 @@ public function setTip($tip) { $allowedValues = $this->getTipAllowableValues(); if (!in_array($tip, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'tip', must be one of '%s'", + "tip: unexpected enum value '%s' - Supported values are [%s]", $tip, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/Management/UpdateSplitConfigurationRuleRequest.php b/src/Adyen/Model/Management/UpdateSplitConfigurationRuleRequest.php index 555d87508..e9d4c299c 100644 --- a/src/Adyen/Model/Management/UpdateSplitConfigurationRuleRequest.php +++ b/src/Adyen/Model/Management/UpdateSplitConfigurationRuleRequest.php @@ -29,17 +29,17 @@ class UpdateSplitConfigurationRuleRequest implements ModelInterface, ArrayAccess public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'UpdateSplitConfigurationRuleRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'currency' => 'string', 'fundingSource' => 'string', @@ -48,12 +48,12 @@ class UpdateSplitConfigurationRuleRequest implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'currency' => null, 'fundingSource' => null, @@ -62,10 +62,10 @@ class UpdateSplitConfigurationRuleRequest implements ModelInterface, ArrayAccess ]; /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ protected static $openAPINullables = [ 'currency' => false, 'fundingSource' => false, @@ -74,10 +74,10 @@ class UpdateSplitConfigurationRuleRequest implements ModelInterface, ArrayAccess ]; /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ protected $openAPINullablesSetToNull = []; /** @@ -253,14 +253,14 @@ public function __construct(?array $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 - */ + * 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])) { @@ -282,6 +282,9 @@ public function listInvalidProperties() if ($this->container['currency'] === null) { $invalidProperties[] = "'currency' can't be null"; } + if ($this->container['fundingSource'] === null) { + $invalidProperties[] = "'fundingSource' can't be null"; + } if ($this->container['paymentMethod'] === null) { $invalidProperties[] = "'paymentMethod' can't be null"; } @@ -330,7 +333,7 @@ public function setCurrency($currency) /** * Gets fundingSource * - * @return string|null + * @return string */ public function getFundingSource() { @@ -340,7 +343,7 @@ public function getFundingSource() /** * Sets fundingSource * - * @param string|null $fundingSource The funding source of the payment method. This only applies to card transactions. Possible values: * **credit** * **debit** * **prepaid** * **deferred_debit** * **charged** * **ANY** + * @param string $fundingSource The funding source of the payment method. Possible values: * **credit** * **debit** * **prepaid** * **deferred_debit** * **charged** * **ANY** * * @return self */ @@ -474,10 +477,10 @@ public function toArray(): array // 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 + // 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 + // 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; diff --git a/src/Adyen/Model/Management/UpdateStoreRequest.php b/src/Adyen/Model/Management/UpdateStoreRequest.php index 232ee6c0b..adf25b653 100644 --- a/src/Adyen/Model/Management/UpdateStoreRequest.php +++ b/src/Adyen/Model/Management/UpdateStoreRequest.php @@ -512,11 +512,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/Management/ValuelinkInfo.php b/src/Adyen/Model/Management/ValuelinkInfo.php new file mode 100644 index 000000000..f2291f457 --- /dev/null +++ b/src/Adyen/Model/Management/ValuelinkInfo.php @@ -0,0 +1,536 @@ + + */ +class ValuelinkInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ValuelinkInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authorisationMid' => 'string', + 'pinSupport' => 'string', + 'submitterId' => 'string', + 'terminalId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authorisationMid' => null, + 'pinSupport' => null, + 'submitterId' => null, + 'terminalId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authorisationMid' => false, + 'pinSupport' => false, + 'submitterId' => false, + 'terminalId' => 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 = [ + 'authorisationMid' => 'authorisationMid', + 'pinSupport' => 'pinSupport', + 'submitterId' => 'submitterId', + 'terminalId' => 'terminalId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authorisationMid' => 'setAuthorisationMid', + 'pinSupport' => 'setPinSupport', + 'submitterId' => 'setSubmitterId', + 'terminalId' => 'setTerminalId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authorisationMid' => 'getAuthorisationMid', + 'pinSupport' => 'getPinSupport', + 'submitterId' => 'getSubmitterId', + 'terminalId' => 'getTerminalId' + ]; + + /** + * 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 PIN_SUPPORT_PIN = 'PIN'; + public const PIN_SUPPORT_NO_PIN = 'NO PIN'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPinSupportAllowableValues() + { + return [ + self::PIN_SUPPORT_PIN, + self::PIN_SUPPORT_NO_PIN, + ]; + } + /** + * 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('authorisationMid', $data ?? [], null); + $this->setIfExists('pinSupport', $data ?? [], null); + $this->setIfExists('submitterId', $data ?? [], null); + $this->setIfExists('terminalId', $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['authorisationMid'] === null) { + $invalidProperties[] = "'authorisationMid' can't be null"; + } + if ($this->container['pinSupport'] === null) { + $invalidProperties[] = "'pinSupport' can't be null"; + } + $allowedValues = $this->getPinSupportAllowableValues(); + if (!is_null($this->container['pinSupport']) && !in_array($this->container['pinSupport'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'pinSupport', must be one of '%s'", + $this->container['pinSupport'], + 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 authorisationMid + * + * @return string + */ + public function getAuthorisationMid() + { + return $this->container['authorisationMid']; + } + + /** + * Sets authorisationMid + * + * @param string $authorisationMid Authorisation Mid + * + * @return self + */ + public function setAuthorisationMid($authorisationMid) + { + $this->container['authorisationMid'] = $authorisationMid; + + return $this; + } + + /** + * Gets pinSupport + * + * @return string + */ + public function getPinSupport() + { + return $this->container['pinSupport']; + } + + /** + * Sets pinSupport + * + * @param string $pinSupport PIN Support. For ecommerce, PIN is required. + * + * @return self + */ + public function setPinSupport($pinSupport) + { + $allowedValues = $this->getPinSupportAllowableValues(); + if (!in_array($pinSupport, $allowedValues, true)) { + error_log( + sprintf( + "pinSupport: unexpected enum value '%s' - Supported values are [%s]", + $pinSupport, + implode(', ', $allowedValues) + ) + ); + } + $this->container['pinSupport'] = $pinSupport; + + return $this; + } + + /** + * Gets submitterId + * + * @return string|null + */ + public function getSubmitterId() + { + return $this->container['submitterId']; + } + + /** + * Sets submitterId + * + * @param string|null $submitterId Submitter ID + * + * @return self + */ + public function setSubmitterId($submitterId) + { + $this->container['submitterId'] = $submitterId; + + return $this; + } + + /** + * Gets terminalId + * + * @return string|null + */ + public function getTerminalId() + { + return $this->container['terminalId']; + } + + /** + * Sets terminalId + * + * @param string|null $terminalId Terminal ID + * + * @return self + */ + public function setTerminalId($terminalId) + { + $this->container['terminalId'] = $terminalId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Webhook.php b/src/Adyen/Model/Management/Webhook.php index 0f7ecb13c..7c3741443 100644 --- a/src/Adyen/Model/Management/Webhook.php +++ b/src/Adyen/Model/Management/Webhook.php @@ -743,11 +743,11 @@ public function setCommunicationFormat($communicationFormat) { $allowedValues = $this->getCommunicationFormatAllowableValues(); if (!in_array($communicationFormat, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'communicationFormat', must be one of '%s'", + "communicationFormat: unexpected enum value '%s' - Supported values are [%s]", $communicationFormat, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -801,11 +801,11 @@ public function setEncryptionProtocol($encryptionProtocol) { $allowedValues = $this->getEncryptionProtocolAllowableValues(); if (!in_array($encryptionProtocol, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'encryptionProtocol', must be one of '%s'", + "encryptionProtocol: unexpected enum value '%s' - Supported values are [%s]", $encryptionProtocol, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -835,11 +835,11 @@ public function setFilterMerchantAccountType($filterMerchantAccountType) { $allowedValues = $this->getFilterMerchantAccountTypeAllowableValues(); if (!in_array($filterMerchantAccountType, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'filterMerchantAccountType', must be one of '%s'", + "filterMerchantAccountType: unexpected enum value '%s' - Supported values are [%s]", $filterMerchantAccountType, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } @@ -989,11 +989,11 @@ public function setNetworkType($networkType) { $allowedValues = $this->getNetworkTypeAllowableValues(); if (!in_array($networkType, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'networkType', must be one of '%s'", + "networkType: unexpected enum value '%s' - Supported values are [%s]", $networkType, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Service/Management/SplitConfigurationMerchantLevelApi.php b/src/Adyen/Service/Management/SplitConfigurationMerchantLevelApi.php index c9cd480f8..c8f7d5698 100644 --- a/src/Adyen/Service/Management/SplitConfigurationMerchantLevelApi.php +++ b/src/Adyen/Service/Management/SplitConfigurationMerchantLevelApi.php @@ -57,7 +57,7 @@ public function createRule(string $merchantId, string $splitConfigurationId, \Ad } /** - * Create a split configuration + * Create a split configuration profile * * @param string $merchantId * @param \Adyen\Model\Management\SplitConfiguration $splitConfiguration @@ -73,7 +73,7 @@ public function createSplitConfiguration(string $merchantId, \Adyen\Model\Manage } /** - * Delete a split configuration + * Delete a split configuration profile * * @param string $merchantId * @param string $splitConfigurationId @@ -89,7 +89,7 @@ public function deleteSplitConfiguration(string $merchantId, string $splitConfig } /** - * Delete a split configuration rule + * Delete a rule * * @param string $merchantId * @param string $splitConfigurationId @@ -106,7 +106,7 @@ public function deleteSplitConfigurationRule(string $merchantId, string $splitCo } /** - * Get a split configuration + * Get a split configuration profile * * @param string $merchantId * @param string $splitConfigurationId @@ -122,7 +122,7 @@ public function getSplitConfiguration(string $merchantId, string $splitConfigura } /** - * Get a list of split configurations + * Get a list of split configuration profiles * * @param string $merchantId * @param array|null $requestOptions @@ -137,7 +137,7 @@ public function listSplitConfigurations(string $merchantId, ?array $requestOptio } /** - * Update split conditions + * Update the split conditions * * @param string $merchantId * @param string $splitConfigurationId @@ -155,7 +155,7 @@ public function updateSplitConditions(string $merchantId, string $splitConfigura } /** - * Update split configuration description + * Update the description of the split configuration profile * * @param string $merchantId * @param string $splitConfigurationId