diff --git a/src/Adyen/Model/BalancePlatform/Amount.php b/src/Adyen/Model/BalancePlatform/Amount.php index 522b8c6f..b495d0bf 100644 --- a/src/Adyen/Model/BalancePlatform/Amount.php +++ b/src/Adyen/Model/BalancePlatform/Amount.php @@ -302,7 +302,7 @@ public function getCurrency() /** * Sets currency * - * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). * * @return self */ @@ -326,7 +326,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). + * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/Balance.php b/src/Adyen/Model/BalancePlatform/Balance.php index 471d7710..5a6c3539 100644 --- a/src/Adyen/Model/BalancePlatform/Balance.php +++ b/src/Adyen/Model/BalancePlatform/Balance.php @@ -329,7 +329,7 @@ public function getAvailable() /** * Sets available * - * @param int $available The current balance minus any reserved balance. + * @param int $available The balance available for use. * * @return self */ @@ -353,7 +353,7 @@ public function getBalance() /** * Sets balance * - * @param int $balance The current balance of funds in the balance account. These are the funds from all transactions with a value date in the past that have not yet been paid out. + * @param int $balance The sum of transactions that have already been settled. * * @return self */ @@ -401,7 +401,7 @@ public function getPending() /** * Sets pending * - * @param int|null $pending The amount of funds that Adyen has processed for this account, but will be settled in a future date. For more information, see how to settle funds for users in your [platform](https://docs.adyen.com/platforms/settle-funds) and [marketplace](https://docs.adyen.com/marketplaces/settle-funds). + * @param int|null $pending The sum of the transactions that will be settled in the future. * * @return self */ @@ -425,7 +425,7 @@ public function getReserved() /** * Sets reserved * - * @param int $reserved The amount reserved for payments that have been [authorised](https://docs.adyen.com/issuing/payment-stages/#authorised), but not yet [captured](https://docs.adyen.com/issuing/payment-stages/#captured) by the merchant. Applies only to [Adyen-issued cards](https://docs.adyen.com/issuing). + * @param int $reserved The balance currently held in reserve. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/CounterpartyBankRestriction.php b/src/Adyen/Model/BalancePlatform/CounterpartyBankRestriction.php index bace924a..fc2939bb 100644 --- a/src/Adyen/Model/BalancePlatform/CounterpartyBankRestriction.php +++ b/src/Adyen/Model/BalancePlatform/CounterpartyBankRestriction.php @@ -323,7 +323,7 @@ public function getValue() /** * Sets value * - * @param \Adyen\Model\BalancePlatform\BankIdentification[]|null $value List of counterparty Bank Institutions and the operation. + * @param \Adyen\Model\BalancePlatform\BankIdentification[]|null $value The list of counterparty bank institutions to be evaluated. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/CounterpartyTypesRestriction.php b/src/Adyen/Model/BalancePlatform/CounterpartyTypesRestriction.php new file mode 100644 index 00000000..ad74095b --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/CounterpartyTypesRestriction.php @@ -0,0 +1,468 @@ + + */ +class CounterpartyTypesRestriction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CounterpartyTypesRestriction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'operation' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const VALUE_BALANCE_ACCOUNT = 'balanceAccount'; + public const VALUE_BANK_ACCOUNT = 'bankAccount'; + public const VALUE_CARD = 'card'; + public const VALUE_TRANSFER_INSTRUMENT = 'transferInstrument'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getValueAllowableValues() + { + return [ + self::VALUE_BALANCE_ACCOUNT, + self::VALUE_BANK_ACCOUNT, + self::VALUE_CARD, + self::VALUE_TRANSFER_INSTRUMENT, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation Defines how the condition must be evaluated. + * + * @return self + */ + public function setOperation($operation) + { + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return string[]|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string[]|null $value The list of counterparty types to be evaluated. + * + * @return self + */ + public function setValue($value) + { + $allowedValues = $this->getValueAllowableValues(); + if (array_diff($value, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'value', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.php b/src/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.php index ceaed7ef..8af18d66 100644 --- a/src/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.php +++ b/src/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.php @@ -320,7 +320,7 @@ public function getSettlementDelayDays() /** * Sets settlementDelayDays * - * @param int|null $settlementDelayDays Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement#settlement-batch) are made available in this balance account. Possible values: **1** to **10**, or **null**. * Setting this value to an integer enables Sales day settlement in this balance account. See how Sales day settlement works in your [marketplace](https://docs.adyen.com/marketplaces/settle-funds/sales-day-settlement) or [platform](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement). * Setting this value to **null** enables Pass-through settlement in this balance account. See how Pass-through settlement works in your [marketplace](https://docs.adyen.com/marketplaces/settle-funds/pass-through-settlement) or [platform](https://docs.adyen.com/platforms/settle-funds/pass-through-settlement). Default value: **null**. + * @param int|null $settlementDelayDays Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement#settlement-batch) are made available in this balance account. Possible values: **1** to **20**, or **null**. * Setting this value to an integer enables Sales day settlement in this balance account. See how Sales day settlement works in your [marketplace](https://docs.adyen.com/marketplaces/settle-funds/sales-day-settlement) or [platform](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement). * Setting this value to **null** enables Pass-through settlement in this balance account. See how Pass-through settlement works in your [marketplace](https://docs.adyen.com/marketplaces/settle-funds/pass-through-settlement) or [platform](https://docs.adyen.com/platforms/settle-funds/pass-through-settlement). Default value: **null**. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/SourceAccountTypesRestriction.php b/src/Adyen/Model/BalancePlatform/SourceAccountTypesRestriction.php new file mode 100644 index 00000000..be06216c --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/SourceAccountTypesRestriction.php @@ -0,0 +1,464 @@ + + */ +class SourceAccountTypesRestriction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SourceAccountTypesRestriction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'operation' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const VALUE_BALANCE_ACCOUNT = 'balanceAccount'; + public const VALUE_BUSINESS_ACCOUNT = 'businessAccount'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getValueAllowableValues() + { + return [ + self::VALUE_BALANCE_ACCOUNT, + self::VALUE_BUSINESS_ACCOUNT, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation Defines how the condition must be evaluated. + * + * @return self + */ + public function setOperation($operation) + { + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return string[]|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string[]|null $value The list of source account types to be evaluated. + * + * @return self + */ + public function setValue($value) + { + $allowedValues = $this->getValueAllowableValues(); + if (array_diff($value, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'value', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php b/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php index 1bc139f9..5603255a 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php @@ -47,6 +47,7 @@ class TransactionRuleRestrictions implements ModelInterface, ArrayAccess, \JsonS 'activeNetworkTokens' => '\Adyen\Model\BalancePlatform\ActiveNetworkTokensRestriction', 'brandVariants' => '\Adyen\Model\BalancePlatform\BrandVariantsRestriction', 'counterpartyBank' => '\Adyen\Model\BalancePlatform\CounterpartyBankRestriction', + 'counterpartyTypes' => '\Adyen\Model\BalancePlatform\CounterpartyTypesRestriction', 'countries' => '\Adyen\Model\BalancePlatform\CountriesRestriction', 'dayOfWeek' => '\Adyen\Model\BalancePlatform\DayOfWeekRestriction', 'differentCurrencies' => '\Adyen\Model\BalancePlatform\DifferentCurrenciesRestriction', @@ -61,6 +62,7 @@ class TransactionRuleRestrictions implements ModelInterface, ArrayAccess, \JsonS 'riskScores' => '\Adyen\Model\BalancePlatform\RiskScoresRestriction', 'sameAmountRestriction' => '\Adyen\Model\BalancePlatform\SameAmountRestriction', 'sameCounterpartyRestriction' => '\Adyen\Model\BalancePlatform\SameCounterpartyRestriction', + 'sourceAccountTypes' => '\Adyen\Model\BalancePlatform\SourceAccountTypesRestriction', 'timeOfDay' => '\Adyen\Model\BalancePlatform\TimeOfDayRestriction', 'totalAmount' => '\Adyen\Model\BalancePlatform\TotalAmountRestriction' ]; @@ -76,6 +78,7 @@ class TransactionRuleRestrictions implements ModelInterface, ArrayAccess, \JsonS 'activeNetworkTokens' => null, 'brandVariants' => null, 'counterpartyBank' => null, + 'counterpartyTypes' => null, 'countries' => null, 'dayOfWeek' => null, 'differentCurrencies' => null, @@ -90,6 +93,7 @@ class TransactionRuleRestrictions implements ModelInterface, ArrayAccess, \JsonS 'riskScores' => null, 'sameAmountRestriction' => null, 'sameCounterpartyRestriction' => null, + 'sourceAccountTypes' => null, 'timeOfDay' => null, 'totalAmount' => null ]; @@ -103,6 +107,7 @@ class TransactionRuleRestrictions implements ModelInterface, ArrayAccess, \JsonS 'activeNetworkTokens' => false, 'brandVariants' => false, 'counterpartyBank' => false, + 'counterpartyTypes' => false, 'countries' => false, 'dayOfWeek' => false, 'differentCurrencies' => false, @@ -117,6 +122,7 @@ class TransactionRuleRestrictions implements ModelInterface, ArrayAccess, \JsonS 'riskScores' => false, 'sameAmountRestriction' => false, 'sameCounterpartyRestriction' => false, + 'sourceAccountTypes' => false, 'timeOfDay' => false, 'totalAmount' => false ]; @@ -210,6 +216,7 @@ public function isNullableSetToNull(string $property): bool 'activeNetworkTokens' => 'activeNetworkTokens', 'brandVariants' => 'brandVariants', 'counterpartyBank' => 'counterpartyBank', + 'counterpartyTypes' => 'counterpartyTypes', 'countries' => 'countries', 'dayOfWeek' => 'dayOfWeek', 'differentCurrencies' => 'differentCurrencies', @@ -224,6 +231,7 @@ public function isNullableSetToNull(string $property): bool 'riskScores' => 'riskScores', 'sameAmountRestriction' => 'sameAmountRestriction', 'sameCounterpartyRestriction' => 'sameCounterpartyRestriction', + 'sourceAccountTypes' => 'sourceAccountTypes', 'timeOfDay' => 'timeOfDay', 'totalAmount' => 'totalAmount' ]; @@ -237,6 +245,7 @@ public function isNullableSetToNull(string $property): bool 'activeNetworkTokens' => 'setActiveNetworkTokens', 'brandVariants' => 'setBrandVariants', 'counterpartyBank' => 'setCounterpartyBank', + 'counterpartyTypes' => 'setCounterpartyTypes', 'countries' => 'setCountries', 'dayOfWeek' => 'setDayOfWeek', 'differentCurrencies' => 'setDifferentCurrencies', @@ -251,6 +260,7 @@ public function isNullableSetToNull(string $property): bool 'riskScores' => 'setRiskScores', 'sameAmountRestriction' => 'setSameAmountRestriction', 'sameCounterpartyRestriction' => 'setSameCounterpartyRestriction', + 'sourceAccountTypes' => 'setSourceAccountTypes', 'timeOfDay' => 'setTimeOfDay', 'totalAmount' => 'setTotalAmount' ]; @@ -264,6 +274,7 @@ public function isNullableSetToNull(string $property): bool 'activeNetworkTokens' => 'getActiveNetworkTokens', 'brandVariants' => 'getBrandVariants', 'counterpartyBank' => 'getCounterpartyBank', + 'counterpartyTypes' => 'getCounterpartyTypes', 'countries' => 'getCountries', 'dayOfWeek' => 'getDayOfWeek', 'differentCurrencies' => 'getDifferentCurrencies', @@ -278,6 +289,7 @@ public function isNullableSetToNull(string $property): bool 'riskScores' => 'getRiskScores', 'sameAmountRestriction' => 'getSameAmountRestriction', 'sameCounterpartyRestriction' => 'getSameCounterpartyRestriction', + 'sourceAccountTypes' => 'getSourceAccountTypes', 'timeOfDay' => 'getTimeOfDay', 'totalAmount' => 'getTotalAmount' ]; @@ -342,6 +354,7 @@ public function __construct(array $data = null) $this->setIfExists('activeNetworkTokens', $data ?? [], null); $this->setIfExists('brandVariants', $data ?? [], null); $this->setIfExists('counterpartyBank', $data ?? [], null); + $this->setIfExists('counterpartyTypes', $data ?? [], null); $this->setIfExists('countries', $data ?? [], null); $this->setIfExists('dayOfWeek', $data ?? [], null); $this->setIfExists('differentCurrencies', $data ?? [], null); @@ -356,6 +369,7 @@ public function __construct(array $data = null) $this->setIfExists('riskScores', $data ?? [], null); $this->setIfExists('sameAmountRestriction', $data ?? [], null); $this->setIfExists('sameCounterpartyRestriction', $data ?? [], null); + $this->setIfExists('sourceAccountTypes', $data ?? [], null); $this->setIfExists('timeOfDay', $data ?? [], null); $this->setIfExists('totalAmount', $data ?? [], null); } @@ -474,6 +488,30 @@ public function setCounterpartyBank($counterpartyBank) return $this; } + /** + * Gets counterpartyTypes + * + * @return \Adyen\Model\BalancePlatform\CounterpartyTypesRestriction|null + */ + public function getCounterpartyTypes() + { + return $this->container['counterpartyTypes']; + } + + /** + * Sets counterpartyTypes + * + * @param \Adyen\Model\BalancePlatform\CounterpartyTypesRestriction|null $counterpartyTypes counterpartyTypes + * + * @return self + */ + public function setCounterpartyTypes($counterpartyTypes) + { + $this->container['counterpartyTypes'] = $counterpartyTypes; + + return $this; + } + /** * Gets countries * @@ -810,6 +848,30 @@ public function setSameCounterpartyRestriction($sameCounterpartyRestriction) return $this; } + /** + * Gets sourceAccountTypes + * + * @return \Adyen\Model\BalancePlatform\SourceAccountTypesRestriction|null + */ + public function getSourceAccountTypes() + { + return $this->container['sourceAccountTypes']; + } + + /** + * Sets sourceAccountTypes + * + * @param \Adyen\Model\BalancePlatform\SourceAccountTypesRestriction|null $sourceAccountTypes sourceAccountTypes + * + * @return self + */ + public function setSourceAccountTypes($sourceAccountTypes) + { + $this->container['sourceAccountTypes'] = $sourceAccountTypes; + + return $this; + } + /** * Gets timeOfDay * diff --git a/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.php index 5bba61b2..c6693bf1 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.php +++ b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.php @@ -46,6 +46,7 @@ class AccountHolderNotificationRequest implements ModelInterface, ArrayAccess, \ protected static $openAPITypes = [ 'data' => '\Adyen\Model\ConfigurationWebhooks\AccountHolderNotificationData', 'environment' => 'string', + 'timestamp' => '\DateTime', 'type' => 'string' ]; @@ -59,6 +60,7 @@ class AccountHolderNotificationRequest implements ModelInterface, ArrayAccess, \ protected static $openAPIFormats = [ 'data' => null, 'environment' => null, + 'timestamp' => 'date-time', 'type' => null ]; @@ -70,6 +72,7 @@ class AccountHolderNotificationRequest implements ModelInterface, ArrayAccess, \ protected static $openAPINullables = [ 'data' => false, 'environment' => false, + 'timestamp' => false, 'type' => false ]; @@ -161,6 +164,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'data' => 'data', 'environment' => 'environment', + 'timestamp' => 'timestamp', 'type' => 'type' ]; @@ -172,6 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'data' => 'setData', 'environment' => 'setEnvironment', + 'timestamp' => 'setTimestamp', 'type' => 'setType' ]; @@ -183,6 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'data' => 'getData', 'environment' => 'getEnvironment', + 'timestamp' => 'getTimestamp', 'type' => 'getType' ]; @@ -259,6 +265,7 @@ public function __construct(array $data = null) { $this->setIfExists('data', $data ?? [], null); $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -370,6 +377,30 @@ public function setEnvironment($environment) return $this; } + /** + * Gets timestamp + * + * @return \DateTime|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param \DateTime|null $timestamp When the event was queued. + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/ConfigurationWebhooks/Amount.php b/src/Adyen/Model/ConfigurationWebhooks/Amount.php index 0c734a3b..be7a534f 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Amount.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Amount.php @@ -302,7 +302,7 @@ public function getCurrency() /** * Sets currency * - * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). * * @return self */ @@ -326,7 +326,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). + * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/Balance.php b/src/Adyen/Model/ConfigurationWebhooks/Balance.php index 34c9371f..9f903f59 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/Balance.php +++ b/src/Adyen/Model/ConfigurationWebhooks/Balance.php @@ -329,7 +329,7 @@ public function getAvailable() /** * Sets available * - * @param int $available The current balance minus any reserved balance. + * @param int $available The balance available for use. * * @return self */ @@ -353,7 +353,7 @@ public function getBalance() /** * Sets balance * - * @param int $balance The current balance of funds in the balance account. These are the funds from all transactions with a value date in the past that have not yet been paid out. + * @param int $balance The sum of transactions that have already been settled. * * @return self */ @@ -401,7 +401,7 @@ public function getPending() /** * Sets pending * - * @param int|null $pending The amount of funds that Adyen has processed for this account, but will be settled in a future date. For more information, see how to settle funds for users in your [platform](https://docs.adyen.com/platforms/settle-funds) and [marketplace](https://docs.adyen.com/marketplaces/settle-funds). + * @param int|null $pending The sum of the transactions that will be settled in the future. * * @return self */ @@ -425,7 +425,7 @@ public function getReserved() /** * Sets reserved * - * @param int $reserved The amount reserved for payments that have been [authorised](https://docs.adyen.com/issuing/payment-stages/#authorised), but not yet [captured](https://docs.adyen.com/issuing/payment-stages/#captured) by the merchant. Applies only to [Adyen-issued cards](https://docs.adyen.com/issuing). + * @param int $reserved The balance currently held in reserve. * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.php index 07bffc10..64595f66 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.php +++ b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.php @@ -46,6 +46,7 @@ class BalanceAccountNotificationRequest implements ModelInterface, ArrayAccess, protected static $openAPITypes = [ 'data' => '\Adyen\Model\ConfigurationWebhooks\BalanceAccountNotificationData', 'environment' => 'string', + 'timestamp' => '\DateTime', 'type' => 'string' ]; @@ -59,6 +60,7 @@ class BalanceAccountNotificationRequest implements ModelInterface, ArrayAccess, protected static $openAPIFormats = [ 'data' => null, 'environment' => null, + 'timestamp' => 'date-time', 'type' => null ]; @@ -70,6 +72,7 @@ class BalanceAccountNotificationRequest implements ModelInterface, ArrayAccess, protected static $openAPINullables = [ 'data' => false, 'environment' => false, + 'timestamp' => false, 'type' => false ]; @@ -161,6 +164,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'data' => 'data', 'environment' => 'environment', + 'timestamp' => 'timestamp', 'type' => 'type' ]; @@ -172,6 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'data' => 'setData', 'environment' => 'setEnvironment', + 'timestamp' => 'setTimestamp', 'type' => 'setType' ]; @@ -183,6 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'data' => 'getData', 'environment' => 'getEnvironment', + 'timestamp' => 'getTimestamp', 'type' => 'getType' ]; @@ -259,6 +265,7 @@ public function __construct(array $data = null) { $this->setIfExists('data', $data ?? [], null); $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -370,6 +377,30 @@ public function setEnvironment($environment) return $this; } + /** + * Gets timestamp + * + * @return \DateTime|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param \DateTime|null $timestamp When the event was queued. + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.php index b7202ac5..066a55ee 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.php @@ -46,6 +46,7 @@ class CardOrderNotificationRequest implements ModelInterface, ArrayAccess, \Json protected static $openAPITypes = [ 'data' => '\Adyen\Model\ConfigurationWebhooks\CardOrderItem', 'environment' => 'string', + 'timestamp' => '\DateTime', 'type' => 'string' ]; @@ -59,6 +60,7 @@ class CardOrderNotificationRequest implements ModelInterface, ArrayAccess, \Json protected static $openAPIFormats = [ 'data' => null, 'environment' => null, + 'timestamp' => 'date-time', 'type' => null ]; @@ -70,6 +72,7 @@ class CardOrderNotificationRequest implements ModelInterface, ArrayAccess, \Json protected static $openAPINullables = [ 'data' => false, 'environment' => false, + 'timestamp' => false, 'type' => false ]; @@ -161,6 +164,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'data' => 'data', 'environment' => 'environment', + 'timestamp' => 'timestamp', 'type' => 'type' ]; @@ -172,6 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'data' => 'setData', 'environment' => 'setEnvironment', + 'timestamp' => 'setTimestamp', 'type' => 'setType' ]; @@ -183,6 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'data' => 'getData', 'environment' => 'getEnvironment', + 'timestamp' => 'getTimestamp', 'type' => 'getType' ]; @@ -259,6 +265,7 @@ public function __construct(array $data = null) { $this->setIfExists('data', $data ?? [], null); $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -370,6 +377,30 @@ public function setEnvironment($environment) return $this; } + /** + * Gets timestamp + * + * @return \DateTime|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param \DateTime|null $timestamp When the event was queued. + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.php index 6d30a341..0e86a8d7 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.php +++ b/src/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.php @@ -46,6 +46,7 @@ class PaymentNotificationRequest implements ModelInterface, ArrayAccess, \JsonSe protected static $openAPITypes = [ 'data' => '\Adyen\Model\ConfigurationWebhooks\PaymentInstrumentNotificationData', 'environment' => 'string', + 'timestamp' => '\DateTime', 'type' => 'string' ]; @@ -59,6 +60,7 @@ class PaymentNotificationRequest implements ModelInterface, ArrayAccess, \JsonSe protected static $openAPIFormats = [ 'data' => null, 'environment' => null, + 'timestamp' => 'date-time', 'type' => null ]; @@ -70,6 +72,7 @@ class PaymentNotificationRequest implements ModelInterface, ArrayAccess, \JsonSe protected static $openAPINullables = [ 'data' => false, 'environment' => false, + 'timestamp' => false, 'type' => false ]; @@ -161,6 +164,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'data' => 'data', 'environment' => 'environment', + 'timestamp' => 'timestamp', 'type' => 'type' ]; @@ -172,6 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'data' => 'setData', 'environment' => 'setEnvironment', + 'timestamp' => 'setTimestamp', 'type' => 'setType' ]; @@ -183,6 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'data' => 'getData', 'environment' => 'getEnvironment', + 'timestamp' => 'getTimestamp', 'type' => 'getType' ]; @@ -259,6 +265,7 @@ public function __construct(array $data = null) { $this->setIfExists('data', $data ?? [], null); $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -370,6 +377,30 @@ public function setEnvironment($environment) return $this; } + /** + * Gets timestamp + * + * @return \DateTime|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param \DateTime|null $timestamp When the event was queued. + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.php b/src/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.php index 873f9285..0ed6333f 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.php +++ b/src/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.php @@ -320,7 +320,7 @@ public function getSettlementDelayDays() /** * Sets settlementDelayDays * - * @param int|null $settlementDelayDays Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement#settlement-batch) are made available in this balance account. Possible values: **1** to **10**, or **null**. * Setting this value to an integer enables Sales day settlement in this balance account. See how Sales day settlement works in your [marketplace](https://docs.adyen.com/marketplaces/settle-funds/sales-day-settlement) or [platform](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement). * Setting this value to **null** enables Pass-through settlement in this balance account. See how Pass-through settlement works in your [marketplace](https://docs.adyen.com/marketplaces/settle-funds/pass-through-settlement) or [platform](https://docs.adyen.com/platforms/settle-funds/pass-through-settlement). Default value: **null**. + * @param int|null $settlementDelayDays Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement#settlement-batch) are made available in this balance account. Possible values: **1** to **20**, or **null**. * Setting this value to an integer enables Sales day settlement in this balance account. See how Sales day settlement works in your [marketplace](https://docs.adyen.com/marketplaces/settle-funds/sales-day-settlement) or [platform](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement). * Setting this value to **null** enables Pass-through settlement in this balance account. See how Pass-through settlement works in your [marketplace](https://docs.adyen.com/marketplaces/settle-funds/pass-through-settlement) or [platform](https://docs.adyen.com/platforms/settle-funds/pass-through-settlement). Default value: **null**. * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.php index 09b0e527..323c2548 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.php +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.php @@ -46,6 +46,7 @@ class SweepConfigurationNotificationRequest implements ModelInterface, ArrayAcce protected static $openAPITypes = [ 'data' => '\Adyen\Model\ConfigurationWebhooks\SweepConfigurationNotificationData', 'environment' => 'string', + 'timestamp' => '\DateTime', 'type' => 'string' ]; @@ -59,6 +60,7 @@ class SweepConfigurationNotificationRequest implements ModelInterface, ArrayAcce protected static $openAPIFormats = [ 'data' => null, 'environment' => null, + 'timestamp' => 'date-time', 'type' => null ]; @@ -70,6 +72,7 @@ class SweepConfigurationNotificationRequest implements ModelInterface, ArrayAcce protected static $openAPINullables = [ 'data' => false, 'environment' => false, + 'timestamp' => false, 'type' => false ]; @@ -161,6 +164,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'data' => 'data', 'environment' => 'environment', + 'timestamp' => 'timestamp', 'type' => 'type' ]; @@ -172,6 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'data' => 'setData', 'environment' => 'setEnvironment', + 'timestamp' => 'setTimestamp', 'type' => 'setType' ]; @@ -183,6 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'data' => 'getData', 'environment' => 'getEnvironment', + 'timestamp' => 'getTimestamp', 'type' => 'getType' ]; @@ -261,6 +267,7 @@ public function __construct(array $data = null) { $this->setIfExists('data', $data ?? [], null); $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -372,6 +379,30 @@ public function setEnvironment($environment) return $this; } + /** + * Gets timestamp + * + * @return \DateTime|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param \DateTime|null $timestamp When the event was queued. + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/Management/Amount.php b/src/Adyen/Model/Management/Amount.php index 33653484..856712d6 100644 --- a/src/Adyen/Model/Management/Amount.php +++ b/src/Adyen/Model/Management/Amount.php @@ -302,7 +302,7 @@ public function getCurrency() /** * Sets currency * - * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). * * @return self */ @@ -326,7 +326,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). + * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * * @return self */ diff --git a/src/Adyen/Model/Management/TerminalConnectivityCellular.php b/src/Adyen/Model/Management/TerminalConnectivityCellular.php index c0bcb374..490699d4 100644 --- a/src/Adyen/Model/Management/TerminalConnectivityCellular.php +++ b/src/Adyen/Model/Management/TerminalConnectivityCellular.php @@ -45,6 +45,7 @@ class TerminalConnectivityCellular implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'iccid' => 'string', + 'iccid2' => 'string', 'status' => 'string' ]; @@ -57,6 +58,7 @@ class TerminalConnectivityCellular implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'iccid' => null, + 'iccid2' => null, 'status' => null ]; @@ -67,6 +69,7 @@ class TerminalConnectivityCellular implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'iccid' => false, + 'iccid2' => false, 'status' => false ]; @@ -157,6 +160,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'iccid' => 'iccid', + 'iccid2' => 'iccid2', 'status' => 'status' ]; @@ -167,6 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'iccid' => 'setIccid', + 'iccid2' => 'setIccid2', 'status' => 'setStatus' ]; @@ -177,6 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'iccid' => 'getIccid', + 'iccid2' => 'getIccid2', 'status' => 'getStatus' ]; @@ -258,6 +264,7 @@ public function getStatusAllowableValues() public function __construct(array $data = null) { $this->setIfExists('iccid', $data ?? [], null); + $this->setIfExists('iccid2', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); } @@ -325,7 +332,7 @@ public function getIccid() /** * Sets iccid * - * @param string|null $iccid The integrated circuit card identifier (ICCID) of the SIM card in the terminal. + * @param string|null $iccid The integrated circuit card identifier (ICCID) of the primary SIM card in the terminal. * * @return self */ @@ -336,6 +343,30 @@ public function setIccid($iccid) return $this; } + /** + * Gets iccid2 + * + * @return string|null + */ + public function getIccid2() + { + return $this->container['iccid2']; + } + + /** + * Sets iccid2 + * + * @param string|null $iccid2 The integrated circuit card identifier (ICCID) of the secondary SIM card in the terminal, typically used for a [third-party SIM card](https://docs.adyen.com/point-of-sale/design-your-integration/network-and-connectivity/cellular-failover/#using-a-third-party-sim-card). + * + * @return self + */ + public function setIccid2($iccid2) + { + $this->container['iccid2'] = $iccid2; + + return $this; + } + /** * Gets status * @@ -349,7 +380,7 @@ public function getStatus() /** * Sets status * - * @param string|null $status On a terminal that supports 3G or 4G connectivity, indicates the status of the SIM card in the terminal. + * @param string|null $status On a terminal that supports 3G or 4G connectivity, indicates the status of the primary SIM card in the terminal. * * @return self */ diff --git a/src/Adyen/Model/Management/UpdatePaymentMethodInfo.php b/src/Adyen/Model/Management/UpdatePaymentMethodInfo.php index 6c6f2931..d4d7949d 100644 --- a/src/Adyen/Model/Management/UpdatePaymentMethodInfo.php +++ b/src/Adyen/Model/Management/UpdatePaymentMethodInfo.php @@ -64,6 +64,7 @@ class UpdatePaymentMethodInfo implements ModelInterface, ArrayAccess, \JsonSeria 'nyce' => '\Adyen\Model\Management\NyceInfo', 'pulse' => '\Adyen\Model\Management\PulseInfo', 'star' => '\Adyen\Model\Management\StarInfo', + 'storeId' => 'string', 'storeIds' => 'string[]', 'visa' => '\Adyen\Model\Management\GenericPmWithTdiInfo' ]; @@ -96,6 +97,7 @@ class UpdatePaymentMethodInfo implements ModelInterface, ArrayAccess, \JsonSeria 'nyce' => null, 'pulse' => null, 'star' => null, + 'storeId' => null, 'storeIds' => null, 'visa' => null ]; @@ -126,6 +128,7 @@ class UpdatePaymentMethodInfo implements ModelInterface, ArrayAccess, \JsonSeria 'nyce' => false, 'pulse' => false, 'star' => false, + 'storeId' => false, 'storeIds' => false, 'visa' => false ]; @@ -236,6 +239,7 @@ public function isNullableSetToNull(string $property): bool 'nyce' => 'nyce', 'pulse' => 'pulse', 'star' => 'star', + 'storeId' => 'storeId', 'storeIds' => 'storeIds', 'visa' => 'visa' ]; @@ -266,6 +270,7 @@ public function isNullableSetToNull(string $property): bool 'nyce' => 'setNyce', 'pulse' => 'setPulse', 'star' => 'setStar', + 'storeId' => 'setStoreId', 'storeIds' => 'setStoreIds', 'visa' => 'setVisa' ]; @@ -296,6 +301,7 @@ public function isNullableSetToNull(string $property): bool 'nyce' => 'getNyce', 'pulse' => 'getPulse', 'star' => 'getStar', + 'storeId' => 'getStoreId', 'storeIds' => 'getStoreIds', 'visa' => 'getVisa' ]; @@ -377,6 +383,7 @@ public function __construct(array $data = null) $this->setIfExists('nyce', $data ?? [], null); $this->setIfExists('pulse', $data ?? [], null); $this->setIfExists('star', $data ?? [], null); + $this->setIfExists('storeId', $data ?? [], null); $this->setIfExists('storeIds', $data ?? [], null); $this->setIfExists('visa', $data ?? [], null); } @@ -903,10 +910,35 @@ public function setStar($star) return $this; } + /** + * Gets storeId + * + * @return string|null + */ + public function getStoreId() + { + return $this->container['storeId']; + } + + /** + * Sets storeId + * + * @param string|null $storeId The store for this payment method + * + * @return self + */ + public function setStoreId($storeId) + { + $this->container['storeId'] = $storeId; + + return $this; + } + /** * Gets storeIds * * @return string[]|null + * @deprecated */ public function getStoreIds() { @@ -919,6 +951,7 @@ public function getStoreIds() * @param string[]|null $storeIds The list of stores for this payment method * * @return self + * @deprecated */ public function setStoreIds($storeIds) { diff --git a/src/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.php b/src/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.php new file mode 100644 index 00000000..36ba72a7 --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.php @@ -0,0 +1,543 @@ + + */ +class TerminalAssignmentNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TerminalAssignmentNotificationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'assignedToAccount' => 'string', + 'assignedToStore' => 'string', + 'eventDate' => 'string', + 'pspReference' => 'string', + 'uniqueTerminalId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'assignedToAccount' => null, + 'assignedToStore' => null, + 'eventDate' => null, + 'pspReference' => null, + 'uniqueTerminalId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'assignedToAccount' => false, + 'assignedToStore' => false, + 'eventDate' => false, + 'pspReference' => false, + 'uniqueTerminalId' => 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 = [ + 'assignedToAccount' => 'assignedToAccount', + 'assignedToStore' => 'assignedToStore', + 'eventDate' => 'eventDate', + 'pspReference' => 'pspReference', + 'uniqueTerminalId' => 'uniqueTerminalId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'assignedToAccount' => 'setAssignedToAccount', + 'assignedToStore' => 'setAssignedToStore', + 'eventDate' => 'setEventDate', + 'pspReference' => 'setPspReference', + 'uniqueTerminalId' => 'setUniqueTerminalId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'assignedToAccount' => 'getAssignedToAccount', + 'assignedToStore' => 'getAssignedToStore', + 'eventDate' => 'getEventDate', + 'pspReference' => 'getPspReference', + 'uniqueTerminalId' => 'getUniqueTerminalId' + ]; + + /** + * 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('assignedToAccount', $data ?? [], null); + $this->setIfExists('assignedToStore', $data ?? [], null); + $this->setIfExists('eventDate', $data ?? [], null); + $this->setIfExists('pspReference', $data ?? [], null); + $this->setIfExists('uniqueTerminalId', $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['assignedToAccount'] === null) { + $invalidProperties[] = "'assignedToAccount' can't be null"; + } + if ($this->container['eventDate'] === null) { + $invalidProperties[] = "'eventDate' can't be null"; + } + if ($this->container['pspReference'] === null) { + $invalidProperties[] = "'pspReference' can't be null"; + } + if ($this->container['uniqueTerminalId'] === null) { + $invalidProperties[] = "'uniqueTerminalId' 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 assignedToAccount + * + * @return string + */ + public function getAssignedToAccount() + { + return $this->container['assignedToAccount']; + } + + /** + * Sets assignedToAccount + * + * @param string $assignedToAccount The unique identifier of the merchant/company account to which the terminal is assigned. + * + * @return self + */ + public function setAssignedToAccount($assignedToAccount) + { + $this->container['assignedToAccount'] = $assignedToAccount; + + return $this; + } + + /** + * Gets assignedToStore + * + * @return string|null + */ + public function getAssignedToStore() + { + return $this->container['assignedToStore']; + } + + /** + * Sets assignedToStore + * + * @param string|null $assignedToStore The unique identifier of the store to which the terminal is assigned. + * + * @return self + */ + public function setAssignedToStore($assignedToStore) + { + $this->container['assignedToStore'] = $assignedToStore; + + return $this; + } + + /** + * Gets eventDate + * + * @return string + */ + public function getEventDate() + { + return $this->container['eventDate']; + } + + /** + * Sets eventDate + * + * @param string $eventDate The date and time when an event has been completed. + * + * @return self + */ + public function setEventDate($eventDate) + { + $this->container['eventDate'] = $eventDate; + + return $this; + } + + /** + * Gets pspReference + * + * @return string + */ + public function getPspReference() + { + return $this->container['pspReference']; + } + + /** + * Sets pspReference + * + * @param string $pspReference The PSP reference of the request from which the notification originates. + * + * @return self + */ + public function setPspReference($pspReference) + { + $this->container['pspReference'] = $pspReference; + + return $this; + } + + /** + * Gets uniqueTerminalId + * + * @return string + */ + public function getUniqueTerminalId() + { + return $this->container['uniqueTerminalId']; + } + + /** + * Sets uniqueTerminalId + * + * @param string $uniqueTerminalId The unique identifier of the terminal. + * + * @return self + */ + public function setUniqueTerminalId($uniqueTerminalId) + { + $this->container['uniqueTerminalId'] = $uniqueTerminalId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.php b/src/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.php new file mode 100644 index 00000000..bea94b1c --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.php @@ -0,0 +1,407 @@ + + */ +class TerminalAssignmentNotificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TerminalAssignmentNotificationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'notificationResponse' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'notificationResponse' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'notificationResponse' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'notificationResponse' => 'notificationResponse' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'notificationResponse' => 'setNotificationResponse' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'notificationResponse' => 'getNotificationResponse' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('notificationResponse', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets notificationResponse + * + * @return string|null + */ + public function getNotificationResponse() + { + return $this->container['notificationResponse']; + } + + /** + * Sets notificationResponse + * + * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * + * @return self + */ + public function setNotificationResponse($notificationResponse) + { + $this->container['notificationResponse'] = $notificationResponse; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ReportWebhooks/ReportNotificationRequest.php b/src/Adyen/Model/ReportWebhooks/ReportNotificationRequest.php index 998c9bf2..651247a9 100644 --- a/src/Adyen/Model/ReportWebhooks/ReportNotificationRequest.php +++ b/src/Adyen/Model/ReportWebhooks/ReportNotificationRequest.php @@ -46,6 +46,7 @@ class ReportNotificationRequest implements ModelInterface, ArrayAccess, \JsonSer protected static $openAPITypes = [ 'data' => '\Adyen\Model\ReportWebhooks\ReportNotificationData', 'environment' => 'string', + 'timestamp' => '\DateTime', 'type' => 'string' ]; @@ -59,6 +60,7 @@ class ReportNotificationRequest implements ModelInterface, ArrayAccess, \JsonSer protected static $openAPIFormats = [ 'data' => null, 'environment' => null, + 'timestamp' => 'date-time', 'type' => null ]; @@ -70,6 +72,7 @@ class ReportNotificationRequest implements ModelInterface, ArrayAccess, \JsonSer protected static $openAPINullables = [ 'data' => false, 'environment' => false, + 'timestamp' => false, 'type' => false ]; @@ -161,6 +164,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'data' => 'data', 'environment' => 'environment', + 'timestamp' => 'timestamp', 'type' => 'type' ]; @@ -172,6 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'data' => 'setData', 'environment' => 'setEnvironment', + 'timestamp' => 'setTimestamp', 'type' => 'setType' ]; @@ -183,6 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'data' => 'getData', 'environment' => 'getEnvironment', + 'timestamp' => 'getTimestamp', 'type' => 'getType' ]; @@ -257,6 +263,7 @@ public function __construct(array $data = null) { $this->setIfExists('data', $data ?? [], null); $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -368,6 +375,30 @@ public function setEnvironment($environment) return $this; } + /** + * Gets timestamp + * + * @return \DateTime|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param \DateTime|null $timestamp When the event was queued. + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + /** * Gets type *