diff --git a/src/Adyen/Model/Checkout/AchDetails.php b/src/Adyen/Model/Checkout/AchDetails.php index 3ff18e95d..f30743c45 100644 --- a/src/Adyen/Model/Checkout/AchDetails.php +++ b/src/Adyen/Model/Checkout/AchDetails.php @@ -53,6 +53,7 @@ class AchDetails implements ModelInterface, ArrayAccess, \JsonSerializable 'ownerName' => 'string', 'recurringDetailReference' => 'string', 'storedPaymentMethodId' => 'string', + 'transferInstrumentId' => 'string', 'type' => 'string' ]; @@ -73,6 +74,7 @@ class AchDetails implements ModelInterface, ArrayAccess, \JsonSerializable 'ownerName' => null, 'recurringDetailReference' => null, 'storedPaymentMethodId' => null, + 'transferInstrumentId' => null, 'type' => null ]; @@ -91,6 +93,7 @@ class AchDetails implements ModelInterface, ArrayAccess, \JsonSerializable 'ownerName' => false, 'recurringDetailReference' => false, 'storedPaymentMethodId' => false, + 'transferInstrumentId' => false, 'type' => false ]; @@ -189,6 +192,7 @@ public function isNullableSetToNull(string $property): bool 'ownerName' => 'ownerName', 'recurringDetailReference' => 'recurringDetailReference', 'storedPaymentMethodId' => 'storedPaymentMethodId', + 'transferInstrumentId' => 'transferInstrumentId', 'type' => 'type' ]; @@ -207,6 +211,7 @@ public function isNullableSetToNull(string $property): bool 'ownerName' => 'setOwnerName', 'recurringDetailReference' => 'setRecurringDetailReference', 'storedPaymentMethodId' => 'setStoredPaymentMethodId', + 'transferInstrumentId' => 'setTransferInstrumentId', 'type' => 'setType' ]; @@ -225,6 +230,7 @@ public function isNullableSetToNull(string $property): bool 'ownerName' => 'getOwnerName', 'recurringDetailReference' => 'getRecurringDetailReference', 'storedPaymentMethodId' => 'getStoredPaymentMethodId', + 'transferInstrumentId' => 'getTransferInstrumentId', 'type' => 'getType' ]; @@ -332,6 +338,7 @@ public function __construct(array $data = null) $this->setIfExists('ownerName', $data ?? [], null); $this->setIfExists('recurringDetailReference', $data ?? [], null); $this->setIfExists('storedPaymentMethodId', $data ?? [], null); + $this->setIfExists('transferInstrumentId', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -623,6 +630,30 @@ public function setStoredPaymentMethodId($storedPaymentMethodId) return $this; } + /** + * Gets transferInstrumentId + * + * @return string|null + */ + public function getTransferInstrumentId() + { + return $this->container['transferInstrumentId']; + } + + /** + * Sets transferInstrumentId + * + * @param string|null $transferInstrumentId The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. + * + * @return self + */ + public function setTransferInstrumentId($transferInstrumentId) + { + $this->container['transferInstrumentId'] = $transferInstrumentId; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/Checkout/Amounts.php b/src/Adyen/Model/Checkout/Amounts.php new file mode 100644 index 000000000..6dfa1f058 --- /dev/null +++ b/src/Adyen/Model/Checkout/Amounts.php @@ -0,0 +1,444 @@ + + */ +class Amounts implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Amounts'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'values' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'values' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'values' => 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 = [ + 'currency' => 'currency', + 'values' => 'values' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'values' => 'setValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'values' => 'getValues' + ]; + + /** + * 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('currency', $data ?? [], null); + $this->setIfExists('values', $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['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['values'] === null) { + $invalidProperties[] = "'values' 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 currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). + * + * @return self + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets values + * + * @return int[] + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param int[] $values The amounts of the donation (in [minor units](https://docs.adyen.com/development-resources/currency-codes/)). + * + * @return self + */ + public function setValues($values) + { + $this->container['values'] = $values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/BacsDirectDebitDetails.php b/src/Adyen/Model/Checkout/BacsDirectDebitDetails.php index 25414f8ef..b29e7f510 100644 --- a/src/Adyen/Model/Checkout/BacsDirectDebitDetails.php +++ b/src/Adyen/Model/Checkout/BacsDirectDebitDetails.php @@ -50,6 +50,7 @@ class BacsDirectDebitDetails implements ModelInterface, ArrayAccess, \JsonSerial 'holderName' => 'string', 'recurringDetailReference' => 'string', 'storedPaymentMethodId' => 'string', + 'transferInstrumentId' => 'string', 'type' => 'string' ]; @@ -67,6 +68,7 @@ class BacsDirectDebitDetails implements ModelInterface, ArrayAccess, \JsonSerial 'holderName' => null, 'recurringDetailReference' => null, 'storedPaymentMethodId' => null, + 'transferInstrumentId' => null, 'type' => null ]; @@ -82,6 +84,7 @@ class BacsDirectDebitDetails implements ModelInterface, ArrayAccess, \JsonSerial 'holderName' => false, 'recurringDetailReference' => false, 'storedPaymentMethodId' => false, + 'transferInstrumentId' => false, 'type' => false ]; @@ -177,6 +180,7 @@ public function isNullableSetToNull(string $property): bool 'holderName' => 'holderName', 'recurringDetailReference' => 'recurringDetailReference', 'storedPaymentMethodId' => 'storedPaymentMethodId', + 'transferInstrumentId' => 'transferInstrumentId', 'type' => 'type' ]; @@ -192,6 +196,7 @@ public function isNullableSetToNull(string $property): bool 'holderName' => 'setHolderName', 'recurringDetailReference' => 'setRecurringDetailReference', 'storedPaymentMethodId' => 'setStoredPaymentMethodId', + 'transferInstrumentId' => 'setTransferInstrumentId', 'type' => 'setType' ]; @@ -207,6 +212,7 @@ public function isNullableSetToNull(string $property): bool 'holderName' => 'getHolderName', 'recurringDetailReference' => 'getRecurringDetailReference', 'storedPaymentMethodId' => 'getStoredPaymentMethodId', + 'transferInstrumentId' => 'getTransferInstrumentId', 'type' => 'getType' ]; @@ -285,6 +291,7 @@ public function __construct(array $data = null) $this->setIfExists('holderName', $data ?? [], null); $this->setIfExists('recurringDetailReference', $data ?? [], null); $this->setIfExists('storedPaymentMethodId', $data ?? [], null); + $this->setIfExists('transferInstrumentId', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -485,6 +492,30 @@ public function setStoredPaymentMethodId($storedPaymentMethodId) return $this; } + /** + * Gets transferInstrumentId + * + * @return string|null + */ + public function getTransferInstrumentId() + { + return $this->container['transferInstrumentId']; + } + + /** + * Sets transferInstrumentId + * + * @param string|null $transferInstrumentId The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. + * + * @return self + */ + public function setTransferInstrumentId($transferInstrumentId) + { + $this->container['transferInstrumentId'] = $transferInstrumentId; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php index a9b888de5..09485a2e7 100644 --- a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php +++ b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php @@ -54,6 +54,7 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'ownerName' => 'string', 'recurringDetailReference' => 'string', 'storedPaymentMethodId' => 'string', + 'transferInstrumentId' => 'string', 'type' => 'string', 'billingAddress' => 'string', 'deliveryAddress' => 'string', @@ -127,6 +128,7 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'ownerName' => null, 'recurringDetailReference' => null, 'storedPaymentMethodId' => null, + 'transferInstrumentId' => null, 'type' => null, 'billingAddress' => null, 'deliveryAddress' => null, @@ -198,6 +200,7 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'ownerName' => false, 'recurringDetailReference' => false, 'storedPaymentMethodId' => false, + 'transferInstrumentId' => false, 'type' => false, 'billingAddress' => false, 'deliveryAddress' => false, @@ -349,6 +352,7 @@ public function isNullableSetToNull(string $property): bool 'ownerName' => 'ownerName', 'recurringDetailReference' => 'recurringDetailReference', 'storedPaymentMethodId' => 'storedPaymentMethodId', + 'transferInstrumentId' => 'transferInstrumentId', 'type' => 'type', 'billingAddress' => 'billingAddress', 'deliveryAddress' => 'deliveryAddress', @@ -420,6 +424,7 @@ public function isNullableSetToNull(string $property): bool 'ownerName' => 'setOwnerName', 'recurringDetailReference' => 'setRecurringDetailReference', 'storedPaymentMethodId' => 'setStoredPaymentMethodId', + 'transferInstrumentId' => 'setTransferInstrumentId', 'type' => 'setType', 'billingAddress' => 'setBillingAddress', 'deliveryAddress' => 'setDeliveryAddress', @@ -491,6 +496,7 @@ public function isNullableSetToNull(string $property): bool 'ownerName' => 'getOwnerName', 'recurringDetailReference' => 'getRecurringDetailReference', 'storedPaymentMethodId' => 'getStoredPaymentMethodId', + 'transferInstrumentId' => 'getTransferInstrumentId', 'type' => 'getType', 'billingAddress' => 'getBillingAddress', 'deliveryAddress' => 'getDeliveryAddress', @@ -612,6 +618,7 @@ public function __construct(array $data = null) $this->setIfExists('ownerName', $data ?? [], null); $this->setIfExists('recurringDetailReference', $data ?? [], null); $this->setIfExists('storedPaymentMethodId', $data ?? [], null); + $this->setIfExists('transferInstrumentId', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('billingAddress', $data ?? [], null); $this->setIfExists('deliveryAddress', $data ?? [], null); @@ -974,6 +981,30 @@ public function setStoredPaymentMethodId($storedPaymentMethodId) return $this; } + /** + * Gets transferInstrumentId + * + * @return string|null + */ + public function getTransferInstrumentId() + { + return $this->container['transferInstrumentId']; + } + + /** + * Sets transferInstrumentId + * + * @param string|null $transferInstrumentId The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. + * + * @return self + */ + public function setTransferInstrumentId($transferInstrumentId) + { + $this->container['transferInstrumentId'] = $transferInstrumentId; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php b/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php index 3b86c867c..2cd96d65f 100644 --- a/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php +++ b/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php @@ -97,6 +97,7 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'splitCardFundingSources' => 'bool', 'splits' => '\Adyen\Model\Checkout\Split[]', 'store' => 'string', + 'storeFiltrationMode' => 'string', 'storePaymentMethod' => 'bool', 'storePaymentMethodMode' => 'string', 'telephoneNumber' => 'string', @@ -167,6 +168,7 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'splitCardFundingSources' => null, 'splits' => null, 'store' => null, + 'storeFiltrationMode' => null, 'storePaymentMethod' => null, 'storePaymentMethodMode' => null, 'telephoneNumber' => null, @@ -235,6 +237,7 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'splitCardFundingSources' => false, 'splits' => false, 'store' => false, + 'storeFiltrationMode' => false, 'storePaymentMethod' => false, 'storePaymentMethodMode' => false, 'telephoneNumber' => false, @@ -383,6 +386,7 @@ public function isNullableSetToNull(string $property): bool 'splitCardFundingSources' => 'splitCardFundingSources', 'splits' => 'splits', 'store' => 'store', + 'storeFiltrationMode' => 'storeFiltrationMode', 'storePaymentMethod' => 'storePaymentMethod', 'storePaymentMethodMode' => 'storePaymentMethodMode', 'telephoneNumber' => 'telephoneNumber', @@ -451,6 +455,7 @@ public function isNullableSetToNull(string $property): bool 'splitCardFundingSources' => 'setSplitCardFundingSources', 'splits' => 'setSplits', 'store' => 'setStore', + 'storeFiltrationMode' => 'setStoreFiltrationMode', 'storePaymentMethod' => 'setStorePaymentMethod', 'storePaymentMethodMode' => 'setStorePaymentMethodMode', 'telephoneNumber' => 'setTelephoneNumber', @@ -519,6 +524,7 @@ public function isNullableSetToNull(string $property): bool 'splitCardFundingSources' => 'getSplitCardFundingSources', 'splits' => 'getSplits', 'store' => 'getStore', + 'storeFiltrationMode' => 'getStoreFiltrationMode', 'storePaymentMethod' => 'getStorePaymentMethod', 'storePaymentMethodMode' => 'getStorePaymentMethodMode', 'telephoneNumber' => 'getTelephoneNumber', @@ -581,6 +587,9 @@ public function getModelName() public const SHOPPER_INTERACTION_CONT_AUTH = 'ContAuth'; public const SHOPPER_INTERACTION_MOTO = 'Moto'; public const SHOPPER_INTERACTION_POS = 'POS'; + public const STORE_FILTRATION_MODE_EXCLUSIVE = 'exclusive'; + public const STORE_FILTRATION_MODE_INCLUSIVE = 'inclusive'; + public const STORE_FILTRATION_MODE_SKIP_FILTER = 'skipFilter'; public const STORE_PAYMENT_METHOD_MODE_ASK_FOR_CONSENT = 'askForConsent'; public const STORE_PAYMENT_METHOD_MODE_DISABLED = 'disabled'; public const STORE_PAYMENT_METHOD_MODE_ENABLED = 'enabled'; @@ -637,6 +646,19 @@ public function getShopperInteractionAllowableValues() self::SHOPPER_INTERACTION_POS, ]; } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStoreFiltrationModeAllowableValues() + { + return [ + self::STORE_FILTRATION_MODE_EXCLUSIVE, + self::STORE_FILTRATION_MODE_INCLUSIVE, + self::STORE_FILTRATION_MODE_SKIP_FILTER, + ]; + } /** * Gets allowable values of the enum * @@ -718,6 +740,7 @@ public function __construct(array $data = null) $this->setIfExists('splitCardFundingSources', $data ?? [], null); $this->setIfExists('splits', $data ?? [], null); $this->setIfExists('store', $data ?? [], null); + $this->setIfExists('storeFiltrationMode', $data ?? [], null); $this->setIfExists('storePaymentMethod', $data ?? [], null); $this->setIfExists('storePaymentMethodMode', $data ?? [], null); $this->setIfExists('telephoneNumber', $data ?? [], null); @@ -802,6 +825,15 @@ public function listInvalidProperties() ); } + $allowedValues = $this->getStoreFiltrationModeAllowableValues(); + if (!is_null($this->container['storeFiltrationMode']) && !in_array($this->container['storeFiltrationMode'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'storeFiltrationMode', must be one of '%s'", + $this->container['storeFiltrationMode'], + implode("', '", $allowedValues) + ); + } + $allowedValues = $this->getStorePaymentMethodModeAllowableValues(); if (!is_null($this->container['storePaymentMethodMode']) && !in_array($this->container['storePaymentMethodMode'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -2138,6 +2170,40 @@ public function setStore($store) return $this; } + /** + * Gets storeFiltrationMode + * + * @return string|null + */ + public function getStoreFiltrationMode() + { + return $this->container['storeFiltrationMode']; + } + + /** + * Sets storeFiltrationMode + * + * @param string|null $storeFiltrationMode Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. - 'skipFilter': All payment methods are returned, regardless of store association. + * + * @return self + */ + public function setStoreFiltrationMode($storeFiltrationMode) + { + $allowedValues = $this->getStoreFiltrationModeAllowableValues(); + if (!in_array($storeFiltrationMode, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'storeFiltrationMode', must be one of '%s'", + $storeFiltrationMode, + implode("', '", $allowedValues) + ) + ); + } + $this->container['storeFiltrationMode'] = $storeFiltrationMode; + + return $this; + } + /** * Gets storePaymentMethod * diff --git a/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php b/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php index f769d421c..3322ae0a4 100644 --- a/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php +++ b/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php @@ -99,6 +99,7 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'splitCardFundingSources' => 'bool', 'splits' => '\Adyen\Model\Checkout\Split[]', 'store' => 'string', + 'storeFiltrationMode' => 'string', 'storePaymentMethod' => 'bool', 'storePaymentMethodMode' => 'string', 'telephoneNumber' => 'string', @@ -172,6 +173,7 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'splitCardFundingSources' => null, 'splits' => null, 'store' => null, + 'storeFiltrationMode' => null, 'storePaymentMethod' => null, 'storePaymentMethodMode' => null, 'telephoneNumber' => null, @@ -243,6 +245,7 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'splitCardFundingSources' => false, 'splits' => false, 'store' => false, + 'storeFiltrationMode' => false, 'storePaymentMethod' => false, 'storePaymentMethodMode' => false, 'telephoneNumber' => false, @@ -394,6 +397,7 @@ public function isNullableSetToNull(string $property): bool 'splitCardFundingSources' => 'splitCardFundingSources', 'splits' => 'splits', 'store' => 'store', + 'storeFiltrationMode' => 'storeFiltrationMode', 'storePaymentMethod' => 'storePaymentMethod', 'storePaymentMethodMode' => 'storePaymentMethodMode', 'telephoneNumber' => 'telephoneNumber', @@ -465,6 +469,7 @@ public function isNullableSetToNull(string $property): bool 'splitCardFundingSources' => 'setSplitCardFundingSources', 'splits' => 'setSplits', 'store' => 'setStore', + 'storeFiltrationMode' => 'setStoreFiltrationMode', 'storePaymentMethod' => 'setStorePaymentMethod', 'storePaymentMethodMode' => 'setStorePaymentMethodMode', 'telephoneNumber' => 'setTelephoneNumber', @@ -536,6 +541,7 @@ public function isNullableSetToNull(string $property): bool 'splitCardFundingSources' => 'getSplitCardFundingSources', 'splits' => 'getSplits', 'store' => 'getStore', + 'storeFiltrationMode' => 'getStoreFiltrationMode', 'storePaymentMethod' => 'getStorePaymentMethod', 'storePaymentMethodMode' => 'getStorePaymentMethodMode', 'telephoneNumber' => 'getTelephoneNumber', @@ -599,6 +605,9 @@ public function getModelName() public const SHOPPER_INTERACTION_CONT_AUTH = 'ContAuth'; public const SHOPPER_INTERACTION_MOTO = 'Moto'; public const SHOPPER_INTERACTION_POS = 'POS'; + public const STORE_FILTRATION_MODE_EXCLUSIVE = 'exclusive'; + public const STORE_FILTRATION_MODE_INCLUSIVE = 'inclusive'; + public const STORE_FILTRATION_MODE_SKIP_FILTER = 'skipFilter'; public const STORE_PAYMENT_METHOD_MODE_ASK_FOR_CONSENT = 'askForConsent'; public const STORE_PAYMENT_METHOD_MODE_DISABLED = 'disabled'; public const STORE_PAYMENT_METHOD_MODE_ENABLED = 'enabled'; @@ -655,6 +664,19 @@ public function getShopperInteractionAllowableValues() self::SHOPPER_INTERACTION_POS, ]; } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStoreFiltrationModeAllowableValues() + { + return [ + self::STORE_FILTRATION_MODE_EXCLUSIVE, + self::STORE_FILTRATION_MODE_INCLUSIVE, + self::STORE_FILTRATION_MODE_SKIP_FILTER, + ]; + } /** * Gets allowable values of the enum * @@ -738,6 +760,7 @@ public function __construct(array $data = null) $this->setIfExists('splitCardFundingSources', $data ?? [], null); $this->setIfExists('splits', $data ?? [], null); $this->setIfExists('store', $data ?? [], null); + $this->setIfExists('storeFiltrationMode', $data ?? [], null); $this->setIfExists('storePaymentMethod', $data ?? [], null); $this->setIfExists('storePaymentMethodMode', $data ?? [], null); $this->setIfExists('telephoneNumber', $data ?? [], null); @@ -829,6 +852,15 @@ public function listInvalidProperties() ); } + $allowedValues = $this->getStoreFiltrationModeAllowableValues(); + if (!is_null($this->container['storeFiltrationMode']) && !in_array($this->container['storeFiltrationMode'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'storeFiltrationMode', must be one of '%s'", + $this->container['storeFiltrationMode'], + implode("', '", $allowedValues) + ); + } + $allowedValues = $this->getStorePaymentMethodModeAllowableValues(); if (!is_null($this->container['storePaymentMethodMode']) && !in_array($this->container['storePaymentMethodMode'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -2213,6 +2245,40 @@ public function setStore($store) return $this; } + /** + * Gets storeFiltrationMode + * + * @return string|null + */ + public function getStoreFiltrationMode() + { + return $this->container['storeFiltrationMode']; + } + + /** + * Sets storeFiltrationMode + * + * @param string|null $storeFiltrationMode Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. - 'skipFilter': All payment methods are returned, regardless of store association. + * + * @return self + */ + public function setStoreFiltrationMode($storeFiltrationMode) + { + $allowedValues = $this->getStoreFiltrationModeAllowableValues(); + if (!in_array($storeFiltrationMode, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'storeFiltrationMode', must be one of '%s'", + $storeFiltrationMode, + implode("', '", $allowedValues) + ) + ); + } + $this->container['storeFiltrationMode'] = $storeFiltrationMode; + + return $this; + } + /** * Gets storePaymentMethod * diff --git a/src/Adyen/Model/Checkout/Donation.php b/src/Adyen/Model/Checkout/Donation.php new file mode 100644 index 000000000..b4480f34c --- /dev/null +++ b/src/Adyen/Model/Checkout/Donation.php @@ -0,0 +1,506 @@ + + */ +class Donation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Donation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'donationType' => 'string', + 'maxRoundupAmount' => 'int', + 'values' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'donationType' => null, + 'maxRoundupAmount' => 'int64', + 'values' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'donationType' => false, + 'maxRoundupAmount' => false, + 'values' => 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 = [ + 'currency' => 'currency', + 'donationType' => 'donationType', + 'maxRoundupAmount' => 'maxRoundupAmount', + 'values' => 'values' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'donationType' => 'setDonationType', + 'maxRoundupAmount' => 'setMaxRoundupAmount', + 'values' => 'setValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'donationType' => 'getDonationType', + 'maxRoundupAmount' => 'getMaxRoundupAmount', + 'values' => 'getValues' + ]; + + /** + * 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('currency', $data ?? [], null); + $this->setIfExists('donationType', $data ?? [], null); + $this->setIfExists('maxRoundupAmount', $data ?? [], null); + $this->setIfExists('values', $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['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['donationType'] === null) { + $invalidProperties[] = "'donationType' 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 currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). + * + * @return self + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets donationType + * + * @return string + */ + public function getDonationType() + { + return $this->container['donationType']; + } + + /** + * Sets donationType + * + * @param string $donationType The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types).\"Possible values:\\n\\n**roundup**: a donation where the original transaction amount is rounded up as a donation.**fixedAmounts**: a donation where you show fixed donations amounts that the shopper can select from. + * + * @return self + */ + public function setDonationType($donationType) + { + $this->container['donationType'] = $donationType; + + return $this; + } + + /** + * Gets maxRoundupAmount + * + * @return int|null + */ + public function getMaxRoundupAmount() + { + return $this->container['maxRoundupAmount']; + } + + /** + * Sets maxRoundupAmount + * + * @param int|null $maxRoundupAmount The maximum amount a transaction can be rounded up to make a donation. This field is only present when `donationType` is **roundup**. + * + * @return self + */ + public function setMaxRoundupAmount($maxRoundupAmount) + { + $this->container['maxRoundupAmount'] = $maxRoundupAmount; + + return $this; + } + + /** + * Gets values + * + * @return int[]|null + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param int[]|null $values The fixed donation amounts in [minor units](https://docs.adyen.com/development-resources/currency-codes//#minor-units). This field is only present when `donationType` is **fixedAmounts**. + * + * @return self + */ + public function setValues($values) + { + $this->container['values'] = $values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/DonationCampaign.php b/src/Adyen/Model/Checkout/DonationCampaign.php new file mode 100644 index 000000000..d76733ef5 --- /dev/null +++ b/src/Adyen/Model/Checkout/DonationCampaign.php @@ -0,0 +1,717 @@ + + */ +class DonationCampaign implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DonationCampaign'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amounts' => '\Adyen\Model\Checkout\Amounts', + 'bannerUrl' => 'string', + 'campaignName' => 'string', + 'causeName' => 'string', + 'donation' => '\Adyen\Model\Checkout\Donation', + 'id' => 'string', + 'logoUrl' => 'string', + 'nonprofitDescription' => 'string', + 'nonprofitName' => 'string', + 'nonprofitUrl' => 'string', + 'termsAndConditionsUrl' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amounts' => null, + 'bannerUrl' => null, + 'campaignName' => null, + 'causeName' => null, + 'donation' => null, + 'id' => null, + 'logoUrl' => null, + 'nonprofitDescription' => null, + 'nonprofitName' => null, + 'nonprofitUrl' => null, + 'termsAndConditionsUrl' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amounts' => false, + 'bannerUrl' => false, + 'campaignName' => false, + 'causeName' => false, + 'donation' => false, + 'id' => false, + 'logoUrl' => false, + 'nonprofitDescription' => false, + 'nonprofitName' => false, + 'nonprofitUrl' => false, + 'termsAndConditionsUrl' => 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 = [ + 'amounts' => 'amounts', + 'bannerUrl' => 'bannerUrl', + 'campaignName' => 'campaignName', + 'causeName' => 'causeName', + 'donation' => 'donation', + 'id' => 'id', + 'logoUrl' => 'logoUrl', + 'nonprofitDescription' => 'nonprofitDescription', + 'nonprofitName' => 'nonprofitName', + 'nonprofitUrl' => 'nonprofitUrl', + 'termsAndConditionsUrl' => 'termsAndConditionsUrl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amounts' => 'setAmounts', + 'bannerUrl' => 'setBannerUrl', + 'campaignName' => 'setCampaignName', + 'causeName' => 'setCauseName', + 'donation' => 'setDonation', + 'id' => 'setId', + 'logoUrl' => 'setLogoUrl', + 'nonprofitDescription' => 'setNonprofitDescription', + 'nonprofitName' => 'setNonprofitName', + 'nonprofitUrl' => 'setNonprofitUrl', + 'termsAndConditionsUrl' => 'setTermsAndConditionsUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amounts' => 'getAmounts', + 'bannerUrl' => 'getBannerUrl', + 'campaignName' => 'getCampaignName', + 'causeName' => 'getCauseName', + 'donation' => 'getDonation', + 'id' => 'getId', + 'logoUrl' => 'getLogoUrl', + 'nonprofitDescription' => 'getNonprofitDescription', + 'nonprofitName' => 'getNonprofitName', + 'nonprofitUrl' => 'getNonprofitUrl', + 'termsAndConditionsUrl' => 'getTermsAndConditionsUrl' + ]; + + /** + * 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('amounts', $data ?? [], null); + $this->setIfExists('bannerUrl', $data ?? [], null); + $this->setIfExists('campaignName', $data ?? [], null); + $this->setIfExists('causeName', $data ?? [], null); + $this->setIfExists('donation', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('logoUrl', $data ?? [], null); + $this->setIfExists('nonprofitDescription', $data ?? [], null); + $this->setIfExists('nonprofitName', $data ?? [], null); + $this->setIfExists('nonprofitUrl', $data ?? [], null); + $this->setIfExists('termsAndConditionsUrl', $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 amounts + * + * @return \Adyen\Model\Checkout\Amounts|null + */ + public function getAmounts() + { + return $this->container['amounts']; + } + + /** + * Sets amounts + * + * @param \Adyen\Model\Checkout\Amounts|null $amounts amounts + * + * @return self + */ + public function setAmounts($amounts) + { + $this->container['amounts'] = $amounts; + + return $this; + } + + /** + * Gets bannerUrl + * + * @return string|null + */ + public function getBannerUrl() + { + return $this->container['bannerUrl']; + } + + /** + * Sets bannerUrl + * + * @param string|null $bannerUrl The URL for the banner of the nonprofit or campaign. + * + * @return self + */ + public function setBannerUrl($bannerUrl) + { + $this->container['bannerUrl'] = $bannerUrl; + + return $this; + } + + /** + * Gets campaignName + * + * @return string|null + */ + public function getCampaignName() + { + return $this->container['campaignName']; + } + + /** + * Sets campaignName + * + * @param string|null $campaignName The name of the donation campaign.. + * + * @return self + */ + public function setCampaignName($campaignName) + { + $this->container['campaignName'] = $campaignName; + + return $this; + } + + /** + * Gets causeName + * + * @return string|null + */ + public function getCauseName() + { + return $this->container['causeName']; + } + + /** + * Sets causeName + * + * @param string|null $causeName The cause of the nonprofit. + * + * @return self + */ + public function setCauseName($causeName) + { + $this->container['causeName'] = $causeName; + + return $this; + } + + /** + * Gets donation + * + * @return \Adyen\Model\Checkout\Donation|null + */ + public function getDonation() + { + return $this->container['donation']; + } + + /** + * Sets donation + * + * @param \Adyen\Model\Checkout\Donation|null $donation donation + * + * @return self + */ + public function setDonation($donation) + { + $this->container['donation'] = $donation; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique campaign ID of the donation campaign. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets logoUrl + * + * @return string|null + */ + public function getLogoUrl() + { + return $this->container['logoUrl']; + } + + /** + * Sets logoUrl + * + * @param string|null $logoUrl The URL for the logo of the nonprofit. + * + * @return self + */ + public function setLogoUrl($logoUrl) + { + $this->container['logoUrl'] = $logoUrl; + + return $this; + } + + /** + * Gets nonprofitDescription + * + * @return string|null + */ + public function getNonprofitDescription() + { + return $this->container['nonprofitDescription']; + } + + /** + * Sets nonprofitDescription + * + * @param string|null $nonprofitDescription The description of the nonprofit. + * + * @return self + */ + public function setNonprofitDescription($nonprofitDescription) + { + $this->container['nonprofitDescription'] = $nonprofitDescription; + + return $this; + } + + /** + * Gets nonprofitName + * + * @return string|null + */ + public function getNonprofitName() + { + return $this->container['nonprofitName']; + } + + /** + * Sets nonprofitName + * + * @param string|null $nonprofitName The name of the nonprofit organization that receives the donation. + * + * @return self + */ + public function setNonprofitName($nonprofitName) + { + $this->container['nonprofitName'] = $nonprofitName; + + return $this; + } + + /** + * Gets nonprofitUrl + * + * @return string|null + */ + public function getNonprofitUrl() + { + return $this->container['nonprofitUrl']; + } + + /** + * Sets nonprofitUrl + * + * @param string|null $nonprofitUrl The website URL of the nonprofit. + * + * @return self + */ + public function setNonprofitUrl($nonprofitUrl) + { + $this->container['nonprofitUrl'] = $nonprofitUrl; + + return $this; + } + + /** + * Gets termsAndConditionsUrl + * + * @return string|null + */ + public function getTermsAndConditionsUrl() + { + return $this->container['termsAndConditionsUrl']; + } + + /** + * Sets termsAndConditionsUrl + * + * @param string|null $termsAndConditionsUrl The URL of the terms and conditions page of the nonprofit and the campaign. + * + * @return self + */ + public function setTermsAndConditionsUrl($termsAndConditionsUrl) + { + $this->container['termsAndConditionsUrl'] = $termsAndConditionsUrl; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/DonationCampaignsRequest.php b/src/Adyen/Model/Checkout/DonationCampaignsRequest.php new file mode 100644 index 000000000..e8a189b2b --- /dev/null +++ b/src/Adyen/Model/Checkout/DonationCampaignsRequest.php @@ -0,0 +1,475 @@ + + */ +class DonationCampaignsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DonationCampaignsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'locale' => 'string', + 'merchantAccount' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'locale' => null, + 'merchantAccount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'locale' => false, + 'merchantAccount' => 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 = [ + 'currency' => 'currency', + 'locale' => 'locale', + 'merchantAccount' => 'merchantAccount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'locale' => 'setLocale', + 'merchantAccount' => 'setMerchantAccount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'locale' => 'getLocale', + 'merchantAccount' => 'getMerchantAccount' + ]; + + /** + * 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('currency', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); + $this->setIfExists('merchantAccount', $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['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['merchantAccount'] === null) { + $invalidProperties[] = "'merchantAccount' 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 currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). + * + * @return self + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets locale + * + * @return string|null + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string|null $locale Locale on the shopper interaction device. + * + * @return self + */ + public function setLocale($locale) + { + $this->container['locale'] = $locale; + + return $this; + } + + /** + * Gets merchantAccount + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchantAccount']; + } + + /** + * Sets merchantAccount + * + * @param string $merchantAccount Your merchant account identifier. + * + * @return self + */ + public function setMerchantAccount($merchantAccount) + { + $this->container['merchantAccount'] = $merchantAccount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/DonationCampaignsResponse.php b/src/Adyen/Model/Checkout/DonationCampaignsResponse.php new file mode 100644 index 000000000..307fd2ed8 --- /dev/null +++ b/src/Adyen/Model/Checkout/DonationCampaignsResponse.php @@ -0,0 +1,407 @@ + + */ +class DonationCampaignsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DonationCampaignsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'donationCampaigns' => '\Adyen\Model\Checkout\DonationCampaign[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'donationCampaigns' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'donationCampaigns' => 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 = [ + 'donationCampaigns' => 'donationCampaigns' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'donationCampaigns' => 'setDonationCampaigns' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'donationCampaigns' => 'getDonationCampaigns' + ]; + + /** + * 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('donationCampaigns', $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 donationCampaigns + * + * @return \Adyen\Model\Checkout\DonationCampaign[]|null + */ + public function getDonationCampaigns() + { + return $this->container['donationCampaigns']; + } + + /** + * Sets donationCampaigns + * + * @param \Adyen\Model\Checkout\DonationCampaign[]|null $donationCampaigns List of active donation campaigns for your merchant account. + * + * @return self + */ + public function setDonationCampaigns($donationCampaigns) + { + $this->container['donationCampaigns'] = $donationCampaigns; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/DonationPaymentRequest.php b/src/Adyen/Model/Checkout/DonationPaymentRequest.php index 2e42f4822..e3735288c 100644 --- a/src/Adyen/Model/Checkout/DonationPaymentRequest.php +++ b/src/Adyen/Model/Checkout/DonationPaymentRequest.php @@ -60,6 +60,7 @@ class DonationPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerial 'deliveryAddress' => '\Adyen\Model\Checkout\DeliveryAddress', 'deviceFingerprint' => 'string', 'donationAccount' => 'string', + 'donationCampaignId' => 'string', 'donationOriginalPspReference' => 'string', 'donationToken' => 'string', 'lineItems' => '\Adyen\Model\Checkout\LineItem[]', @@ -111,6 +112,7 @@ class DonationPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerial 'deliveryAddress' => null, 'deviceFingerprint' => null, 'donationAccount' => null, + 'donationCampaignId' => null, 'donationOriginalPspReference' => null, 'donationToken' => null, 'lineItems' => null, @@ -160,6 +162,7 @@ class DonationPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerial 'deliveryAddress' => false, 'deviceFingerprint' => false, 'donationAccount' => false, + 'donationCampaignId' => false, 'donationOriginalPspReference' => false, 'donationToken' => false, 'lineItems' => false, @@ -289,6 +292,7 @@ public function isNullableSetToNull(string $property): bool 'deliveryAddress' => 'deliveryAddress', 'deviceFingerprint' => 'deviceFingerprint', 'donationAccount' => 'donationAccount', + 'donationCampaignId' => 'donationCampaignId', 'donationOriginalPspReference' => 'donationOriginalPspReference', 'donationToken' => 'donationToken', 'lineItems' => 'lineItems', @@ -338,6 +342,7 @@ public function isNullableSetToNull(string $property): bool 'deliveryAddress' => 'setDeliveryAddress', 'deviceFingerprint' => 'setDeviceFingerprint', 'donationAccount' => 'setDonationAccount', + 'donationCampaignId' => 'setDonationCampaignId', 'donationOriginalPspReference' => 'setDonationOriginalPspReference', 'donationToken' => 'setDonationToken', 'lineItems' => 'setLineItems', @@ -387,6 +392,7 @@ public function isNullableSetToNull(string $property): bool 'deliveryAddress' => 'getDeliveryAddress', 'deviceFingerprint' => 'getDeviceFingerprint', 'donationAccount' => 'getDonationAccount', + 'donationCampaignId' => 'getDonationCampaignId', 'donationOriginalPspReference' => 'getDonationOriginalPspReference', 'donationToken' => 'getDonationToken', 'lineItems' => 'getLineItems', @@ -537,6 +543,7 @@ public function __construct(array $data = null) $this->setIfExists('deliveryAddress', $data ?? [], null); $this->setIfExists('deviceFingerprint', $data ?? [], null); $this->setIfExists('donationAccount', $data ?? [], null); + $this->setIfExists('donationCampaignId', $data ?? [], null); $this->setIfExists('donationOriginalPspReference', $data ?? [], null); $this->setIfExists('donationToken', $data ?? [], null); $this->setIfExists('lineItems', $data ?? [], null); @@ -1044,6 +1051,30 @@ public function setDonationAccount($donationAccount) return $this; } + /** + * Gets donationCampaignId + * + * @return string|null + */ + public function getDonationCampaignId() + { + return $this->container['donationCampaignId']; + } + + /** + * Sets donationCampaignId + * + * @param string|null $donationCampaignId The donation campaign ID received in the `/donationCampaigns` call. + * + * @return self + */ + public function setDonationCampaignId($donationCampaignId) + { + $this->container['donationCampaignId'] = $donationCampaignId; + + return $this; + } + /** * Gets donationOriginalPspReference * diff --git a/src/Adyen/Model/Checkout/PaymentDetails.php b/src/Adyen/Model/Checkout/PaymentDetails.php index 9924f0da6..7c05dc23a 100644 --- a/src/Adyen/Model/Checkout/PaymentDetails.php +++ b/src/Adyen/Model/Checkout/PaymentDetails.php @@ -223,6 +223,7 @@ public function getModelName() public const TYPE_ALIPAY = 'alipay'; public const TYPE_MULTIBANCO = 'multibanco'; + public const TYPE_BANK_TRANSFER_IBAN = 'bankTransfer_IBAN'; public const TYPE_PAYBRIGHT = 'paybright'; public const TYPE_PAYNOW = 'paynow'; public const TYPE_AFFIRM = 'affirm'; @@ -321,6 +322,7 @@ public function getTypeAllowableValues() return [ self::TYPE_ALIPAY, self::TYPE_MULTIBANCO, + self::TYPE_BANK_TRANSFER_IBAN, self::TYPE_PAYBRIGHT, self::TYPE_PAYNOW, self::TYPE_AFFIRM, diff --git a/src/Adyen/Model/Checkout/SepaDirectDebitDetails.php b/src/Adyen/Model/Checkout/SepaDirectDebitDetails.php index d83454ddc..1cdab04d9 100644 --- a/src/Adyen/Model/Checkout/SepaDirectDebitDetails.php +++ b/src/Adyen/Model/Checkout/SepaDirectDebitDetails.php @@ -49,6 +49,7 @@ class SepaDirectDebitDetails implements ModelInterface, ArrayAccess, \JsonSerial 'ownerName' => 'string', 'recurringDetailReference' => 'string', 'storedPaymentMethodId' => 'string', + 'transferInstrumentId' => 'string', 'type' => 'string' ]; @@ -65,6 +66,7 @@ class SepaDirectDebitDetails implements ModelInterface, ArrayAccess, \JsonSerial 'ownerName' => null, 'recurringDetailReference' => null, 'storedPaymentMethodId' => null, + 'transferInstrumentId' => null, 'type' => null ]; @@ -79,6 +81,7 @@ class SepaDirectDebitDetails implements ModelInterface, ArrayAccess, \JsonSerial 'ownerName' => false, 'recurringDetailReference' => false, 'storedPaymentMethodId' => false, + 'transferInstrumentId' => false, 'type' => false ]; @@ -173,6 +176,7 @@ public function isNullableSetToNull(string $property): bool 'ownerName' => 'ownerName', 'recurringDetailReference' => 'recurringDetailReference', 'storedPaymentMethodId' => 'storedPaymentMethodId', + 'transferInstrumentId' => 'transferInstrumentId', 'type' => 'type' ]; @@ -187,6 +191,7 @@ public function isNullableSetToNull(string $property): bool 'ownerName' => 'setOwnerName', 'recurringDetailReference' => 'setRecurringDetailReference', 'storedPaymentMethodId' => 'setStoredPaymentMethodId', + 'transferInstrumentId' => 'setTransferInstrumentId', 'type' => 'setType' ]; @@ -201,6 +206,7 @@ public function isNullableSetToNull(string $property): bool 'ownerName' => 'getOwnerName', 'recurringDetailReference' => 'getRecurringDetailReference', 'storedPaymentMethodId' => 'getStoredPaymentMethodId', + 'transferInstrumentId' => 'getTransferInstrumentId', 'type' => 'getType' ]; @@ -280,6 +286,7 @@ public function __construct(array $data = null) $this->setIfExists('ownerName', $data ?? [], null); $this->setIfExists('recurringDetailReference', $data ?? [], null); $this->setIfExists('storedPaymentMethodId', $data ?? [], null); + $this->setIfExists('transferInstrumentId', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -462,6 +469,30 @@ public function setStoredPaymentMethodId($storedPaymentMethodId) return $this; } + /** + * Gets transferInstrumentId + * + * @return string|null + */ + public function getTransferInstrumentId() + { + return $this->container['transferInstrumentId']; + } + + /** + * Sets transferInstrumentId + * + * @param string|null $transferInstrumentId The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. + * + * @return self + */ + public function setTransferInstrumentId($transferInstrumentId) + { + $this->container['transferInstrumentId'] = $transferInstrumentId; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/Checkout/Split.php b/src/Adyen/Model/Checkout/Split.php index 0c6af777f..9459a92dc 100644 --- a/src/Adyen/Model/Checkout/Split.php +++ b/src/Adyen/Model/Checkout/Split.php @@ -465,7 +465,7 @@ public function getType() /** * Sets type * - * @param string $type The part of the payment you want to book to the specified `account`. Possible values for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books part of the payment (specified in `amount`) to the specified `account`. * Transaction fees types that you can book to the specified `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the transaction fees due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the transaction fees due to Adyen under [Interchange ++ pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the fees paid to the card scheme for using their network. * **Remainder**: the amount left over after a currency conversion, booked to the specified `account`. * **VAT**: the value-added tax charged on the payment, booked to your platforms liable balance account. * **Commission**: your platform's commission (specified in `amount`) on the payment, booked to your liable balance account. * **Default**: in very specific use cases, allows you to book the specified `amount` to the specified `account`. For more information, contact Adyen support. Possible values for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, **Marketplace**, **PaymentFee**, **VAT**. + * @param string $type The part of the payment you want to book to the specified `account`. Possible values for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books part of the payment (specified in `amount`) to the specified `account`. * Transaction fees types that you can book to the specified `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the transaction fees due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the transaction fees due to Adyen under [Interchange ++ pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: your platform's commission on the payment (specified in `amount`), booked to your liable balance account. * **Remainder**: the amount left over after a currency conversion, booked to the specified `account`. * **TopUp**: allows you and your users to top up balance accounts using direct debit, card payments, or other payment methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms liable balance account. * **Commission**: your platform's commission (specified in `amount`) on the payment, booked to your liable balance account. * **Default**: in very specific use cases, allows you to book the specified `amount` to the specified `account`. For more information, contact Adyen support. Possible values for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, **Marketplace**, **PaymentFee**, **VAT**. * * @return self */ diff --git a/src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php b/src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php index 4f6f8aa92..bd930be5d 100644 --- a/src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php +++ b/src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php @@ -236,7 +236,6 @@ public function getModelName() public const TYPE_BCMC_MOBILE = 'bcmc_mobile'; public const TYPE_BCMC_MOBILE_QR = 'bcmc_mobile_QR'; public const TYPE_BCMC_MOBILE_APP = 'bcmc_mobile_app'; - public const TYPE_BANK_TRANSFER_IBAN = 'bankTransfer_IBAN'; public const TYPE_MOMO_WALLET = 'momo_wallet'; public const TYPE_MOMO_WALLET_APP = 'momo_wallet_app'; public const TYPE_TWINT = 'twint'; @@ -264,7 +263,6 @@ public function getTypeAllowableValues() self::TYPE_BCMC_MOBILE, self::TYPE_BCMC_MOBILE_QR, self::TYPE_BCMC_MOBILE_APP, - self::TYPE_BANK_TRANSFER_IBAN, self::TYPE_MOMO_WALLET, self::TYPE_MOMO_WALLET_APP, self::TYPE_TWINT, diff --git a/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.php b/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.php index 63b3cc739..ab08d6a90 100644 --- a/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.php +++ b/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.php @@ -368,7 +368,7 @@ public function getTermsOfServiceDocumentFormat() /** * Sets termsOfServiceDocumentFormat * - * @param string|null $termsOfServiceDocumentFormat The requested format for the Terms of Service document. Default value: JSON. + * @param string|null $termsOfServiceDocumentFormat The requested format for the Terms of Service document. Default value: JSON. Possible values: JSON or PDF. * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/Organization.php b/src/Adyen/Model/LegalEntityManagement/Organization.php index a144c2080..8d7b95902 100644 --- a/src/Adyen/Model/LegalEntityManagement/Organization.php +++ b/src/Adyen/Model/LegalEntityManagement/Organization.php @@ -44,6 +44,7 @@ class Organization implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'countryOfGoverningLaw' => 'string', 'dateOfIncorporation' => 'string', 'description' => 'string', 'doingBusinessAs' => 'string', @@ -70,6 +71,7 @@ class Organization implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'countryOfGoverningLaw' => null, 'dateOfIncorporation' => null, 'description' => null, 'doingBusinessAs' => null, @@ -94,6 +96,7 @@ class Organization implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ + 'countryOfGoverningLaw' => false, 'dateOfIncorporation' => false, 'description' => false, 'doingBusinessAs' => false, @@ -198,6 +201,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'countryOfGoverningLaw' => 'countryOfGoverningLaw', 'dateOfIncorporation' => 'dateOfIncorporation', 'description' => 'description', 'doingBusinessAs' => 'doingBusinessAs', @@ -222,6 +226,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'countryOfGoverningLaw' => 'setCountryOfGoverningLaw', 'dateOfIncorporation' => 'setDateOfIncorporation', 'description' => 'setDescription', 'doingBusinessAs' => 'setDoingBusinessAs', @@ -246,6 +251,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'countryOfGoverningLaw' => 'getCountryOfGoverningLaw', 'dateOfIncorporation' => 'getDateOfIncorporation', 'description' => 'getDescription', 'doingBusinessAs' => 'getDoingBusinessAs', @@ -357,6 +363,7 @@ public function getVatAbsenceReasonAllowableValues() */ public function __construct(array $data = null) { + $this->setIfExists('countryOfGoverningLaw', $data ?? [], null); $this->setIfExists('dateOfIncorporation', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); $this->setIfExists('doingBusinessAs', $data ?? [], null); @@ -441,6 +448,30 @@ public function valid() } + /** + * Gets countryOfGoverningLaw + * + * @return string|null + */ + public function getCountryOfGoverningLaw() + { + return $this->container['countryOfGoverningLaw']; + } + + /** + * Sets countryOfGoverningLaw + * + * @param string|null $countryOfGoverningLaw The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the governing country. + * + * @return self + */ + public function setCountryOfGoverningLaw($countryOfGoverningLaw) + { + $this->container['countryOfGoverningLaw'] = $countryOfGoverningLaw; + + return $this; + } + /** * Gets dateOfIncorporation * diff --git a/src/Adyen/Model/LegalEntityManagement/TaxInformation.php b/src/Adyen/Model/LegalEntityManagement/TaxInformation.php index 9225bb9f2..346e17a73 100644 --- a/src/Adyen/Model/LegalEntityManagement/TaxInformation.php +++ b/src/Adyen/Model/LegalEntityManagement/TaxInformation.php @@ -351,7 +351,7 @@ public function getType() /** * Sets type * - * @param string|null $type The TIN type depending on the country where it was issued. Provide only for countries that have multiple tax IDs, such as Sweden, the UK, or the US. For example, provide **SSN**, **EIN**, or **ITIN** for the US. + * @param string|null $type The TIN type depending on the country where it was issued. Only provide if the country has multiple tax IDs: Singapore, Sweden, the UK, or the US. For example, provide **SSN**, **EIN**, or **ITIN** for the US. * * @return self */ diff --git a/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php b/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php index 9ce9938b8..41f2511af 100644 --- a/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php +++ b/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php @@ -862,7 +862,7 @@ public function getType() /** * Sets type * - * @param string $type The type of webhook that is being created. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **ach-notification-of-change-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **rreq-notification** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). + * @param string $type The type of webhook that is being created. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **ach-notification-of-change-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **rreq-notification** - **terminal-settings** - **terminal-boarding** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). * * @return self */ diff --git a/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php b/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php index d3a57948b..4872fca09 100644 --- a/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php +++ b/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php @@ -759,7 +759,7 @@ public function getType() /** * Sets type * - * @param string $type The type of webhook that is being created. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **ach-notification-of-change-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **rreq-notification** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). + * @param string $type The type of webhook that is being created. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **ach-notification-of-change-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **rreq-notification** - **terminal-settings** - **terminal-boarding** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). * * @return self */ diff --git a/src/Adyen/Model/Management/PaymentMethod.php b/src/Adyen/Model/Management/PaymentMethod.php index 8048f8730..3569f8867 100644 --- a/src/Adyen/Model/Management/PaymentMethod.php +++ b/src/Adyen/Model/Management/PaymentMethod.php @@ -77,6 +77,7 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'sofort' => '\Adyen\Model\Management\SofortInfo', 'storeIds' => 'string[]', 'swish' => '\Adyen\Model\Management\SwishInfo', + 'ticket' => '\Adyen\Model\Management\TicketInfo', 'twint' => '\Adyen\Model\Management\TwintInfo', 'type' => 'string', 'verificationStatus' => 'string', @@ -127,6 +128,7 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'sofort' => null, 'storeIds' => null, 'swish' => null, + 'ticket' => null, 'twint' => null, 'type' => null, 'verificationStatus' => null, @@ -175,6 +177,7 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'sofort' => false, 'storeIds' => false, 'swish' => false, + 'ticket' => false, 'twint' => false, 'type' => false, 'verificationStatus' => false, @@ -303,6 +306,7 @@ public function isNullableSetToNull(string $property): bool 'sofort' => 'sofort', 'storeIds' => 'storeIds', 'swish' => 'swish', + 'ticket' => 'ticket', 'twint' => 'twint', 'type' => 'type', 'verificationStatus' => 'verificationStatus', @@ -351,6 +355,7 @@ public function isNullableSetToNull(string $property): bool 'sofort' => 'setSofort', 'storeIds' => 'setStoreIds', 'swish' => 'setSwish', + 'ticket' => 'setTicket', 'twint' => 'setTwint', 'type' => 'setType', 'verificationStatus' => 'setVerificationStatus', @@ -399,6 +404,7 @@ public function isNullableSetToNull(string $property): bool 'sofort' => 'getSofort', 'storeIds' => 'getStoreIds', 'swish' => 'getSwish', + 'ticket' => 'getTicket', 'twint' => 'getTwint', 'type' => 'getType', 'verificationStatus' => 'getVerificationStatus', @@ -516,6 +522,7 @@ public function __construct(array $data = null) $this->setIfExists('sofort', $data ?? [], null); $this->setIfExists('storeIds', $data ?? [], null); $this->setIfExists('swish', $data ?? [], null); + $this->setIfExists('ticket', $data ?? [], null); $this->setIfExists('twint', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('verificationStatus', $data ?? [], null); @@ -1371,6 +1378,30 @@ public function setSwish($swish) return $this; } + /** + * Gets ticket + * + * @return \Adyen\Model\Management\TicketInfo|null + */ + public function getTicket() + { + return $this->container['ticket']; + } + + /** + * Sets ticket + * + * @param \Adyen\Model\Management\TicketInfo|null $ticket ticket + * + * @return self + */ + public function setTicket($ticket) + { + $this->container['ticket'] = $ticket; + + return $this; + } + /** * Gets twint * diff --git a/src/Adyen/Model/Management/PaymentMethodResponse.php b/src/Adyen/Model/Management/PaymentMethodResponse.php index f8d3b19b4..0ed843066 100644 --- a/src/Adyen/Model/Management/PaymentMethodResponse.php +++ b/src/Adyen/Model/Management/PaymentMethodResponse.php @@ -277,9 +277,12 @@ public function getModelName() public const TYPES_WITH_ERRORS_MULTIBANCO = 'multibanco'; public const TYPES_WITH_ERRORS_ONLINE_BANKING_PL = 'onlineBanking_PL'; public const TYPES_WITH_ERRORS_PAYBYBANK = 'paybybank'; + public const TYPES_WITH_ERRORS_PAYNOW = 'paynow'; + public const TYPES_WITH_ERRORS_PAYNOW_POS = 'paynow_pos'; public const TYPES_WITH_ERRORS_PAYPAL = 'paypal'; public const TYPES_WITH_ERRORS_PAYSHOP = 'payshop'; public const TYPES_WITH_ERRORS_SWISH = 'swish'; + public const TYPES_WITH_ERRORS_TICKET = 'ticket'; public const TYPES_WITH_ERRORS_TRUSTLY = 'trustly'; public const TYPES_WITH_ERRORS_TWINT = 'twint'; public const TYPES_WITH_ERRORS_TWINT_POS = 'twint_pos'; @@ -336,9 +339,12 @@ public function getTypesWithErrorsAllowableValues() self::TYPES_WITH_ERRORS_MULTIBANCO, self::TYPES_WITH_ERRORS_ONLINE_BANKING_PL, self::TYPES_WITH_ERRORS_PAYBYBANK, + self::TYPES_WITH_ERRORS_PAYNOW, + self::TYPES_WITH_ERRORS_PAYNOW_POS, self::TYPES_WITH_ERRORS_PAYPAL, self::TYPES_WITH_ERRORS_PAYSHOP, self::TYPES_WITH_ERRORS_SWISH, + self::TYPES_WITH_ERRORS_TICKET, self::TYPES_WITH_ERRORS_TRUSTLY, self::TYPES_WITH_ERRORS_TWINT, self::TYPES_WITH_ERRORS_TWINT_POS, diff --git a/src/Adyen/Model/Management/PaymentMethodSetupInfo.php b/src/Adyen/Model/Management/PaymentMethodSetupInfo.php index 81e01a046..84dfcb5a1 100644 --- a/src/Adyen/Model/Management/PaymentMethodSetupInfo.php +++ b/src/Adyen/Model/Management/PaymentMethodSetupInfo.php @@ -74,6 +74,7 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'sofort' => '\Adyen\Model\Management\SofortInfo', 'storeIds' => 'string[]', 'swish' => '\Adyen\Model\Management\SwishInfo', + 'ticket' => '\Adyen\Model\Management\TicketInfo', 'twint' => '\Adyen\Model\Management\TwintInfo', 'type' => 'string', 'vipps' => '\Adyen\Model\Management\VippsInfo', @@ -120,6 +121,7 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'sofort' => null, 'storeIds' => null, 'swish' => null, + 'ticket' => null, 'twint' => null, 'type' => null, 'vipps' => null, @@ -164,6 +166,7 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'sofort' => false, 'storeIds' => false, 'swish' => false, + 'ticket' => false, 'twint' => false, 'type' => false, 'vipps' => false, @@ -288,6 +291,7 @@ public function isNullableSetToNull(string $property): bool 'sofort' => 'sofort', 'storeIds' => 'storeIds', 'swish' => 'swish', + 'ticket' => 'ticket', 'twint' => 'twint', 'type' => 'type', 'vipps' => 'vipps', @@ -332,6 +336,7 @@ public function isNullableSetToNull(string $property): bool 'sofort' => 'setSofort', 'storeIds' => 'setStoreIds', 'swish' => 'setSwish', + 'ticket' => 'setTicket', 'twint' => 'setTwint', 'type' => 'setType', 'vipps' => 'setVipps', @@ -376,6 +381,7 @@ public function isNullableSetToNull(string $property): bool 'sofort' => 'getSofort', 'storeIds' => 'getStoreIds', 'swish' => 'getSwish', + 'ticket' => 'getTicket', 'twint' => 'getTwint', 'type' => 'getType', 'vipps' => 'getVipps', @@ -467,9 +473,12 @@ public function getModelName() public const TYPE_MULTIBANCO = 'multibanco'; public const TYPE_ONLINE_BANKING_PL = 'onlineBanking_PL'; public const TYPE_PAYBYBANK = 'paybybank'; + public const TYPE_PAYNOW = 'paynow'; + public const TYPE_PAYNOW_POS = 'paynow_pos'; public const TYPE_PAYPAL = 'paypal'; public const TYPE_PAYSHOP = 'payshop'; public const TYPE_SWISH = 'swish'; + public const TYPE_TICKET = 'ticket'; public const TYPE_TRUSTLY = 'trustly'; public const TYPE_TWINT = 'twint'; public const TYPE_TWINT_POS = 'twint_pos'; @@ -540,9 +549,12 @@ public function getTypeAllowableValues() self::TYPE_MULTIBANCO, self::TYPE_ONLINE_BANKING_PL, self::TYPE_PAYBYBANK, + self::TYPE_PAYNOW, + self::TYPE_PAYNOW_POS, self::TYPE_PAYPAL, self::TYPE_PAYSHOP, self::TYPE_SWISH, + self::TYPE_TICKET, self::TYPE_TRUSTLY, self::TYPE_TWINT, self::TYPE_TWINT_POS, @@ -599,6 +611,7 @@ public function __construct(array $data = null) $this->setIfExists('sofort', $data ?? [], null); $this->setIfExists('storeIds', $data ?? [], null); $this->setIfExists('swish', $data ?? [], null); + $this->setIfExists('ticket', $data ?? [], null); $this->setIfExists('twint', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('vipps', $data ?? [], null); @@ -1400,6 +1413,30 @@ public function setSwish($swish) return $this; } + /** + * Gets ticket + * + * @return \Adyen\Model\Management\TicketInfo|null + */ + public function getTicket() + { + return $this->container['ticket']; + } + + /** + * Sets ticket + * + * @param \Adyen\Model\Management\TicketInfo|null $ticket ticket + * + * @return self + */ + public function setTicket($ticket) + { + $this->container['ticket'] = $ticket; + + return $this; + } + /** * Gets twint * diff --git a/src/Adyen/Model/Management/TicketInfo.php b/src/Adyen/Model/Management/TicketInfo.php new file mode 100644 index 000000000..d92458ac4 --- /dev/null +++ b/src/Adyen/Model/Management/TicketInfo.php @@ -0,0 +1,407 @@ + + */ +class TicketInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TicketInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'requestorId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'requestorId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'requestorId' => 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 = [ + 'requestorId' => 'requestorId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requestorId' => 'setRequestorId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requestorId' => 'getRequestorId' + ]; + + /** + * 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('requestorId', $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 requestorId + * + * @return string|null + */ + public function getRequestorId() + { + return $this->container['requestorId']; + } + + /** + * Sets requestorId + * + * @param string|null $requestorId Ticket requestorId + * + * @return self + */ + public function setRequestorId($requestorId) + { + $this->container['requestorId'] = $requestorId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Webhook.php b/src/Adyen/Model/Management/Webhook.php index 0fc4e71e1..578cde7b4 100644 --- a/src/Adyen/Model/Management/Webhook.php +++ b/src/Adyen/Model/Management/Webhook.php @@ -1042,7 +1042,7 @@ public function getType() /** * Sets type * - * @param string $type The type of webhook. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **ach-notification-of-change-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **terminal-api-notification** - **terminal-settings** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). + * @param string $type The type of webhook. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **ach-notification-of-change-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **terminal-api-notification** - **terminal-settings** - **terminal-boarding** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). * * @return self */ diff --git a/src/Adyen/Model/ManagementWebhooks/TerminalBoardingData.php b/src/Adyen/Model/ManagementWebhooks/TerminalBoardingData.php new file mode 100644 index 000000000..d7d855fe1 --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/TerminalBoardingData.php @@ -0,0 +1,506 @@ + + */ +class TerminalBoardingData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TerminalBoardingData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'companyId' => 'string', + 'merchantId' => 'string', + 'storeId' => 'string', + 'uniqueTerminalId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'companyId' => null, + 'merchantId' => null, + 'storeId' => null, + 'uniqueTerminalId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'companyId' => false, + 'merchantId' => false, + 'storeId' => false, + 'uniqueTerminalId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'companyId' => 'companyId', + 'merchantId' => 'merchantId', + 'storeId' => 'storeId', + 'uniqueTerminalId' => 'uniqueTerminalId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'companyId' => 'setCompanyId', + 'merchantId' => 'setMerchantId', + 'storeId' => 'setStoreId', + 'uniqueTerminalId' => 'setUniqueTerminalId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'companyId' => 'getCompanyId', + 'merchantId' => 'getMerchantId', + 'storeId' => 'getStoreId', + 'uniqueTerminalId' => 'getUniqueTerminalId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('companyId', $data ?? [], null); + $this->setIfExists('merchantId', $data ?? [], null); + $this->setIfExists('storeId', $data ?? [], null); + $this->setIfExists('uniqueTerminalId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['companyId'] === null) { + $invalidProperties[] = "'companyId' can't be null"; + } + if ($this->container['uniqueTerminalId'] === null) { + $invalidProperties[] = "'uniqueTerminalId' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets companyId + * + * @return string + */ + public function getCompanyId() + { + return $this->container['companyId']; + } + + /** + * Sets companyId + * + * @param string $companyId The unique identifier of the company account. + * + * @return self + */ + public function setCompanyId($companyId) + { + $this->container['companyId'] = $companyId; + + return $this; + } + + /** + * Gets merchantId + * + * @return string|null + */ + public function getMerchantId() + { + return $this->container['merchantId']; + } + + /** + * Sets merchantId + * + * @param string|null $merchantId The unique identifier of the merchant account. + * + * @return self + */ + public function setMerchantId($merchantId) + { + $this->container['merchantId'] = $merchantId; + + return $this; + } + + /** + * Gets storeId + * + * @return string|null + */ + public function getStoreId() + { + return $this->container['storeId']; + } + + /** + * Sets storeId + * + * @param string|null $storeId The unique identifier of the store. + * + * @return self + */ + public function setStoreId($storeId) + { + $this->container['storeId'] = $storeId; + + return $this; + } + + /** + * Gets uniqueTerminalId + * + * @return string + */ + public function getUniqueTerminalId() + { + return $this->container['uniqueTerminalId']; + } + + /** + * Sets uniqueTerminalId + * + * @param string $uniqueTerminalId The unique identifier of the terminal. + * + * @return self + */ + public function setUniqueTerminalId($uniqueTerminalId) + { + $this->container['uniqueTerminalId'] = $uniqueTerminalId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.php b/src/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.php new file mode 100644 index 000000000..485f981f9 --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.php @@ -0,0 +1,543 @@ + + */ +class TerminalBoardingNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TerminalBoardingNotificationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'createdAt' => '\DateTime', + 'data' => '\Adyen\Model\ManagementWebhooks\TerminalBoardingData', + 'environment' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'createdAt' => 'date-time', + 'data' => null, + 'environment' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'createdAt' => false, + 'data' => false, + 'environment' => 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 = [ + 'createdAt' => 'createdAt', + 'data' => 'data', + 'environment' => 'environment', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'createdAt' => 'setCreatedAt', + 'data' => 'setData', + 'environment' => 'setEnvironment', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'createdAt' => 'getCreatedAt', + 'data' => 'getData', + 'environment' => 'getEnvironment', + '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_TERMINAL_BOARDING_TRIGGERED = 'terminalBoarding.triggered'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_TERMINAL_BOARDING_TRIGGERED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('createdAt', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['environment'] === null) { + $invalidProperties[] = "'environment' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Timestamp for when the webhook was created. + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets data + * + * @return \Adyen\Model\ManagementWebhooks\TerminalBoardingData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\ManagementWebhooks\TerminalBoardingData $data data + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets environment + * + * @return string + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param string $environment The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @return self + */ + public function setEnvironment($environment) + { + $this->container['environment'] = $environment; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of notification. + * + * @return self + */ + public function setType($type) + { + $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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.php b/src/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.php new file mode 100644 index 000000000..2f441e39c --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.php @@ -0,0 +1,407 @@ + + */ +class TerminalBoardingNotificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TerminalBoardingNotificationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'notificationResponse' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'notificationResponse' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'notificationResponse' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'notificationResponse' => 'notificationResponse' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'notificationResponse' => 'setNotificationResponse' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'notificationResponse' => 'getNotificationResponse' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('notificationResponse', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets notificationResponse + * + * @return string|null + */ + public function getNotificationResponse() + { + return $this->container['notificationResponse']; + } + + /** + * Sets notificationResponse + * + * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * + * @return self + */ + public function setNotificationResponse($notificationResponse) + { + $this->container['notificationResponse'] = $notificationResponse; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/Card.php b/src/Adyen/Model/TransferWebhooks/Card.php new file mode 100644 index 000000000..fde4d646c --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/Card.php @@ -0,0 +1,444 @@ + + */ +class Card implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Card'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cardHolder' => '\Adyen\Model\TransferWebhooks\PartyIdentification', + 'cardIdentification' => '\Adyen\Model\TransferWebhooks\CardIdentification' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cardHolder' => null, + 'cardIdentification' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'cardHolder' => false, + 'cardIdentification' => 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 = [ + 'cardHolder' => 'cardHolder', + 'cardIdentification' => 'cardIdentification' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cardHolder' => 'setCardHolder', + 'cardIdentification' => 'setCardIdentification' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cardHolder' => 'getCardHolder', + 'cardIdentification' => 'getCardIdentification' + ]; + + /** + * 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('cardHolder', $data ?? [], null); + $this->setIfExists('cardIdentification', $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['cardHolder'] === null) { + $invalidProperties[] = "'cardHolder' can't be null"; + } + if ($this->container['cardIdentification'] === null) { + $invalidProperties[] = "'cardIdentification' 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 cardHolder + * + * @return \Adyen\Model\TransferWebhooks\PartyIdentification + */ + public function getCardHolder() + { + return $this->container['cardHolder']; + } + + /** + * Sets cardHolder + * + * @param \Adyen\Model\TransferWebhooks\PartyIdentification $cardHolder cardHolder + * + * @return self + */ + public function setCardHolder($cardHolder) + { + $this->container['cardHolder'] = $cardHolder; + + return $this; + } + + /** + * Gets cardIdentification + * + * @return \Adyen\Model\TransferWebhooks\CardIdentification + */ + public function getCardIdentification() + { + return $this->container['cardIdentification']; + } + + /** + * Sets cardIdentification + * + * @param \Adyen\Model\TransferWebhooks\CardIdentification $cardIdentification cardIdentification + * + * @return self + */ + public function setCardIdentification($cardIdentification) + { + $this->container['cardIdentification'] = $cardIdentification; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/CardIdentification.php b/src/Adyen/Model/TransferWebhooks/CardIdentification.php new file mode 100644 index 000000000..a0e84e354 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/CardIdentification.php @@ -0,0 +1,593 @@ + + */ +class CardIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CardIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'expiryMonth' => 'string', + 'expiryYear' => 'string', + 'issueNumber' => 'string', + 'number' => 'string', + 'startMonth' => 'string', + 'startYear' => 'string', + 'storedPaymentMethodId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'expiryMonth' => null, + 'expiryYear' => null, + 'issueNumber' => null, + 'number' => null, + 'startMonth' => null, + 'startYear' => null, + 'storedPaymentMethodId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'expiryMonth' => false, + 'expiryYear' => false, + 'issueNumber' => false, + 'number' => false, + 'startMonth' => false, + 'startYear' => false, + 'storedPaymentMethodId' => 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 = [ + 'expiryMonth' => 'expiryMonth', + 'expiryYear' => 'expiryYear', + 'issueNumber' => 'issueNumber', + 'number' => 'number', + 'startMonth' => 'startMonth', + 'startYear' => 'startYear', + 'storedPaymentMethodId' => 'storedPaymentMethodId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'expiryMonth' => 'setExpiryMonth', + 'expiryYear' => 'setExpiryYear', + 'issueNumber' => 'setIssueNumber', + 'number' => 'setNumber', + 'startMonth' => 'setStartMonth', + 'startYear' => 'setStartYear', + 'storedPaymentMethodId' => 'setStoredPaymentMethodId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'expiryMonth' => 'getExpiryMonth', + 'expiryYear' => 'getExpiryYear', + 'issueNumber' => 'getIssueNumber', + 'number' => 'getNumber', + 'startMonth' => 'getStartMonth', + 'startYear' => 'getStartYear', + 'storedPaymentMethodId' => 'getStoredPaymentMethodId' + ]; + + /** + * 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('expiryMonth', $data ?? [], null); + $this->setIfExists('expiryYear', $data ?? [], null); + $this->setIfExists('issueNumber', $data ?? [], null); + $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('startMonth', $data ?? [], null); + $this->setIfExists('startYear', $data ?? [], null); + $this->setIfExists('storedPaymentMethodId', $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 expiryMonth + * + * @return string|null + */ + public function getExpiryMonth() + { + return $this->container['expiryMonth']; + } + + /** + * Sets expiryMonth + * + * @param string|null $expiryMonth The expiry month of the card. Format: two digits. Add a leading zero for single-digit months. For example: * 03 = March * 11 = November + * + * @return self + */ + public function setExpiryMonth($expiryMonth) + { + $this->container['expiryMonth'] = $expiryMonth; + + return $this; + } + + /** + * Gets expiryYear + * + * @return string|null + */ + public function getExpiryYear() + { + return $this->container['expiryYear']; + } + + /** + * Sets expiryYear + * + * @param string|null $expiryYear The expiry year of the card. Format: four digits. For example: 2020 + * + * @return self + */ + public function setExpiryYear($expiryYear) + { + $this->container['expiryYear'] = $expiryYear; + + return $this; + } + + /** + * Gets issueNumber + * + * @return string|null + */ + public function getIssueNumber() + { + return $this->container['issueNumber']; + } + + /** + * Sets issueNumber + * + * @param string|null $issueNumber The issue number of the card. Applies only to some UK debit cards. + * + * @return self + */ + public function setIssueNumber($issueNumber) + { + $this->container['issueNumber'] = $issueNumber; + + return $this; + } + + /** + * Gets number + * + * @return string|null + */ + public function getNumber() + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string|null $number The card number without any separators. For security, the response only includes the last four digits of the card number. + * + * @return self + */ + public function setNumber($number) + { + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets startMonth + * + * @return string|null + */ + public function getStartMonth() + { + return $this->container['startMonth']; + } + + /** + * Sets startMonth + * + * @param string|null $startMonth The month when the card was issued. Applies only to some UK debit cards. Format: two digits. Add a leading zero for single-digit months. For example: * 03 = March * 11 = November + * + * @return self + */ + public function setStartMonth($startMonth) + { + $this->container['startMonth'] = $startMonth; + + return $this; + } + + /** + * Gets startYear + * + * @return string|null + */ + public function getStartYear() + { + return $this->container['startYear']; + } + + /** + * Sets startYear + * + * @param string|null $startYear The year when the card was issued. Applies only to some UK debit cards. Format: four digits. For example: 2020 + * + * @return self + */ + public function setStartYear($startYear) + { + $this->container['startYear'] = $startYear; + + return $this; + } + + /** + * Gets storedPaymentMethodId + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['storedPaymentMethodId']; + } + + /** + * Sets storedPaymentMethodId + * + * @param string|null $storedPaymentMethodId The unique [token](/payouts/payout-service/pay-out-to-cards/manage-card-information#save-card-details) created to identify the counterparty. + * + * @return self + */ + public function setStoredPaymentMethodId($storedPaymentMethodId) + { + $this->container['storedPaymentMethodId'] = $storedPaymentMethodId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/CounterpartyV3.php b/src/Adyen/Model/TransferWebhooks/CounterpartyV3.php index 91885776f..0d8c54577 100644 --- a/src/Adyen/Model/TransferWebhooks/CounterpartyV3.php +++ b/src/Adyen/Model/TransferWebhooks/CounterpartyV3.php @@ -46,6 +46,7 @@ class CounterpartyV3 implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'balanceAccountId' => 'string', 'bankAccount' => '\Adyen\Model\TransferWebhooks\BankAccountV3', + 'card' => '\Adyen\Model\TransferWebhooks\Card', 'merchant' => '\Adyen\Model\TransferWebhooks\MerchantData', 'transferInstrumentId' => 'string' ]; @@ -60,6 +61,7 @@ class CounterpartyV3 implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'balanceAccountId' => null, 'bankAccount' => null, + 'card' => null, 'merchant' => null, 'transferInstrumentId' => null ]; @@ -72,6 +74,7 @@ class CounterpartyV3 implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPINullables = [ 'balanceAccountId' => false, 'bankAccount' => false, + 'card' => false, 'merchant' => false, 'transferInstrumentId' => false ]; @@ -164,6 +167,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'balanceAccountId' => 'balanceAccountId', 'bankAccount' => 'bankAccount', + 'card' => 'card', 'merchant' => 'merchant', 'transferInstrumentId' => 'transferInstrumentId' ]; @@ -176,6 +180,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'balanceAccountId' => 'setBalanceAccountId', 'bankAccount' => 'setBankAccount', + 'card' => 'setCard', 'merchant' => 'setMerchant', 'transferInstrumentId' => 'setTransferInstrumentId' ]; @@ -188,6 +193,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'balanceAccountId' => 'getBalanceAccountId', 'bankAccount' => 'getBankAccount', + 'card' => 'getCard', 'merchant' => 'getMerchant', 'transferInstrumentId' => 'getTransferInstrumentId' ]; @@ -251,6 +257,7 @@ public function __construct(array $data = null) { $this->setIfExists('balanceAccountId', $data ?? [], null); $this->setIfExists('bankAccount', $data ?? [], null); + $this->setIfExists('card', $data ?? [], null); $this->setIfExists('merchant', $data ?? [], null); $this->setIfExists('transferInstrumentId', $data ?? [], null); } @@ -310,7 +317,7 @@ public function getBalanceAccountId() /** * Sets balanceAccountId * - * @param string|null $balanceAccountId The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). + * @param string|null $balanceAccountId The unique identifier of the counterparty [balance account](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id). * * @return self */ @@ -345,6 +352,30 @@ public function setBankAccount($bankAccount) return $this; } + /** + * Gets card + * + * @return \Adyen\Model\TransferWebhooks\Card|null + */ + public function getCard() + { + return $this->container['card']; + } + + /** + * Sets card + * + * @param \Adyen\Model\TransferWebhooks\Card|null $card card + * + * @return self + */ + public function setCard($card) + { + $this->container['card'] = $card; + + return $this; + } + /** * Gets merchant * @@ -382,7 +413,7 @@ public function getTransferInstrumentId() /** * Sets transferInstrumentId * - * @param string|null $transferInstrumentId The unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * @param string|null $transferInstrumentId The unique identifier of the counterparty [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id). * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/PartyIdentification.php b/src/Adyen/Model/TransferWebhooks/PartyIdentification.php index b7713d785..a4105dac5 100644 --- a/src/Adyen/Model/TransferWebhooks/PartyIdentification.php +++ b/src/Adyen/Model/TransferWebhooks/PartyIdentification.php @@ -319,9 +319,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['fullName'] === null) { - $invalidProperties[] = "'fullName' can't be null"; - } $allowedValues = $this->getTypeAllowableValues(); if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -383,7 +380,7 @@ public function getDateOfBirth() /** * Sets dateOfBirth * - * @param \DateTime|null $dateOfBirth The date of birth of the individual in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. For example, **YYYY-MM-DD**. Should not be before January 1, 1900. Allowed only when `type` is **individual**. + * @param \DateTime|null $dateOfBirth The date of birth of the individual in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. For example, **YYYY-MM-DD**. Allowed only when `type` is **individual**. * * @return self */ @@ -407,7 +404,7 @@ public function getFirstName() /** * Sets firstName * - * @param string|null $firstName First name of the individual. Allowed only when `type` is **individual**. Supported characters: [a-z] [A-Z] - . / — and Space. + * @param string|null $firstName The first name of the individual. Supported characters: [a-z] [A-Z] - . / — and space. This parameter is: - Allowed only when `type` is **individual**. - Required when `category` is **card**. * * @return self */ @@ -421,7 +418,7 @@ public function setFirstName($firstName) /** * Gets fullName * - * @return string + * @return string|null */ public function getFullName() { @@ -431,7 +428,7 @@ public function getFullName() /** * Sets fullName * - * @param string $fullName The name of the entity. Supported characters: [a-z] [A-Z] [0-9] , . ; : - — / \\ + & ! ? @ ( ) \" ' and Space. + * @param string|null $fullName The full name of the entity that owns the bank account or card. Supported characters: [a-z] [A-Z] [0-9] , . ; : - — / \\ + & ! ? @ ( ) \" ' and space. Required when `category` is **bank**. * * @return self */ @@ -455,7 +452,7 @@ public function getLastName() /** * Sets lastName * - * @param string|null $lastName Last name of the individual. Allowed only when `type` is **individual**. Supported characters: [a-z] [A-Z] - . / — and Space. + * @param string|null $lastName The last name of the individual. Supported characters: [a-z] [A-Z] - . / — and space. This parameter is: - Allowed only when `type` is **individual**. - Required when `category` is **card**. * * @return self */ @@ -479,7 +476,7 @@ public function getReference() /** * Sets reference * - * @param string|null $reference A unique reference to identify the party or counterparty involved in transfers. This identifier ensures consistency and uniqueness throughout all transactions initiated to and from the same party. For example, your client's unique wallet or payee ID. + * @param string|null $reference A unique reference to identify the party or counterparty involved in the transfer. For example, your client's unique wallet or payee ID. Required when you include `cardIdentification.storedPaymentMethodId`. * * @return self */ @@ -503,7 +500,7 @@ public function getType() /** * Sets type * - * @param string|null $type The type of entity that owns the bank account. Possible values: **individual**, **organization**, or **unknown**. + * @param string|null $type The type of entity that owns the bank account or card. Possible values: **individual**, **organization**, or **unknown**. Required when `category` is **card**. In this case, the value must be **individual**. * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/TransferData.php b/src/Adyen/Model/TransferWebhooks/TransferData.php index 86e6b45c1..311e60ce0 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferData.php +++ b/src/Adyen/Model/TransferWebhooks/TransferData.php @@ -342,6 +342,7 @@ public function getModelName() } public const CATEGORY_BANK = 'bank'; + public const CATEGORY_CARD = 'card'; public const CATEGORY_INTERNAL = 'internal'; public const CATEGORY_ISSUED_CARD = 'issuedCard'; public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; @@ -431,46 +432,44 @@ public function getModelName() public const STATUS_SECOND_CHARGEBACK = 'secondChargeback'; public const STATUS_SECOND_CHARGEBACK_PENDING = 'secondChargebackPending'; public const STATUS_UNDEFINED = 'undefined'; - public const TYPE_ATM_WITHDRAWAL = 'atmWithdrawal'; - public const TYPE_ATM_WITHDRAWAL_REVERSAL = 'atmWithdrawalReversal'; - public const TYPE_BALANCE_ADJUSTMENT = 'balanceAdjustment'; - public const TYPE_BALANCE_MIGRATION = 'balanceMigration'; - public const TYPE_BALANCE_ROLLOVER = 'balanceRollover'; - public const TYPE_BANK_DIRECT_DEBIT = 'bankDirectDebit'; - public const TYPE_BANK_TRANSFER = 'bankTransfer'; - public const TYPE_CAPITAL_FUNDS_COLLECTION = 'capitalFundsCollection'; + public const TYPE_PAYMENT = 'payment'; public const TYPE_CAPTURE = 'capture'; public const TYPE_CAPTURE_REVERSAL = 'captureReversal'; - public const TYPE_CARD_TRANSFER = 'cardTransfer'; - public const TYPE_CASH_OUT_FEE = 'cashOutFee'; - public const TYPE_CASH_OUT_FUNDING = 'cashOutFunding'; - public const TYPE_CASH_OUT_INSTRUCTION = 'cashOutInstruction'; - public const TYPE_CASHOUT_FEE = 'cashoutFee'; - public const TYPE_CASHOUT_FUNDING = 'cashoutFunding'; - public const TYPE_CASHOUT_REPAYMENT = 'cashoutRepayment'; + public const TYPE_REFUND = 'refund'; + public const TYPE_REFUND_REVERSAL = 'refundReversal'; public const TYPE_CHARGEBACK = 'chargeback'; public const TYPE_CHARGEBACK_CORRECTION = 'chargebackCorrection'; public const TYPE_CHARGEBACK_REVERSAL = 'chargebackReversal'; public const TYPE_CHARGEBACK_REVERSAL_CORRECTION = 'chargebackReversalCorrection'; - public const TYPE_DEPOSIT_CORRECTION = 'depositCorrection'; - public const TYPE_FEE = 'fee'; - public const TYPE_GRANT = 'grant'; - public const TYPE_INSTALLMENT = 'installment'; - public const TYPE_INSTALLMENT_REVERSAL = 'installmentReversal'; - public const TYPE_INTERNAL_DIRECT_DEBIT = 'internalDirectDebit'; + public const TYPE_SECOND_CHARGEBACK = 'secondChargeback'; + public const TYPE_SECOND_CHARGEBACK_CORRECTION = 'secondChargebackCorrection'; + public const TYPE_ATM_WITHDRAWAL = 'atmWithdrawal'; + public const TYPE_ATM_WITHDRAWAL_REVERSAL = 'atmWithdrawalReversal'; public const TYPE_INTERNAL_TRANSFER = 'internalTransfer'; - public const TYPE_INVOICE_DEDUCTION = 'invoiceDeduction'; - public const TYPE_LEFTOVER = 'leftover'; + public const TYPE_INTERNAL_DIRECT_DEBIT = 'internalDirectDebit'; public const TYPE_MANUAL_CORRECTION = 'manualCorrection'; + public const TYPE_INVOICE_DEDUCTION = 'invoiceDeduction'; + public const TYPE_DEPOSIT_CORRECTION = 'depositCorrection'; + public const TYPE_RESERVE_ADJUSTMENT = 'reserveAdjustment'; + public const TYPE_BANK_TRANSFER = 'bankTransfer'; + public const TYPE_BANK_DIRECT_DEBIT = 'bankDirectDebit'; + public const TYPE_CARD_TRANSFER = 'cardTransfer'; public const TYPE_MISC_COST = 'miscCost'; - public const TYPE_PAYMENT = 'payment'; public const TYPE_PAYMENT_COST = 'paymentCost'; - public const TYPE_REFUND = 'refund'; - public const TYPE_REFUND_REVERSAL = 'refundReversal'; + public const TYPE_FEE = 'fee'; + public const TYPE_LEFTOVER = 'leftover'; + public const TYPE_GRANT = 'grant'; + public const TYPE_CAPITAL_FUNDS_COLLECTION = 'capitalFundsCollection'; + public const TYPE_CASH_OUT_INSTRUCTION = 'cashOutInstruction'; + public const TYPE_CASHOUT_FEE = 'cashoutFee'; + public const TYPE_CASHOUT_REPAYMENT = 'cashoutRepayment'; + public const TYPE_CASHOUT_FUNDING = 'cashoutFunding'; public const TYPE_REPAYMENT = 'repayment'; - public const TYPE_RESERVE_ADJUSTMENT = 'reserveAdjustment'; - public const TYPE_SECOND_CHARGEBACK = 'secondChargeback'; - public const TYPE_SECOND_CHARGEBACK_CORRECTION = 'secondChargebackCorrection'; + public const TYPE_INSTALLMENT = 'installment'; + public const TYPE_INSTALLMENT_REVERSAL = 'installmentReversal'; + public const TYPE_BALANCE_ADJUSTMENT = 'balanceAdjustment'; + public const TYPE_BALANCE_ROLLOVER = 'balanceRollover'; + public const TYPE_BALANCE_MIGRATION = 'balanceMigration'; /** * Gets allowable values of the enum @@ -481,6 +480,7 @@ public function getCategoryAllowableValues() { return [ self::CATEGORY_BANK, + self::CATEGORY_CARD, self::CATEGORY_INTERNAL, self::CATEGORY_ISSUED_CARD, self::CATEGORY_PLATFORM_PAYMENT, @@ -610,46 +610,44 @@ public function getStatusAllowableValues() public function getTypeAllowableValues() { return [ - self::TYPE_ATM_WITHDRAWAL, - self::TYPE_ATM_WITHDRAWAL_REVERSAL, - self::TYPE_BALANCE_ADJUSTMENT, - self::TYPE_BALANCE_MIGRATION, - self::TYPE_BALANCE_ROLLOVER, - self::TYPE_BANK_DIRECT_DEBIT, - self::TYPE_BANK_TRANSFER, - self::TYPE_CAPITAL_FUNDS_COLLECTION, + self::TYPE_PAYMENT, self::TYPE_CAPTURE, self::TYPE_CAPTURE_REVERSAL, - self::TYPE_CARD_TRANSFER, - self::TYPE_CASH_OUT_FEE, - self::TYPE_CASH_OUT_FUNDING, - self::TYPE_CASH_OUT_INSTRUCTION, - self::TYPE_CASHOUT_FEE, - self::TYPE_CASHOUT_FUNDING, - self::TYPE_CASHOUT_REPAYMENT, + self::TYPE_REFUND, + self::TYPE_REFUND_REVERSAL, self::TYPE_CHARGEBACK, self::TYPE_CHARGEBACK_CORRECTION, self::TYPE_CHARGEBACK_REVERSAL, self::TYPE_CHARGEBACK_REVERSAL_CORRECTION, - self::TYPE_DEPOSIT_CORRECTION, - self::TYPE_FEE, - self::TYPE_GRANT, - self::TYPE_INSTALLMENT, - self::TYPE_INSTALLMENT_REVERSAL, - self::TYPE_INTERNAL_DIRECT_DEBIT, + self::TYPE_SECOND_CHARGEBACK, + self::TYPE_SECOND_CHARGEBACK_CORRECTION, + self::TYPE_ATM_WITHDRAWAL, + self::TYPE_ATM_WITHDRAWAL_REVERSAL, self::TYPE_INTERNAL_TRANSFER, - self::TYPE_INVOICE_DEDUCTION, - self::TYPE_LEFTOVER, + self::TYPE_INTERNAL_DIRECT_DEBIT, self::TYPE_MANUAL_CORRECTION, + self::TYPE_INVOICE_DEDUCTION, + self::TYPE_DEPOSIT_CORRECTION, + self::TYPE_RESERVE_ADJUSTMENT, + self::TYPE_BANK_TRANSFER, + self::TYPE_BANK_DIRECT_DEBIT, + self::TYPE_CARD_TRANSFER, self::TYPE_MISC_COST, - self::TYPE_PAYMENT, self::TYPE_PAYMENT_COST, - self::TYPE_REFUND, - self::TYPE_REFUND_REVERSAL, + self::TYPE_FEE, + self::TYPE_LEFTOVER, + self::TYPE_GRANT, + self::TYPE_CAPITAL_FUNDS_COLLECTION, + self::TYPE_CASH_OUT_INSTRUCTION, + self::TYPE_CASHOUT_FEE, + self::TYPE_CASHOUT_REPAYMENT, + self::TYPE_CASHOUT_FUNDING, self::TYPE_REPAYMENT, - self::TYPE_RESERVE_ADJUSTMENT, - self::TYPE_SECOND_CHARGEBACK, - self::TYPE_SECOND_CHARGEBACK_CORRECTION, + self::TYPE_INSTALLMENT, + self::TYPE_INSTALLMENT_REVERSAL, + self::TYPE_BALANCE_ADJUSTMENT, + self::TYPE_BALANCE_ROLLOVER, + self::TYPE_BALANCE_MIGRATION, ]; } /** @@ -920,7 +918,7 @@ public function getCategory() /** * Sets category * - * @param string $category The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. + * @param string $category The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.php b/src/Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.php index 68bf75ff8..6b25d649c 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.php +++ b/src/Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.php @@ -46,6 +46,7 @@ class TransferNotificationCounterParty implements ModelInterface, ArrayAccess, \ protected static $openAPITypes = [ 'balanceAccountId' => 'string', 'bankAccount' => '\Adyen\Model\TransferWebhooks\BankAccountV3', + 'card' => '\Adyen\Model\TransferWebhooks\Card', 'merchant' => '\Adyen\Model\TransferWebhooks\TransferNotificationMerchantData', 'transferInstrumentId' => 'string' ]; @@ -60,6 +61,7 @@ class TransferNotificationCounterParty implements ModelInterface, ArrayAccess, \ protected static $openAPIFormats = [ 'balanceAccountId' => null, 'bankAccount' => null, + 'card' => null, 'merchant' => null, 'transferInstrumentId' => null ]; @@ -72,6 +74,7 @@ class TransferNotificationCounterParty implements ModelInterface, ArrayAccess, \ protected static $openAPINullables = [ 'balanceAccountId' => false, 'bankAccount' => false, + 'card' => false, 'merchant' => false, 'transferInstrumentId' => false ]; @@ -164,6 +167,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'balanceAccountId' => 'balanceAccountId', 'bankAccount' => 'bankAccount', + 'card' => 'card', 'merchant' => 'merchant', 'transferInstrumentId' => 'transferInstrumentId' ]; @@ -176,6 +180,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'balanceAccountId' => 'setBalanceAccountId', 'bankAccount' => 'setBankAccount', + 'card' => 'setCard', 'merchant' => 'setMerchant', 'transferInstrumentId' => 'setTransferInstrumentId' ]; @@ -188,6 +193,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'balanceAccountId' => 'getBalanceAccountId', 'bankAccount' => 'getBankAccount', + 'card' => 'getCard', 'merchant' => 'getMerchant', 'transferInstrumentId' => 'getTransferInstrumentId' ]; @@ -251,6 +257,7 @@ public function __construct(array $data = null) { $this->setIfExists('balanceAccountId', $data ?? [], null); $this->setIfExists('bankAccount', $data ?? [], null); + $this->setIfExists('card', $data ?? [], null); $this->setIfExists('merchant', $data ?? [], null); $this->setIfExists('transferInstrumentId', $data ?? [], null); } @@ -310,7 +317,7 @@ public function getBalanceAccountId() /** * Sets balanceAccountId * - * @param string|null $balanceAccountId The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). + * @param string|null $balanceAccountId The unique identifier of the counterparty [balance account](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id). * * @return self */ @@ -345,6 +352,30 @@ public function setBankAccount($bankAccount) return $this; } + /** + * Gets card + * + * @return \Adyen\Model\TransferWebhooks\Card|null + */ + public function getCard() + { + return $this->container['card']; + } + + /** + * Sets card + * + * @param \Adyen\Model\TransferWebhooks\Card|null $card card + * + * @return self + */ + public function setCard($card) + { + $this->container['card'] = $card; + + return $this; + } + /** * Gets merchant * @@ -382,7 +413,7 @@ public function getTransferInstrumentId() /** * Sets transferInstrumentId * - * @param string|null $transferInstrumentId The unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * @param string|null $transferInstrumentId The unique identifier of the counterparty [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id). * * @return self */ diff --git a/src/Adyen/Model/Transfers/Card.php b/src/Adyen/Model/Transfers/Card.php new file mode 100644 index 000000000..3afb8859f --- /dev/null +++ b/src/Adyen/Model/Transfers/Card.php @@ -0,0 +1,444 @@ + + */ +class Card implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Card'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cardHolder' => '\Adyen\Model\Transfers\PartyIdentification', + 'cardIdentification' => '\Adyen\Model\Transfers\CardIdentification' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cardHolder' => null, + 'cardIdentification' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'cardHolder' => false, + 'cardIdentification' => 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 = [ + 'cardHolder' => 'cardHolder', + 'cardIdentification' => 'cardIdentification' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cardHolder' => 'setCardHolder', + 'cardIdentification' => 'setCardIdentification' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cardHolder' => 'getCardHolder', + 'cardIdentification' => 'getCardIdentification' + ]; + + /** + * 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('cardHolder', $data ?? [], null); + $this->setIfExists('cardIdentification', $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['cardHolder'] === null) { + $invalidProperties[] = "'cardHolder' can't be null"; + } + if ($this->container['cardIdentification'] === null) { + $invalidProperties[] = "'cardIdentification' 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 cardHolder + * + * @return \Adyen\Model\Transfers\PartyIdentification + */ + public function getCardHolder() + { + return $this->container['cardHolder']; + } + + /** + * Sets cardHolder + * + * @param \Adyen\Model\Transfers\PartyIdentification $cardHolder cardHolder + * + * @return self + */ + public function setCardHolder($cardHolder) + { + $this->container['cardHolder'] = $cardHolder; + + return $this; + } + + /** + * Gets cardIdentification + * + * @return \Adyen\Model\Transfers\CardIdentification + */ + public function getCardIdentification() + { + return $this->container['cardIdentification']; + } + + /** + * Sets cardIdentification + * + * @param \Adyen\Model\Transfers\CardIdentification $cardIdentification cardIdentification + * + * @return self + */ + public function setCardIdentification($cardIdentification) + { + $this->container['cardIdentification'] = $cardIdentification; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/CardIdentification.php b/src/Adyen/Model/Transfers/CardIdentification.php new file mode 100644 index 000000000..3bd28422b --- /dev/null +++ b/src/Adyen/Model/Transfers/CardIdentification.php @@ -0,0 +1,593 @@ + + */ +class CardIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CardIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'expiryMonth' => 'string', + 'expiryYear' => 'string', + 'issueNumber' => 'string', + 'number' => 'string', + 'startMonth' => 'string', + 'startYear' => 'string', + 'storedPaymentMethodId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'expiryMonth' => null, + 'expiryYear' => null, + 'issueNumber' => null, + 'number' => null, + 'startMonth' => null, + 'startYear' => null, + 'storedPaymentMethodId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'expiryMonth' => false, + 'expiryYear' => false, + 'issueNumber' => false, + 'number' => false, + 'startMonth' => false, + 'startYear' => false, + 'storedPaymentMethodId' => 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 = [ + 'expiryMonth' => 'expiryMonth', + 'expiryYear' => 'expiryYear', + 'issueNumber' => 'issueNumber', + 'number' => 'number', + 'startMonth' => 'startMonth', + 'startYear' => 'startYear', + 'storedPaymentMethodId' => 'storedPaymentMethodId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'expiryMonth' => 'setExpiryMonth', + 'expiryYear' => 'setExpiryYear', + 'issueNumber' => 'setIssueNumber', + 'number' => 'setNumber', + 'startMonth' => 'setStartMonth', + 'startYear' => 'setStartYear', + 'storedPaymentMethodId' => 'setStoredPaymentMethodId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'expiryMonth' => 'getExpiryMonth', + 'expiryYear' => 'getExpiryYear', + 'issueNumber' => 'getIssueNumber', + 'number' => 'getNumber', + 'startMonth' => 'getStartMonth', + 'startYear' => 'getStartYear', + 'storedPaymentMethodId' => 'getStoredPaymentMethodId' + ]; + + /** + * 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('expiryMonth', $data ?? [], null); + $this->setIfExists('expiryYear', $data ?? [], null); + $this->setIfExists('issueNumber', $data ?? [], null); + $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('startMonth', $data ?? [], null); + $this->setIfExists('startYear', $data ?? [], null); + $this->setIfExists('storedPaymentMethodId', $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 expiryMonth + * + * @return string|null + */ + public function getExpiryMonth() + { + return $this->container['expiryMonth']; + } + + /** + * Sets expiryMonth + * + * @param string|null $expiryMonth The expiry month of the card. Format: two digits. Add a leading zero for single-digit months. For example: * 03 = March * 11 = November + * + * @return self + */ + public function setExpiryMonth($expiryMonth) + { + $this->container['expiryMonth'] = $expiryMonth; + + return $this; + } + + /** + * Gets expiryYear + * + * @return string|null + */ + public function getExpiryYear() + { + return $this->container['expiryYear']; + } + + /** + * Sets expiryYear + * + * @param string|null $expiryYear The expiry year of the card. Format: four digits. For example: 2020 + * + * @return self + */ + public function setExpiryYear($expiryYear) + { + $this->container['expiryYear'] = $expiryYear; + + return $this; + } + + /** + * Gets issueNumber + * + * @return string|null + */ + public function getIssueNumber() + { + return $this->container['issueNumber']; + } + + /** + * Sets issueNumber + * + * @param string|null $issueNumber The issue number of the card. Applies only to some UK debit cards. + * + * @return self + */ + public function setIssueNumber($issueNumber) + { + $this->container['issueNumber'] = $issueNumber; + + return $this; + } + + /** + * Gets number + * + * @return string|null + */ + public function getNumber() + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string|null $number The card number without any separators. For security, the response only includes the last four digits of the card number. + * + * @return self + */ + public function setNumber($number) + { + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets startMonth + * + * @return string|null + */ + public function getStartMonth() + { + return $this->container['startMonth']; + } + + /** + * Sets startMonth + * + * @param string|null $startMonth The month when the card was issued. Applies only to some UK debit cards. Format: two digits. Add a leading zero for single-digit months. For example: * 03 = March * 11 = November + * + * @return self + */ + public function setStartMonth($startMonth) + { + $this->container['startMonth'] = $startMonth; + + return $this; + } + + /** + * Gets startYear + * + * @return string|null + */ + public function getStartYear() + { + return $this->container['startYear']; + } + + /** + * Sets startYear + * + * @param string|null $startYear The year when the card was issued. Applies only to some UK debit cards. Format: four digits. For example: 2020 + * + * @return self + */ + public function setStartYear($startYear) + { + $this->container['startYear'] = $startYear; + + return $this; + } + + /** + * Gets storedPaymentMethodId + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['storedPaymentMethodId']; + } + + /** + * Sets storedPaymentMethodId + * + * @param string|null $storedPaymentMethodId The unique [token](/payouts/payout-service/pay-out-to-cards/manage-card-information#save-card-details) created to identify the counterparty. + * + * @return self + */ + public function setStoredPaymentMethodId($storedPaymentMethodId) + { + $this->container['storedPaymentMethodId'] = $storedPaymentMethodId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/CounterpartyInfoV3.php b/src/Adyen/Model/Transfers/CounterpartyInfoV3.php index f920c6fb6..2af7909b4 100644 --- a/src/Adyen/Model/Transfers/CounterpartyInfoV3.php +++ b/src/Adyen/Model/Transfers/CounterpartyInfoV3.php @@ -46,6 +46,7 @@ class CounterpartyInfoV3 implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPITypes = [ 'balanceAccountId' => 'string', 'bankAccount' => '\Adyen\Model\Transfers\BankAccountV3', + 'card' => '\Adyen\Model\Transfers\Card', 'transferInstrumentId' => 'string' ]; @@ -59,6 +60,7 @@ class CounterpartyInfoV3 implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPIFormats = [ 'balanceAccountId' => null, 'bankAccount' => null, + 'card' => null, 'transferInstrumentId' => null ]; @@ -70,6 +72,7 @@ class CounterpartyInfoV3 implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPINullables = [ 'balanceAccountId' => false, 'bankAccount' => false, + 'card' => false, 'transferInstrumentId' => false ]; @@ -161,6 +164,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'balanceAccountId' => 'balanceAccountId', 'bankAccount' => 'bankAccount', + 'card' => 'card', 'transferInstrumentId' => 'transferInstrumentId' ]; @@ -172,6 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'balanceAccountId' => 'setBalanceAccountId', 'bankAccount' => 'setBankAccount', + 'card' => 'setCard', 'transferInstrumentId' => 'setTransferInstrumentId' ]; @@ -183,6 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'balanceAccountId' => 'getBalanceAccountId', 'bankAccount' => 'getBankAccount', + 'card' => 'getCard', 'transferInstrumentId' => 'getTransferInstrumentId' ]; @@ -245,6 +251,7 @@ public function __construct(array $data = null) { $this->setIfExists('balanceAccountId', $data ?? [], null); $this->setIfExists('bankAccount', $data ?? [], null); + $this->setIfExists('card', $data ?? [], null); $this->setIfExists('transferInstrumentId', $data ?? [], null); } @@ -303,7 +310,7 @@ public function getBalanceAccountId() /** * Sets balanceAccountId * - * @param string|null $balanceAccountId The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). + * @param string|null $balanceAccountId The unique identifier of the counterparty [balance account](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id). * * @return self */ @@ -338,6 +345,30 @@ public function setBankAccount($bankAccount) return $this; } + /** + * Gets card + * + * @return \Adyen\Model\Transfers\Card|null + */ + public function getCard() + { + return $this->container['card']; + } + + /** + * Sets card + * + * @param \Adyen\Model\Transfers\Card|null $card card + * + * @return self + */ + public function setCard($card) + { + $this->container['card'] = $card; + + return $this; + } + /** * Gets transferInstrumentId * @@ -351,7 +382,7 @@ public function getTransferInstrumentId() /** * Sets transferInstrumentId * - * @param string|null $transferInstrumentId The unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * @param string|null $transferInstrumentId The unique identifier of the counterparty [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id). * * @return self */ diff --git a/src/Adyen/Model/Transfers/CounterpartyV3.php b/src/Adyen/Model/Transfers/CounterpartyV3.php index 720f72056..419c03ab2 100644 --- a/src/Adyen/Model/Transfers/CounterpartyV3.php +++ b/src/Adyen/Model/Transfers/CounterpartyV3.php @@ -46,6 +46,7 @@ class CounterpartyV3 implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'balanceAccountId' => 'string', 'bankAccount' => '\Adyen\Model\Transfers\BankAccountV3', + 'card' => '\Adyen\Model\Transfers\Card', 'merchant' => '\Adyen\Model\Transfers\MerchantData', 'transferInstrumentId' => 'string' ]; @@ -60,6 +61,7 @@ class CounterpartyV3 implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'balanceAccountId' => null, 'bankAccount' => null, + 'card' => null, 'merchant' => null, 'transferInstrumentId' => null ]; @@ -72,6 +74,7 @@ class CounterpartyV3 implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPINullables = [ 'balanceAccountId' => false, 'bankAccount' => false, + 'card' => false, 'merchant' => false, 'transferInstrumentId' => false ]; @@ -164,6 +167,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'balanceAccountId' => 'balanceAccountId', 'bankAccount' => 'bankAccount', + 'card' => 'card', 'merchant' => 'merchant', 'transferInstrumentId' => 'transferInstrumentId' ]; @@ -176,6 +180,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'balanceAccountId' => 'setBalanceAccountId', 'bankAccount' => 'setBankAccount', + 'card' => 'setCard', 'merchant' => 'setMerchant', 'transferInstrumentId' => 'setTransferInstrumentId' ]; @@ -188,6 +193,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'balanceAccountId' => 'getBalanceAccountId', 'bankAccount' => 'getBankAccount', + 'card' => 'getCard', 'merchant' => 'getMerchant', 'transferInstrumentId' => 'getTransferInstrumentId' ]; @@ -251,6 +257,7 @@ public function __construct(array $data = null) { $this->setIfExists('balanceAccountId', $data ?? [], null); $this->setIfExists('bankAccount', $data ?? [], null); + $this->setIfExists('card', $data ?? [], null); $this->setIfExists('merchant', $data ?? [], null); $this->setIfExists('transferInstrumentId', $data ?? [], null); } @@ -310,7 +317,7 @@ public function getBalanceAccountId() /** * Sets balanceAccountId * - * @param string|null $balanceAccountId The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). + * @param string|null $balanceAccountId The unique identifier of the counterparty [balance account](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id). * * @return self */ @@ -345,6 +352,30 @@ public function setBankAccount($bankAccount) return $this; } + /** + * Gets card + * + * @return \Adyen\Model\Transfers\Card|null + */ + public function getCard() + { + return $this->container['card']; + } + + /** + * Sets card + * + * @param \Adyen\Model\Transfers\Card|null $card card + * + * @return self + */ + public function setCard($card) + { + $this->container['card'] = $card; + + return $this; + } + /** * Gets merchant * @@ -382,7 +413,7 @@ public function getTransferInstrumentId() /** * Sets transferInstrumentId * - * @param string|null $transferInstrumentId The unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * @param string|null $transferInstrumentId The unique identifier of the counterparty [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id). * * @return self */ diff --git a/src/Adyen/Model/Transfers/PartyIdentification.php b/src/Adyen/Model/Transfers/PartyIdentification.php index 6ffc839e2..44cc38562 100644 --- a/src/Adyen/Model/Transfers/PartyIdentification.php +++ b/src/Adyen/Model/Transfers/PartyIdentification.php @@ -319,9 +319,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['fullName'] === null) { - $invalidProperties[] = "'fullName' can't be null"; - } $allowedValues = $this->getTypeAllowableValues(); if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -383,7 +380,7 @@ public function getDateOfBirth() /** * Sets dateOfBirth * - * @param \DateTime|null $dateOfBirth The date of birth of the individual in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. For example, **YYYY-MM-DD**. Should not be before January 1, 1900. Allowed only when `type` is **individual**. + * @param \DateTime|null $dateOfBirth The date of birth of the individual in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. For example, **YYYY-MM-DD**. Allowed only when `type` is **individual**. * * @return self */ @@ -407,7 +404,7 @@ public function getFirstName() /** * Sets firstName * - * @param string|null $firstName First name of the individual. Allowed only when `type` is **individual**. Supported characters: [a-z] [A-Z] - . / — and Space. + * @param string|null $firstName The first name of the individual. Supported characters: [a-z] [A-Z] - . / — and space. This parameter is: - Allowed only when `type` is **individual**. - Required when `category` is **card**. * * @return self */ @@ -421,7 +418,7 @@ public function setFirstName($firstName) /** * Gets fullName * - * @return string + * @return string|null */ public function getFullName() { @@ -431,7 +428,7 @@ public function getFullName() /** * Sets fullName * - * @param string $fullName The name of the entity. Supported characters: [a-z] [A-Z] [0-9] , . ; : - — / \\ + & ! ? @ ( ) \" ' and Space. + * @param string|null $fullName The full name of the entity that owns the bank account or card. Supported characters: [a-z] [A-Z] [0-9] , . ; : - — / \\ + & ! ? @ ( ) \" ' and space. Required when `category` is **bank**. * * @return self */ @@ -455,7 +452,7 @@ public function getLastName() /** * Sets lastName * - * @param string|null $lastName Last name of the individual. Allowed only when `type` is **individual**. Supported characters: [a-z] [A-Z] - . / — and Space. + * @param string|null $lastName The last name of the individual. Supported characters: [a-z] [A-Z] - . / — and space. This parameter is: - Allowed only when `type` is **individual**. - Required when `category` is **card**. * * @return self */ @@ -479,7 +476,7 @@ public function getReference() /** * Sets reference * - * @param string|null $reference A unique reference to identify the party or counterparty involved in transfers. This identifier ensures consistency and uniqueness throughout all transactions initiated to and from the same party. For example, your client's unique wallet or payee ID. + * @param string|null $reference A unique reference to identify the party or counterparty involved in the transfer. For example, your client's unique wallet or payee ID. Required when you include `cardIdentification.storedPaymentMethodId`. * * @return self */ @@ -503,7 +500,7 @@ public function getType() /** * Sets type * - * @param string|null $type The type of entity that owns the bank account. Possible values: **individual**, **organization**, or **unknown**. + * @param string|null $type The type of entity that owns the bank account or card. Possible values: **individual**, **organization**, or **unknown**. Required when `category` is **card**. In this case, the value must be **individual**. * * @return self */ diff --git a/src/Adyen/Model/Transfers/Transfer.php b/src/Adyen/Model/Transfers/Transfer.php index d7be15bcc..5de58ad67 100644 --- a/src/Adyen/Model/Transfers/Transfer.php +++ b/src/Adyen/Model/Transfers/Transfer.php @@ -306,6 +306,7 @@ public function getModelName() } public const CATEGORY_BANK = 'bank'; + public const CATEGORY_CARD = 'card'; public const CATEGORY_INTERNAL = 'internal'; public const CATEGORY_ISSUED_CARD = 'issuedCard'; public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; @@ -395,46 +396,44 @@ public function getModelName() public const STATUS_SECOND_CHARGEBACK = 'secondChargeback'; public const STATUS_SECOND_CHARGEBACK_PENDING = 'secondChargebackPending'; public const STATUS_UNDEFINED = 'undefined'; - public const TYPE_ATM_WITHDRAWAL = 'atmWithdrawal'; - public const TYPE_ATM_WITHDRAWAL_REVERSAL = 'atmWithdrawalReversal'; - public const TYPE_BALANCE_ADJUSTMENT = 'balanceAdjustment'; - public const TYPE_BALANCE_MIGRATION = 'balanceMigration'; - public const TYPE_BALANCE_ROLLOVER = 'balanceRollover'; - public const TYPE_BANK_DIRECT_DEBIT = 'bankDirectDebit'; - public const TYPE_BANK_TRANSFER = 'bankTransfer'; - public const TYPE_CAPITAL_FUNDS_COLLECTION = 'capitalFundsCollection'; + public const TYPE_PAYMENT = 'payment'; public const TYPE_CAPTURE = 'capture'; public const TYPE_CAPTURE_REVERSAL = 'captureReversal'; - public const TYPE_CARD_TRANSFER = 'cardTransfer'; - public const TYPE_CASH_OUT_FEE = 'cashOutFee'; - public const TYPE_CASH_OUT_FUNDING = 'cashOutFunding'; - public const TYPE_CASH_OUT_INSTRUCTION = 'cashOutInstruction'; - public const TYPE_CASHOUT_FEE = 'cashoutFee'; - public const TYPE_CASHOUT_FUNDING = 'cashoutFunding'; - public const TYPE_CASHOUT_REPAYMENT = 'cashoutRepayment'; + public const TYPE_REFUND = 'refund'; + public const TYPE_REFUND_REVERSAL = 'refundReversal'; public const TYPE_CHARGEBACK = 'chargeback'; public const TYPE_CHARGEBACK_CORRECTION = 'chargebackCorrection'; public const TYPE_CHARGEBACK_REVERSAL = 'chargebackReversal'; public const TYPE_CHARGEBACK_REVERSAL_CORRECTION = 'chargebackReversalCorrection'; - public const TYPE_DEPOSIT_CORRECTION = 'depositCorrection'; - public const TYPE_FEE = 'fee'; - public const TYPE_GRANT = 'grant'; - public const TYPE_INSTALLMENT = 'installment'; - public const TYPE_INSTALLMENT_REVERSAL = 'installmentReversal'; - public const TYPE_INTERNAL_DIRECT_DEBIT = 'internalDirectDebit'; + public const TYPE_SECOND_CHARGEBACK = 'secondChargeback'; + public const TYPE_SECOND_CHARGEBACK_CORRECTION = 'secondChargebackCorrection'; + public const TYPE_ATM_WITHDRAWAL = 'atmWithdrawal'; + public const TYPE_ATM_WITHDRAWAL_REVERSAL = 'atmWithdrawalReversal'; public const TYPE_INTERNAL_TRANSFER = 'internalTransfer'; - public const TYPE_INVOICE_DEDUCTION = 'invoiceDeduction'; - public const TYPE_LEFTOVER = 'leftover'; + public const TYPE_INTERNAL_DIRECT_DEBIT = 'internalDirectDebit'; public const TYPE_MANUAL_CORRECTION = 'manualCorrection'; + public const TYPE_INVOICE_DEDUCTION = 'invoiceDeduction'; + public const TYPE_DEPOSIT_CORRECTION = 'depositCorrection'; + public const TYPE_RESERVE_ADJUSTMENT = 'reserveAdjustment'; + public const TYPE_BANK_TRANSFER = 'bankTransfer'; + public const TYPE_BANK_DIRECT_DEBIT = 'bankDirectDebit'; + public const TYPE_CARD_TRANSFER = 'cardTransfer'; public const TYPE_MISC_COST = 'miscCost'; - public const TYPE_PAYMENT = 'payment'; public const TYPE_PAYMENT_COST = 'paymentCost'; - public const TYPE_REFUND = 'refund'; - public const TYPE_REFUND_REVERSAL = 'refundReversal'; + public const TYPE_FEE = 'fee'; + public const TYPE_LEFTOVER = 'leftover'; + public const TYPE_GRANT = 'grant'; + public const TYPE_CAPITAL_FUNDS_COLLECTION = 'capitalFundsCollection'; + public const TYPE_CASH_OUT_INSTRUCTION = 'cashOutInstruction'; + public const TYPE_CASHOUT_FEE = 'cashoutFee'; + public const TYPE_CASHOUT_REPAYMENT = 'cashoutRepayment'; + public const TYPE_CASHOUT_FUNDING = 'cashoutFunding'; public const TYPE_REPAYMENT = 'repayment'; - public const TYPE_RESERVE_ADJUSTMENT = 'reserveAdjustment'; - public const TYPE_SECOND_CHARGEBACK = 'secondChargeback'; - public const TYPE_SECOND_CHARGEBACK_CORRECTION = 'secondChargebackCorrection'; + public const TYPE_INSTALLMENT = 'installment'; + public const TYPE_INSTALLMENT_REVERSAL = 'installmentReversal'; + public const TYPE_BALANCE_ADJUSTMENT = 'balanceAdjustment'; + public const TYPE_BALANCE_ROLLOVER = 'balanceRollover'; + public const TYPE_BALANCE_MIGRATION = 'balanceMigration'; /** * Gets allowable values of the enum @@ -445,6 +444,7 @@ public function getCategoryAllowableValues() { return [ self::CATEGORY_BANK, + self::CATEGORY_CARD, self::CATEGORY_INTERNAL, self::CATEGORY_ISSUED_CARD, self::CATEGORY_PLATFORM_PAYMENT, @@ -574,46 +574,44 @@ public function getStatusAllowableValues() public function getTypeAllowableValues() { return [ - self::TYPE_ATM_WITHDRAWAL, - self::TYPE_ATM_WITHDRAWAL_REVERSAL, - self::TYPE_BALANCE_ADJUSTMENT, - self::TYPE_BALANCE_MIGRATION, - self::TYPE_BALANCE_ROLLOVER, - self::TYPE_BANK_DIRECT_DEBIT, - self::TYPE_BANK_TRANSFER, - self::TYPE_CAPITAL_FUNDS_COLLECTION, + self::TYPE_PAYMENT, self::TYPE_CAPTURE, self::TYPE_CAPTURE_REVERSAL, - self::TYPE_CARD_TRANSFER, - self::TYPE_CASH_OUT_FEE, - self::TYPE_CASH_OUT_FUNDING, - self::TYPE_CASH_OUT_INSTRUCTION, - self::TYPE_CASHOUT_FEE, - self::TYPE_CASHOUT_FUNDING, - self::TYPE_CASHOUT_REPAYMENT, + self::TYPE_REFUND, + self::TYPE_REFUND_REVERSAL, self::TYPE_CHARGEBACK, self::TYPE_CHARGEBACK_CORRECTION, self::TYPE_CHARGEBACK_REVERSAL, self::TYPE_CHARGEBACK_REVERSAL_CORRECTION, - self::TYPE_DEPOSIT_CORRECTION, - self::TYPE_FEE, - self::TYPE_GRANT, - self::TYPE_INSTALLMENT, - self::TYPE_INSTALLMENT_REVERSAL, - self::TYPE_INTERNAL_DIRECT_DEBIT, + self::TYPE_SECOND_CHARGEBACK, + self::TYPE_SECOND_CHARGEBACK_CORRECTION, + self::TYPE_ATM_WITHDRAWAL, + self::TYPE_ATM_WITHDRAWAL_REVERSAL, self::TYPE_INTERNAL_TRANSFER, - self::TYPE_INVOICE_DEDUCTION, - self::TYPE_LEFTOVER, + self::TYPE_INTERNAL_DIRECT_DEBIT, self::TYPE_MANUAL_CORRECTION, + self::TYPE_INVOICE_DEDUCTION, + self::TYPE_DEPOSIT_CORRECTION, + self::TYPE_RESERVE_ADJUSTMENT, + self::TYPE_BANK_TRANSFER, + self::TYPE_BANK_DIRECT_DEBIT, + self::TYPE_CARD_TRANSFER, self::TYPE_MISC_COST, - self::TYPE_PAYMENT, self::TYPE_PAYMENT_COST, - self::TYPE_REFUND, - self::TYPE_REFUND_REVERSAL, + self::TYPE_FEE, + self::TYPE_LEFTOVER, + self::TYPE_GRANT, + self::TYPE_CAPITAL_FUNDS_COLLECTION, + self::TYPE_CASH_OUT_INSTRUCTION, + self::TYPE_CASHOUT_FEE, + self::TYPE_CASHOUT_REPAYMENT, + self::TYPE_CASHOUT_FUNDING, self::TYPE_REPAYMENT, - self::TYPE_RESERVE_ADJUSTMENT, - self::TYPE_SECOND_CHARGEBACK, - self::TYPE_SECOND_CHARGEBACK_CORRECTION, + self::TYPE_INSTALLMENT, + self::TYPE_INSTALLMENT_REVERSAL, + self::TYPE_BALANCE_ADJUSTMENT, + self::TYPE_BALANCE_ROLLOVER, + self::TYPE_BALANCE_MIGRATION, ]; } /** @@ -833,7 +831,7 @@ public function getCategory() /** * Sets category * - * @param string $category The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. + * @param string $category The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. * * @return self */ diff --git a/src/Adyen/Model/Transfers/TransferData.php b/src/Adyen/Model/Transfers/TransferData.php index 83e464caf..2e50d0f39 100644 --- a/src/Adyen/Model/Transfers/TransferData.php +++ b/src/Adyen/Model/Transfers/TransferData.php @@ -342,6 +342,7 @@ public function getModelName() } public const CATEGORY_BANK = 'bank'; + public const CATEGORY_CARD = 'card'; public const CATEGORY_INTERNAL = 'internal'; public const CATEGORY_ISSUED_CARD = 'issuedCard'; public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; @@ -431,46 +432,44 @@ public function getModelName() public const STATUS_SECOND_CHARGEBACK = 'secondChargeback'; public const STATUS_SECOND_CHARGEBACK_PENDING = 'secondChargebackPending'; public const STATUS_UNDEFINED = 'undefined'; - public const TYPE_ATM_WITHDRAWAL = 'atmWithdrawal'; - public const TYPE_ATM_WITHDRAWAL_REVERSAL = 'atmWithdrawalReversal'; - public const TYPE_BALANCE_ADJUSTMENT = 'balanceAdjustment'; - public const TYPE_BALANCE_MIGRATION = 'balanceMigration'; - public const TYPE_BALANCE_ROLLOVER = 'balanceRollover'; - public const TYPE_BANK_DIRECT_DEBIT = 'bankDirectDebit'; - public const TYPE_BANK_TRANSFER = 'bankTransfer'; - public const TYPE_CAPITAL_FUNDS_COLLECTION = 'capitalFundsCollection'; + public const TYPE_PAYMENT = 'payment'; public const TYPE_CAPTURE = 'capture'; public const TYPE_CAPTURE_REVERSAL = 'captureReversal'; - public const TYPE_CARD_TRANSFER = 'cardTransfer'; - public const TYPE_CASH_OUT_FEE = 'cashOutFee'; - public const TYPE_CASH_OUT_FUNDING = 'cashOutFunding'; - public const TYPE_CASH_OUT_INSTRUCTION = 'cashOutInstruction'; - public const TYPE_CASHOUT_FEE = 'cashoutFee'; - public const TYPE_CASHOUT_FUNDING = 'cashoutFunding'; - public const TYPE_CASHOUT_REPAYMENT = 'cashoutRepayment'; + public const TYPE_REFUND = 'refund'; + public const TYPE_REFUND_REVERSAL = 'refundReversal'; public const TYPE_CHARGEBACK = 'chargeback'; public const TYPE_CHARGEBACK_CORRECTION = 'chargebackCorrection'; public const TYPE_CHARGEBACK_REVERSAL = 'chargebackReversal'; public const TYPE_CHARGEBACK_REVERSAL_CORRECTION = 'chargebackReversalCorrection'; - public const TYPE_DEPOSIT_CORRECTION = 'depositCorrection'; - public const TYPE_FEE = 'fee'; - public const TYPE_GRANT = 'grant'; - public const TYPE_INSTALLMENT = 'installment'; - public const TYPE_INSTALLMENT_REVERSAL = 'installmentReversal'; - public const TYPE_INTERNAL_DIRECT_DEBIT = 'internalDirectDebit'; + public const TYPE_SECOND_CHARGEBACK = 'secondChargeback'; + public const TYPE_SECOND_CHARGEBACK_CORRECTION = 'secondChargebackCorrection'; + public const TYPE_ATM_WITHDRAWAL = 'atmWithdrawal'; + public const TYPE_ATM_WITHDRAWAL_REVERSAL = 'atmWithdrawalReversal'; public const TYPE_INTERNAL_TRANSFER = 'internalTransfer'; - public const TYPE_INVOICE_DEDUCTION = 'invoiceDeduction'; - public const TYPE_LEFTOVER = 'leftover'; + public const TYPE_INTERNAL_DIRECT_DEBIT = 'internalDirectDebit'; public const TYPE_MANUAL_CORRECTION = 'manualCorrection'; + public const TYPE_INVOICE_DEDUCTION = 'invoiceDeduction'; + public const TYPE_DEPOSIT_CORRECTION = 'depositCorrection'; + public const TYPE_RESERVE_ADJUSTMENT = 'reserveAdjustment'; + public const TYPE_BANK_TRANSFER = 'bankTransfer'; + public const TYPE_BANK_DIRECT_DEBIT = 'bankDirectDebit'; + public const TYPE_CARD_TRANSFER = 'cardTransfer'; public const TYPE_MISC_COST = 'miscCost'; - public const TYPE_PAYMENT = 'payment'; public const TYPE_PAYMENT_COST = 'paymentCost'; - public const TYPE_REFUND = 'refund'; - public const TYPE_REFUND_REVERSAL = 'refundReversal'; + public const TYPE_FEE = 'fee'; + public const TYPE_LEFTOVER = 'leftover'; + public const TYPE_GRANT = 'grant'; + public const TYPE_CAPITAL_FUNDS_COLLECTION = 'capitalFundsCollection'; + public const TYPE_CASH_OUT_INSTRUCTION = 'cashOutInstruction'; + public const TYPE_CASHOUT_FEE = 'cashoutFee'; + public const TYPE_CASHOUT_REPAYMENT = 'cashoutRepayment'; + public const TYPE_CASHOUT_FUNDING = 'cashoutFunding'; public const TYPE_REPAYMENT = 'repayment'; - public const TYPE_RESERVE_ADJUSTMENT = 'reserveAdjustment'; - public const TYPE_SECOND_CHARGEBACK = 'secondChargeback'; - public const TYPE_SECOND_CHARGEBACK_CORRECTION = 'secondChargebackCorrection'; + public const TYPE_INSTALLMENT = 'installment'; + public const TYPE_INSTALLMENT_REVERSAL = 'installmentReversal'; + public const TYPE_BALANCE_ADJUSTMENT = 'balanceAdjustment'; + public const TYPE_BALANCE_ROLLOVER = 'balanceRollover'; + public const TYPE_BALANCE_MIGRATION = 'balanceMigration'; /** * Gets allowable values of the enum @@ -481,6 +480,7 @@ public function getCategoryAllowableValues() { return [ self::CATEGORY_BANK, + self::CATEGORY_CARD, self::CATEGORY_INTERNAL, self::CATEGORY_ISSUED_CARD, self::CATEGORY_PLATFORM_PAYMENT, @@ -610,46 +610,44 @@ public function getStatusAllowableValues() public function getTypeAllowableValues() { return [ - self::TYPE_ATM_WITHDRAWAL, - self::TYPE_ATM_WITHDRAWAL_REVERSAL, - self::TYPE_BALANCE_ADJUSTMENT, - self::TYPE_BALANCE_MIGRATION, - self::TYPE_BALANCE_ROLLOVER, - self::TYPE_BANK_DIRECT_DEBIT, - self::TYPE_BANK_TRANSFER, - self::TYPE_CAPITAL_FUNDS_COLLECTION, + self::TYPE_PAYMENT, self::TYPE_CAPTURE, self::TYPE_CAPTURE_REVERSAL, - self::TYPE_CARD_TRANSFER, - self::TYPE_CASH_OUT_FEE, - self::TYPE_CASH_OUT_FUNDING, - self::TYPE_CASH_OUT_INSTRUCTION, - self::TYPE_CASHOUT_FEE, - self::TYPE_CASHOUT_FUNDING, - self::TYPE_CASHOUT_REPAYMENT, + self::TYPE_REFUND, + self::TYPE_REFUND_REVERSAL, self::TYPE_CHARGEBACK, self::TYPE_CHARGEBACK_CORRECTION, self::TYPE_CHARGEBACK_REVERSAL, self::TYPE_CHARGEBACK_REVERSAL_CORRECTION, - self::TYPE_DEPOSIT_CORRECTION, - self::TYPE_FEE, - self::TYPE_GRANT, - self::TYPE_INSTALLMENT, - self::TYPE_INSTALLMENT_REVERSAL, - self::TYPE_INTERNAL_DIRECT_DEBIT, + self::TYPE_SECOND_CHARGEBACK, + self::TYPE_SECOND_CHARGEBACK_CORRECTION, + self::TYPE_ATM_WITHDRAWAL, + self::TYPE_ATM_WITHDRAWAL_REVERSAL, self::TYPE_INTERNAL_TRANSFER, - self::TYPE_INVOICE_DEDUCTION, - self::TYPE_LEFTOVER, + self::TYPE_INTERNAL_DIRECT_DEBIT, self::TYPE_MANUAL_CORRECTION, + self::TYPE_INVOICE_DEDUCTION, + self::TYPE_DEPOSIT_CORRECTION, + self::TYPE_RESERVE_ADJUSTMENT, + self::TYPE_BANK_TRANSFER, + self::TYPE_BANK_DIRECT_DEBIT, + self::TYPE_CARD_TRANSFER, self::TYPE_MISC_COST, - self::TYPE_PAYMENT, self::TYPE_PAYMENT_COST, - self::TYPE_REFUND, - self::TYPE_REFUND_REVERSAL, + self::TYPE_FEE, + self::TYPE_LEFTOVER, + self::TYPE_GRANT, + self::TYPE_CAPITAL_FUNDS_COLLECTION, + self::TYPE_CASH_OUT_INSTRUCTION, + self::TYPE_CASHOUT_FEE, + self::TYPE_CASHOUT_REPAYMENT, + self::TYPE_CASHOUT_FUNDING, self::TYPE_REPAYMENT, - self::TYPE_RESERVE_ADJUSTMENT, - self::TYPE_SECOND_CHARGEBACK, - self::TYPE_SECOND_CHARGEBACK_CORRECTION, + self::TYPE_INSTALLMENT, + self::TYPE_INSTALLMENT_REVERSAL, + self::TYPE_BALANCE_ADJUSTMENT, + self::TYPE_BALANCE_ROLLOVER, + self::TYPE_BALANCE_MIGRATION, ]; } /** @@ -920,7 +918,7 @@ public function getCategory() /** * Sets category * - * @param string $category The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. + * @param string $category The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. * * @return self */ diff --git a/src/Adyen/Model/Transfers/TransferInfo.php b/src/Adyen/Model/Transfers/TransferInfo.php index 7c41ad684..cf46c0f11 100644 --- a/src/Adyen/Model/Transfers/TransferInfo.php +++ b/src/Adyen/Model/Transfers/TransferInfo.php @@ -282,10 +282,10 @@ public function getModelName() } public const CATEGORY_BANK = 'bank'; + public const CATEGORY_CARD = 'card'; public const CATEGORY_INTERNAL = 'internal'; public const CATEGORY_ISSUED_CARD = 'issuedCard'; public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; - public const CATEGORY_CARD = 'card'; public const PRIORITIES_CROSS_BORDER = 'crossBorder'; public const PRIORITIES_FAST = 'fast'; public const PRIORITIES_INSTANT = 'instant'; @@ -311,10 +311,10 @@ public function getCategoryAllowableValues() { return [ self::CATEGORY_BANK, + self::CATEGORY_CARD, self::CATEGORY_INTERNAL, self::CATEGORY_ISSUED_CARD, self::CATEGORY_PLATFORM_PAYMENT, - self::CATEGORY_CARD, ]; } /** @@ -530,7 +530,7 @@ public function getCategory() /** * Sets category * - * @param string $category The type of transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by a Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. + * @param string $category The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by a Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. * * @return self */ diff --git a/src/Adyen/Model/Transfers/TransferNotificationCounterParty.php b/src/Adyen/Model/Transfers/TransferNotificationCounterParty.php index c2441402d..6e943e8a4 100644 --- a/src/Adyen/Model/Transfers/TransferNotificationCounterParty.php +++ b/src/Adyen/Model/Transfers/TransferNotificationCounterParty.php @@ -46,6 +46,7 @@ class TransferNotificationCounterParty implements ModelInterface, ArrayAccess, \ protected static $openAPITypes = [ 'balanceAccountId' => 'string', 'bankAccount' => '\Adyen\Model\Transfers\BankAccountV3', + 'card' => '\Adyen\Model\Transfers\Card', 'merchant' => '\Adyen\Model\Transfers\TransferNotificationMerchantData', 'transferInstrumentId' => 'string' ]; @@ -60,6 +61,7 @@ class TransferNotificationCounterParty implements ModelInterface, ArrayAccess, \ protected static $openAPIFormats = [ 'balanceAccountId' => null, 'bankAccount' => null, + 'card' => null, 'merchant' => null, 'transferInstrumentId' => null ]; @@ -72,6 +74,7 @@ class TransferNotificationCounterParty implements ModelInterface, ArrayAccess, \ protected static $openAPINullables = [ 'balanceAccountId' => false, 'bankAccount' => false, + 'card' => false, 'merchant' => false, 'transferInstrumentId' => false ]; @@ -164,6 +167,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'balanceAccountId' => 'balanceAccountId', 'bankAccount' => 'bankAccount', + 'card' => 'card', 'merchant' => 'merchant', 'transferInstrumentId' => 'transferInstrumentId' ]; @@ -176,6 +180,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'balanceAccountId' => 'setBalanceAccountId', 'bankAccount' => 'setBankAccount', + 'card' => 'setCard', 'merchant' => 'setMerchant', 'transferInstrumentId' => 'setTransferInstrumentId' ]; @@ -188,6 +193,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'balanceAccountId' => 'getBalanceAccountId', 'bankAccount' => 'getBankAccount', + 'card' => 'getCard', 'merchant' => 'getMerchant', 'transferInstrumentId' => 'getTransferInstrumentId' ]; @@ -251,6 +257,7 @@ public function __construct(array $data = null) { $this->setIfExists('balanceAccountId', $data ?? [], null); $this->setIfExists('bankAccount', $data ?? [], null); + $this->setIfExists('card', $data ?? [], null); $this->setIfExists('merchant', $data ?? [], null); $this->setIfExists('transferInstrumentId', $data ?? [], null); } @@ -310,7 +317,7 @@ public function getBalanceAccountId() /** * Sets balanceAccountId * - * @param string|null $balanceAccountId The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). + * @param string|null $balanceAccountId The unique identifier of the counterparty [balance account](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id). * * @return self */ @@ -345,6 +352,30 @@ public function setBankAccount($bankAccount) return $this; } + /** + * Gets card + * + * @return \Adyen\Model\Transfers\Card|null + */ + public function getCard() + { + return $this->container['card']; + } + + /** + * Sets card + * + * @param \Adyen\Model\Transfers\Card|null $card card + * + * @return self + */ + public function setCard($card) + { + $this->container['card'] = $card; + + return $this; + } + /** * Gets merchant * @@ -382,7 +413,7 @@ public function getTransferInstrumentId() /** * Sets transferInstrumentId * - * @param string|null $transferInstrumentId The unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * @param string|null $transferInstrumentId The unique identifier of the counterparty [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id). * * @return self */ diff --git a/src/Adyen/Model/Transfers/UltimatePartyIdentification.php b/src/Adyen/Model/Transfers/UltimatePartyIdentification.php index c6c1ed2c8..baf77b3a1 100644 --- a/src/Adyen/Model/Transfers/UltimatePartyIdentification.php +++ b/src/Adyen/Model/Transfers/UltimatePartyIdentification.php @@ -319,9 +319,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['fullName'] === null) { - $invalidProperties[] = "'fullName' can't be null"; - } $allowedValues = $this->getTypeAllowableValues(); if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -383,7 +380,7 @@ public function getDateOfBirth() /** * Sets dateOfBirth * - * @param \DateTime|null $dateOfBirth The date of birth of the individual in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. For example, **YYYY-MM-DD**. Should not be before January 1, 1900. Allowed only when `type` is **individual**. + * @param \DateTime|null $dateOfBirth The date of birth of the individual in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. For example, **YYYY-MM-DD**. Allowed only when `type` is **individual**. * * @return self */ @@ -407,7 +404,7 @@ public function getFirstName() /** * Sets firstName * - * @param string|null $firstName First name of the individual. Allowed only when `type` is **individual**. Supported characters: [a-z] [A-Z] - . / — and Space. + * @param string|null $firstName The first name of the individual. Supported characters: [a-z] [A-Z] - . / — and space. This parameter is: - Allowed only when `type` is **individual**. - Required when `category` is **card**. * * @return self */ @@ -421,7 +418,7 @@ public function setFirstName($firstName) /** * Gets fullName * - * @return string + * @return string|null */ public function getFullName() { @@ -431,7 +428,7 @@ public function getFullName() /** * Sets fullName * - * @param string $fullName The name of the entity. Supported characters: [a-z] [A-Z] [0-9] , . ; : - — / \\ + & ! ? @ ( ) \" ' and Space. + * @param string|null $fullName The full name of the entity that owns the bank account or card. Supported characters: [a-z] [A-Z] [0-9] , . ; : - — / \\ + & ! ? @ ( ) \" ' and space. Required when `category` is **bank**. * * @return self */ @@ -455,7 +452,7 @@ public function getLastName() /** * Sets lastName * - * @param string|null $lastName Last name of the individual. Allowed only when `type` is **individual**. Supported characters: [a-z] [A-Z] - . / — and Space. + * @param string|null $lastName The last name of the individual. Supported characters: [a-z] [A-Z] - . / — and space. This parameter is: - Allowed only when `type` is **individual**. - Required when `category` is **card**. * * @return self */ @@ -479,7 +476,7 @@ public function getReference() /** * Sets reference * - * @param string|null $reference A unique reference to identify the party or counterparty involved in transfers. This identifier ensures consistency and uniqueness throughout all transactions initiated to and from the same party. For example, your client's unique wallet or payee ID. + * @param string|null $reference A unique reference to identify the party or counterparty involved in the transfer. For example, your client's unique wallet or payee ID. Required when you include `cardIdentification.storedPaymentMethodId`. * * @return self */ @@ -503,7 +500,7 @@ public function getType() /** * Sets type * - * @param string|null $type The type of entity that owns the bank account. Possible values: **individual**, **organization**, or **unknown**. + * @param string|null $type The type of entity that owns the bank account or card. Possible values: **individual**, **organization**, or **unknown**. Required when `category` is **card**. In this case, the value must be **individual**. * * @return self */ diff --git a/src/Adyen/Service/Checkout/DonationsApi.php b/src/Adyen/Service/Checkout/DonationsApi.php index edd993249..881ff6d23 100644 --- a/src/Adyen/Service/Checkout/DonationsApi.php +++ b/src/Adyen/Service/Checkout/DonationsApi.php @@ -39,6 +39,21 @@ public function __construct(Client $client) $this->baseURL = $this->createBaseUrl("https://checkout-test.adyen.com/v71"); } + /** + * Get a list of donation campaigns. + * + * @param \Adyen\Model\Checkout\DonationCampaignsRequest $donationCampaignsRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Checkout\DonationCampaignsResponse + * @throws AdyenException + */ + public function donationCampaigns(\Adyen\Model\Checkout\DonationCampaignsRequest $donationCampaignsRequest, array $requestOptions = null): \Adyen\Model\Checkout\DonationCampaignsResponse + { + $endpoint = $this->baseURL . "/donationCampaigns"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $donationCampaignsRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\DonationCampaignsResponse::class); + } + /** * Start a transaction for donations *