diff --git a/src/Adyen/Model/BalancePlatform/AccountHolder.php b/src/Adyen/Model/BalancePlatform/AccountHolder.php index 1a3c65f28..365ef4af4 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolder.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolder.php @@ -51,6 +51,7 @@ class AccountHolder implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'string', 'legalEntityId' => 'string', 'metadata' => 'array', + 'migratedAccountHolderCode' => 'string', 'primaryBalanceAccount' => 'string', 'reference' => 'string', 'status' => 'string', @@ -73,6 +74,7 @@ class AccountHolder implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => null, 'legalEntityId' => null, 'metadata' => null, + 'migratedAccountHolderCode' => null, 'primaryBalanceAccount' => null, 'reference' => null, 'status' => null, @@ -93,6 +95,7 @@ class AccountHolder implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => false, 'legalEntityId' => false, 'metadata' => false, + 'migratedAccountHolderCode' => false, 'primaryBalanceAccount' => false, 'reference' => false, 'status' => false, @@ -193,6 +196,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'id', 'legalEntityId' => 'legalEntityId', 'metadata' => 'metadata', + 'migratedAccountHolderCode' => 'migratedAccountHolderCode', 'primaryBalanceAccount' => 'primaryBalanceAccount', 'reference' => 'reference', 'status' => 'status', @@ -213,6 +217,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'setId', 'legalEntityId' => 'setLegalEntityId', 'metadata' => 'setMetadata', + 'migratedAccountHolderCode' => 'setMigratedAccountHolderCode', 'primaryBalanceAccount' => 'setPrimaryBalanceAccount', 'reference' => 'setReference', 'status' => 'setStatus', @@ -233,6 +238,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'getId', 'legalEntityId' => 'getLegalEntityId', 'metadata' => 'getMetadata', + 'migratedAccountHolderCode' => 'getMigratedAccountHolderCode', 'primaryBalanceAccount' => 'getPrimaryBalanceAccount', 'reference' => 'getReference', 'status' => 'getStatus', @@ -322,6 +328,7 @@ public function __construct(array $data = null) $this->setIfExists('id', $data ?? [], null); $this->setIfExists('legalEntityId', $data ?? [], null); $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('migratedAccountHolderCode', $data ?? [], null); $this->setIfExists('primaryBalanceAccount', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); @@ -561,7 +568,7 @@ public function getMetadata() /** * Sets metadata * - * @param array|null $metadata A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * @param array|null $metadata A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. * * @return self */ @@ -575,6 +582,33 @@ public function setMetadata($metadata) return $this; } + /** + * Gets migratedAccountHolderCode + * + * @return string|null + */ + public function getMigratedAccountHolderCode() + { + return $this->container['migratedAccountHolderCode']; + } + + /** + * Sets migratedAccountHolderCode + * + * @param string|null $migratedAccountHolderCode The unique identifier of the migrated account holder in the classic integration. + * + * @return self + */ + public function setMigratedAccountHolderCode($migratedAccountHolderCode) + { + if (is_null($migratedAccountHolderCode)) { + throw new \InvalidArgumentException('non-nullable migratedAccountHolderCode cannot be null'); + } + $this->container['migratedAccountHolderCode'] = $migratedAccountHolderCode; + + return $this; + } + /** * Gets primaryBalanceAccount * diff --git a/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php b/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php index aa8c70c5e..ca54ccbb7 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php @@ -50,6 +50,7 @@ class AccountHolderInfo implements ModelInterface, ArrayAccess, \JsonSerializabl 'description' => 'string', 'legalEntityId' => 'string', 'metadata' => 'array', + 'migratedAccountHolderCode' => 'string', 'reference' => 'string', 'timeZone' => 'string' ]; @@ -68,6 +69,7 @@ class AccountHolderInfo implements ModelInterface, ArrayAccess, \JsonSerializabl 'description' => null, 'legalEntityId' => null, 'metadata' => null, + 'migratedAccountHolderCode' => null, 'reference' => null, 'timeZone' => null ]; @@ -84,6 +86,7 @@ class AccountHolderInfo implements ModelInterface, ArrayAccess, \JsonSerializabl 'description' => false, 'legalEntityId' => false, 'metadata' => false, + 'migratedAccountHolderCode' => false, 'reference' => false, 'timeZone' => false ]; @@ -180,6 +183,7 @@ public function isNullableSetToNull(string $property): bool 'description' => 'description', 'legalEntityId' => 'legalEntityId', 'metadata' => 'metadata', + 'migratedAccountHolderCode' => 'migratedAccountHolderCode', 'reference' => 'reference', 'timeZone' => 'timeZone' ]; @@ -196,6 +200,7 @@ public function isNullableSetToNull(string $property): bool 'description' => 'setDescription', 'legalEntityId' => 'setLegalEntityId', 'metadata' => 'setMetadata', + 'migratedAccountHolderCode' => 'setMigratedAccountHolderCode', 'reference' => 'setReference', 'timeZone' => 'setTimeZone' ]; @@ -212,6 +217,7 @@ public function isNullableSetToNull(string $property): bool 'description' => 'getDescription', 'legalEntityId' => 'getLegalEntityId', 'metadata' => 'getMetadata', + 'migratedAccountHolderCode' => 'getMigratedAccountHolderCode', 'reference' => 'getReference', 'timeZone' => 'getTimeZone' ]; @@ -279,6 +285,7 @@ public function __construct(array $data = null) $this->setIfExists('description', $data ?? [], null); $this->setIfExists('legalEntityId', $data ?? [], null); $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('migratedAccountHolderCode', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('timeZone', $data ?? [], null); } @@ -476,7 +483,7 @@ public function getMetadata() /** * Sets metadata * - * @param array|null $metadata A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * @param array|null $metadata A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. * * @return self */ @@ -490,6 +497,33 @@ public function setMetadata($metadata) return $this; } + /** + * Gets migratedAccountHolderCode + * + * @return string|null + */ + public function getMigratedAccountHolderCode() + { + return $this->container['migratedAccountHolderCode']; + } + + /** + * Sets migratedAccountHolderCode + * + * @param string|null $migratedAccountHolderCode The unique identifier of the migrated account holder in the classic integration. + * + * @return self + */ + public function setMigratedAccountHolderCode($migratedAccountHolderCode) + { + if (is_null($migratedAccountHolderCode)) { + throw new \InvalidArgumentException('non-nullable migratedAccountHolderCode cannot be null'); + } + $this->container['migratedAccountHolderCode'] = $migratedAccountHolderCode; + + return $this; + } + /** * Gets reference * diff --git a/src/Adyen/Model/BalancePlatform/AccountHolderUpdateRequest.php b/src/Adyen/Model/BalancePlatform/AccountHolderUpdateRequest.php new file mode 100644 index 000000000..33619ca92 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/AccountHolderUpdateRequest.php @@ -0,0 +1,761 @@ + + */ +class AccountHolderUpdateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AccountHolderUpdateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balancePlatform' => 'string', + 'capabilities' => 'array', + 'contactDetails' => '\Adyen\Model\BalancePlatform\ContactDetails', + 'description' => 'string', + 'metadata' => 'array', + 'migratedAccountHolderCode' => 'string', + 'primaryBalanceAccount' => 'string', + 'reference' => 'string', + 'status' => 'string', + 'timeZone' => 'string', + 'verificationDeadlines' => '\Adyen\Model\BalancePlatform\VerificationDeadline[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balancePlatform' => null, + 'capabilities' => null, + 'contactDetails' => null, + 'description' => null, + 'metadata' => null, + 'migratedAccountHolderCode' => null, + 'primaryBalanceAccount' => null, + 'reference' => null, + 'status' => null, + 'timeZone' => null, + 'verificationDeadlines' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balancePlatform' => false, + 'capabilities' => false, + 'contactDetails' => false, + 'description' => false, + 'metadata' => false, + 'migratedAccountHolderCode' => false, + 'primaryBalanceAccount' => false, + 'reference' => false, + 'status' => false, + 'timeZone' => false, + 'verificationDeadlines' => 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 = [ + 'balancePlatform' => 'balancePlatform', + 'capabilities' => 'capabilities', + 'contactDetails' => 'contactDetails', + 'description' => 'description', + 'metadata' => 'metadata', + 'migratedAccountHolderCode' => 'migratedAccountHolderCode', + 'primaryBalanceAccount' => 'primaryBalanceAccount', + 'reference' => 'reference', + 'status' => 'status', + 'timeZone' => 'timeZone', + 'verificationDeadlines' => 'verificationDeadlines' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balancePlatform' => 'setBalancePlatform', + 'capabilities' => 'setCapabilities', + 'contactDetails' => 'setContactDetails', + 'description' => 'setDescription', + 'metadata' => 'setMetadata', + 'migratedAccountHolderCode' => 'setMigratedAccountHolderCode', + 'primaryBalanceAccount' => 'setPrimaryBalanceAccount', + 'reference' => 'setReference', + 'status' => 'setStatus', + 'timeZone' => 'setTimeZone', + 'verificationDeadlines' => 'setVerificationDeadlines' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balancePlatform' => 'getBalancePlatform', + 'capabilities' => 'getCapabilities', + 'contactDetails' => 'getContactDetails', + 'description' => 'getDescription', + 'metadata' => 'getMetadata', + 'migratedAccountHolderCode' => 'getMigratedAccountHolderCode', + 'primaryBalanceAccount' => 'getPrimaryBalanceAccount', + 'reference' => 'getReference', + 'status' => 'getStatus', + 'timeZone' => 'getTimeZone', + 'verificationDeadlines' => 'getVerificationDeadlines' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_CLOSED = 'closed'; + public const STATUS_INACTIVE = 'inactive'; + public const STATUS_SUSPENDED = 'suspended'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_CLOSED, + self::STATUS_INACTIVE, + self::STATUS_SUSPENDED, + ]; + } + /** + * 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('balancePlatform', $data ?? [], null); + $this->setIfExists('capabilities', $data ?? [], null); + $this->setIfExists('contactDetails', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('migratedAccountHolderCode', $data ?? [], null); + $this->setIfExists('primaryBalanceAccount', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('timeZone', $data ?? [], null); + $this->setIfExists('verificationDeadlines', $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->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + 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 balancePlatform + * + * @return string|null + */ + public function getBalancePlatform() + { + return $this->container['balancePlatform']; + } + + /** + * Sets balancePlatform + * + * @param string|null $balancePlatform The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms. + * + * @return self + */ + public function setBalancePlatform($balancePlatform) + { + if (is_null($balancePlatform)) { + throw new \InvalidArgumentException('non-nullable balancePlatform cannot be null'); + } + $this->container['balancePlatform'] = $balancePlatform; + + return $this; + } + + /** + * Gets capabilities + * + * @return array|null + */ + public function getCapabilities() + { + return $this->container['capabilities']; + } + + /** + * Sets capabilities + * + * @param array|null $capabilities Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability. + * + * @return self + */ + public function setCapabilities($capabilities) + { + if (is_null($capabilities)) { + throw new \InvalidArgumentException('non-nullable capabilities cannot be null'); + } + $this->container['capabilities'] = $capabilities; + + return $this; + } + + /** + * Gets contactDetails + * + * @return \Adyen\Model\BalancePlatform\ContactDetails|null + */ + public function getContactDetails() + { + return $this->container['contactDetails']; + } + + /** + * Sets contactDetails + * + * @param \Adyen\Model\BalancePlatform\ContactDetails|null $contactDetails contactDetails + * + * @return self + */ + public function setContactDetails($contactDetails) + { + if (is_null($contactDetails)) { + throw new \InvalidArgumentException('non-nullable contactDetails cannot be null'); + } + $this->container['contactDetails'] = $contactDetails; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for the account holder, maximum 300 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets migratedAccountHolderCode + * + * @return string|null + */ + public function getMigratedAccountHolderCode() + { + return $this->container['migratedAccountHolderCode']; + } + + /** + * Sets migratedAccountHolderCode + * + * @param string|null $migratedAccountHolderCode The unique identifier of the migrated account holder in the classic integration. + * + * @return self + */ + public function setMigratedAccountHolderCode($migratedAccountHolderCode) + { + if (is_null($migratedAccountHolderCode)) { + throw new \InvalidArgumentException('non-nullable migratedAccountHolderCode cannot be null'); + } + $this->container['migratedAccountHolderCode'] = $migratedAccountHolderCode; + + return $this; + } + + /** + * Gets primaryBalanceAccount + * + * @return string|null + */ + public function getPrimaryBalanceAccount() + { + return $this->container['primaryBalanceAccount']; + } + + /** + * Sets primaryBalanceAccount + * + * @param string|null $primaryBalanceAccount The ID of the account holder's primary balance account. By default, this is set to the first balance account that you create for the account holder. To assign a different balance account, send a PATCH request. + * + * @return self + */ + public function setPrimaryBalanceAccount($primaryBalanceAccount) + { + if (is_null($primaryBalanceAccount)) { + throw new \InvalidArgumentException('non-nullable primaryBalanceAccount cannot be null'); + } + $this->container['primaryBalanceAccount'] = $primaryBalanceAccount; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the account holder, maximum 150 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the account holder. Possible values: * **active**: The account holder is active. This is the default status when creating an account holder. * **inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **closed**: The account holder is permanently deactivated by you. This action cannot be undone. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets timeZone + * + * @return string|null + */ + public function getTimeZone() + { + return $this->container['timeZone']; + } + + /** + * Sets timeZone + * + * @param string|null $timeZone The time zone of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * + * @return self + */ + public function setTimeZone($timeZone) + { + if (is_null($timeZone)) { + throw new \InvalidArgumentException('non-nullable timeZone cannot be null'); + } + $this->container['timeZone'] = $timeZone; + + return $this; + } + + /** + * Gets verificationDeadlines + * + * @return \Adyen\Model\BalancePlatform\VerificationDeadline[]|null + */ + public function getVerificationDeadlines() + { + return $this->container['verificationDeadlines']; + } + + /** + * Sets verificationDeadlines + * + * @param \Adyen\Model\BalancePlatform\VerificationDeadline[]|null $verificationDeadlines List of verification deadlines and the capabilities that will be disallowed if verification errors are not resolved. + * + * @return self + */ + public function setVerificationDeadlines($verificationDeadlines) + { + if (is_null($verificationDeadlines)) { + throw new \InvalidArgumentException('non-nullable verificationDeadlines cannot be null'); + } + $this->container['verificationDeadlines'] = $verificationDeadlines; + + 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); + } + + /** + * 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/BRLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/BRLocalAccountIdentification.php new file mode 100644 index 000000000..0f2153959 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BRLocalAccountIdentification.php @@ -0,0 +1,529 @@ + + */ +class BRLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BRLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'bankCode' => 'string', + 'branchNumber' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'bankCode' => null, + 'branchNumber' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'bankCode' => false, + 'branchNumber' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'accountNumber' => 'accountNumber', + 'bankCode' => 'bankCode', + 'branchNumber' => 'branchNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'bankCode' => 'setBankCode', + 'branchNumber' => 'setBranchNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'bankCode' => 'getBankCode', + 'branchNumber' => 'getBranchNumber', + '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_BR_LOCAL = 'brLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BR_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('bankCode', $data ?? [], null); + $this->setIfExists('branchNumber', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'brLocal'); + } + + /** + * 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['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['bankCode'] === null) { + $invalidProperties[] = "'bankCode' can't be null"; + } + if ($this->container['branchNumber'] === null) { + $invalidProperties[] = "'branchNumber' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets bankCode + * + * @return string + */ + public function getBankCode() + { + return $this->container['bankCode']; + } + + /** + * Sets bankCode + * + * @param string $bankCode The 3-digit bank code, with leading zeros. + * + * @return self + */ + public function setBankCode($bankCode) + { + if (is_null($bankCode)) { + throw new \InvalidArgumentException('non-nullable bankCode cannot be null'); + } + $this->container['bankCode'] = $bankCode; + + return $this; + } + + /** + * Gets branchNumber + * + * @return string + */ + public function getBranchNumber() + { + return $this->container['branchNumber']; + } + + /** + * Sets branchNumber + * + * @param string $branchNumber The bank account branch number, without separators or whitespace. + * + * @return self + */ + public function setBranchNumber($branchNumber) + { + if (is_null($branchNumber)) { + throw new \InvalidArgumentException('non-nullable branchNumber cannot be null'); + } + $this->container['branchNumber'] = $branchNumber; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **brLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * 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/Balance.php b/src/Adyen/Model/BalancePlatform/Balance.php index 6d27facc8..da44b35f2 100644 --- a/src/Adyen/Model/BalancePlatform/Balance.php +++ b/src/Adyen/Model/BalancePlatform/Balance.php @@ -47,6 +47,7 @@ class Balance implements ModelInterface, ArrayAccess, \JsonSerializable 'available' => 'int', 'balance' => 'int', 'currency' => 'string', + 'pending' => 'int', 'reserved' => 'int' ]; @@ -61,6 +62,7 @@ class Balance implements ModelInterface, ArrayAccess, \JsonSerializable 'available' => 'int64', 'balance' => 'int64', 'currency' => null, + 'pending' => 'int64', 'reserved' => 'int64' ]; @@ -73,6 +75,7 @@ class Balance implements ModelInterface, ArrayAccess, \JsonSerializable 'available' => false, 'balance' => false, 'currency' => false, + 'pending' => false, 'reserved' => false ]; @@ -165,6 +168,7 @@ public function isNullableSetToNull(string $property): bool 'available' => 'available', 'balance' => 'balance', 'currency' => 'currency', + 'pending' => 'pending', 'reserved' => 'reserved' ]; @@ -177,6 +181,7 @@ public function isNullableSetToNull(string $property): bool 'available' => 'setAvailable', 'balance' => 'setBalance', 'currency' => 'setCurrency', + 'pending' => 'setPending', 'reserved' => 'setReserved' ]; @@ -189,6 +194,7 @@ public function isNullableSetToNull(string $property): bool 'available' => 'getAvailable', 'balance' => 'getBalance', 'currency' => 'getCurrency', + 'pending' => 'getPending', 'reserved' => 'getReserved' ]; @@ -252,6 +258,7 @@ public function __construct(array $data = null) $this->setIfExists('available', $data ?? [], null); $this->setIfExists('balance', $data ?? [], null); $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('pending', $data ?? [], null); $this->setIfExists('reserved', $data ?? [], null); } @@ -390,6 +397,33 @@ public function setCurrency($currency) return $this; } + /** + * Gets pending + * + * @return int|null + */ + public function getPending() + { + return $this->container['pending']; + } + + /** + * Sets pending + * + * @param int|null $pending The amount pending to be paid out but not yet available in the balance. + * + * @return self + */ + public function setPending($pending) + { + if (is_null($pending)) { + throw new \InvalidArgumentException('non-nullable pending cannot be null'); + } + $this->container['pending'] = $pending; + + return $this; + } + /** * Gets reserved * diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccount.php b/src/Adyen/Model/BalancePlatform/BalanceAccount.php index 6bcda02ae..2ef327c28 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccount.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccount.php @@ -50,6 +50,8 @@ class BalanceAccount implements ModelInterface, ArrayAccess, \JsonSerializable 'description' => 'string', 'id' => 'string', 'metadata' => 'array', + 'migratedAccountCode' => 'string', + 'platformPaymentConfiguration' => '\Adyen\Model\BalancePlatform\PlatformPaymentConfiguration', 'reference' => 'string', 'status' => 'string', 'timeZone' => 'string' @@ -69,6 +71,8 @@ class BalanceAccount implements ModelInterface, ArrayAccess, \JsonSerializable 'description' => null, 'id' => null, 'metadata' => null, + 'migratedAccountCode' => null, + 'platformPaymentConfiguration' => null, 'reference' => null, 'status' => null, 'timeZone' => null @@ -86,6 +90,8 @@ class BalanceAccount implements ModelInterface, ArrayAccess, \JsonSerializable 'description' => false, 'id' => false, 'metadata' => false, + 'migratedAccountCode' => false, + 'platformPaymentConfiguration' => false, 'reference' => false, 'status' => false, 'timeZone' => false @@ -183,6 +189,8 @@ public function isNullableSetToNull(string $property): bool 'description' => 'description', 'id' => 'id', 'metadata' => 'metadata', + 'migratedAccountCode' => 'migratedAccountCode', + 'platformPaymentConfiguration' => 'platformPaymentConfiguration', 'reference' => 'reference', 'status' => 'status', 'timeZone' => 'timeZone' @@ -200,6 +208,8 @@ public function isNullableSetToNull(string $property): bool 'description' => 'setDescription', 'id' => 'setId', 'metadata' => 'setMetadata', + 'migratedAccountCode' => 'setMigratedAccountCode', + 'platformPaymentConfiguration' => 'setPlatformPaymentConfiguration', 'reference' => 'setReference', 'status' => 'setStatus', 'timeZone' => 'setTimeZone' @@ -217,6 +227,8 @@ public function isNullableSetToNull(string $property): bool 'description' => 'getDescription', 'id' => 'getId', 'metadata' => 'getMetadata', + 'migratedAccountCode' => 'getMigratedAccountCode', + 'platformPaymentConfiguration' => 'getPlatformPaymentConfiguration', 'reference' => 'getReference', 'status' => 'getStatus', 'timeZone' => 'getTimeZone' @@ -303,6 +315,8 @@ public function __construct(array $data = null) $this->setIfExists('description', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('migratedAccountCode', $data ?? [], null); + $this->setIfExists('platformPaymentConfiguration', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('timeZone', $data ?? [], null); @@ -513,7 +527,7 @@ public function getMetadata() /** * Sets metadata * - * @param array|null $metadata A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * @param array|null $metadata A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. * * @return self */ @@ -527,6 +541,60 @@ public function setMetadata($metadata) return $this; } + /** + * Gets migratedAccountCode + * + * @return string|null + */ + public function getMigratedAccountCode() + { + return $this->container['migratedAccountCode']; + } + + /** + * Sets migratedAccountCode + * + * @param string|null $migratedAccountCode The unique identifier of the account of the migrated account holder in the classic integration. + * + * @return self + */ + public function setMigratedAccountCode($migratedAccountCode) + { + if (is_null($migratedAccountCode)) { + throw new \InvalidArgumentException('non-nullable migratedAccountCode cannot be null'); + } + $this->container['migratedAccountCode'] = $migratedAccountCode; + + return $this; + } + + /** + * Gets platformPaymentConfiguration + * + * @return \Adyen\Model\BalancePlatform\PlatformPaymentConfiguration|null + */ + public function getPlatformPaymentConfiguration() + { + return $this->container['platformPaymentConfiguration']; + } + + /** + * Sets platformPaymentConfiguration + * + * @param \Adyen\Model\BalancePlatform\PlatformPaymentConfiguration|null $platformPaymentConfiguration platformPaymentConfiguration + * + * @return self + */ + public function setPlatformPaymentConfiguration($platformPaymentConfiguration) + { + if (is_null($platformPaymentConfiguration)) { + throw new \InvalidArgumentException('non-nullable platformPaymentConfiguration cannot be null'); + } + $this->container['platformPaymentConfiguration'] = $platformPaymentConfiguration; + + return $this; + } + /** * Gets reference * diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountBase.php b/src/Adyen/Model/BalancePlatform/BalanceAccountBase.php index 3c0bfc830..ba7373e31 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccountBase.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountBase.php @@ -49,6 +49,8 @@ class BalanceAccountBase implements ModelInterface, ArrayAccess, \JsonSerializab 'description' => 'string', 'id' => 'string', 'metadata' => 'array', + 'migratedAccountCode' => 'string', + 'platformPaymentConfiguration' => '\Adyen\Model\BalancePlatform\PlatformPaymentConfiguration', 'reference' => 'string', 'status' => 'string', 'timeZone' => 'string' @@ -67,6 +69,8 @@ class BalanceAccountBase implements ModelInterface, ArrayAccess, \JsonSerializab 'description' => null, 'id' => null, 'metadata' => null, + 'migratedAccountCode' => null, + 'platformPaymentConfiguration' => null, 'reference' => null, 'status' => null, 'timeZone' => null @@ -83,6 +87,8 @@ class BalanceAccountBase implements ModelInterface, ArrayAccess, \JsonSerializab 'description' => false, 'id' => false, 'metadata' => false, + 'migratedAccountCode' => false, + 'platformPaymentConfiguration' => false, 'reference' => false, 'status' => false, 'timeZone' => false @@ -179,6 +185,8 @@ public function isNullableSetToNull(string $property): bool 'description' => 'description', 'id' => 'id', 'metadata' => 'metadata', + 'migratedAccountCode' => 'migratedAccountCode', + 'platformPaymentConfiguration' => 'platformPaymentConfiguration', 'reference' => 'reference', 'status' => 'status', 'timeZone' => 'timeZone' @@ -195,6 +203,8 @@ public function isNullableSetToNull(string $property): bool 'description' => 'setDescription', 'id' => 'setId', 'metadata' => 'setMetadata', + 'migratedAccountCode' => 'setMigratedAccountCode', + 'platformPaymentConfiguration' => 'setPlatformPaymentConfiguration', 'reference' => 'setReference', 'status' => 'setStatus', 'timeZone' => 'setTimeZone' @@ -211,6 +221,8 @@ public function isNullableSetToNull(string $property): bool 'description' => 'getDescription', 'id' => 'getId', 'metadata' => 'getMetadata', + 'migratedAccountCode' => 'getMigratedAccountCode', + 'platformPaymentConfiguration' => 'getPlatformPaymentConfiguration', 'reference' => 'getReference', 'status' => 'getStatus', 'timeZone' => 'getTimeZone' @@ -296,6 +308,8 @@ public function __construct(array $data = null) $this->setIfExists('description', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('migratedAccountCode', $data ?? [], null); + $this->setIfExists('platformPaymentConfiguration', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('timeZone', $data ?? [], null); @@ -479,7 +493,7 @@ public function getMetadata() /** * Sets metadata * - * @param array|null $metadata A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * @param array|null $metadata A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. * * @return self */ @@ -493,6 +507,60 @@ public function setMetadata($metadata) return $this; } + /** + * Gets migratedAccountCode + * + * @return string|null + */ + public function getMigratedAccountCode() + { + return $this->container['migratedAccountCode']; + } + + /** + * Sets migratedAccountCode + * + * @param string|null $migratedAccountCode The unique identifier of the account of the migrated account holder in the classic integration. + * + * @return self + */ + public function setMigratedAccountCode($migratedAccountCode) + { + if (is_null($migratedAccountCode)) { + throw new \InvalidArgumentException('non-nullable migratedAccountCode cannot be null'); + } + $this->container['migratedAccountCode'] = $migratedAccountCode; + + return $this; + } + + /** + * Gets platformPaymentConfiguration + * + * @return \Adyen\Model\BalancePlatform\PlatformPaymentConfiguration|null + */ + public function getPlatformPaymentConfiguration() + { + return $this->container['platformPaymentConfiguration']; + } + + /** + * Sets platformPaymentConfiguration + * + * @param \Adyen\Model\BalancePlatform\PlatformPaymentConfiguration|null $platformPaymentConfiguration platformPaymentConfiguration + * + * @return self + */ + public function setPlatformPaymentConfiguration($platformPaymentConfiguration) + { + if (is_null($platformPaymentConfiguration)) { + throw new \InvalidArgumentException('non-nullable platformPaymentConfiguration cannot be null'); + } + $this->container['platformPaymentConfiguration'] = $platformPaymentConfiguration; + + return $this; + } + /** * Gets reference * diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php b/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php index 222fa639f..29f07c3fd 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php @@ -48,6 +48,8 @@ class BalanceAccountInfo implements ModelInterface, ArrayAccess, \JsonSerializab 'defaultCurrencyCode' => 'string', 'description' => 'string', 'metadata' => 'array', + 'migratedAccountCode' => 'string', + 'platformPaymentConfiguration' => '\Adyen\Model\BalancePlatform\PlatformPaymentConfiguration', 'reference' => 'string', 'timeZone' => 'string' ]; @@ -64,6 +66,8 @@ class BalanceAccountInfo implements ModelInterface, ArrayAccess, \JsonSerializab 'defaultCurrencyCode' => null, 'description' => null, 'metadata' => null, + 'migratedAccountCode' => null, + 'platformPaymentConfiguration' => null, 'reference' => null, 'timeZone' => null ]; @@ -78,6 +82,8 @@ class BalanceAccountInfo implements ModelInterface, ArrayAccess, \JsonSerializab 'defaultCurrencyCode' => false, 'description' => false, 'metadata' => false, + 'migratedAccountCode' => false, + 'platformPaymentConfiguration' => false, 'reference' => false, 'timeZone' => false ]; @@ -172,6 +178,8 @@ public function isNullableSetToNull(string $property): bool 'defaultCurrencyCode' => 'defaultCurrencyCode', 'description' => 'description', 'metadata' => 'metadata', + 'migratedAccountCode' => 'migratedAccountCode', + 'platformPaymentConfiguration' => 'platformPaymentConfiguration', 'reference' => 'reference', 'timeZone' => 'timeZone' ]; @@ -186,6 +194,8 @@ public function isNullableSetToNull(string $property): bool 'defaultCurrencyCode' => 'setDefaultCurrencyCode', 'description' => 'setDescription', 'metadata' => 'setMetadata', + 'migratedAccountCode' => 'setMigratedAccountCode', + 'platformPaymentConfiguration' => 'setPlatformPaymentConfiguration', 'reference' => 'setReference', 'timeZone' => 'setTimeZone' ]; @@ -200,6 +210,8 @@ public function isNullableSetToNull(string $property): bool 'defaultCurrencyCode' => 'getDefaultCurrencyCode', 'description' => 'getDescription', 'metadata' => 'getMetadata', + 'migratedAccountCode' => 'getMigratedAccountCode', + 'platformPaymentConfiguration' => 'getPlatformPaymentConfiguration', 'reference' => 'getReference', 'timeZone' => 'getTimeZone' ]; @@ -265,6 +277,8 @@ public function __construct(array $data = null) $this->setIfExists('defaultCurrencyCode', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('migratedAccountCode', $data ?? [], null); + $this->setIfExists('platformPaymentConfiguration', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('timeZone', $data ?? [], null); } @@ -408,7 +422,7 @@ public function getMetadata() /** * Sets metadata * - * @param array|null $metadata A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * @param array|null $metadata A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. * * @return self */ @@ -422,6 +436,60 @@ public function setMetadata($metadata) return $this; } + /** + * Gets migratedAccountCode + * + * @return string|null + */ + public function getMigratedAccountCode() + { + return $this->container['migratedAccountCode']; + } + + /** + * Sets migratedAccountCode + * + * @param string|null $migratedAccountCode The unique identifier of the account of the migrated account holder in the classic integration. + * + * @return self + */ + public function setMigratedAccountCode($migratedAccountCode) + { + if (is_null($migratedAccountCode)) { + throw new \InvalidArgumentException('non-nullable migratedAccountCode cannot be null'); + } + $this->container['migratedAccountCode'] = $migratedAccountCode; + + return $this; + } + + /** + * Gets platformPaymentConfiguration + * + * @return \Adyen\Model\BalancePlatform\PlatformPaymentConfiguration|null + */ + public function getPlatformPaymentConfiguration() + { + return $this->container['platformPaymentConfiguration']; + } + + /** + * Sets platformPaymentConfiguration + * + * @param \Adyen\Model\BalancePlatform\PlatformPaymentConfiguration|null $platformPaymentConfiguration platformPaymentConfiguration + * + * @return self + */ + public function setPlatformPaymentConfiguration($platformPaymentConfiguration) + { + if (is_null($platformPaymentConfiguration)) { + throw new \InvalidArgumentException('non-nullable platformPaymentConfiguration cannot be null'); + } + $this->container['platformPaymentConfiguration'] = $platformPaymentConfiguration; + + return $this; + } + /** * Gets reference * diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php b/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php index 783e01676..e97f31c21 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php @@ -48,6 +48,7 @@ class BalanceAccountUpdateRequest implements ModelInterface, ArrayAccess, \JsonS 'defaultCurrencyCode' => 'string', 'description' => 'string', 'metadata' => 'array', + 'platformPaymentConfiguration' => '\Adyen\Model\BalancePlatform\PlatformPaymentConfiguration', 'reference' => 'string', 'status' => 'string', 'timeZone' => 'string' @@ -65,6 +66,7 @@ class BalanceAccountUpdateRequest implements ModelInterface, ArrayAccess, \JsonS 'defaultCurrencyCode' => null, 'description' => null, 'metadata' => null, + 'platformPaymentConfiguration' => null, 'reference' => null, 'status' => null, 'timeZone' => null @@ -80,6 +82,7 @@ class BalanceAccountUpdateRequest implements ModelInterface, ArrayAccess, \JsonS 'defaultCurrencyCode' => false, 'description' => false, 'metadata' => false, + 'platformPaymentConfiguration' => false, 'reference' => false, 'status' => false, 'timeZone' => false @@ -175,6 +178,7 @@ public function isNullableSetToNull(string $property): bool 'defaultCurrencyCode' => 'defaultCurrencyCode', 'description' => 'description', 'metadata' => 'metadata', + 'platformPaymentConfiguration' => 'platformPaymentConfiguration', 'reference' => 'reference', 'status' => 'status', 'timeZone' => 'timeZone' @@ -190,6 +194,7 @@ public function isNullableSetToNull(string $property): bool 'defaultCurrencyCode' => 'setDefaultCurrencyCode', 'description' => 'setDescription', 'metadata' => 'setMetadata', + 'platformPaymentConfiguration' => 'setPlatformPaymentConfiguration', 'reference' => 'setReference', 'status' => 'setStatus', 'timeZone' => 'setTimeZone' @@ -205,6 +210,7 @@ public function isNullableSetToNull(string $property): bool 'defaultCurrencyCode' => 'getDefaultCurrencyCode', 'description' => 'getDescription', 'metadata' => 'getMetadata', + 'platformPaymentConfiguration' => 'getPlatformPaymentConfiguration', 'reference' => 'getReference', 'status' => 'getStatus', 'timeZone' => 'getTimeZone' @@ -289,6 +295,7 @@ public function __construct(array $data = null) $this->setIfExists('defaultCurrencyCode', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('platformPaymentConfiguration', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('timeZone', $data ?? [], null); @@ -439,7 +446,7 @@ public function getMetadata() /** * Sets metadata * - * @param array|null $metadata A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * @param array|null $metadata A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. * * @return self */ @@ -453,6 +460,33 @@ public function setMetadata($metadata) return $this; } + /** + * Gets platformPaymentConfiguration + * + * @return \Adyen\Model\BalancePlatform\PlatformPaymentConfiguration|null + */ + public function getPlatformPaymentConfiguration() + { + return $this->container['platformPaymentConfiguration']; + } + + /** + * Sets platformPaymentConfiguration + * + * @param \Adyen\Model\BalancePlatform\PlatformPaymentConfiguration|null $platformPaymentConfiguration platformPaymentConfiguration + * + * @return self + */ + public function setPlatformPaymentConfiguration($platformPaymentConfiguration) + { + if (is_null($platformPaymentConfiguration)) { + throw new \InvalidArgumentException('non-nullable platformPaymentConfiguration cannot be null'); + } + $this->container['platformPaymentConfiguration'] = $platformPaymentConfiguration; + + return $this; + } + /** * Gets reference * diff --git a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php index 6289eb9d8..caa0377e6 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php @@ -48,11 +48,13 @@ class BankAccountIdentificationValidationRequestAccountIdentification implements 'accountNumber' => 'string', 'bsbCode' => 'string', 'type' => 'string', + 'bankCode' => 'string', + 'branchNumber' => 'string', 'accountType' => 'string', 'institutionNumber' => 'string', 'transitNumber' => 'string', - 'bankCode' => 'string', 'iban' => 'string', + 'accountSuffix' => 'string', 'additionalBankIdentification' => '\Adyen\Model\BalancePlatform\AdditionalBankIdentification', 'bic' => 'string', 'clearingNumber' => 'string', @@ -71,11 +73,13 @@ class BankAccountIdentificationValidationRequestAccountIdentification implements 'accountNumber' => null, 'bsbCode' => null, 'type' => null, + 'bankCode' => null, + 'branchNumber' => null, 'accountType' => null, 'institutionNumber' => null, 'transitNumber' => null, - 'bankCode' => null, 'iban' => null, + 'accountSuffix' => null, 'additionalBankIdentification' => null, 'bic' => null, 'clearingNumber' => null, @@ -92,11 +96,13 @@ class BankAccountIdentificationValidationRequestAccountIdentification implements 'accountNumber' => false, 'bsbCode' => false, 'type' => false, + 'bankCode' => false, + 'branchNumber' => false, 'accountType' => false, 'institutionNumber' => false, 'transitNumber' => false, - 'bankCode' => false, 'iban' => false, + 'accountSuffix' => false, 'additionalBankIdentification' => false, 'bic' => false, 'clearingNumber' => false, @@ -193,11 +199,13 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'accountNumber', 'bsbCode' => 'bsbCode', 'type' => 'type', + 'bankCode' => 'bankCode', + 'branchNumber' => 'branchNumber', 'accountType' => 'accountType', 'institutionNumber' => 'institutionNumber', 'transitNumber' => 'transitNumber', - 'bankCode' => 'bankCode', 'iban' => 'iban', + 'accountSuffix' => 'accountSuffix', 'additionalBankIdentification' => 'additionalBankIdentification', 'bic' => 'bic', 'clearingNumber' => 'clearingNumber', @@ -214,11 +222,13 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'setAccountNumber', 'bsbCode' => 'setBsbCode', 'type' => 'setType', + 'bankCode' => 'setBankCode', + 'branchNumber' => 'setBranchNumber', 'accountType' => 'setAccountType', 'institutionNumber' => 'setInstitutionNumber', 'transitNumber' => 'setTransitNumber', - 'bankCode' => 'setBankCode', 'iban' => 'setIban', + 'accountSuffix' => 'setAccountSuffix', 'additionalBankIdentification' => 'setAdditionalBankIdentification', 'bic' => 'setBic', 'clearingNumber' => 'setClearingNumber', @@ -235,11 +245,13 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'getAccountNumber', 'bsbCode' => 'getBsbCode', 'type' => 'getType', + 'bankCode' => 'getBankCode', + 'branchNumber' => 'getBranchNumber', 'accountType' => 'getAccountType', 'institutionNumber' => 'getInstitutionNumber', 'transitNumber' => 'getTransitNumber', - 'bankCode' => 'getBankCode', 'iban' => 'getIban', + 'accountSuffix' => 'getAccountSuffix', 'additionalBankIdentification' => 'getAdditionalBankIdentification', 'bic' => 'getBic', 'clearingNumber' => 'getClearingNumber', @@ -306,11 +318,13 @@ public function __construct(array $data = null) $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bsbCode', $data ?? [], null); $this->setIfExists('type', $data ?? [], 'usLocal'); + $this->setIfExists('bankCode', $data ?? [], null); + $this->setIfExists('branchNumber', $data ?? [], null); $this->setIfExists('accountType', $data ?? [], 'checking'); $this->setIfExists('institutionNumber', $data ?? [], null); $this->setIfExists('transitNumber', $data ?? [], null); - $this->setIfExists('bankCode', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('accountSuffix', $data ?? [], null); $this->setIfExists('additionalBankIdentification', $data ?? [], null); $this->setIfExists('bic', $data ?? [], null); $this->setIfExists('clearingNumber', $data ?? [], null); @@ -355,6 +369,12 @@ public function listInvalidProperties() $invalidProperties[] = "'type' can't be null"; } + if ($this->container['bankCode'] === null) { + $invalidProperties[] = "'bankCode' can't be null"; + } + if ($this->container['branchNumber'] === null) { + $invalidProperties[] = "'branchNumber' can't be null"; + } if ($this->container['institutionNumber'] === null) { $invalidProperties[] = "'institutionNumber' can't be null"; @@ -362,12 +382,12 @@ public function listInvalidProperties() if ($this->container['transitNumber'] === null) { $invalidProperties[] = "'transitNumber' can't be null"; } - if ($this->container['bankCode'] === null) { - $invalidProperties[] = "'bankCode' can't be null"; - } if ($this->container['iban'] === null) { $invalidProperties[] = "'iban' can't be null"; } + if ($this->container['accountSuffix'] === null) { + $invalidProperties[] = "'accountSuffix' can't be null"; + } if ($this->container['bic'] === null) { $invalidProperties[] = "'bic' can't be null"; } @@ -476,6 +496,60 @@ public function setType($type) return $this; } + /** + * Gets bankCode + * + * @return string + */ + public function getBankCode() + { + return $this->container['bankCode']; + } + + /** + * Sets bankCode + * + * @param string $bankCode The 6-digit bank code including the 2-digit bank code and 4-digit branch code, without separators or whitespace. + * + * @return self + */ + public function setBankCode($bankCode) + { + if (is_null($bankCode)) { + throw new \InvalidArgumentException('non-nullable bankCode cannot be null'); + } + $this->container['bankCode'] = $bankCode; + + return $this; + } + + /** + * Gets branchNumber + * + * @return string + */ + public function getBranchNumber() + { + return $this->container['branchNumber']; + } + + /** + * Sets branchNumber + * + * @param string $branchNumber The bank account branch number, without separators or whitespace. + * + * @return self + */ + public function setBranchNumber($branchNumber) + { + if (is_null($branchNumber)) { + throw new \InvalidArgumentException('non-nullable branchNumber cannot be null'); + } + $this->container['branchNumber'] = $branchNumber; + + return $this; + } + /** * Gets accountType * @@ -558,55 +632,55 @@ public function setTransitNumber($transitNumber) } /** - * Gets bankCode + * Gets iban * * @return string */ - public function getBankCode() + public function getIban() { - return $this->container['bankCode']; + return $this->container['iban']; } /** - * Sets bankCode + * Sets iban * - * @param string $bankCode The 4-digit bank code (Kód banky), without separators or whitespace. + * @param string $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. * * @return self */ - public function setBankCode($bankCode) + public function setIban($iban) { - if (is_null($bankCode)) { - throw new \InvalidArgumentException('non-nullable bankCode cannot be null'); + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); } - $this->container['bankCode'] = $bankCode; + $this->container['iban'] = $iban; return $this; } /** - * Gets iban + * Gets accountSuffix * * @return string */ - public function getIban() + public function getAccountSuffix() { - return $this->container['iban']; + return $this->container['accountSuffix']; } /** - * Sets iban + * Sets accountSuffix * - * @param string $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * @param string $accountSuffix The 2- to 3-digit account suffix, without separators or whitespace. * * @return self */ - public function setIban($iban) + public function setAccountSuffix($accountSuffix) { - if (is_null($iban)) { - throw new \InvalidArgumentException('non-nullable iban cannot be null'); + if (is_null($accountSuffix)) { + throw new \InvalidArgumentException('non-nullable accountSuffix cannot be null'); } - $this->container['iban'] = $iban; + $this->container['accountSuffix'] = $accountSuffix; return $this; } diff --git a/src/Adyen/Model/BalancePlatform/Card.php b/src/Adyen/Model/BalancePlatform/Card.php index 74191c721..8a9ab2f62 100644 --- a/src/Adyen/Model/BalancePlatform/Card.php +++ b/src/Adyen/Model/BalancePlatform/Card.php @@ -55,7 +55,8 @@ class Card implements ModelInterface, ArrayAccess, \JsonSerializable 'expiration' => '\Adyen\Model\BalancePlatform\Expiry', 'formFactor' => 'string', 'lastFour' => 'string', - 'number' => 'string' + 'number' => 'string', + 'threeDSecure' => 'string' ]; /** @@ -77,7 +78,8 @@ class Card implements ModelInterface, ArrayAccess, \JsonSerializable 'expiration' => null, 'formFactor' => null, 'lastFour' => null, - 'number' => null + 'number' => null, + 'threeDSecure' => null ]; /** @@ -97,7 +99,8 @@ class Card implements ModelInterface, ArrayAccess, \JsonSerializable 'expiration' => false, 'formFactor' => false, 'lastFour' => false, - 'number' => false + 'number' => false, + 'threeDSecure' => false ]; /** @@ -197,7 +200,8 @@ public function isNullableSetToNull(string $property): bool 'expiration' => 'expiration', 'formFactor' => 'formFactor', 'lastFour' => 'lastFour', - 'number' => 'number' + 'number' => 'number', + 'threeDSecure' => 'threeDSecure' ]; /** @@ -217,7 +221,8 @@ public function isNullableSetToNull(string $property): bool 'expiration' => 'setExpiration', 'formFactor' => 'setFormFactor', 'lastFour' => 'setLastFour', - 'number' => 'setNumber' + 'number' => 'setNumber', + 'threeDSecure' => 'setThreeDSecure' ]; /** @@ -237,7 +242,8 @@ public function isNullableSetToNull(string $property): bool 'expiration' => 'getExpiration', 'formFactor' => 'getFormFactor', 'lastFour' => 'getLastFour', - 'number' => 'getNumber' + 'number' => 'getNumber', + 'threeDSecure' => 'getThreeDSecure' ]; /** @@ -325,6 +331,7 @@ public function __construct(array $data = null) $this->setIfExists('formFactor', $data ?? [], null); $this->setIfExists('lastFour', $data ?? [], null); $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('threeDSecure', $data ?? [], null); } /** @@ -487,7 +494,7 @@ public function getBrandVariant() /** * Sets brandVariant * - * @param string $brandVariant The brand variant of the physical or the virtual card. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**. + * @param string $brandVariant The brand variant of the physical or the virtual card. For example, **visadebit** or **mcprepaid**. >Reach out to your Adyen contact to get the values relevant for your integration. * * @return self */ @@ -726,6 +733,33 @@ public function setNumber($number) return $this; } + + /** + * Gets threeDSecure + * + * @return string|null + */ + public function getThreeDSecure() + { + return $this->container['threeDSecure']; + } + + /** + * Sets threeDSecure + * + * @param string|null $threeDSecure Allocates a specific product range for either a physical or a virtual card. Possible values: **fullySupported**, **secureCorporate**. >Reach out to your Adyen contact to get the values relevant for your integration. + * + * @return self + */ + public function setThreeDSecure($threeDSecure) + { + if (is_null($threeDSecure)) { + throw new \InvalidArgumentException('non-nullable threeDSecure cannot be null'); + } + $this->container['threeDSecure'] = $threeDSecure; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/BalancePlatform/CardInfo.php b/src/Adyen/Model/BalancePlatform/CardInfo.php index c9651abaf..fc86a8101 100644 --- a/src/Adyen/Model/BalancePlatform/CardInfo.php +++ b/src/Adyen/Model/BalancePlatform/CardInfo.php @@ -50,7 +50,8 @@ class CardInfo implements ModelInterface, ArrayAccess, \JsonSerializable 'cardholderName' => 'string', 'configuration' => '\Adyen\Model\BalancePlatform\CardConfiguration', 'deliveryContact' => '\Adyen\Model\BalancePlatform\DeliveryContact', - 'formFactor' => 'string' + 'formFactor' => 'string', + 'threeDSecure' => 'string' ]; /** @@ -67,7 +68,8 @@ class CardInfo implements ModelInterface, ArrayAccess, \JsonSerializable 'cardholderName' => null, 'configuration' => null, 'deliveryContact' => null, - 'formFactor' => null + 'formFactor' => null, + 'threeDSecure' => null ]; /** @@ -82,7 +84,8 @@ class CardInfo implements ModelInterface, ArrayAccess, \JsonSerializable 'cardholderName' => false, 'configuration' => false, 'deliveryContact' => false, - 'formFactor' => false + 'formFactor' => false, + 'threeDSecure' => false ]; /** @@ -177,7 +180,8 @@ public function isNullableSetToNull(string $property): bool 'cardholderName' => 'cardholderName', 'configuration' => 'configuration', 'deliveryContact' => 'deliveryContact', - 'formFactor' => 'formFactor' + 'formFactor' => 'formFactor', + 'threeDSecure' => 'threeDSecure' ]; /** @@ -192,7 +196,8 @@ public function isNullableSetToNull(string $property): bool 'cardholderName' => 'setCardholderName', 'configuration' => 'setConfiguration', 'deliveryContact' => 'setDeliveryContact', - 'formFactor' => 'setFormFactor' + 'formFactor' => 'setFormFactor', + 'threeDSecure' => 'setThreeDSecure' ]; /** @@ -207,7 +212,8 @@ public function isNullableSetToNull(string $property): bool 'cardholderName' => 'getCardholderName', 'configuration' => 'getConfiguration', 'deliveryContact' => 'getDeliveryContact', - 'formFactor' => 'getFormFactor' + 'formFactor' => 'getFormFactor', + 'threeDSecure' => 'getThreeDSecure' ]; /** @@ -290,6 +296,7 @@ public function __construct(array $data = null) $this->setIfExists('configuration', $data ?? [], null); $this->setIfExists('deliveryContact', $data ?? [], null); $this->setIfExists('formFactor', $data ?? [], null); + $this->setIfExists('threeDSecure', $data ?? [], null); } /** @@ -422,7 +429,7 @@ public function getBrandVariant() /** * Sets brandVariant * - * @param string $brandVariant The brand variant of the physical or the virtual card. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**. + * @param string $brandVariant The brand variant of the physical or the virtual card. For example, **visadebit** or **mcprepaid**. >Reach out to your Adyen contact to get the values relevant for your integration. * * @return self */ @@ -553,6 +560,33 @@ public function setFormFactor($formFactor) return $this; } + + /** + * Gets threeDSecure + * + * @return string|null + */ + public function getThreeDSecure() + { + return $this->container['threeDSecure']; + } + + /** + * Sets threeDSecure + * + * @param string|null $threeDSecure Allocates a specific product range for either a physical or a virtual card. Possible values: **fullySupported**, **secureCorporate**. >Reach out to your Adyen contact to get the values relevant for your integration. + * + * @return self + */ + public function setThreeDSecure($threeDSecure) + { + if (is_null($threeDSecure)) { + throw new \InvalidArgumentException('non-nullable threeDSecure cannot be null'); + } + $this->container['threeDSecure'] = $threeDSecure; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php b/src/Adyen/Model/BalancePlatform/DKLocalAccountIdentification.php similarity index 77% rename from src/Adyen/Model/BalancePlatform/CronSweepSchedule.php rename to src/Adyen/Model/BalancePlatform/DKLocalAccountIdentification.php index c8d27666b..26337eff2 100644 --- a/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php +++ b/src/Adyen/Model/BalancePlatform/DKLocalAccountIdentification.php @@ -19,7 +19,7 @@ use Adyen\Model\BalancePlatform\ObjectSerializer; /** - * CronSweepSchedule Class Doc Comment + * DKLocalAccountIdentification Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class CronSweepSchedule implements ModelInterface, ArrayAccess, \JsonSerializable +class DKLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class CronSweepSchedule implements ModelInterface, ArrayAccess, \JsonSerializabl * * @var string */ - protected static $openAPIModelName = 'CronSweepSchedule'; + protected static $openAPIModelName = 'DKLocalAccountIdentification'; /** * Array of property to type mappings. Used for (de)serialization @@ -44,7 +44,8 @@ class CronSweepSchedule implements ModelInterface, ArrayAccess, \JsonSerializabl * @var string[] */ protected static $openAPITypes = [ - 'cronExpression' => 'string', + 'accountNumber' => 'string', + 'bankCode' => 'string', 'type' => 'string' ]; @@ -56,7 +57,8 @@ class CronSweepSchedule implements ModelInterface, ArrayAccess, \JsonSerializabl * @psalm-var array */ protected static $openAPIFormats = [ - 'cronExpression' => null, + 'accountNumber' => null, + 'bankCode' => null, 'type' => null ]; @@ -66,7 +68,8 @@ class CronSweepSchedule implements ModelInterface, ArrayAccess, \JsonSerializabl * @var boolean[] */ protected static $openAPINullables = [ - 'cronExpression' => false, + 'accountNumber' => false, + 'bankCode' => false, 'type' => false ]; @@ -156,7 +159,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'cronExpression' => 'cronExpression', + 'accountNumber' => 'accountNumber', + 'bankCode' => 'bankCode', 'type' => 'type' ]; @@ -166,7 +170,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'cronExpression' => 'setCronExpression', + 'accountNumber' => 'setAccountNumber', + 'bankCode' => 'setBankCode', 'type' => 'setType' ]; @@ -176,7 +181,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'cronExpression' => 'getCronExpression', + 'accountNumber' => 'getAccountNumber', + 'bankCode' => 'getBankCode', 'type' => 'getType' ]; @@ -221,11 +227,7 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_DAILY = 'daily'; - public const TYPE_WEEKLY = 'weekly'; - public const TYPE_MONTHLY = 'monthly'; - public const TYPE_BALANCE = 'balance'; - public const TYPE_CRON = 'cron'; + public const TYPE_DK_LOCAL = 'dkLocal'; /** * Gets allowable values of the enum @@ -235,11 +237,7 @@ public function getModelName() public function getTypeAllowableValues() { return [ - self::TYPE_DAILY, - self::TYPE_WEEKLY, - self::TYPE_MONTHLY, - self::TYPE_BALANCE, - self::TYPE_CRON, + self::TYPE_DK_LOCAL, ]; } /** @@ -257,8 +255,9 @@ public function getTypeAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('cronExpression', $data ?? [], null); - $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('bankCode', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'dkLocal'); } /** @@ -288,8 +287,14 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['cronExpression'] === null) { - $invalidProperties[] = "'cronExpression' can't be null"; + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['bankCode'] === null) { + $invalidProperties[] = "'bankCode' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; } $allowedValues = $this->getTypeAllowableValues(); if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { @@ -316,28 +321,55 @@ public function valid() /** - * Gets cronExpression + * Gets accountNumber * * @return string */ - public function getCronExpression() + public function getAccountNumber() { - return $this->container['cronExpression']; + return $this->container['accountNumber']; } /** - * Sets cronExpression + * Sets accountNumber * - * @param string $cronExpression A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: *****, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples. + * @param string $accountNumber The 4-10 digits bank account number (Kontonummer) (without separators or whitespace). * * @return self */ - public function setCronExpression($cronExpression) + public function setAccountNumber($accountNumber) { - if (is_null($cronExpression)) { - throw new \InvalidArgumentException('non-nullable cronExpression cannot be null'); + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); } - $this->container['cronExpression'] = $cronExpression; + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets bankCode + * + * @return string + */ + public function getBankCode() + { + return $this->container['bankCode']; + } + + /** + * Sets bankCode + * + * @param string $bankCode The 4-digit bank code (Registreringsnummer) (without separators or whitespace). + * + * @return self + */ + public function setBankCode($bankCode) + { + if (is_null($bankCode)) { + throw new \InvalidArgumentException('non-nullable bankCode cannot be null'); + } + $this->container['bankCode'] = $bankCode; return $this; } @@ -345,7 +377,7 @@ public function setCronExpression($cronExpression) /** * Gets type * - * @return string|null + * @return string */ public function getType() { @@ -355,7 +387,7 @@ public function getType() /** * Sets type * - * @param string|null $type The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. + * @param string $type **dkLocal** * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/DeviceInfo.php b/src/Adyen/Model/BalancePlatform/DeviceInfo.php new file mode 100644 index 000000000..83dab0c3a --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/DeviceInfo.php @@ -0,0 +1,724 @@ + + */ +class DeviceInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DeviceInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cardCaptureTechnology' => 'string', + 'deviceName' => 'string', + 'formFactor' => 'string', + 'imei' => 'string', + 'isoDeviceType' => 'string', + 'msisdn' => 'string', + 'osName' => 'string', + 'osVersion' => 'string', + 'paymentTypes' => 'string[]', + 'serialNumber' => 'string', + 'storageTechnology' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cardCaptureTechnology' => null, + 'deviceName' => null, + 'formFactor' => null, + 'imei' => null, + 'isoDeviceType' => null, + 'msisdn' => null, + 'osName' => null, + 'osVersion' => null, + 'paymentTypes' => null, + 'serialNumber' => null, + 'storageTechnology' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'cardCaptureTechnology' => false, + 'deviceName' => false, + 'formFactor' => false, + 'imei' => false, + 'isoDeviceType' => false, + 'msisdn' => false, + 'osName' => false, + 'osVersion' => false, + 'paymentTypes' => false, + 'serialNumber' => false, + 'storageTechnology' => 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 = [ + 'cardCaptureTechnology' => 'cardCaptureTechnology', + 'deviceName' => 'deviceName', + 'formFactor' => 'formFactor', + 'imei' => 'imei', + 'isoDeviceType' => 'isoDeviceType', + 'msisdn' => 'msisdn', + 'osName' => 'osName', + 'osVersion' => 'osVersion', + 'paymentTypes' => 'paymentTypes', + 'serialNumber' => 'serialNumber', + 'storageTechnology' => 'storageTechnology' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cardCaptureTechnology' => 'setCardCaptureTechnology', + 'deviceName' => 'setDeviceName', + 'formFactor' => 'setFormFactor', + 'imei' => 'setImei', + 'isoDeviceType' => 'setIsoDeviceType', + 'msisdn' => 'setMsisdn', + 'osName' => 'setOsName', + 'osVersion' => 'setOsVersion', + 'paymentTypes' => 'setPaymentTypes', + 'serialNumber' => 'setSerialNumber', + 'storageTechnology' => 'setStorageTechnology' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cardCaptureTechnology' => 'getCardCaptureTechnology', + 'deviceName' => 'getDeviceName', + 'formFactor' => 'getFormFactor', + 'imei' => 'getImei', + 'isoDeviceType' => 'getIsoDeviceType', + 'msisdn' => 'getMsisdn', + 'osName' => 'getOsName', + 'osVersion' => 'getOsVersion', + 'paymentTypes' => 'getPaymentTypes', + 'serialNumber' => 'getSerialNumber', + 'storageTechnology' => 'getStorageTechnology' + ]; + + /** + * 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('cardCaptureTechnology', $data ?? [], null); + $this->setIfExists('deviceName', $data ?? [], null); + $this->setIfExists('formFactor', $data ?? [], null); + $this->setIfExists('imei', $data ?? [], null); + $this->setIfExists('isoDeviceType', $data ?? [], null); + $this->setIfExists('msisdn', $data ?? [], null); + $this->setIfExists('osName', $data ?? [], null); + $this->setIfExists('osVersion', $data ?? [], null); + $this->setIfExists('paymentTypes', $data ?? [], null); + $this->setIfExists('serialNumber', $data ?? [], null); + $this->setIfExists('storageTechnology', $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 cardCaptureTechnology + * + * @return string|null + */ + public function getCardCaptureTechnology() + { + return $this->container['cardCaptureTechnology']; + } + + /** + * Sets cardCaptureTechnology + * + * @param string|null $cardCaptureTechnology The technology used to capture the card details. + * + * @return self + */ + public function setCardCaptureTechnology($cardCaptureTechnology) + { + if (is_null($cardCaptureTechnology)) { + throw new \InvalidArgumentException('non-nullable cardCaptureTechnology cannot be null'); + } + $this->container['cardCaptureTechnology'] = $cardCaptureTechnology; + + return $this; + } + + /** + * Gets deviceName + * + * @return string|null + */ + public function getDeviceName() + { + return $this->container['deviceName']; + } + + /** + * Sets deviceName + * + * @param string|null $deviceName The name of the device. + * + * @return self + */ + public function setDeviceName($deviceName) + { + if (is_null($deviceName)) { + throw new \InvalidArgumentException('non-nullable deviceName cannot be null'); + } + $this->container['deviceName'] = $deviceName; + + return $this; + } + + /** + * Gets formFactor + * + * @return string|null + */ + public function getFormFactor() + { + return $this->container['formFactor']; + } + + /** + * Sets formFactor + * + * @param string|null $formFactor The form factor of the device to be provisioned. + * + * @return self + */ + public function setFormFactor($formFactor) + { + if (is_null($formFactor)) { + throw new \InvalidArgumentException('non-nullable formFactor cannot be null'); + } + $this->container['formFactor'] = $formFactor; + + return $this; + } + + /** + * Gets imei + * + * @return string|null + */ + public function getImei() + { + return $this->container['imei']; + } + + /** + * Sets imei + * + * @param string|null $imei The IMEI number of the device being provisioned. + * + * @return self + */ + public function setImei($imei) + { + if (is_null($imei)) { + throw new \InvalidArgumentException('non-nullable imei cannot be null'); + } + $this->container['imei'] = $imei; + + return $this; + } + + /** + * Gets isoDeviceType + * + * @return string|null + */ + public function getIsoDeviceType() + { + return $this->container['isoDeviceType']; + } + + /** + * Sets isoDeviceType + * + * @param string|null $isoDeviceType The 2-digit device type provided on the ISO messages that the token is being provisioned to. + * + * @return self + */ + public function setIsoDeviceType($isoDeviceType) + { + if (is_null($isoDeviceType)) { + throw new \InvalidArgumentException('non-nullable isoDeviceType cannot be null'); + } + $this->container['isoDeviceType'] = $isoDeviceType; + + return $this; + } + + /** + * Gets msisdn + * + * @return string|null + */ + public function getMsisdn() + { + return $this->container['msisdn']; + } + + /** + * Sets msisdn + * + * @param string|null $msisdn The MSISDN of the device being provisioned. + * + * @return self + */ + public function setMsisdn($msisdn) + { + if (is_null($msisdn)) { + throw new \InvalidArgumentException('non-nullable msisdn cannot be null'); + } + $this->container['msisdn'] = $msisdn; + + return $this; + } + + /** + * Gets osName + * + * @return string|null + */ + public function getOsName() + { + return $this->container['osName']; + } + + /** + * Sets osName + * + * @param string|null $osName The name of the device operating system. + * + * @return self + */ + public function setOsName($osName) + { + if (is_null($osName)) { + throw new \InvalidArgumentException('non-nullable osName cannot be null'); + } + $this->container['osName'] = $osName; + + return $this; + } + + /** + * Gets osVersion + * + * @return string|null + */ + public function getOsVersion() + { + return $this->container['osVersion']; + } + + /** + * Sets osVersion + * + * @param string|null $osVersion The version of the device operating system. + * + * @return self + */ + public function setOsVersion($osVersion) + { + if (is_null($osVersion)) { + throw new \InvalidArgumentException('non-nullable osVersion cannot be null'); + } + $this->container['osVersion'] = $osVersion; + + return $this; + } + + /** + * Gets paymentTypes + * + * @return string[]|null + */ + public function getPaymentTypes() + { + return $this->container['paymentTypes']; + } + + /** + * Sets paymentTypes + * + * @param string[]|null $paymentTypes Different types of payments supported for the network token. + * + * @return self + */ + public function setPaymentTypes($paymentTypes) + { + if (is_null($paymentTypes)) { + throw new \InvalidArgumentException('non-nullable paymentTypes cannot be null'); + } + $this->container['paymentTypes'] = $paymentTypes; + + return $this; + } + + /** + * Gets serialNumber + * + * @return string|null + */ + public function getSerialNumber() + { + return $this->container['serialNumber']; + } + + /** + * Sets serialNumber + * + * @param string|null $serialNumber The serial number of the device. + * + * @return self + */ + public function setSerialNumber($serialNumber) + { + if (is_null($serialNumber)) { + throw new \InvalidArgumentException('non-nullable serialNumber cannot be null'); + } + $this->container['serialNumber'] = $serialNumber; + + return $this; + } + + /** + * Gets storageTechnology + * + * @return string|null + */ + public function getStorageTechnology() + { + return $this->container['storageTechnology']; + } + + /** + * Sets storageTechnology + * + * @param string|null $storageTechnology The architecture or technology used for network token storage. + * + * @return self + */ + public function setStorageTechnology($storageTechnology) + { + if (is_null($storageTechnology)) { + throw new \InvalidArgumentException('non-nullable storageTechnology cannot be null'); + } + $this->container['storageTechnology'] = $storageTechnology; + + 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); + } + + /** + * 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/GetNetworkTokenResponse.php b/src/Adyen/Model/BalancePlatform/GetNetworkTokenResponse.php new file mode 100644 index 000000000..77f552a91 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/GetNetworkTokenResponse.php @@ -0,0 +1,387 @@ + + */ +class GetNetworkTokenResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetNetworkTokenResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'token' => '\Adyen\Model\BalancePlatform\NetworkToken' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'token' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'token' => 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 = [ + 'token' => 'token' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'token' => 'setToken' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'token' => 'getToken' + ]; + + /** + * 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('token', $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['token'] === null) { + $invalidProperties[] = "'token' 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 token + * + * @return \Adyen\Model\BalancePlatform\NetworkToken + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * + * @param \Adyen\Model\BalancePlatform\NetworkToken $token token + * + * @return self + */ + public function setToken($token) + { + if (is_null($token)) { + throw new \InvalidArgumentException('non-nullable token cannot be null'); + } + $this->container['token'] = $token; + + 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); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/HKLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/HKLocalAccountIdentification.php new file mode 100644 index 000000000..b36fadcbe --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/HKLocalAccountIdentification.php @@ -0,0 +1,492 @@ + + */ +class HKLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'HKLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'bankCode' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'bankCode' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'bankCode' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'accountNumber' => 'accountNumber', + 'bankCode' => 'bankCode', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'bankCode' => 'setBankCode', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'bankCode' => 'getBankCode', + '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_HK_LOCAL = 'hkLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_HK_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('bankCode', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'hkLocal'); + } + + /** + * 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['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['bankCode'] === null) { + $invalidProperties[] = "'bankCode' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The 6- to 19-character bank account number (alphanumeric), without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets bankCode + * + * @return string + */ + public function getBankCode() + { + return $this->container['bankCode']; + } + + /** + * Sets bankCode + * + * @param string $bankCode The 6-digit bank code including the 3-digit bank code and 3-digit branch code, without separators or whitespace. + * + * @return self + */ + public function setBankCode($bankCode) + { + if (is_null($bankCode)) { + throw new \InvalidArgumentException('non-nullable bankCode cannot be null'); + } + $this->container['bankCode'] = $bankCode; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **hkLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * 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/ListNetworkTokensResponse.php b/src/Adyen/Model/BalancePlatform/ListNetworkTokensResponse.php new file mode 100644 index 000000000..58c7af8de --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ListNetworkTokensResponse.php @@ -0,0 +1,384 @@ + + */ +class ListNetworkTokensResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListNetworkTokensResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'networkTokens' => '\Adyen\Model\BalancePlatform\NetworkToken[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'networkTokens' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'networkTokens' => 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 = [ + 'networkTokens' => 'networkTokens' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'networkTokens' => 'setNetworkTokens' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'networkTokens' => 'getNetworkTokens' + ]; + + /** + * 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('networkTokens', $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 networkTokens + * + * @return \Adyen\Model\BalancePlatform\NetworkToken[]|null + */ + public function getNetworkTokens() + { + return $this->container['networkTokens']; + } + + /** + * Sets networkTokens + * + * @param \Adyen\Model\BalancePlatform\NetworkToken[]|null $networkTokens List of network tokens. + * + * @return self + */ + public function setNetworkTokens($networkTokens) + { + if (is_null($networkTokens)) { + throw new \InvalidArgumentException('non-nullable networkTokens cannot be null'); + } + $this->container['networkTokens'] = $networkTokens; + + 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); + } + + /** + * 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/NZLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/NZLocalAccountIdentification.php new file mode 100644 index 000000000..0df909d2b --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/NZLocalAccountIdentification.php @@ -0,0 +1,529 @@ + + */ +class NZLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NZLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'accountSuffix' => 'string', + 'bankCode' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'accountSuffix' => null, + 'bankCode' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'accountSuffix' => false, + 'bankCode' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'accountNumber' => 'accountNumber', + 'accountSuffix' => 'accountSuffix', + 'bankCode' => 'bankCode', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'accountSuffix' => 'setAccountSuffix', + 'bankCode' => 'setBankCode', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'accountSuffix' => 'getAccountSuffix', + 'bankCode' => 'getBankCode', + '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_NZ_LOCAL = 'nzLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_NZ_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('accountSuffix', $data ?? [], null); + $this->setIfExists('bankCode', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'nzLocal'); + } + + /** + * 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['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['accountSuffix'] === null) { + $invalidProperties[] = "'accountSuffix' can't be null"; + } + if ($this->container['bankCode'] === null) { + $invalidProperties[] = "'bankCode' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The 7-digit bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets accountSuffix + * + * @return string + */ + public function getAccountSuffix() + { + return $this->container['accountSuffix']; + } + + /** + * Sets accountSuffix + * + * @param string $accountSuffix The 2- to 3-digit account suffix, without separators or whitespace. + * + * @return self + */ + public function setAccountSuffix($accountSuffix) + { + if (is_null($accountSuffix)) { + throw new \InvalidArgumentException('non-nullable accountSuffix cannot be null'); + } + $this->container['accountSuffix'] = $accountSuffix; + + return $this; + } + + /** + * Gets bankCode + * + * @return string + */ + public function getBankCode() + { + return $this->container['bankCode']; + } + + /** + * Sets bankCode + * + * @param string $bankCode The 6-digit bank code including the 2-digit bank code and 4-digit branch code, without separators or whitespace. + * + * @return self + */ + public function setBankCode($bankCode) + { + if (is_null($bankCode)) { + throw new \InvalidArgumentException('non-nullable bankCode cannot be null'); + } + $this->container['bankCode'] = $bankCode; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **nzLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * 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/NetworkToken.php b/src/Adyen/Model/BalancePlatform/NetworkToken.php new file mode 100644 index 000000000..d5d4a0ee1 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/NetworkToken.php @@ -0,0 +1,659 @@ + + */ +class NetworkToken implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NetworkToken'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'brandVariant' => 'string', + 'creationDate' => '\DateTime', + 'device' => '\Adyen\Model\BalancePlatform\DeviceInfo', + 'id' => 'string', + 'paymentInstrumentId' => 'string', + 'status' => 'string', + 'tokenLastFour' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'brandVariant' => null, + 'creationDate' => 'date-time', + 'device' => null, + 'id' => null, + 'paymentInstrumentId' => null, + 'status' => null, + 'tokenLastFour' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'brandVariant' => false, + 'creationDate' => false, + 'device' => false, + 'id' => false, + 'paymentInstrumentId' => false, + 'status' => false, + 'tokenLastFour' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'brandVariant' => 'brandVariant', + 'creationDate' => 'creationDate', + 'device' => 'device', + 'id' => 'id', + 'paymentInstrumentId' => 'paymentInstrumentId', + 'status' => 'status', + 'tokenLastFour' => 'tokenLastFour', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'brandVariant' => 'setBrandVariant', + 'creationDate' => 'setCreationDate', + 'device' => 'setDevice', + 'id' => 'setId', + 'paymentInstrumentId' => 'setPaymentInstrumentId', + 'status' => 'setStatus', + 'tokenLastFour' => 'setTokenLastFour', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'brandVariant' => 'getBrandVariant', + 'creationDate' => 'getCreationDate', + 'device' => 'getDevice', + 'id' => 'getId', + 'paymentInstrumentId' => 'getPaymentInstrumentId', + 'status' => 'getStatus', + 'tokenLastFour' => 'getTokenLastFour', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_INACTIVE = 'inactive'; + public const STATUS_SUSPENDED = 'suspended'; + public const STATUS_CLOSED = 'closed'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, + self::STATUS_SUSPENDED, + self::STATUS_CLOSED, + ]; + } + /** + * 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('brandVariant', $data ?? [], null); + $this->setIfExists('creationDate', $data ?? [], null); + $this->setIfExists('device', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('paymentInstrumentId', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('tokenLastFour', $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->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + 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 brandVariant + * + * @return string|null + */ + public function getBrandVariant() + { + return $this->container['brandVariant']; + } + + /** + * Sets brandVariant + * + * @param string|null $brandVariant The card brand variant of the payment instrument associated with the network token. For example, **mc_prepaid_mrw**. + * + * @return self + */ + public function setBrandVariant($brandVariant) + { + if (is_null($brandVariant)) { + throw new \InvalidArgumentException('non-nullable brandVariant cannot be null'); + } + $this->container['brandVariant'] = $brandVariant; + + return $this; + } + + /** + * Gets creationDate + * + * @return \DateTime|null + */ + public function getCreationDate() + { + return $this->container['creationDate']; + } + + /** + * Sets creationDate + * + * @param \DateTime|null $creationDate Date and time when the network token was created, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) extended format. For example, **2020-12-18T10:15:30+01:00**.. + * + * @return self + */ + public function setCreationDate($creationDate) + { + if (is_null($creationDate)) { + throw new \InvalidArgumentException('non-nullable creationDate cannot be null'); + } + $this->container['creationDate'] = $creationDate; + + return $this; + } + + /** + * Gets device + * + * @return \Adyen\Model\BalancePlatform\DeviceInfo|null + */ + public function getDevice() + { + return $this->container['device']; + } + + /** + * Sets device + * + * @param \Adyen\Model\BalancePlatform\DeviceInfo|null $device device + * + * @return self + */ + public function setDevice($device) + { + if (is_null($device)) { + throw new \InvalidArgumentException('non-nullable device cannot be null'); + } + $this->container['device'] = $device; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the network token. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets paymentInstrumentId + * + * @return string|null + */ + public function getPaymentInstrumentId() + { + return $this->container['paymentInstrumentId']; + } + + /** + * Sets paymentInstrumentId + * + * @param string|null $paymentInstrumentId The unique identifier of the payment instrument to which this network token belongs to. + * + * @return self + */ + public function setPaymentInstrumentId($paymentInstrumentId) + { + if (is_null($paymentInstrumentId)) { + throw new \InvalidArgumentException('non-nullable paymentInstrumentId cannot be null'); + } + $this->container['paymentInstrumentId'] = $paymentInstrumentId; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the network token. Possible values: **active**, **inactive**, **suspended**, **closed**. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets tokenLastFour + * + * @return string|null + */ + public function getTokenLastFour() + { + return $this->container['tokenLastFour']; + } + + /** + * Sets tokenLastFour + * + * @param string|null $tokenLastFour The last four digits of the network token `id`. + * + * @return self + */ + public function setTokenLastFour($tokenLastFour) + { + if (is_null($tokenLastFour)) { + throw new \InvalidArgumentException('non-nullable tokenLastFour cannot be null'); + } + $this->container['tokenLastFour'] = $tokenLastFour; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of wallet the network token is associated with. For example, **applePay**. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * 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/SweepConfigurationV2Schedule.php b/src/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.php similarity index 72% rename from src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php rename to src/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.php index da70889aa..d5f3759b0 100644 --- a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php +++ b/src/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.php @@ -19,16 +19,15 @@ use Adyen\Model\BalancePlatform\ObjectSerializer; /** - * SweepConfigurationV2Schedule Class Doc Comment + * PlatformPaymentConfiguration Class Doc Comment * * @category Class - * @description The schedule when the `triggerAmount` is evaluated. If the balance meets the threshold, funds are pushed out of or pulled in to the balance account. * @package Adyen * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class SweepConfigurationV2Schedule implements ModelInterface, ArrayAccess, \JsonSerializable +class PlatformPaymentConfiguration implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -37,7 +36,7 @@ class SweepConfigurationV2Schedule implements ModelInterface, ArrayAccess, \Json * * @var string */ - protected static $openAPIModelName = 'SweepConfigurationV2_schedule'; + protected static $openAPIModelName = 'PlatformPaymentConfiguration'; /** * Array of property to type mappings. Used for (de)serialization @@ -45,8 +44,8 @@ class SweepConfigurationV2Schedule implements ModelInterface, ArrayAccess, \Json * @var string[] */ protected static $openAPITypes = [ - 'cronExpression' => 'string', - 'type' => 'string' + 'salesDayClosingTime' => 'string', + 'settlementDelayDays' => 'int' ]; /** @@ -57,8 +56,8 @@ class SweepConfigurationV2Schedule implements ModelInterface, ArrayAccess, \Json * @psalm-var array */ protected static $openAPIFormats = [ - 'cronExpression' => null, - 'type' => null + 'salesDayClosingTime' => 'time', + 'settlementDelayDays' => 'int32' ]; /** @@ -67,8 +66,8 @@ class SweepConfigurationV2Schedule implements ModelInterface, ArrayAccess, \Json * @var boolean[] */ protected static $openAPINullables = [ - 'cronExpression' => false, - 'type' => false + 'salesDayClosingTime' => false, + 'settlementDelayDays' => true ]; /** @@ -157,8 +156,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'cronExpression' => 'cronExpression', - 'type' => 'type' + 'salesDayClosingTime' => 'salesDayClosingTime', + 'settlementDelayDays' => 'settlementDelayDays' ]; /** @@ -167,8 +166,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'cronExpression' => 'setCronExpression', - 'type' => 'setType' + 'salesDayClosingTime' => 'setSalesDayClosingTime', + 'settlementDelayDays' => 'setSettlementDelayDays' ]; /** @@ -177,8 +176,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'cronExpression' => 'getCronExpression', - 'type' => 'getType' + 'salesDayClosingTime' => 'getSalesDayClosingTime', + 'settlementDelayDays' => 'getSettlementDelayDays' ]; /** @@ -222,6 +221,7 @@ public function getModelName() return self::$openAPIModelName; } + /** * Associative array for storing property values * @@ -237,8 +237,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('cronExpression', $data ?? [], null); - $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('salesDayClosingTime', $data ?? [], null); + $this->setIfExists('settlementDelayDays', $data ?? [], null); } /** @@ -268,10 +268,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['cronExpression'] === null) { - $invalidProperties[] = "'cronExpression' can't be null"; - } - return $invalidProperties; } @@ -288,55 +284,53 @@ public function valid() /** - * Gets cronExpression + * Gets salesDayClosingTime * - * @return string + * @return string|null */ - public function getCronExpression() + public function getSalesDayClosingTime() { - return $this->container['cronExpression']; + return $this->container['salesDayClosingTime']; } /** - * Sets cronExpression + * Sets salesDayClosingTime * - * @param string $cronExpression A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: *****, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples. + * @param string|null $salesDayClosingTime Specifies at what time a [sales day](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement#sales-day) ends. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. * * @return self */ - public function setCronExpression($cronExpression) + public function setSalesDayClosingTime($salesDayClosingTime) { - if (is_null($cronExpression)) { - throw new \InvalidArgumentException('non-nullable cronExpression cannot be null'); + if (is_null($salesDayClosingTime)) { + throw new \InvalidArgumentException('non-nullable salesDayClosingTime cannot be null'); } - $this->container['cronExpression'] = $cronExpression; + $this->container['salesDayClosingTime'] = $salesDayClosingTime; return $this; } /** - * Gets type + * Gets settlementDelayDays * - * @return string|null + * @return int|null */ - public function getType() + public function getSettlementDelayDays() { - return $this->container['type']; + return $this->container['settlementDelayDays']; } /** - * Sets type + * Sets settlementDelayDays * - * @param string|null $type The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. + * @param int|null $settlementDelayDays Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement#settlement-batch) are made available. Possible values: **0** to **10**, or **null**. * Setting this value to an integer enables [Sales day settlement](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement). * Setting this value to **null** enables [Pass-through settlement](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/pass-through-settlement). Default value: **null**. * * @return self */ - public function setType($type) + public function setSettlementDelayDays($settlementDelayDays) { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $this->container['type'] = $type; + // Do nothing for nullable integers + $this->container['settlementDelayDays'] = $settlementDelayDays; return $this; } diff --git a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php index a2fc7040b..78b0ea9f3 100644 --- a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php +++ b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php @@ -51,7 +51,7 @@ class SweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSerializ 'id' => 'string', 'priorities' => 'string[]', 'reason' => 'string', - 'schedule' => '\Adyen\Model\BalancePlatform\SweepConfigurationV2Schedule', + 'schedule' => '\Adyen\Model\BalancePlatform\SweepSchedule', 'status' => 'string', 'sweepAmount' => '\Adyen\Model\BalancePlatform\Amount', 'targetAmount' => '\Adyen\Model\BalancePlatform\Amount', @@ -733,7 +733,7 @@ public function setReason($reason) /** * Gets schedule * - * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2Schedule + * @return \Adyen\Model\BalancePlatform\SweepSchedule */ public function getSchedule() { @@ -743,7 +743,7 @@ public function getSchedule() /** * Sets schedule * - * @param \Adyen\Model\BalancePlatform\SweepConfigurationV2Schedule $schedule schedule + * @param \Adyen\Model\BalancePlatform\SweepSchedule $schedule schedule * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/SweepSchedule.php b/src/Adyen/Model/BalancePlatform/SweepSchedule.php index db9908ba1..bf132e224 100644 --- a/src/Adyen/Model/BalancePlatform/SweepSchedule.php +++ b/src/Adyen/Model/BalancePlatform/SweepSchedule.php @@ -44,6 +44,7 @@ class SweepSchedule implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'cronExpression' => 'string', 'type' => 'string' ]; @@ -55,6 +56,7 @@ class SweepSchedule implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'cronExpression' => null, 'type' => null ]; @@ -64,6 +66,7 @@ class SweepSchedule implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ + 'cronExpression' => false, 'type' => false ]; @@ -153,6 +156,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'cronExpression' => 'cronExpression', 'type' => 'type' ]; @@ -162,6 +166,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'cronExpression' => 'setCronExpression', 'type' => 'setType' ]; @@ -171,6 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'cronExpression' => 'getCronExpression', 'type' => 'getType' ]; @@ -251,6 +257,7 @@ public function getTypeAllowableValues() */ public function __construct(array $data = null) { + $this->setIfExists('cronExpression', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -281,6 +288,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } $allowedValues = $this->getTypeAllowableValues(); if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -306,10 +316,37 @@ public function valid() /** - * Gets type + * Gets cronExpression * * @return string|null */ + public function getCronExpression() + { + return $this->container['cronExpression']; + } + + /** + * Sets cronExpression + * + * @param string|null $cronExpression A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: *****, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples. Required when `type` is **cron**. + * + * @return self + */ + public function setCronExpression($cronExpression) + { + if (is_null($cronExpression)) { + throw new \InvalidArgumentException('non-nullable cronExpression cannot be null'); + } + $this->container['cronExpression'] = $cronExpression; + + return $this; + } + + /** + * Gets type + * + * @return string + */ public function getType() { return $this->container['type']; @@ -318,7 +355,7 @@ public function getType() /** * Sets type * - * @param string|null $type The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. + * @param string $type The schedule type. Possible values: * **cron**: push out funds based on a `cronExpression`. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/TransactionRule.php b/src/Adyen/Model/BalancePlatform/TransactionRule.php index 291e2af69..b76ef65f4 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRule.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRule.php @@ -297,6 +297,7 @@ public function getModelName() public const OUTCOME_TYPE_SCORE_BASED = 'scoreBased'; public const REQUEST_TYPE_AUTHENTICATION = 'authentication'; public const REQUEST_TYPE_AUTHORIZATION = 'authorization'; + public const REQUEST_TYPE_BANK_TRANSFER = 'bankTransfer'; public const REQUEST_TYPE_TOKENIZATION = 'tokenization'; public const STATUS_ACTIVE = 'active'; public const STATUS_INACTIVE = 'inactive'; @@ -327,6 +328,7 @@ public function getRequestTypeAllowableValues() return [ self::REQUEST_TYPE_AUTHENTICATION, self::REQUEST_TYPE_AUTHORIZATION, + self::REQUEST_TYPE_BANK_TRANSFER, self::REQUEST_TYPE_TOKENIZATION, ]; } diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php index 4a400e57a..a687fa12d 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php @@ -291,6 +291,7 @@ public function getModelName() public const OUTCOME_TYPE_SCORE_BASED = 'scoreBased'; public const REQUEST_TYPE_AUTHENTICATION = 'authentication'; public const REQUEST_TYPE_AUTHORIZATION = 'authorization'; + public const REQUEST_TYPE_BANK_TRANSFER = 'bankTransfer'; public const REQUEST_TYPE_TOKENIZATION = 'tokenization'; public const STATUS_ACTIVE = 'active'; public const STATUS_INACTIVE = 'inactive'; @@ -321,6 +322,7 @@ public function getRequestTypeAllowableValues() return [ self::REQUEST_TYPE_AUTHENTICATION, self::REQUEST_TYPE_AUTHORIZATION, + self::REQUEST_TYPE_BANK_TRANSFER, self::REQUEST_TYPE_TOKENIZATION, ]; } diff --git a/src/Adyen/Model/BalancePlatform/UpdateNetworkTokenRequest.php b/src/Adyen/Model/BalancePlatform/UpdateNetworkTokenRequest.php new file mode 100644 index 000000000..218c6ebfa --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/UpdateNetworkTokenRequest.php @@ -0,0 +1,419 @@ + + */ +class UpdateNetworkTokenRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateNetworkTokenRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_SUSPENDED = 'suspended'; + public const STATUS_CLOSED = 'closed'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_SUSPENDED, + self::STATUS_CLOSED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + } + + /** + * 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->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The new status of the network token. Possible values: **active**, **suspended**, **closed**. The **closed** status is final and cannot be changed. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * 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); + } + + /** + * 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/UpdateSweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.php new file mode 100644 index 000000000..eaedc36f7 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.php @@ -0,0 +1,981 @@ + + */ +class UpdateSweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateSweepConfigurationV2'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'category' => 'string', + 'counterparty' => '\Adyen\Model\BalancePlatform\SweepCounterparty', + 'currency' => 'string', + 'description' => 'string', + 'id' => 'string', + 'priorities' => 'string[]', + 'reason' => 'string', + 'schedule' => '\Adyen\Model\BalancePlatform\SweepSchedule', + 'status' => 'string', + 'sweepAmount' => '\Adyen\Model\BalancePlatform\Amount', + 'targetAmount' => '\Adyen\Model\BalancePlatform\Amount', + 'triggerAmount' => '\Adyen\Model\BalancePlatform\Amount', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'category' => null, + 'counterparty' => null, + 'currency' => null, + 'description' => null, + 'id' => null, + 'priorities' => null, + 'reason' => null, + 'schedule' => null, + 'status' => null, + 'sweepAmount' => null, + 'targetAmount' => null, + 'triggerAmount' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'category' => false, + 'counterparty' => false, + 'currency' => false, + 'description' => false, + 'id' => false, + 'priorities' => false, + 'reason' => false, + 'schedule' => false, + 'status' => false, + 'sweepAmount' => false, + 'targetAmount' => false, + 'triggerAmount' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'category' => 'category', + 'counterparty' => 'counterparty', + 'currency' => 'currency', + 'description' => 'description', + 'id' => 'id', + 'priorities' => 'priorities', + 'reason' => 'reason', + 'schedule' => 'schedule', + 'status' => 'status', + 'sweepAmount' => 'sweepAmount', + 'targetAmount' => 'targetAmount', + 'triggerAmount' => 'triggerAmount', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'category' => 'setCategory', + 'counterparty' => 'setCounterparty', + 'currency' => 'setCurrency', + 'description' => 'setDescription', + 'id' => 'setId', + 'priorities' => 'setPriorities', + 'reason' => 'setReason', + 'schedule' => 'setSchedule', + 'status' => 'setStatus', + 'sweepAmount' => 'setSweepAmount', + 'targetAmount' => 'setTargetAmount', + 'triggerAmount' => 'setTriggerAmount', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'category' => 'getCategory', + 'counterparty' => 'getCounterparty', + 'currency' => 'getCurrency', + 'description' => 'getDescription', + 'id' => 'getId', + 'priorities' => 'getPriorities', + 'reason' => 'getReason', + 'schedule' => 'getSchedule', + 'status' => 'getStatus', + 'sweepAmount' => 'getSweepAmount', + 'targetAmount' => 'getTargetAmount', + 'triggerAmount' => 'getTriggerAmount', + '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 CATEGORY_BANK = 'bank'; + public const CATEGORY_INTERNAL = 'internal'; + public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; + public const PRIORITIES_CROSS_BORDER = 'crossBorder'; + public const PRIORITIES_DIRECT_DEBIT = 'directDebit'; + public const PRIORITIES_FAST = 'fast'; + public const PRIORITIES_INSTANT = 'instant'; + public const PRIORITIES_INTERNAL = 'internal'; + public const PRIORITIES_REGULAR = 'regular'; + public const PRIORITIES_WIRE = 'wire'; + public const REASON_AMOUNT_LIMIT_EXCEEDED = 'amountLimitExceeded'; + public const REASON_APPROVED = 'approved'; + public const REASON_COUNTERPARTY_ACCOUNT_BLOCKED = 'counterpartyAccountBlocked'; + public const REASON_COUNTERPARTY_ACCOUNT_CLOSED = 'counterpartyAccountClosed'; + public const REASON_COUNTERPARTY_ACCOUNT_NOT_FOUND = 'counterpartyAccountNotFound'; + public const REASON_COUNTERPARTY_ADDRESS_REQUIRED = 'counterpartyAddressRequired'; + public const REASON_COUNTERPARTY_BANK_TIMED_OUT = 'counterpartyBankTimedOut'; + public const REASON_COUNTERPARTY_BANK_UNAVAILABLE = 'counterpartyBankUnavailable'; + public const REASON_ERROR = 'error'; + public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; + public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; + public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; + public const REASON_UNKNOWN = 'unknown'; + public const STATUS_ACTIVE = 'active'; + public const STATUS_INACTIVE = 'inactive'; + public const TYPE_PULL = 'pull'; + public const TYPE_PUSH = 'push'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCategoryAllowableValues() + { + return [ + self::CATEGORY_BANK, + self::CATEGORY_INTERNAL, + self::CATEGORY_PLATFORM_PAYMENT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPrioritiesAllowableValues() + { + return [ + self::PRIORITIES_CROSS_BORDER, + self::PRIORITIES_DIRECT_DEBIT, + self::PRIORITIES_FAST, + self::PRIORITIES_INSTANT, + self::PRIORITIES_INTERNAL, + self::PRIORITIES_REGULAR, + self::PRIORITIES_WIRE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getReasonAllowableValues() + { + return [ + self::REASON_AMOUNT_LIMIT_EXCEEDED, + self::REASON_APPROVED, + self::REASON_COUNTERPARTY_ACCOUNT_BLOCKED, + self::REASON_COUNTERPARTY_ACCOUNT_CLOSED, + self::REASON_COUNTERPARTY_ACCOUNT_NOT_FOUND, + self::REASON_COUNTERPARTY_ADDRESS_REQUIRED, + self::REASON_COUNTERPARTY_BANK_TIMED_OUT, + self::REASON_COUNTERPARTY_BANK_UNAVAILABLE, + self::REASON_ERROR, + self::REASON_NOT_ENOUGH_BALANCE, + self::REASON_REFUSED_BY_COUNTERPARTY_BANK, + self::REASON_ROUTE_NOT_FOUND, + self::REASON_UNKNOWN, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_PULL, + self::TYPE_PUSH, + ]; + } + /** + * 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('category', $data ?? [], null); + $this->setIfExists('counterparty', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('priorities', $data ?? [], null); + $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('schedule', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('sweepAmount', $data ?? [], null); + $this->setIfExists('targetAmount', $data ?? [], null); + $this->setIfExists('triggerAmount', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'push'); + } + + /** + * 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->getCategoryAllowableValues(); + if (!is_null($this->container['category']) && !in_array($this->container['category'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'category', must be one of '%s'", + $this->container['category'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getReasonAllowableValues(); + if (!is_null($this->container['reason']) && !in_array($this->container['reason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'reason', must be one of '%s'", + $this->container['reason'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + $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 category + * + * @return string|null + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param string|null $category The type of transfer that results from the sweep. Possible values: - **bank**: Sweep to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. Required when setting `priorities`. + * + * @return self + */ + public function setCategory($category) + { + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); + } + $allowedValues = $this->getCategoryAllowableValues(); + if (!in_array($category, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'category', must be one of '%s'", + $category, + implode("', '", $allowedValues) + ) + ); + } + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets counterparty + * + * @return \Adyen\Model\BalancePlatform\SweepCounterparty|null + */ + public function getCounterparty() + { + return $this->container['counterparty']; + } + + /** + * Sets counterparty + * + * @param \Adyen\Model\BalancePlatform\SweepCounterparty|null $counterparty counterparty + * + * @return self + */ + public function setCounterparty($counterparty) + { + if (is_null($counterparty)) { + throw new \InvalidArgumentException('non-nullable counterparty cannot be null'); + } + $this->container['counterparty'] = $counterparty; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) in uppercase. For example, **EUR**. The sweep currency must match any of the [balances currencies](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__resParam_balances). + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The message that will be used in the sweep transfer's description body with a maximum length of 140 characters. If the message is longer after replacing placeholders, the message will be cut off at 140 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the sweep. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets priorities + * + * @return string[]|null + */ + public function getPriorities() + { + return $this->container['priorities']; + } + + /** + * Sets priorities + * + * @param string[]|null $priorities The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority listed first, and if that's not possible, it moves on to the next option in the order of provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see [optional priorities setup](https://docs.adyen.com/marketplaces-and-platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). + * + * @return self + */ + public function setPriorities($priorities) + { + if (is_null($priorities)) { + throw new \InvalidArgumentException('non-nullable priorities cannot be null'); + } + $allowedValues = $this->getPrioritiesAllowableValues(); + if (array_diff($priorities, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'priorities', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['priorities'] = $priorities; + + return $this; + } + + /** + * Gets reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason The reason for disabling the sweep. + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $allowedValues = $this->getReasonAllowableValues(); + if (!in_array($reason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'reason', must be one of '%s'", + $reason, + implode("', '", $allowedValues) + ) + ); + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets schedule + * + * @return \Adyen\Model\BalancePlatform\SweepSchedule|null + */ + public function getSchedule() + { + return $this->container['schedule']; + } + + /** + * Sets schedule + * + * @param \Adyen\Model\BalancePlatform\SweepSchedule|null $schedule schedule + * + * @return self + */ + public function setSchedule($schedule) + { + if (is_null($schedule)) { + throw new \InvalidArgumentException('non-nullable schedule cannot be null'); + } + $this->container['schedule'] = $schedule; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets sweepAmount + * + * @return \Adyen\Model\BalancePlatform\Amount|null + */ + public function getSweepAmount() + { + return $this->container['sweepAmount']; + } + + /** + * Sets sweepAmount + * + * @param \Adyen\Model\BalancePlatform\Amount|null $sweepAmount sweepAmount + * + * @return self + */ + public function setSweepAmount($sweepAmount) + { + if (is_null($sweepAmount)) { + throw new \InvalidArgumentException('non-nullable sweepAmount cannot be null'); + } + $this->container['sweepAmount'] = $sweepAmount; + + return $this; + } + + /** + * Gets targetAmount + * + * @return \Adyen\Model\BalancePlatform\Amount|null + */ + public function getTargetAmount() + { + return $this->container['targetAmount']; + } + + /** + * Sets targetAmount + * + * @param \Adyen\Model\BalancePlatform\Amount|null $targetAmount targetAmount + * + * @return self + */ + public function setTargetAmount($targetAmount) + { + if (is_null($targetAmount)) { + throw new \InvalidArgumentException('non-nullable targetAmount cannot be null'); + } + $this->container['targetAmount'] = $targetAmount; + + return $this; + } + + /** + * Gets triggerAmount + * + * @return \Adyen\Model\BalancePlatform\Amount|null + */ + public function getTriggerAmount() + { + return $this->container['triggerAmount']; + } + + /** + * Sets triggerAmount + * + * @param \Adyen\Model\BalancePlatform\Amount|null $triggerAmount triggerAmount + * + * @return self + */ + public function setTriggerAmount($triggerAmount) + { + if (is_null($triggerAmount)) { + throw new \InvalidArgumentException('non-nullable triggerAmount cannot be null'); + } + $this->container['triggerAmount'] = $triggerAmount; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * 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/VerificationDeadline.php b/src/Adyen/Model/BalancePlatform/VerificationDeadline.php index 50cb3275e..821f264fd 100644 --- a/src/Adyen/Model/BalancePlatform/VerificationDeadline.php +++ b/src/Adyen/Model/BalancePlatform/VerificationDeadline.php @@ -45,6 +45,7 @@ class VerificationDeadline implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPITypes = [ 'capabilities' => 'string[]', + 'entityIds' => 'string[]', 'expiresAt' => '\DateTime' ]; @@ -57,6 +58,7 @@ class VerificationDeadline implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPIFormats = [ 'capabilities' => null, + 'entityIds' => null, 'expiresAt' => 'date-time' ]; @@ -67,6 +69,7 @@ class VerificationDeadline implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'capabilities' => false, + 'entityIds' => false, 'expiresAt' => false ]; @@ -157,6 +160,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'capabilities' => 'capabilities', + 'entityIds' => 'entityIds', 'expiresAt' => 'expiresAt' ]; @@ -167,6 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'capabilities' => 'setCapabilities', + 'entityIds' => 'setEntityIds', 'expiresAt' => 'setExpiresAt' ]; @@ -177,6 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'capabilities' => 'getCapabilities', + 'entityIds' => 'getEntityIds', 'expiresAt' => 'getExpiresAt' ]; @@ -348,6 +354,7 @@ public function getCapabilitiesAllowableValues() public function __construct(array $data = null) { $this->setIfExists('capabilities', $data ?? [], null); + $this->setIfExists('entityIds', $data ?? [], null); $this->setIfExists('expiresAt', $data ?? [], null); } @@ -435,6 +442,33 @@ public function setCapabilities($capabilities) return $this; } + /** + * Gets entityIds + * + * @return string[]|null + */ + public function getEntityIds() + { + return $this->container['entityIds']; + } + + /** + * Sets entityIds + * + * @param string[]|null $entityIds The unique identifiers of the bank account(s) that the deadline applies to + * + * @return self + */ + public function setEntityIds($entityIds) + { + if (is_null($entityIds)) { + throw new \InvalidArgumentException('non-nullable entityIds cannot be null'); + } + $this->container['entityIds'] = $entityIds; + + return $this; + } + /** * Gets expiresAt * diff --git a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php index 45101359a..4628fc732 100644 --- a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php +++ b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php @@ -81,12 +81,12 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'shopperEmail' => 'string', 'telephoneNumber' => 'string', 'googlePayToken' => 'string', + 'subtype' => 'string', 'masterpassTransactionId' => 'string', 'orderID' => 'string', 'payeePreferred' => 'string', 'payerID' => 'string', 'payerSelected' => 'string', - 'subtype' => 'string', 'virtualPaymentAddress' => 'string', 'samsungPayToken' => 'string', 'iban' => 'string', @@ -141,12 +141,12 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'shopperEmail' => null, 'telephoneNumber' => null, 'googlePayToken' => null, + 'subtype' => null, 'masterpassTransactionId' => null, 'orderID' => null, 'payeePreferred' => null, 'payerID' => null, 'payerSelected' => null, - 'subtype' => null, 'virtualPaymentAddress' => null, 'samsungPayToken' => null, 'iban' => null, @@ -199,12 +199,12 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'shopperEmail' => false, 'telephoneNumber' => false, 'googlePayToken' => false, + 'subtype' => false, 'masterpassTransactionId' => false, 'orderID' => false, 'payeePreferred' => false, 'payerID' => false, 'payerSelected' => false, - 'subtype' => false, 'virtualPaymentAddress' => false, 'samsungPayToken' => false, 'iban' => false, @@ -337,12 +337,12 @@ public function isNullableSetToNull(string $property): bool 'shopperEmail' => 'shopperEmail', 'telephoneNumber' => 'telephoneNumber', 'googlePayToken' => 'googlePayToken', + 'subtype' => 'subtype', 'masterpassTransactionId' => 'masterpassTransactionId', 'orderID' => 'orderID', 'payeePreferred' => 'payeePreferred', 'payerID' => 'payerID', 'payerSelected' => 'payerSelected', - 'subtype' => 'subtype', 'virtualPaymentAddress' => 'virtualPaymentAddress', 'samsungPayToken' => 'samsungPayToken', 'iban' => 'iban', @@ -395,12 +395,12 @@ public function isNullableSetToNull(string $property): bool 'shopperEmail' => 'setShopperEmail', 'telephoneNumber' => 'setTelephoneNumber', 'googlePayToken' => 'setGooglePayToken', + 'subtype' => 'setSubtype', 'masterpassTransactionId' => 'setMasterpassTransactionId', 'orderID' => 'setOrderID', 'payeePreferred' => 'setPayeePreferred', 'payerID' => 'setPayerID', 'payerSelected' => 'setPayerSelected', - 'subtype' => 'setSubtype', 'virtualPaymentAddress' => 'setVirtualPaymentAddress', 'samsungPayToken' => 'setSamsungPayToken', 'iban' => 'setIban', @@ -453,12 +453,12 @@ public function isNullableSetToNull(string $property): bool 'shopperEmail' => 'getShopperEmail', 'telephoneNumber' => 'getTelephoneNumber', 'googlePayToken' => 'getGooglePayToken', + 'subtype' => 'getSubtype', 'masterpassTransactionId' => 'getMasterpassTransactionId', 'orderID' => 'getOrderID', 'payeePreferred' => 'getPayeePreferred', 'payerID' => 'getPayerID', 'payerSelected' => 'getPayerSelected', - 'subtype' => 'getSubtype', 'virtualPaymentAddress' => 'getVirtualPaymentAddress', 'samsungPayToken' => 'getSamsungPayToken', 'iban' => 'getIban', @@ -561,12 +561,12 @@ public function __construct(array $data = null) $this->setIfExists('shopperEmail', $data ?? [], null); $this->setIfExists('telephoneNumber', $data ?? [], null); $this->setIfExists('googlePayToken', $data ?? [], null); + $this->setIfExists('subtype', $data ?? [], null); $this->setIfExists('masterpassTransactionId', $data ?? [], null); $this->setIfExists('orderID', $data ?? [], null); $this->setIfExists('payeePreferred', $data ?? [], null); $this->setIfExists('payerID', $data ?? [], null); $this->setIfExists('payerSelected', $data ?? [], null); - $this->setIfExists('subtype', $data ?? [], null); $this->setIfExists('virtualPaymentAddress', $data ?? [], null); $this->setIfExists('samsungPayToken', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); @@ -636,10 +636,10 @@ public function listInvalidProperties() if ($this->container['googlePayToken'] === null) { $invalidProperties[] = "'googlePayToken' can't be null"; } + if ($this->container['masterpassTransactionId'] === null) { $invalidProperties[] = "'masterpassTransactionId' can't be null"; } - if ($this->container['samsungPayToken'] === null) { $invalidProperties[] = "'samsungPayToken' can't be null"; } @@ -1643,6 +1643,33 @@ public function setGooglePayToken($googlePayToken) return $this; } + /** + * Gets subtype + * + * @return string|null + */ + public function getSubtype() + { + return $this->container['subtype']; + } + + /** + * Sets subtype + * + * @param string|null $subtype The type of flow to initiate. + * + * @return self + */ + public function setSubtype($subtype) + { + if (is_null($subtype)) { + throw new \InvalidArgumentException('non-nullable subtype cannot be null'); + } + $this->container['subtype'] = $subtype; + + return $this; + } + /** * Gets masterpassTransactionId * @@ -1778,33 +1805,6 @@ public function setPayerSelected($payerSelected) return $this; } - /** - * Gets subtype - * - * @return string|null - */ - public function getSubtype() - { - return $this->container['subtype']; - } - - /** - * Sets subtype - * - * @param string|null $subtype The type of flow to initiate. - * - * @return self - */ - public function setSubtype($subtype) - { - if (is_null($subtype)) { - throw new \InvalidArgumentException('non-nullable subtype cannot be null'); - } - $this->container['subtype'] = $subtype; - - return $this; - } - /** * Gets virtualPaymentAddress * diff --git a/src/Adyen/Model/Checkout/KlarnaDetails.php b/src/Adyen/Model/Checkout/KlarnaDetails.php index 58b8a81be..cbb7c0f2b 100644 --- a/src/Adyen/Model/Checkout/KlarnaDetails.php +++ b/src/Adyen/Model/Checkout/KlarnaDetails.php @@ -50,6 +50,7 @@ class KlarnaDetails implements ModelInterface, ArrayAccess, \JsonSerializable 'personalDetails' => 'string', 'recurringDetailReference' => 'string', 'storedPaymentMethodId' => 'string', + 'subtype' => 'string', 'type' => 'string' ]; @@ -67,6 +68,7 @@ class KlarnaDetails implements ModelInterface, ArrayAccess, \JsonSerializable 'personalDetails' => null, 'recurringDetailReference' => null, 'storedPaymentMethodId' => null, + 'subtype' => null, 'type' => null ]; @@ -82,6 +84,7 @@ class KlarnaDetails implements ModelInterface, ArrayAccess, \JsonSerializable 'personalDetails' => false, 'recurringDetailReference' => false, 'storedPaymentMethodId' => false, + 'subtype' => false, 'type' => false ]; @@ -177,6 +180,7 @@ public function isNullableSetToNull(string $property): bool 'personalDetails' => 'personalDetails', 'recurringDetailReference' => 'recurringDetailReference', 'storedPaymentMethodId' => 'storedPaymentMethodId', + 'subtype' => 'subtype', 'type' => 'type' ]; @@ -192,6 +196,7 @@ public function isNullableSetToNull(string $property): bool 'personalDetails' => 'setPersonalDetails', 'recurringDetailReference' => 'setRecurringDetailReference', 'storedPaymentMethodId' => 'setStoredPaymentMethodId', + 'subtype' => 'setSubtype', 'type' => 'setType' ]; @@ -207,6 +212,7 @@ public function isNullableSetToNull(string $property): bool 'personalDetails' => 'getPersonalDetails', 'recurringDetailReference' => 'getRecurringDetailReference', 'storedPaymentMethodId' => 'getStoredPaymentMethodId', + 'subtype' => 'getSubtype', 'type' => 'getType' ]; @@ -251,6 +257,8 @@ public function getModelName() return self::$openAPIModelName; } + public const SUBTYPE_REDIRECT = 'redirect'; + public const SUBTYPE_SDK = 'sdk'; public const TYPE_KLARNA = 'klarna'; public const TYPE_KLARNAPAYMENTS = 'klarnapayments'; public const TYPE_KLARNAPAYMENTS_ACCOUNT = 'klarnapayments_account'; @@ -259,6 +267,18 @@ public function getModelName() public const TYPE_KLARNA_ACCOUNT = 'klarna_account'; public const TYPE_KLARNA_B2B = 'klarna_b2b'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSubtypeAllowableValues() + { + return [ + self::SUBTYPE_REDIRECT, + self::SUBTYPE_SDK, + ]; + } /** * Gets allowable values of the enum * @@ -297,6 +317,7 @@ public function __construct(array $data = null) $this->setIfExists('personalDetails', $data ?? [], null); $this->setIfExists('recurringDetailReference', $data ?? [], null); $this->setIfExists('storedPaymentMethodId', $data ?? [], null); + $this->setIfExists('subtype', $data ?? [], null); $this->setIfExists('type', $data ?? [], 'klarna'); } @@ -327,6 +348,15 @@ public function listInvalidProperties() { $invalidProperties = []; + $allowedValues = $this->getSubtypeAllowableValues(); + if (!is_null($this->container['subtype']) && !in_array($this->container['subtype'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'subtype', must be one of '%s'", + $this->container['subtype'], + implode("', '", $allowedValues) + ); + } + if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } @@ -518,6 +548,43 @@ public function setStoredPaymentMethodId($storedPaymentMethodId) return $this; } + /** + * Gets subtype + * + * @return string|null + */ + public function getSubtype() + { + return $this->container['subtype']; + } + + /** + * Sets subtype + * + * @param string|null $subtype The type of flow to initiate. + * + * @return self + */ + public function setSubtype($subtype) + { + if (is_null($subtype)) { + throw new \InvalidArgumentException('non-nullable subtype cannot be null'); + } + $allowedValues = $this->getSubtypeAllowableValues(); + if (!in_array($subtype, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'subtype', must be one of '%s'", + $subtype, + implode("', '", $allowedValues) + ) + ); + } + $this->container['subtype'] = $subtype; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/Payments/AdditionalDataCarRental.php b/src/Adyen/Model/Payments/AdditionalDataCarRental.php index 66376f9ff..d7188693b 100644 --- a/src/Adyen/Model/Payments/AdditionalDataCarRental.php +++ b/src/Adyen/Model/Payments/AdditionalDataCarRental.php @@ -497,7 +497,7 @@ public function getCarRentalDaysRented() /** * Sets carRentalDaysRented * - * @param string|null $carRentalDaysRented Number of days for which the car is being rented. * Format: Numeric * maxLength: 2 * Must not be all spaces + * @param string|null $carRentalDaysRented Number of days for which the car is being rented. * Format: Numeric * maxLength: 4 * Must not be all spaces * * @return self */ @@ -1010,7 +1010,7 @@ public function getTravelEntertainmentAuthDataDuration() /** * Sets travelEntertainmentAuthDataDuration * - * @param string|null $travelEntertainmentAuthDataDuration Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 2 + * @param string|null $travelEntertainmentAuthDataDuration Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 4 * * @return self */ diff --git a/src/Adyen/Model/Payments/AdditionalDataLevel23.php b/src/Adyen/Model/Payments/AdditionalDataLevel23.php index 545a4f30f..720404310 100644 --- a/src/Adyen/Model/Payments/AdditionalDataLevel23.php +++ b/src/Adyen/Model/Payments/AdditionalDataLevel23.php @@ -401,7 +401,7 @@ public function getEnhancedSchemeDataCustomerReference() /** * Sets enhancedSchemeDataCustomerReference * - * @param string|null $enhancedSchemeDataCustomerReference The customer code, if supplied by a customer. Encoding: ASCII Max length: 25 characters Must not start with a space or be all spaces Must not be all zeros + * @param string|null $enhancedSchemeDataCustomerReference The customer code. Encoding: ASCII Max length: 25 characters Must not start with a space or be all spaces Must not be all zeros * * @return self */ diff --git a/src/Adyen/Model/Payments/AdditionalDataLodging.php b/src/Adyen/Model/Payments/AdditionalDataLodging.php index 606f5c1af..4978768c6 100644 --- a/src/Adyen/Model/Payments/AdditionalDataLodging.php +++ b/src/Adyen/Model/Payments/AdditionalDataLodging.php @@ -664,7 +664,7 @@ public function getLodgingRoom1NumberOfNights() /** * Sets lodgingRoom1NumberOfNights * - * @param string|null $lodgingRoom1NumberOfNights The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 2 characters + * @param string|null $lodgingRoom1NumberOfNights The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 4 characters * * @return self */ @@ -772,7 +772,7 @@ public function getTravelEntertainmentAuthDataDuration() /** * Sets travelEntertainmentAuthDataDuration * - * @param string|null $travelEntertainmentAuthDataDuration The number of nights. This should be included in the auth message. * Format: numeric * Max length: 2 characters + * @param string|null $travelEntertainmentAuthDataDuration The number of nights. This should be included in the auth message. * Format: numeric * Max length: 4 characters * * @return self */ diff --git a/src/Adyen/Model/Payments/PaymentResult.php b/src/Adyen/Model/Payments/PaymentResult.php index 1a1b04555..6007582a4 100644 --- a/src/Adyen/Model/Payments/PaymentResult.php +++ b/src/Adyen/Model/Payments/PaymentResult.php @@ -282,6 +282,7 @@ public function getModelName() public const RESULT_CODE_CHALLENGE_SHOPPER = 'ChallengeShopper'; public const RESULT_CODE_ERROR = 'Error'; public const RESULT_CODE_IDENTIFY_SHOPPER = 'IdentifyShopper'; + public const RESULT_CODE_PARTIALLY_AUTHORISED = 'PartiallyAuthorised'; public const RESULT_CODE_PENDING = 'Pending'; public const RESULT_CODE_PRESENT_TO_SHOPPER = 'PresentToShopper'; public const RESULT_CODE_RECEIVED = 'Received'; @@ -304,6 +305,7 @@ public function getResultCodeAllowableValues() self::RESULT_CODE_CHALLENGE_SHOPPER, self::RESULT_CODE_ERROR, self::RESULT_CODE_IDENTIFY_SHOPPER, + self::RESULT_CODE_PARTIALLY_AUTHORISED, self::RESULT_CODE_PENDING, self::RESULT_CODE_PRESENT_TO_SHOPPER, self::RESULT_CODE_RECEIVED, @@ -674,7 +676,7 @@ public function getResultCode() /** * Sets resultCode * - * @param string|null $resultCode The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. + * @param string|null $resultCode The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * * @return self */ diff --git a/src/Adyen/Model/Payments/ThreeDS2Result.php b/src/Adyen/Model/Payments/ThreeDS2Result.php index 8ab6f586c..e96490780 100644 --- a/src/Adyen/Model/Payments/ThreeDS2Result.php +++ b/src/Adyen/Model/Payments/ThreeDS2Result.php @@ -47,12 +47,12 @@ class ThreeDS2Result implements ModelInterface, ArrayAccess, \JsonSerializable 'authenticationValue' => 'string', 'cavvAlgorithm' => 'string', 'challengeCancel' => 'string', - 'challengeIndicator' => 'string', 'dsTransID' => 'string', 'eci' => 'string', 'exemptionIndicator' => 'string', 'messageVersion' => 'string', 'riskScore' => 'string', + 'threeDSRequestorChallengeInd' => 'string', 'threeDSServerTransID' => 'string', 'timestamp' => 'string', 'transStatus' => 'string', @@ -71,12 +71,12 @@ class ThreeDS2Result implements ModelInterface, ArrayAccess, \JsonSerializable 'authenticationValue' => null, 'cavvAlgorithm' => null, 'challengeCancel' => null, - 'challengeIndicator' => null, 'dsTransID' => null, 'eci' => null, 'exemptionIndicator' => null, 'messageVersion' => null, 'riskScore' => null, + 'threeDSRequestorChallengeInd' => null, 'threeDSServerTransID' => null, 'timestamp' => null, 'transStatus' => null, @@ -93,12 +93,12 @@ class ThreeDS2Result implements ModelInterface, ArrayAccess, \JsonSerializable 'authenticationValue' => false, 'cavvAlgorithm' => false, 'challengeCancel' => false, - 'challengeIndicator' => false, 'dsTransID' => false, 'eci' => false, 'exemptionIndicator' => false, 'messageVersion' => false, 'riskScore' => false, + 'threeDSRequestorChallengeInd' => false, 'threeDSServerTransID' => false, 'timestamp' => false, 'transStatus' => false, @@ -195,12 +195,12 @@ public function isNullableSetToNull(string $property): bool 'authenticationValue' => 'authenticationValue', 'cavvAlgorithm' => 'cavvAlgorithm', 'challengeCancel' => 'challengeCancel', - 'challengeIndicator' => 'challengeIndicator', 'dsTransID' => 'dsTransID', 'eci' => 'eci', 'exemptionIndicator' => 'exemptionIndicator', 'messageVersion' => 'messageVersion', 'riskScore' => 'riskScore', + 'threeDSRequestorChallengeInd' => 'threeDSRequestorChallengeInd', 'threeDSServerTransID' => 'threeDSServerTransID', 'timestamp' => 'timestamp', 'transStatus' => 'transStatus', @@ -217,12 +217,12 @@ public function isNullableSetToNull(string $property): bool 'authenticationValue' => 'setAuthenticationValue', 'cavvAlgorithm' => 'setCavvAlgorithm', 'challengeCancel' => 'setChallengeCancel', - 'challengeIndicator' => 'setChallengeIndicator', 'dsTransID' => 'setDsTransID', 'eci' => 'setEci', 'exemptionIndicator' => 'setExemptionIndicator', 'messageVersion' => 'setMessageVersion', 'riskScore' => 'setRiskScore', + 'threeDSRequestorChallengeInd' => 'setThreeDSRequestorChallengeInd', 'threeDSServerTransID' => 'setThreeDSServerTransID', 'timestamp' => 'setTimestamp', 'transStatus' => 'setTransStatus', @@ -239,12 +239,12 @@ public function isNullableSetToNull(string $property): bool 'authenticationValue' => 'getAuthenticationValue', 'cavvAlgorithm' => 'getCavvAlgorithm', 'challengeCancel' => 'getChallengeCancel', - 'challengeIndicator' => 'getChallengeIndicator', 'dsTransID' => 'getDsTransID', 'eci' => 'getEci', 'exemptionIndicator' => 'getExemptionIndicator', 'messageVersion' => 'getMessageVersion', 'riskScore' => 'getRiskScore', + 'threeDSRequestorChallengeInd' => 'getThreeDSRequestorChallengeInd', 'threeDSServerTransID' => 'getThreeDSServerTransID', 'timestamp' => 'getTimestamp', 'transStatus' => 'getTransStatus', @@ -300,14 +300,16 @@ public function getModelName() public const CHALLENGE_CANCEL__05 = '05'; public const CHALLENGE_CANCEL__06 = '06'; public const CHALLENGE_CANCEL__07 = '07'; - public const CHALLENGE_INDICATOR_NO_PREFERENCE = 'noPreference'; - public const CHALLENGE_INDICATOR_REQUEST_NO_CHALLENGE = 'requestNoChallenge'; - public const CHALLENGE_INDICATOR_REQUEST_CHALLENGE = 'requestChallenge'; - public const CHALLENGE_INDICATOR_REQUEST_CHALLENGE_AS_MANDATE = 'requestChallengeAsMandate'; public const EXEMPTION_INDICATOR_LOW_VALUE = 'lowValue'; public const EXEMPTION_INDICATOR_SECURE_CORPORATE = 'secureCorporate'; public const EXEMPTION_INDICATOR_TRUSTED_BENEFICIARY = 'trustedBeneficiary'; public const EXEMPTION_INDICATOR_TRANSACTION_RISK_ANALYSIS = 'transactionRiskAnalysis'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__01 = '01'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__02 = '02'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__03 = '03'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__04 = '04'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__05 = '05'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__06 = '06'; /** * Gets allowable values of the enum @@ -331,13 +333,13 @@ public function getChallengeCancelAllowableValues() * * @return string[] */ - public function getChallengeIndicatorAllowableValues() + public function getExemptionIndicatorAllowableValues() { return [ - self::CHALLENGE_INDICATOR_NO_PREFERENCE, - self::CHALLENGE_INDICATOR_REQUEST_NO_CHALLENGE, - self::CHALLENGE_INDICATOR_REQUEST_CHALLENGE, - self::CHALLENGE_INDICATOR_REQUEST_CHALLENGE_AS_MANDATE, + self::EXEMPTION_INDICATOR_LOW_VALUE, + self::EXEMPTION_INDICATOR_SECURE_CORPORATE, + self::EXEMPTION_INDICATOR_TRUSTED_BENEFICIARY, + self::EXEMPTION_INDICATOR_TRANSACTION_RISK_ANALYSIS, ]; } /** @@ -345,13 +347,15 @@ public function getChallengeIndicatorAllowableValues() * * @return string[] */ - public function getExemptionIndicatorAllowableValues() + public function getThreeDSRequestorChallengeIndAllowableValues() { return [ - self::EXEMPTION_INDICATOR_LOW_VALUE, - self::EXEMPTION_INDICATOR_SECURE_CORPORATE, - self::EXEMPTION_INDICATOR_TRUSTED_BENEFICIARY, - self::EXEMPTION_INDICATOR_TRANSACTION_RISK_ANALYSIS, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__01, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__02, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__03, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__04, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__05, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__06, ]; } /** @@ -372,12 +376,12 @@ public function __construct(array $data = null) $this->setIfExists('authenticationValue', $data ?? [], null); $this->setIfExists('cavvAlgorithm', $data ?? [], null); $this->setIfExists('challengeCancel', $data ?? [], null); - $this->setIfExists('challengeIndicator', $data ?? [], null); $this->setIfExists('dsTransID', $data ?? [], null); $this->setIfExists('eci', $data ?? [], null); $this->setIfExists('exemptionIndicator', $data ?? [], null); $this->setIfExists('messageVersion', $data ?? [], null); $this->setIfExists('riskScore', $data ?? [], null); + $this->setIfExists('threeDSRequestorChallengeInd', $data ?? [], null); $this->setIfExists('threeDSServerTransID', $data ?? [], null); $this->setIfExists('timestamp', $data ?? [], null); $this->setIfExists('transStatus', $data ?? [], null); @@ -421,20 +425,20 @@ public function listInvalidProperties() ); } - $allowedValues = $this->getChallengeIndicatorAllowableValues(); - if (!is_null($this->container['challengeIndicator']) && !in_array($this->container['challengeIndicator'], $allowedValues, true)) { + $allowedValues = $this->getExemptionIndicatorAllowableValues(); + if (!is_null($this->container['exemptionIndicator']) && !in_array($this->container['exemptionIndicator'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'challengeIndicator', must be one of '%s'", - $this->container['challengeIndicator'], + "invalid value '%s' for 'exemptionIndicator', must be one of '%s'", + $this->container['exemptionIndicator'], implode("', '", $allowedValues) ); } - $allowedValues = $this->getExemptionIndicatorAllowableValues(); - if (!is_null($this->container['exemptionIndicator']) && !in_array($this->container['exemptionIndicator'], $allowedValues, true)) { + $allowedValues = $this->getThreeDSRequestorChallengeIndAllowableValues(); + if (!is_null($this->container['threeDSRequestorChallengeInd']) && !in_array($this->container['threeDSRequestorChallengeInd'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'exemptionIndicator', must be one of '%s'", - $this->container['exemptionIndicator'], + "invalid value '%s' for 'threeDSRequestorChallengeInd', must be one of '%s'", + $this->container['threeDSRequestorChallengeInd'], implode("', '", $allowedValues) ); } @@ -545,43 +549,6 @@ public function setChallengeCancel($challengeCancel) return $this; } - /** - * Gets challengeIndicator - * - * @return string|null - */ - public function getChallengeIndicator() - { - return $this->container['challengeIndicator']; - } - - /** - * Sets challengeIndicator - * - * @param string|null $challengeIndicator Specifies a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` - * - * @return self - */ - public function setChallengeIndicator($challengeIndicator) - { - if (is_null($challengeIndicator)) { - throw new \InvalidArgumentException('non-nullable challengeIndicator cannot be null'); - } - $allowedValues = $this->getChallengeIndicatorAllowableValues(); - if (!in_array($challengeIndicator, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'challengeIndicator', must be one of '%s'", - $challengeIndicator, - implode("', '", $allowedValues) - ) - ); - } - $this->container['challengeIndicator'] = $challengeIndicator; - - return $this; - } - /** * Gets dsTransID * @@ -727,6 +694,43 @@ public function setRiskScore($riskScore) return $this; } + /** + * Gets threeDSRequestorChallengeInd + * + * @return string|null + */ + public function getThreeDSRequestorChallengeInd() + { + return $this->container['threeDSRequestorChallengeInd']; + } + + /** + * Sets threeDSRequestorChallengeInd + * + * @param string|null $threeDSRequestorChallengeInd Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only + * + * @return self + */ + public function setThreeDSRequestorChallengeInd($threeDSRequestorChallengeInd) + { + if (is_null($threeDSRequestorChallengeInd)) { + throw new \InvalidArgumentException('non-nullable threeDSRequestorChallengeInd cannot be null'); + } + $allowedValues = $this->getThreeDSRequestorChallengeIndAllowableValues(); + if (!in_array($threeDSRequestorChallengeInd, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'threeDSRequestorChallengeInd', must be one of '%s'", + $threeDSRequestorChallengeInd, + implode("', '", $allowedValues) + ) + ); + } + $this->container['threeDSRequestorChallengeInd'] = $threeDSRequestorChallengeInd; + + return $this; + } + /** * Gets threeDSServerTransID * diff --git a/src/Adyen/Model/Transfers/BRLocalAccountIdentification.php b/src/Adyen/Model/Transfers/BRLocalAccountIdentification.php index 7a7e1bcc5..391619ac6 100644 --- a/src/Adyen/Model/Transfers/BRLocalAccountIdentification.php +++ b/src/Adyen/Model/Transfers/BRLocalAccountIdentification.php @@ -343,7 +343,7 @@ public function getAccountNumber() /** * Sets accountNumber * - * @param string $accountNumber The bank account number (without separators or whitespace). + * @param string $accountNumber The bank account number, without separators or whitespace. * * @return self */ @@ -370,7 +370,7 @@ public function getBankCode() /** * Sets bankCode * - * @param string $bankCode The 3-digit Brazilian bank code (with leading zeros). + * @param string $bankCode The 3-digit bank code, with leading zeros. * * @return self */ @@ -397,7 +397,7 @@ public function getBranchNumber() /** * Sets branchNumber * - * @param string $branchNumber The bank account branch number (without separators or whitespace). + * @param string $branchNumber The bank account branch number, without separators or whitespace. * * @return self */ diff --git a/src/Adyen/Model/Transfers/BankAccountV3AccountIdentification.php b/src/Adyen/Model/Transfers/BankAccountV3AccountIdentification.php index 97c7f80e7..939de4326 100644 --- a/src/Adyen/Model/Transfers/BankAccountV3AccountIdentification.php +++ b/src/Adyen/Model/Transfers/BankAccountV3AccountIdentification.php @@ -536,7 +536,7 @@ public function getBranchNumber() /** * Sets branchNumber * - * @param string $branchNumber The bank account branch number (without separators or whitespace). + * @param string $branchNumber The bank account branch number, without separators or whitespace. * * @return self */ diff --git a/src/Adyen/Model/Transfers/HKLocalAccountIdentification.php b/src/Adyen/Model/Transfers/HKLocalAccountIdentification.php new file mode 100644 index 000000000..dd4935f46 --- /dev/null +++ b/src/Adyen/Model/Transfers/HKLocalAccountIdentification.php @@ -0,0 +1,492 @@ + + */ +class HKLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'HKLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'bankCode' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'bankCode' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'bankCode' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'accountNumber' => 'accountNumber', + 'bankCode' => 'bankCode', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'bankCode' => 'setBankCode', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'bankCode' => 'getBankCode', + '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_HK_LOCAL = 'hkLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_HK_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('bankCode', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'hkLocal'); + } + + /** + * 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['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['bankCode'] === null) { + $invalidProperties[] = "'bankCode' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The 6- to 19-character bank account number (alphanumeric), without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets bankCode + * + * @return string + */ + public function getBankCode() + { + return $this->container['bankCode']; + } + + /** + * Sets bankCode + * + * @param string $bankCode The 6-digit bank code including the 3-digit bank code and 3-digit branch code, without separators or whitespace. + * + * @return self + */ + public function setBankCode($bankCode) + { + if (is_null($bankCode)) { + throw new \InvalidArgumentException('non-nullable bankCode cannot be null'); + } + $this->container['bankCode'] = $bankCode; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **hkLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/Transaction.php b/src/Adyen/Model/Transfers/Transaction.php index a4a722c6b..934086e72 100644 --- a/src/Adyen/Model/Transfers/Transaction.php +++ b/src/Adyen/Model/Transfers/Transaction.php @@ -52,7 +52,9 @@ class Transaction implements ModelInterface, ArrayAccess, \JsonSerializable 'category' => 'string', 'counterparty' => '\Adyen\Model\Transfers\CounterpartyV3', 'createdAt' => '\DateTime', + 'creationDate' => '\DateTime', 'description' => 'string', + 'eventId' => 'string', 'id' => 'string', 'instructedAmount' => '\Adyen\Model\Transfers\Amount', 'paymentInstrumentId' => 'string', @@ -80,7 +82,9 @@ class Transaction implements ModelInterface, ArrayAccess, \JsonSerializable 'category' => null, 'counterparty' => null, 'createdAt' => 'date-time', + 'creationDate' => 'date-time', 'description' => null, + 'eventId' => null, 'id' => null, 'instructedAmount' => null, 'paymentInstrumentId' => null, @@ -106,7 +110,9 @@ class Transaction implements ModelInterface, ArrayAccess, \JsonSerializable 'category' => false, 'counterparty' => false, 'createdAt' => false, + 'creationDate' => false, 'description' => false, + 'eventId' => false, 'id' => false, 'instructedAmount' => false, 'paymentInstrumentId' => false, @@ -212,7 +218,9 @@ public function isNullableSetToNull(string $property): bool 'category' => 'category', 'counterparty' => 'counterparty', 'createdAt' => 'createdAt', + 'creationDate' => 'creationDate', 'description' => 'description', + 'eventId' => 'eventId', 'id' => 'id', 'instructedAmount' => 'instructedAmount', 'paymentInstrumentId' => 'paymentInstrumentId', @@ -238,7 +246,9 @@ public function isNullableSetToNull(string $property): bool 'category' => 'setCategory', 'counterparty' => 'setCounterparty', 'createdAt' => 'setCreatedAt', + 'creationDate' => 'setCreationDate', 'description' => 'setDescription', + 'eventId' => 'setEventId', 'id' => 'setId', 'instructedAmount' => 'setInstructedAmount', 'paymentInstrumentId' => 'setPaymentInstrumentId', @@ -264,7 +274,9 @@ public function isNullableSetToNull(string $property): bool 'category' => 'getCategory', 'counterparty' => 'getCounterparty', 'createdAt' => 'getCreatedAt', + 'creationDate' => 'getCreationDate', 'description' => 'getDescription', + 'eventId' => 'getEventId', 'id' => 'getId', 'instructedAmount' => 'getInstructedAmount', 'paymentInstrumentId' => 'getPaymentInstrumentId', @@ -443,7 +455,9 @@ public function __construct(array $data = null) $this->setIfExists('category', $data ?? [], null); $this->setIfExists('counterparty', $data ?? [], null); $this->setIfExists('createdAt', $data ?? [], null); + $this->setIfExists('creationDate', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('eventId', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('instructedAmount', $data ?? [], null); $this->setIfExists('paymentInstrumentId', $data ?? [], null); @@ -783,6 +797,33 @@ public function setCreatedAt($createdAt) return $this; } + /** + * Gets creationDate + * + * @return \DateTime|null + */ + public function getCreationDate() + { + return $this->container['creationDate']; + } + + /** + * Sets creationDate + * + * @param \DateTime|null $creationDate The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + * + * @return self + */ + public function setCreationDate($creationDate) + { + if (is_null($creationDate)) { + throw new \InvalidArgumentException('non-nullable creationDate cannot be null'); + } + $this->container['creationDate'] = $creationDate; + + return $this; + } + /** * Gets description * @@ -810,6 +851,33 @@ public function setDescription($description) return $this; } + /** + * Gets eventId + * + * @return string|null + */ + public function getEventId() + { + return $this->container['eventId']; + } + + /** + * Sets eventId + * + * @param string|null $eventId The PSP reference in the journal. + * + * @return self + */ + public function setEventId($eventId) + { + if (is_null($eventId)) { + throw new \InvalidArgumentException('non-nullable eventId cannot be null'); + } + $this->container['eventId'] = $eventId; + + return $this; + } + /** * Gets id * diff --git a/src/Adyen/Model/Transfers/Transfer.php b/src/Adyen/Model/Transfers/Transfer.php index 185679d3d..5b012dab0 100644 --- a/src/Adyen/Model/Transfers/Transfer.php +++ b/src/Adyen/Model/Transfers/Transfer.php @@ -386,6 +386,10 @@ public function getModelName() public const STATUS_MERCHANT_PAYIN_REVERSED_PENDING = 'merchantPayinReversedPending'; public const STATUS_MISC_COST = 'miscCost'; public const STATUS_MISC_COST_PENDING = 'miscCostPending'; + public const STATUS_OPERATION_AUTHORIZED = 'operationAuthorized'; + public const STATUS_OPERATION_BOOKED = 'operationBooked'; + public const STATUS_OPERATION_PENDING = 'operationPending'; + public const STATUS_OPERATION_RECEIVED = 'operationReceived'; public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; public const STATUS_RECEIVED = 'received'; @@ -525,6 +529,10 @@ public function getStatusAllowableValues() self::STATUS_MERCHANT_PAYIN_REVERSED_PENDING, self::STATUS_MISC_COST, self::STATUS_MISC_COST_PENDING, + self::STATUS_OPERATION_AUTHORIZED, + self::STATUS_OPERATION_BOOKED, + self::STATUS_OPERATION_PENDING, + self::STATUS_OPERATION_RECEIVED, self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, self::STATUS_RECEIVED, diff --git a/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php b/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php index b07fa624e..07b167c3a 100644 --- a/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php +++ b/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php @@ -73,15 +73,15 @@ public function getAllBalanceAccountsOfAccountHolder(string $id, array $requestO * Update an account holder * * @param string $id - * @param \Adyen\Model\BalancePlatform\AccountHolder $accountHolder + * @param \Adyen\Model\BalancePlatform\AccountHolderUpdateRequest $accountHolderUpdateRequest * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\AccountHolder * @throws AdyenException */ - public function updateAccountHolder(string $id, \Adyen\Model\BalancePlatform\AccountHolder $accountHolder, array $requestOptions = null): \Adyen\Model\BalancePlatform\AccountHolder + public function updateAccountHolder(string $id, \Adyen\Model\BalancePlatform\AccountHolderUpdateRequest $accountHolderUpdateRequest, array $requestOptions = null): \Adyen\Model\BalancePlatform\AccountHolder { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/accountHolders/{id}"); - $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $accountHolder->jsonSerialize(), $requestOptions); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $accountHolderUpdateRequest->jsonSerialize(), $requestOptions); return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\AccountHolder::class); } diff --git a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php index ba4aba203..3f39a1d2e 100644 --- a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php +++ b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php @@ -120,15 +120,15 @@ public function getAllPaymentInstrumentsForBalanceAccount(string $id, array $req * * @param string $balanceAccountId * @param string $sweepId - * @param \Adyen\Model\BalancePlatform\SweepConfigurationV2 $sweepConfigurationV2 + * @param \Adyen\Model\BalancePlatform\UpdateSweepConfigurationV2 $updateSweepConfigurationV2 * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 * @throws AdyenException */ - public function updateSweep(string $balanceAccountId, string $sweepId, \Adyen\Model\BalancePlatform\SweepConfigurationV2 $sweepConfigurationV2, array $requestOptions = null): \Adyen\Model\BalancePlatform\SweepConfigurationV2 + public function updateSweep(string $balanceAccountId, string $sweepId, \Adyen\Model\BalancePlatform\UpdateSweepConfigurationV2 $updateSweepConfigurationV2, array $requestOptions = null): \Adyen\Model\BalancePlatform\SweepConfigurationV2 { $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); - $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $sweepConfigurationV2->jsonSerialize(), $requestOptions); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateSweepConfigurationV2->jsonSerialize(), $requestOptions); return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\SweepConfigurationV2::class); } diff --git a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php index c646e0311..6197e93ac 100644 --- a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php +++ b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php @@ -44,9 +44,10 @@ public function __construct(Client $client) * * @param \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest * @param array|null $requestOptions + * @throws AdyenException */ - public function validateBankAccountIdentification(\Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest, array $requestOptions = null): void + public function validateBankAccountIdentification(\Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest, array $requestOptions = null) { $endpoint = $this->baseURL . "/validateBankAccountIdentification"; $this->requestHttp($endpoint, strtolower('POST'), (array) $bankAccountIdentificationValidationRequest->jsonSerialize(), $requestOptions); diff --git a/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php b/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php new file mode 100644 index 000000000..5b9df002c --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php @@ -0,0 +1,71 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Get a network token + * + * @param string $networkTokenId + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\GetNetworkTokenResponse + * @throws AdyenException + */ + public function getNetworkToken(string $networkTokenId, array $requestOptions = null): \Adyen\Model\BalancePlatform\GetNetworkTokenResponse + { + $endpoint = $this->baseURL . str_replace(['{networkTokenId}'], [$networkTokenId], "/networkTokens/{networkTokenId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\GetNetworkTokenResponse::class); + } + + /** + * Update a network token + * + * @param string $networkTokenId + * @param \Adyen\Model\BalancePlatform\UpdateNetworkTokenRequest $updateNetworkTokenRequest + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function updateNetworkToken(string $networkTokenId, \Adyen\Model\BalancePlatform\UpdateNetworkTokenRequest $updateNetworkTokenRequest, array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{networkTokenId}'], [$networkTokenId], "/networkTokens/{networkTokenId}"); + $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateNetworkTokenRequest->jsonSerialize(), $requestOptions); + } +} diff --git a/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php b/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php index 66063d63a..5113efda7 100644 --- a/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php +++ b/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php @@ -54,6 +54,21 @@ public function getPaymentInstrument(string $id, array $requestOptions = null): return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\PaymentInstrument::class); } + /** + * List network tokens + * + * @param string $id + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\ListNetworkTokensResponse + * @throws AdyenException + */ + public function listNetworkTokens(string $id, array $requestOptions = null): \Adyen\Model\BalancePlatform\ListNetworkTokensResponse + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/paymentInstruments/{id}/networkTokens"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\ListNetworkTokensResponse::class); + } + /** * Get the PAN of a payment instrument * diff --git a/src/Adyen/Service/Payments/GeneralApi.php b/src/Adyen/Service/Payments/PaymentsApi.php similarity index 98% rename from src/Adyen/Service/Payments/GeneralApi.php rename to src/Adyen/Service/Payments/PaymentsApi.php index b72bfc5d2..dcc42cf29 100644 --- a/src/Adyen/Service/Payments/GeneralApi.php +++ b/src/Adyen/Service/Payments/PaymentsApi.php @@ -18,7 +18,7 @@ use Adyen\Service; use Adyen\Model\Payments\ObjectSerializer; -class GeneralApi extends Service +class PaymentsApi extends Service { /** * @var array|string|string[] @@ -26,7 +26,7 @@ class GeneralApi extends Service private $baseURL; /** - * GeneralApi constructor. + * PaymentsApi constructor. * * @param \Adyen\Client $client * @throws AdyenException