diff --git a/Makefile b/Makefile index 88ca05f0b..88fe151b3 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,8 @@ $(modelGen): target/spec $(openapi-generator-jar) -g $(generator) \ -o $(output) \ -t ./templates \ - --inline-schema-name-mappings DonationPaymentRequest_paymentMethod=CheckoutPaymentMethod \ + --inline-schema-name-mappings PaymentRequest_paymentMethod=CheckoutPaymentMethod \ + --inline-schema-name-mappings DonationPaymentRequest_paymentMethod=DonationPaymentMethod \ --model-package Model\\$@ \ --api-package Service\\$@ \ --reserved-words-mappings configuration=configuration \ @@ -74,7 +75,8 @@ $(Services): target/spec $(openapi-generator-jar) -g $(generator) \ -o $(output) \ -t ./templates \ - --inline-schema-name-mappings DonationPaymentRequest_paymentMethod=CheckoutPaymentMethod \ + --inline-schema-name-mappings PaymentRequest_paymentMethod=CheckoutPaymentMethod \ + --inline-schema-name-mappings DonationPaymentRequest_paymentMethod=DonationPaymentMethod \ --model-package Model\\$@ \ --api-package Service\\$@ \ --inline-schema-name-mappings BankAccountInfo_accountIdentification=BankAccount \ @@ -98,7 +100,8 @@ $(SingleFileServices): target/spec $(openapi-generator-jar) -c templates/config.yaml \ --model-package Model\\$@ \ --api-package Service\\$@ \ - --inline-schema-name-mappings DonationPaymentRequest_paymentMethod=CheckoutPaymentMethod \ + --inline-schema-name-mappings PaymentRequest_paymentMethod=CheckoutPaymentMethod \ + --inline-schema-name-mappings DonationPaymentRequest_paymentMethod=DonationPaymentMethod \ --reserved-words-mappings configuration=configuration \ --skip-validate-spec \ --additional-properties variableNamingConvention=camelCase \ diff --git a/src/Adyen/Model/Checkout/BillingAddress.php b/src/Adyen/Model/Checkout/BillingAddress.php new file mode 100644 index 000000000..9737f8435 --- /dev/null +++ b/src/Adyen/Model/Checkout/BillingAddress.php @@ -0,0 +1,569 @@ + + */ +class BillingAddress implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BillingAddress'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'country' => 'string', + 'houseNumberOrName' => 'string', + 'postalCode' => 'string', + 'stateOrProvince' => 'string', + 'street' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'city' => null, + 'country' => null, + 'houseNumberOrName' => null, + 'postalCode' => null, + 'stateOrProvince' => null, + 'street' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'city' => false, + 'country' => false, + 'houseNumberOrName' => false, + 'postalCode' => false, + 'stateOrProvince' => false, + 'street' => 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 = [ + 'city' => 'city', + 'country' => 'country', + 'houseNumberOrName' => 'houseNumberOrName', + 'postalCode' => 'postalCode', + 'stateOrProvince' => 'stateOrProvince', + 'street' => 'street' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'houseNumberOrName' => 'setHouseNumberOrName', + 'postalCode' => 'setPostalCode', + 'stateOrProvince' => 'setStateOrProvince', + 'street' => 'setStreet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'houseNumberOrName' => 'getHouseNumberOrName', + 'postalCode' => 'getPostalCode', + 'stateOrProvince' => 'getStateOrProvince', + 'street' => 'getStreet' + ]; + + /** + * 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('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('houseNumberOrName', $data ?? [], null); + $this->setIfExists('postalCode', $data ?? [], null); + $this->setIfExists('stateOrProvince', $data ?? [], null); + $this->setIfExists('street', $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['city'] === null) { + $invalidProperties[] = "'city' can't be null"; + } + if ($this->container['country'] === null) { + $invalidProperties[] = "'country' can't be null"; + } + if ($this->container['houseNumberOrName'] === null) { + $invalidProperties[] = "'houseNumberOrName' can't be null"; + } + if ($this->container['postalCode'] === null) { + $invalidProperties[] = "'postalCode' can't be null"; + } + if ($this->container['street'] === null) { + $invalidProperties[] = "'street' 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 city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city The name of the city. Maximum length: 3000 characters. + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets houseNumberOrName + * + * @return string + */ + public function getHouseNumberOrName() + { + return $this->container['houseNumberOrName']; + } + + /** + * Sets houseNumberOrName + * + * @param string $houseNumberOrName The number or name of the house. Maximum length: 3000 characters. + * + * @return self + */ + public function setHouseNumberOrName($houseNumberOrName) + { + if (is_null($houseNumberOrName)) { + throw new \InvalidArgumentException('non-nullable houseNumberOrName cannot be null'); + } + $this->container['houseNumberOrName'] = $houseNumberOrName; + + return $this; + } + + /** + * Gets postalCode + * + * @return string + */ + public function getPostalCode() + { + return $this->container['postalCode']; + } + + /** + * Sets postalCode + * + * @param string $postalCode A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + * + * @return self + */ + public function setPostalCode($postalCode) + { + if (is_null($postalCode)) { + throw new \InvalidArgumentException('non-nullable postalCode cannot be null'); + } + $this->container['postalCode'] = $postalCode; + + return $this; + } + + /** + * Gets stateOrProvince + * + * @return string|null + */ + public function getStateOrProvince() + { + return $this->container['stateOrProvince']; + } + + /** + * Sets stateOrProvince + * + * @param string|null $stateOrProvince The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + * + * @return self + */ + public function setStateOrProvince($stateOrProvince) + { + if (is_null($stateOrProvince)) { + throw new \InvalidArgumentException('non-nullable stateOrProvince cannot be null'); + } + $this->container['stateOrProvince'] = $stateOrProvince; + + return $this; + } + + /** + * Gets street + * + * @return string + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string $street The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + * + * @return self + */ + public function setStreet($street) + { + if (is_null($street)) { + throw new \InvalidArgumentException('non-nullable street cannot be null'); + } + $this->container['street'] = $street; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CardDetails.php b/src/Adyen/Model/Checkout/CardDetails.php index 33974d5a1..7417472c2 100644 --- a/src/Adyen/Model/Checkout/CardDetails.php +++ b/src/Adyen/Model/Checkout/CardDetails.php @@ -324,11 +324,8 @@ public function getModelName() } public const FUNDING_SOURCE_DEBIT = 'debit'; - public const TYPE_BCMC = 'bcmc'; public const TYPE_SCHEME = 'scheme'; public const TYPE_NETWORK_TOKEN = 'networkToken'; - public const TYPE_GIFTCARD = 'giftcard'; - public const TYPE_ALLIANCEDATA = 'alliancedata'; public const TYPE_CARD = 'card'; /** @@ -350,11 +347,8 @@ public function getFundingSourceAllowableValues() public function getTypeAllowableValues() { return [ - self::TYPE_BCMC, self::TYPE_SCHEME, self::TYPE_NETWORK_TOKEN, - self::TYPE_GIFTCARD, - self::TYPE_ALLIANCEDATA, self::TYPE_CARD, ]; } diff --git a/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php b/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php index faaa4cc9b..adbb7e250 100644 --- a/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php +++ b/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php @@ -51,7 +51,7 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'amount' => '\Adyen\Model\Checkout\Amount', 'applicationInfo' => '\Adyen\Model\Checkout\ApplicationInfo', 'authenticationData' => '\Adyen\Model\Checkout\AuthenticationData', - 'billingAddress' => '\Adyen\Model\Checkout\Address', + 'billingAddress' => '\Adyen\Model\Checkout\BillingAddress', 'blockedPaymentMethods' => 'string[]', 'captureDelayHours' => 'int', 'channel' => 'string', @@ -59,7 +59,7 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'countryCode' => 'string', 'dateOfBirth' => '\DateTime', 'deliverAt' => '\DateTime', - 'deliveryAddress' => '\Adyen\Model\Checkout\Address', + 'deliveryAddress' => '\Adyen\Model\Checkout\DeliveryAddress', 'enableOneClick' => 'bool', 'enablePayOut' => 'bool', 'enableRecurring' => 'bool', @@ -90,6 +90,7 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'shopperName' => '\Adyen\Model\Checkout\Name', 'shopperReference' => 'string', 'shopperStatement' => 'string', + 'showInstallmentAmount' => 'bool', 'socialSecurityNumber' => 'string', 'splitCardFundingSources' => 'bool', 'splits' => '\Adyen\Model\Checkout\Split[]', @@ -155,6 +156,7 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'shopperName' => null, 'shopperReference' => null, 'shopperStatement' => null, + 'showInstallmentAmount' => null, 'socialSecurityNumber' => null, 'splitCardFundingSources' => null, 'splits' => null, @@ -218,6 +220,7 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'shopperName' => false, 'shopperReference' => false, 'shopperStatement' => false, + 'showInstallmentAmount' => false, 'socialSecurityNumber' => false, 'splitCardFundingSources' => false, 'splits' => false, @@ -361,6 +364,7 @@ public function isNullableSetToNull(string $property): bool 'shopperName' => 'shopperName', 'shopperReference' => 'shopperReference', 'shopperStatement' => 'shopperStatement', + 'showInstallmentAmount' => 'showInstallmentAmount', 'socialSecurityNumber' => 'socialSecurityNumber', 'splitCardFundingSources' => 'splitCardFundingSources', 'splits' => 'splits', @@ -424,6 +428,7 @@ public function isNullableSetToNull(string $property): bool 'shopperName' => 'setShopperName', 'shopperReference' => 'setShopperReference', 'shopperStatement' => 'setShopperStatement', + 'showInstallmentAmount' => 'setShowInstallmentAmount', 'socialSecurityNumber' => 'setSocialSecurityNumber', 'splitCardFundingSources' => 'setSplitCardFundingSources', 'splits' => 'setSplits', @@ -487,6 +492,7 @@ public function isNullableSetToNull(string $property): bool 'shopperName' => 'getShopperName', 'shopperReference' => 'getShopperReference', 'shopperStatement' => 'getShopperStatement', + 'showInstallmentAmount' => 'getShowInstallmentAmount', 'socialSecurityNumber' => 'getSocialSecurityNumber', 'splitCardFundingSources' => 'getSplitCardFundingSources', 'splits' => 'getSplits', @@ -667,6 +673,7 @@ public function __construct(array $data = null) $this->setIfExists('shopperName', $data ?? [], null); $this->setIfExists('shopperReference', $data ?? [], null); $this->setIfExists('shopperStatement', $data ?? [], null); + $this->setIfExists('showInstallmentAmount', $data ?? [], null); $this->setIfExists('socialSecurityNumber', $data ?? [], null); $this->setIfExists('splitCardFundingSources', $data ?? [], false); $this->setIfExists('splits', $data ?? [], null); @@ -960,7 +967,7 @@ public function setAuthenticationData($authenticationData) /** * Gets billingAddress * - * @return \Adyen\Model\Checkout\Address|null + * @return \Adyen\Model\Checkout\BillingAddress|null */ public function getBillingAddress() { @@ -970,7 +977,7 @@ public function getBillingAddress() /** * Sets billingAddress * - * @param \Adyen\Model\Checkout\Address|null $billingAddress billingAddress + * @param \Adyen\Model\Checkout\BillingAddress|null $billingAddress billingAddress * * @return self */ @@ -1184,7 +1191,7 @@ public function setDeliverAt($deliverAt) /** * Gets deliveryAddress * - * @return \Adyen\Model\Checkout\Address|null + * @return \Adyen\Model\Checkout\DeliveryAddress|null */ public function getDeliveryAddress() { @@ -1194,7 +1201,7 @@ public function getDeliveryAddress() /** * Sets deliveryAddress * - * @param \Adyen\Model\Checkout\Address|null $deliveryAddress deliveryAddress + * @param \Adyen\Model\Checkout\DeliveryAddress|null $deliveryAddress deliveryAddress * * @return self */ @@ -2038,6 +2045,33 @@ public function setShopperStatement($shopperStatement) return $this; } + /** + * Gets showInstallmentAmount + * + * @return bool|null + */ + public function getShowInstallmentAmount() + { + return $this->container['showInstallmentAmount']; + } + + /** + * Sets showInstallmentAmount + * + * @param bool|null $showInstallmentAmount Set to true to show the payment amount per installment. + * + * @return self + */ + public function setShowInstallmentAmount($showInstallmentAmount) + { + if (is_null($showInstallmentAmount)) { + throw new \InvalidArgumentException('non-nullable showInstallmentAmount cannot be null'); + } + $this->container['showInstallmentAmount'] = $showInstallmentAmount; + + return $this; + } + /** * Gets socialSecurityNumber * diff --git a/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php b/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php index 5927126c1..60b93ffaf 100644 --- a/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php +++ b/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php @@ -51,7 +51,7 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'amount' => '\Adyen\Model\Checkout\Amount', 'applicationInfo' => '\Adyen\Model\Checkout\ApplicationInfo', 'authenticationData' => '\Adyen\Model\Checkout\AuthenticationData', - 'billingAddress' => '\Adyen\Model\Checkout\Address', + 'billingAddress' => '\Adyen\Model\Checkout\BillingAddress', 'blockedPaymentMethods' => 'string[]', 'captureDelayHours' => 'int', 'channel' => 'string', @@ -59,7 +59,7 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'countryCode' => 'string', 'dateOfBirth' => '\DateTime', 'deliverAt' => '\DateTime', - 'deliveryAddress' => '\Adyen\Model\Checkout\Address', + 'deliveryAddress' => '\Adyen\Model\Checkout\DeliveryAddress', 'enableOneClick' => 'bool', 'enablePayOut' => 'bool', 'enableRecurring' => 'bool', @@ -93,6 +93,7 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'shopperName' => '\Adyen\Model\Checkout\Name', 'shopperReference' => 'string', 'shopperStatement' => 'string', + 'showInstallmentAmount' => 'bool', 'socialSecurityNumber' => 'string', 'splitCardFundingSources' => 'bool', 'splits' => '\Adyen\Model\Checkout\Split[]', @@ -161,6 +162,7 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'shopperName' => null, 'shopperReference' => null, 'shopperStatement' => null, + 'showInstallmentAmount' => null, 'socialSecurityNumber' => null, 'splitCardFundingSources' => null, 'splits' => null, @@ -227,6 +229,7 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'shopperName' => false, 'shopperReference' => false, 'shopperStatement' => false, + 'showInstallmentAmount' => false, 'socialSecurityNumber' => false, 'splitCardFundingSources' => false, 'splits' => false, @@ -373,6 +376,7 @@ public function isNullableSetToNull(string $property): bool 'shopperName' => 'shopperName', 'shopperReference' => 'shopperReference', 'shopperStatement' => 'shopperStatement', + 'showInstallmentAmount' => 'showInstallmentAmount', 'socialSecurityNumber' => 'socialSecurityNumber', 'splitCardFundingSources' => 'splitCardFundingSources', 'splits' => 'splits', @@ -439,6 +443,7 @@ public function isNullableSetToNull(string $property): bool 'shopperName' => 'setShopperName', 'shopperReference' => 'setShopperReference', 'shopperStatement' => 'setShopperStatement', + 'showInstallmentAmount' => 'setShowInstallmentAmount', 'socialSecurityNumber' => 'setSocialSecurityNumber', 'splitCardFundingSources' => 'setSplitCardFundingSources', 'splits' => 'setSplits', @@ -505,6 +510,7 @@ public function isNullableSetToNull(string $property): bool 'shopperName' => 'getShopperName', 'shopperReference' => 'getShopperReference', 'shopperStatement' => 'getShopperStatement', + 'showInstallmentAmount' => 'getShowInstallmentAmount', 'socialSecurityNumber' => 'getSocialSecurityNumber', 'splitCardFundingSources' => 'getSplitCardFundingSources', 'splits' => 'getSplits', @@ -702,6 +708,7 @@ public function __construct(array $data = null) $this->setIfExists('shopperName', $data ?? [], null); $this->setIfExists('shopperReference', $data ?? [], null); $this->setIfExists('shopperStatement', $data ?? [], null); + $this->setIfExists('showInstallmentAmount', $data ?? [], null); $this->setIfExists('socialSecurityNumber', $data ?? [], null); $this->setIfExists('splitCardFundingSources', $data ?? [], false); $this->setIfExists('splits', $data ?? [], null); @@ -1010,7 +1017,7 @@ public function setAuthenticationData($authenticationData) /** * Gets billingAddress * - * @return \Adyen\Model\Checkout\Address|null + * @return \Adyen\Model\Checkout\BillingAddress|null */ public function getBillingAddress() { @@ -1020,7 +1027,7 @@ public function getBillingAddress() /** * Sets billingAddress * - * @param \Adyen\Model\Checkout\Address|null $billingAddress billingAddress + * @param \Adyen\Model\Checkout\BillingAddress|null $billingAddress billingAddress * * @return self */ @@ -1234,7 +1241,7 @@ public function setDeliverAt($deliverAt) /** * Gets deliveryAddress * - * @return \Adyen\Model\Checkout\Address|null + * @return \Adyen\Model\Checkout\DeliveryAddress|null */ public function getDeliveryAddress() { @@ -1244,7 +1251,7 @@ public function getDeliveryAddress() /** * Sets deliveryAddress * - * @param \Adyen\Model\Checkout\Address|null $deliveryAddress deliveryAddress + * @param \Adyen\Model\Checkout\DeliveryAddress|null $deliveryAddress deliveryAddress * * @return self */ @@ -2179,6 +2186,33 @@ public function setShopperStatement($shopperStatement) return $this; } + /** + * Gets showInstallmentAmount + * + * @return bool|null + */ + public function getShowInstallmentAmount() + { + return $this->container['showInstallmentAmount']; + } + + /** + * Sets showInstallmentAmount + * + * @param bool|null $showInstallmentAmount Set to true to show the payment amount per installment. + * + * @return self + */ + public function setShowInstallmentAmount($showInstallmentAmount) + { + if (is_null($showInstallmentAmount)) { + throw new \InvalidArgumentException('non-nullable showInstallmentAmount cannot be null'); + } + $this->container['showInstallmentAmount'] = $showInstallmentAmount; + + return $this; + } + /** * Gets socialSecurityNumber * diff --git a/src/Adyen/Model/Checkout/DeliveryAddress.php b/src/Adyen/Model/Checkout/DeliveryAddress.php new file mode 100644 index 000000000..079dc1f63 --- /dev/null +++ b/src/Adyen/Model/Checkout/DeliveryAddress.php @@ -0,0 +1,637 @@ + + */ +class DeliveryAddress implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DeliveryAddress'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'country' => 'string', + 'firstName' => 'string', + 'houseNumberOrName' => 'string', + 'lastName' => 'string', + 'postalCode' => 'string', + 'stateOrProvince' => 'string', + 'street' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'city' => null, + 'country' => null, + 'firstName' => null, + 'houseNumberOrName' => null, + 'lastName' => null, + 'postalCode' => null, + 'stateOrProvince' => null, + 'street' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'city' => false, + 'country' => false, + 'firstName' => false, + 'houseNumberOrName' => false, + 'lastName' => false, + 'postalCode' => false, + 'stateOrProvince' => false, + 'street' => 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 = [ + 'city' => 'city', + 'country' => 'country', + 'firstName' => 'firstName', + 'houseNumberOrName' => 'houseNumberOrName', + 'lastName' => 'lastName', + 'postalCode' => 'postalCode', + 'stateOrProvince' => 'stateOrProvince', + 'street' => 'street' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'firstName' => 'setFirstName', + 'houseNumberOrName' => 'setHouseNumberOrName', + 'lastName' => 'setLastName', + 'postalCode' => 'setPostalCode', + 'stateOrProvince' => 'setStateOrProvince', + 'street' => 'setStreet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'firstName' => 'getFirstName', + 'houseNumberOrName' => 'getHouseNumberOrName', + 'lastName' => 'getLastName', + 'postalCode' => 'getPostalCode', + 'stateOrProvince' => 'getStateOrProvince', + 'street' => 'getStreet' + ]; + + /** + * 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('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('firstName', $data ?? [], null); + $this->setIfExists('houseNumberOrName', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('postalCode', $data ?? [], null); + $this->setIfExists('stateOrProvince', $data ?? [], null); + $this->setIfExists('street', $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['city'] === null) { + $invalidProperties[] = "'city' can't be null"; + } + if ($this->container['country'] === null) { + $invalidProperties[] = "'country' can't be null"; + } + if ($this->container['houseNumberOrName'] === null) { + $invalidProperties[] = "'houseNumberOrName' can't be null"; + } + if ($this->container['postalCode'] === null) { + $invalidProperties[] = "'postalCode' can't be null"; + } + if ($this->container['street'] === null) { + $invalidProperties[] = "'street' 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 city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city The name of the city. Maximum length: 3000 characters. + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets firstName + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string|null $firstName firstName + * + * @return self + */ + public function setFirstName($firstName) + { + if (is_null($firstName)) { + throw new \InvalidArgumentException('non-nullable firstName cannot be null'); + } + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets houseNumberOrName + * + * @return string + */ + public function getHouseNumberOrName() + { + return $this->container['houseNumberOrName']; + } + + /** + * Sets houseNumberOrName + * + * @param string $houseNumberOrName The number or name of the house. Maximum length: 3000 characters. + * + * @return self + */ + public function setHouseNumberOrName($houseNumberOrName) + { + if (is_null($houseNumberOrName)) { + throw new \InvalidArgumentException('non-nullable houseNumberOrName cannot be null'); + } + $this->container['houseNumberOrName'] = $houseNumberOrName; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName() + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName lastName + * + * @return self + */ + public function setLastName($lastName) + { + if (is_null($lastName)) { + throw new \InvalidArgumentException('non-nullable lastName cannot be null'); + } + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets postalCode + * + * @return string + */ + public function getPostalCode() + { + return $this->container['postalCode']; + } + + /** + * Sets postalCode + * + * @param string $postalCode A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + * + * @return self + */ + public function setPostalCode($postalCode) + { + if (is_null($postalCode)) { + throw new \InvalidArgumentException('non-nullable postalCode cannot be null'); + } + $this->container['postalCode'] = $postalCode; + + return $this; + } + + /** + * Gets stateOrProvince + * + * @return string|null + */ + public function getStateOrProvince() + { + return $this->container['stateOrProvince']; + } + + /** + * Sets stateOrProvince + * + * @param string|null $stateOrProvince The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + * + * @return self + */ + public function setStateOrProvince($stateOrProvince) + { + if (is_null($stateOrProvince)) { + throw new \InvalidArgumentException('non-nullable stateOrProvince cannot be null'); + } + $this->container['stateOrProvince'] = $stateOrProvince; + + return $this; + } + + /** + * Gets street + * + * @return string + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string $street The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + * + * @return self + */ + public function setStreet($street) + { + if (is_null($street)) { + throw new \InvalidArgumentException('non-nullable street cannot be null'); + } + $this->container['street'] = $street; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/DokuDetails.php b/src/Adyen/Model/Checkout/DokuDetails.php index ee312f037..380af0987 100644 --- a/src/Adyen/Model/Checkout/DokuDetails.php +++ b/src/Adyen/Model/Checkout/DokuDetails.php @@ -248,6 +248,8 @@ public function getModelName() public const TYPE_BCA_VA = 'doku_bca_va'; public const TYPE_ALFAMART = 'doku_alfamart'; public const TYPE_INDOMARET = 'doku_indomaret'; + public const TYPE_WALLET = 'doku_wallet'; + public const TYPE_OVO = 'doku_ovo'; /** * Gets allowable values of the enum @@ -266,6 +268,8 @@ public function getTypeAllowableValues() self::TYPE_BCA_VA, self::TYPE_ALFAMART, self::TYPE_INDOMARET, + self::TYPE_WALLET, + self::TYPE_OVO, ]; } /** diff --git a/src/Adyen/Model/Checkout/DonationPaymentMethod.php b/src/Adyen/Model/Checkout/DonationPaymentMethod.php new file mode 100644 index 000000000..12feb6c09 --- /dev/null +++ b/src/Adyen/Model/Checkout/DonationPaymentMethod.php @@ -0,0 +1,1113 @@ + + */ +class DonationPaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DonationPaymentMethod'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'applePayToken' => 'string', + 'checkoutAttemptId' => 'string', + 'fundingSource' => 'string', + 'recurringDetailReference' => 'string', + 'storedPaymentMethodId' => 'string', + 'type' => 'string', + 'brand' => 'string', + 'cupsecureplusSmscode' => 'string', + 'cvc' => 'string', + 'encryptedCardNumber' => 'string', + 'encryptedExpiryMonth' => 'string', + 'encryptedExpiryYear' => 'string', + 'encryptedSecurityCode' => 'string', + 'expiryMonth' => 'string', + 'expiryYear' => 'string', + 'holderName' => 'string', + 'networkPaymentReference' => 'string', + 'number' => 'string', + 'shopperNotificationReference' => 'string', + 'threeDS2SdkVersion' => 'string', + 'googlePayToken' => 'string', + 'issuer' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'applePayToken' => null, + 'checkoutAttemptId' => null, + 'fundingSource' => null, + 'recurringDetailReference' => null, + 'storedPaymentMethodId' => null, + 'type' => null, + 'brand' => null, + 'cupsecureplusSmscode' => null, + 'cvc' => null, + 'encryptedCardNumber' => null, + 'encryptedExpiryMonth' => null, + 'encryptedExpiryYear' => null, + 'encryptedSecurityCode' => null, + 'expiryMonth' => null, + 'expiryYear' => null, + 'holderName' => null, + 'networkPaymentReference' => null, + 'number' => null, + 'shopperNotificationReference' => null, + 'threeDS2SdkVersion' => null, + 'googlePayToken' => null, + 'issuer' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'applePayToken' => false, + 'checkoutAttemptId' => false, + 'fundingSource' => false, + 'recurringDetailReference' => false, + 'storedPaymentMethodId' => false, + 'type' => false, + 'brand' => false, + 'cupsecureplusSmscode' => false, + 'cvc' => false, + 'encryptedCardNumber' => false, + 'encryptedExpiryMonth' => false, + 'encryptedExpiryYear' => false, + 'encryptedSecurityCode' => false, + 'expiryMonth' => false, + 'expiryYear' => false, + 'holderName' => false, + 'networkPaymentReference' => false, + 'number' => false, + 'shopperNotificationReference' => false, + 'threeDS2SdkVersion' => false, + 'googlePayToken' => false, + 'issuer' => 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 = [ + 'applePayToken' => 'applePayToken', + 'checkoutAttemptId' => 'checkoutAttemptId', + 'fundingSource' => 'fundingSource', + 'recurringDetailReference' => 'recurringDetailReference', + 'storedPaymentMethodId' => 'storedPaymentMethodId', + 'type' => 'type', + 'brand' => 'brand', + 'cupsecureplusSmscode' => 'cupsecureplus.smscode', + 'cvc' => 'cvc', + 'encryptedCardNumber' => 'encryptedCardNumber', + 'encryptedExpiryMonth' => 'encryptedExpiryMonth', + 'encryptedExpiryYear' => 'encryptedExpiryYear', + 'encryptedSecurityCode' => 'encryptedSecurityCode', + 'expiryMonth' => 'expiryMonth', + 'expiryYear' => 'expiryYear', + 'holderName' => 'holderName', + 'networkPaymentReference' => 'networkPaymentReference', + 'number' => 'number', + 'shopperNotificationReference' => 'shopperNotificationReference', + 'threeDS2SdkVersion' => 'threeDS2SdkVersion', + 'googlePayToken' => 'googlePayToken', + 'issuer' => 'issuer' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'applePayToken' => 'setApplePayToken', + 'checkoutAttemptId' => 'setCheckoutAttemptId', + 'fundingSource' => 'setFundingSource', + 'recurringDetailReference' => 'setRecurringDetailReference', + 'storedPaymentMethodId' => 'setStoredPaymentMethodId', + 'type' => 'setType', + 'brand' => 'setBrand', + 'cupsecureplusSmscode' => 'setCupsecureplusSmscode', + 'cvc' => 'setCvc', + 'encryptedCardNumber' => 'setEncryptedCardNumber', + 'encryptedExpiryMonth' => 'setEncryptedExpiryMonth', + 'encryptedExpiryYear' => 'setEncryptedExpiryYear', + 'encryptedSecurityCode' => 'setEncryptedSecurityCode', + 'expiryMonth' => 'setExpiryMonth', + 'expiryYear' => 'setExpiryYear', + 'holderName' => 'setHolderName', + 'networkPaymentReference' => 'setNetworkPaymentReference', + 'number' => 'setNumber', + 'shopperNotificationReference' => 'setShopperNotificationReference', + 'threeDS2SdkVersion' => 'setThreeDS2SdkVersion', + 'googlePayToken' => 'setGooglePayToken', + 'issuer' => 'setIssuer' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'applePayToken' => 'getApplePayToken', + 'checkoutAttemptId' => 'getCheckoutAttemptId', + 'fundingSource' => 'getFundingSource', + 'recurringDetailReference' => 'getRecurringDetailReference', + 'storedPaymentMethodId' => 'getStoredPaymentMethodId', + 'type' => 'getType', + 'brand' => 'getBrand', + 'cupsecureplusSmscode' => 'getCupsecureplusSmscode', + 'cvc' => 'getCvc', + 'encryptedCardNumber' => 'getEncryptedCardNumber', + 'encryptedExpiryMonth' => 'getEncryptedExpiryMonth', + 'encryptedExpiryYear' => 'getEncryptedExpiryYear', + 'encryptedSecurityCode' => 'getEncryptedSecurityCode', + 'expiryMonth' => 'getExpiryMonth', + 'expiryYear' => 'getExpiryYear', + 'holderName' => 'getHolderName', + 'networkPaymentReference' => 'getNetworkPaymentReference', + 'number' => 'getNumber', + 'shopperNotificationReference' => 'getShopperNotificationReference', + 'threeDS2SdkVersion' => 'getThreeDS2SdkVersion', + 'googlePayToken' => 'getGooglePayToken', + 'issuer' => 'getIssuer' + ]; + + /** + * 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('applePayToken', $data ?? [], null); + $this->setIfExists('checkoutAttemptId', $data ?? [], null); + $this->setIfExists('fundingSource', $data ?? [], null); + $this->setIfExists('recurringDetailReference', $data ?? [], null); + $this->setIfExists('storedPaymentMethodId', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'paywithgoogle'); + $this->setIfExists('brand', $data ?? [], null); + $this->setIfExists('cupsecureplusSmscode', $data ?? [], null); + $this->setIfExists('cvc', $data ?? [], null); + $this->setIfExists('encryptedCardNumber', $data ?? [], null); + $this->setIfExists('encryptedExpiryMonth', $data ?? [], null); + $this->setIfExists('encryptedExpiryYear', $data ?? [], null); + $this->setIfExists('encryptedSecurityCode', $data ?? [], null); + $this->setIfExists('expiryMonth', $data ?? [], null); + $this->setIfExists('expiryYear', $data ?? [], null); + $this->setIfExists('holderName', $data ?? [], null); + $this->setIfExists('networkPaymentReference', $data ?? [], null); + $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('shopperNotificationReference', $data ?? [], null); + $this->setIfExists('threeDS2SdkVersion', $data ?? [], null); + $this->setIfExists('googlePayToken', $data ?? [], null); + $this->setIfExists('issuer', $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['applePayToken'] === null) { + $invalidProperties[] = "'applePayToken' can't be null"; + } + + + if ($this->container['googlePayToken'] === null) { + $invalidProperties[] = "'googlePayToken' can't be null"; + } + if ($this->container['issuer'] === null) { + $invalidProperties[] = "'issuer' 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 applePayToken + * + * @return string + */ + public function getApplePayToken() + { + return $this->container['applePayToken']; + } + + /** + * Sets applePayToken + * + * @param string $applePayToken The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. + * + * @return self + */ + public function setApplePayToken($applePayToken) + { + if (is_null($applePayToken)) { + throw new \InvalidArgumentException('non-nullable applePayToken cannot be null'); + } + $this->container['applePayToken'] = $applePayToken; + + return $this; + } + + /** + * Gets checkoutAttemptId + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkoutAttemptId']; + } + + /** + * Sets checkoutAttemptId + * + * @param string|null $checkoutAttemptId The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkoutAttemptId) + { + if (is_null($checkoutAttemptId)) { + throw new \InvalidArgumentException('non-nullable checkoutAttemptId cannot be null'); + } + $this->container['checkoutAttemptId'] = $checkoutAttemptId; + + return $this; + } + + /** + * Gets fundingSource + * + * @return string|null + */ + public function getFundingSource() + { + return $this->container['fundingSource']; + } + + /** + * Sets fundingSource + * + * @param string|null $fundingSource The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + * + * @return self + */ + public function setFundingSource($fundingSource) + { + if (is_null($fundingSource)) { + throw new \InvalidArgumentException('non-nullable fundingSource cannot be null'); + } + $this->container['fundingSource'] = $fundingSource; + + return $this; + } + + /** + * Gets recurringDetailReference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurringDetailReference']; + } + + /** + * Sets recurringDetailReference + * + * @param string|null $recurringDetailReference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurringDetailReference) + { + if (is_null($recurringDetailReference)) { + throw new \InvalidArgumentException('non-nullable recurringDetailReference cannot be null'); + } + $this->container['recurringDetailReference'] = $recurringDetailReference; + + return $this; + } + + /** + * Gets storedPaymentMethodId + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['storedPaymentMethodId']; + } + + /** + * Sets storedPaymentMethodId + * + * @param string|null $storedPaymentMethodId This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($storedPaymentMethodId) + { + if (is_null($storedPaymentMethodId)) { + throw new \InvalidArgumentException('non-nullable storedPaymentMethodId cannot be null'); + } + $this->container['storedPaymentMethodId'] = $storedPaymentMethodId; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **paywithgoogle** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets brand + * + * @return string|null + */ + public function getBrand() + { + return $this->container['brand']; + } + + /** + * Sets brand + * + * @param string|null $brand Secondary brand of the card. For example: **plastix**, **hmclub**. + * + * @return self + */ + public function setBrand($brand) + { + if (is_null($brand)) { + throw new \InvalidArgumentException('non-nullable brand cannot be null'); + } + $this->container['brand'] = $brand; + + return $this; + } + + /** + * Gets cupsecureplusSmscode + * + * @return string|null + * @deprecated + */ + public function getCupsecureplusSmscode() + { + return $this->container['cupsecureplusSmscode']; + } + + /** + * Sets cupsecureplusSmscode + * + * @param string|null $cupsecureplusSmscode cupsecureplusSmscode + * + * @return self + * @deprecated + */ + public function setCupsecureplusSmscode($cupsecureplusSmscode) + { + if (is_null($cupsecureplusSmscode)) { + throw new \InvalidArgumentException('non-nullable cupsecureplusSmscode cannot be null'); + } + $this->container['cupsecureplusSmscode'] = $cupsecureplusSmscode; + + return $this; + } + + /** + * Gets cvc + * + * @return string|null + */ + public function getCvc() + { + return $this->container['cvc']; + } + + /** + * Sets cvc + * + * @param string|null $cvc The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @return self + */ + public function setCvc($cvc) + { + if (is_null($cvc)) { + throw new \InvalidArgumentException('non-nullable cvc cannot be null'); + } + $this->container['cvc'] = $cvc; + + return $this; + } + + /** + * Gets encryptedCardNumber + * + * @return string|null + */ + public function getEncryptedCardNumber() + { + return $this->container['encryptedCardNumber']; + } + + /** + * Sets encryptedCardNumber + * + * @param string|null $encryptedCardNumber The encrypted card number. + * + * @return self + */ + public function setEncryptedCardNumber($encryptedCardNumber) + { + if (is_null($encryptedCardNumber)) { + throw new \InvalidArgumentException('non-nullable encryptedCardNumber cannot be null'); + } + $this->container['encryptedCardNumber'] = $encryptedCardNumber; + + return $this; + } + + /** + * Gets encryptedExpiryMonth + * + * @return string|null + */ + public function getEncryptedExpiryMonth() + { + return $this->container['encryptedExpiryMonth']; + } + + /** + * Sets encryptedExpiryMonth + * + * @param string|null $encryptedExpiryMonth The encrypted card expiry month. + * + * @return self + */ + public function setEncryptedExpiryMonth($encryptedExpiryMonth) + { + if (is_null($encryptedExpiryMonth)) { + throw new \InvalidArgumentException('non-nullable encryptedExpiryMonth cannot be null'); + } + $this->container['encryptedExpiryMonth'] = $encryptedExpiryMonth; + + return $this; + } + + /** + * Gets encryptedExpiryYear + * + * @return string|null + */ + public function getEncryptedExpiryYear() + { + return $this->container['encryptedExpiryYear']; + } + + /** + * Sets encryptedExpiryYear + * + * @param string|null $encryptedExpiryYear The encrypted card expiry year. + * + * @return self + */ + public function setEncryptedExpiryYear($encryptedExpiryYear) + { + if (is_null($encryptedExpiryYear)) { + throw new \InvalidArgumentException('non-nullable encryptedExpiryYear cannot be null'); + } + $this->container['encryptedExpiryYear'] = $encryptedExpiryYear; + + return $this; + } + + /** + * Gets encryptedSecurityCode + * + * @return string|null + */ + public function getEncryptedSecurityCode() + { + return $this->container['encryptedSecurityCode']; + } + + /** + * Sets encryptedSecurityCode + * + * @param string|null $encryptedSecurityCode The encrypted card verification code. + * + * @return self + */ + public function setEncryptedSecurityCode($encryptedSecurityCode) + { + if (is_null($encryptedSecurityCode)) { + throw new \InvalidArgumentException('non-nullable encryptedSecurityCode cannot be null'); + } + $this->container['encryptedSecurityCode'] = $encryptedSecurityCode; + + return $this; + } + + /** + * Gets expiryMonth + * + * @return string|null + */ + public function getExpiryMonth() + { + return $this->container['expiryMonth']; + } + + /** + * Sets expiryMonth + * + * @param string|null $expiryMonth The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @return self + */ + public function setExpiryMonth($expiryMonth) + { + if (is_null($expiryMonth)) { + throw new \InvalidArgumentException('non-nullable expiryMonth cannot be null'); + } + $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 card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @return self + */ + public function setExpiryYear($expiryYear) + { + if (is_null($expiryYear)) { + throw new \InvalidArgumentException('non-nullable expiryYear cannot be null'); + } + $this->container['expiryYear'] = $expiryYear; + + return $this; + } + + /** + * Gets holderName + * + * @return string|null + */ + public function getHolderName() + { + return $this->container['holderName']; + } + + /** + * Sets holderName + * + * @param string|null $holderName The name of the card holder. + * + * @return self + */ + public function setHolderName($holderName) + { + if (is_null($holderName)) { + throw new \InvalidArgumentException('non-nullable holderName cannot be null'); + } + $this->container['holderName'] = $holderName; + + return $this; + } + + /** + * Gets networkPaymentReference + * + * @return string|null + */ + public function getNetworkPaymentReference() + { + return $this->container['networkPaymentReference']; + } + + /** + * Sets networkPaymentReference + * + * @param string|null $networkPaymentReference The network token reference. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. + * + * @return self + */ + public function setNetworkPaymentReference($networkPaymentReference) + { + if (is_null($networkPaymentReference)) { + throw new \InvalidArgumentException('non-nullable networkPaymentReference cannot be null'); + } + $this->container['networkPaymentReference'] = $networkPaymentReference; + + return $this; + } + + /** + * Gets number + * + * @return string|null + */ + public function getNumber() + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string|null $number The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @return self + */ + public function setNumber($number) + { + if (is_null($number)) { + throw new \InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets shopperNotificationReference + * + * @return string|null + */ + public function getShopperNotificationReference() + { + return $this->container['shopperNotificationReference']; + } + + /** + * Sets shopperNotificationReference + * + * @param string|null $shopperNotificationReference The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India. + * + * @return self + */ + public function setShopperNotificationReference($shopperNotificationReference) + { + if (is_null($shopperNotificationReference)) { + throw new \InvalidArgumentException('non-nullable shopperNotificationReference cannot be null'); + } + $this->container['shopperNotificationReference'] = $shopperNotificationReference; + + return $this; + } + + /** + * Gets threeDS2SdkVersion + * + * @return string|null + */ + public function getThreeDS2SdkVersion() + { + return $this->container['threeDS2SdkVersion']; + } + + /** + * Sets threeDS2SdkVersion + * + * @param string|null $threeDS2SdkVersion Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. + * + * @return self + */ + public function setThreeDS2SdkVersion($threeDS2SdkVersion) + { + if (is_null($threeDS2SdkVersion)) { + throw new \InvalidArgumentException('non-nullable threeDS2SdkVersion cannot be null'); + } + $this->container['threeDS2SdkVersion'] = $threeDS2SdkVersion; + + return $this; + } + + /** + * Gets googlePayToken + * + * @return string + */ + public function getGooglePayToken() + { + return $this->container['googlePayToken']; + } + + /** + * Sets googlePayToken + * + * @param string $googlePayToken The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + * + * @return self + */ + public function setGooglePayToken($googlePayToken) + { + if (is_null($googlePayToken)) { + throw new \InvalidArgumentException('non-nullable googlePayToken cannot be null'); + } + $this->container['googlePayToken'] = $googlePayToken; + + return $this; + } + + /** + * Gets issuer + * + * @return string + */ + public function getIssuer() + { + return $this->container['issuer']; + } + + /** + * Sets issuer + * + * @param string $issuer The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it. + * + * @return self + */ + public function setIssuer($issuer) + { + if (is_null($issuer)) { + throw new \InvalidArgumentException('non-nullable issuer cannot be null'); + } + $this->container['issuer'] = $issuer; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/DonationPaymentRequest.php b/src/Adyen/Model/Checkout/DonationPaymentRequest.php index 566e4c719..d8b2a5251 100644 --- a/src/Adyen/Model/Checkout/DonationPaymentRequest.php +++ b/src/Adyen/Model/Checkout/DonationPaymentRequest.php @@ -47,10 +47,12 @@ class DonationPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerial 'accountInfo' => '\Adyen\Model\Checkout\AccountInfo', 'additionalAmount' => '\Adyen\Model\Checkout\Amount', 'additionalData' => 'array', + 'allowedPaymentMethods' => 'string[]', 'amount' => '\Adyen\Model\Checkout\Amount', 'applicationInfo' => '\Adyen\Model\Checkout\ApplicationInfo', 'authenticationData' => '\Adyen\Model\Checkout\AuthenticationData', - 'billingAddress' => '\Adyen\Model\Checkout\Address', + 'billingAddress' => '\Adyen\Model\Checkout\BillingAddress', + 'blockedPaymentMethods' => 'string[]', 'browserInfo' => '\Adyen\Model\Checkout\BrowserInfo', 'captureDelayHours' => 'int', 'channel' => 'string', @@ -61,7 +63,7 @@ class DonationPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerial 'dateOfBirth' => '\DateTime', 'dccQuote' => '\Adyen\Model\Checkout\ForexQuote', 'deliverAt' => '\DateTime', - 'deliveryAddress' => '\Adyen\Model\Checkout\Address', + 'deliveryAddress' => '\Adyen\Model\Checkout\DeliveryAddress', 'deliveryDate' => '\DateTime', 'deviceFingerprint' => 'string', 'donationAccount' => 'string', @@ -74,6 +76,7 @@ class DonationPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerial 'fraudOffset' => 'int', 'fundOrigin' => '\Adyen\Model\Checkout\FundOrigin', 'fundRecipient' => '\Adyen\Model\Checkout\FundRecipient', + 'fundingSource' => 'string', 'industryUsage' => 'string', 'installments' => '\Adyen\Model\Checkout\Installments', 'lineItems' => '\Adyen\Model\Checkout\LineItem[]', @@ -88,7 +91,7 @@ class DonationPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerial 'order' => '\Adyen\Model\Checkout\EncryptedOrderData', 'orderReference' => 'string', 'origin' => 'string', - 'paymentMethod' => '\Adyen\Model\Checkout\CheckoutPaymentMethod', + 'paymentMethod' => '\Adyen\Model\Checkout\DonationPaymentMethod', 'platformChargebackLogic' => '\Adyen\Model\Checkout\PlatformChargebackLogic', 'recurringExpiry' => 'string', 'recurringFrequency' => 'string', @@ -98,6 +101,7 @@ class DonationPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerial 'reference' => 'string', 'returnUrl' => 'string', 'riskData' => '\Adyen\Model\Checkout\RiskData', + 'selectedRecurringDetailReference' => 'string', 'sessionValidity' => 'string', 'shopperEmail' => 'string', 'shopperIP' => 'string', @@ -127,10 +131,12 @@ class DonationPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerial 'accountInfo' => null, 'additionalAmount' => null, 'additionalData' => null, + 'allowedPaymentMethods' => null, 'amount' => null, 'applicationInfo' => null, 'authenticationData' => null, 'billingAddress' => null, + 'blockedPaymentMethods' => null, 'browserInfo' => null, 'captureDelayHours' => 'int32', 'channel' => null, @@ -154,6 +160,7 @@ class DonationPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerial 'fraudOffset' => 'int32', 'fundOrigin' => null, 'fundRecipient' => null, + 'fundingSource' => null, 'industryUsage' => null, 'installments' => null, 'lineItems' => null, @@ -178,6 +185,7 @@ class DonationPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerial 'reference' => null, 'returnUrl' => null, 'riskData' => null, + 'selectedRecurringDetailReference' => null, 'sessionValidity' => null, 'shopperEmail' => null, 'shopperIP' => null, @@ -205,10 +213,12 @@ class DonationPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerial 'accountInfo' => false, 'additionalAmount' => false, 'additionalData' => false, + 'allowedPaymentMethods' => false, 'amount' => false, 'applicationInfo' => false, 'authenticationData' => false, 'billingAddress' => false, + 'blockedPaymentMethods' => false, 'browserInfo' => false, 'captureDelayHours' => true, 'channel' => false, @@ -232,6 +242,7 @@ class DonationPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerial 'fraudOffset' => true, 'fundOrigin' => false, 'fundRecipient' => false, + 'fundingSource' => false, 'industryUsage' => false, 'installments' => false, 'lineItems' => false, @@ -256,6 +267,7 @@ class DonationPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerial 'reference' => false, 'returnUrl' => false, 'riskData' => false, + 'selectedRecurringDetailReference' => false, 'sessionValidity' => false, 'shopperEmail' => false, 'shopperIP' => false, @@ -363,10 +375,12 @@ public function isNullableSetToNull(string $property): bool 'accountInfo' => 'accountInfo', 'additionalAmount' => 'additionalAmount', 'additionalData' => 'additionalData', + 'allowedPaymentMethods' => 'allowedPaymentMethods', 'amount' => 'amount', 'applicationInfo' => 'applicationInfo', 'authenticationData' => 'authenticationData', 'billingAddress' => 'billingAddress', + 'blockedPaymentMethods' => 'blockedPaymentMethods', 'browserInfo' => 'browserInfo', 'captureDelayHours' => 'captureDelayHours', 'channel' => 'channel', @@ -390,6 +404,7 @@ public function isNullableSetToNull(string $property): bool 'fraudOffset' => 'fraudOffset', 'fundOrigin' => 'fundOrigin', 'fundRecipient' => 'fundRecipient', + 'fundingSource' => 'fundingSource', 'industryUsage' => 'industryUsage', 'installments' => 'installments', 'lineItems' => 'lineItems', @@ -414,6 +429,7 @@ public function isNullableSetToNull(string $property): bool 'reference' => 'reference', 'returnUrl' => 'returnUrl', 'riskData' => 'riskData', + 'selectedRecurringDetailReference' => 'selectedRecurringDetailReference', 'sessionValidity' => 'sessionValidity', 'shopperEmail' => 'shopperEmail', 'shopperIP' => 'shopperIP', @@ -441,10 +457,12 @@ public function isNullableSetToNull(string $property): bool 'accountInfo' => 'setAccountInfo', 'additionalAmount' => 'setAdditionalAmount', 'additionalData' => 'setAdditionalData', + 'allowedPaymentMethods' => 'setAllowedPaymentMethods', 'amount' => 'setAmount', 'applicationInfo' => 'setApplicationInfo', 'authenticationData' => 'setAuthenticationData', 'billingAddress' => 'setBillingAddress', + 'blockedPaymentMethods' => 'setBlockedPaymentMethods', 'browserInfo' => 'setBrowserInfo', 'captureDelayHours' => 'setCaptureDelayHours', 'channel' => 'setChannel', @@ -468,6 +486,7 @@ public function isNullableSetToNull(string $property): bool 'fraudOffset' => 'setFraudOffset', 'fundOrigin' => 'setFundOrigin', 'fundRecipient' => 'setFundRecipient', + 'fundingSource' => 'setFundingSource', 'industryUsage' => 'setIndustryUsage', 'installments' => 'setInstallments', 'lineItems' => 'setLineItems', @@ -492,6 +511,7 @@ public function isNullableSetToNull(string $property): bool 'reference' => 'setReference', 'returnUrl' => 'setReturnUrl', 'riskData' => 'setRiskData', + 'selectedRecurringDetailReference' => 'setSelectedRecurringDetailReference', 'sessionValidity' => 'setSessionValidity', 'shopperEmail' => 'setShopperEmail', 'shopperIP' => 'setShopperIP', @@ -519,10 +539,12 @@ public function isNullableSetToNull(string $property): bool 'accountInfo' => 'getAccountInfo', 'additionalAmount' => 'getAdditionalAmount', 'additionalData' => 'getAdditionalData', + 'allowedPaymentMethods' => 'getAllowedPaymentMethods', 'amount' => 'getAmount', 'applicationInfo' => 'getApplicationInfo', 'authenticationData' => 'getAuthenticationData', 'billingAddress' => 'getBillingAddress', + 'blockedPaymentMethods' => 'getBlockedPaymentMethods', 'browserInfo' => 'getBrowserInfo', 'captureDelayHours' => 'getCaptureDelayHours', 'channel' => 'getChannel', @@ -546,6 +568,7 @@ public function isNullableSetToNull(string $property): bool 'fraudOffset' => 'getFraudOffset', 'fundOrigin' => 'getFundOrigin', 'fundRecipient' => 'getFundRecipient', + 'fundingSource' => 'getFundingSource', 'industryUsage' => 'getIndustryUsage', 'installments' => 'getInstallments', 'lineItems' => 'getLineItems', @@ -570,6 +593,7 @@ public function isNullableSetToNull(string $property): bool 'reference' => 'getReference', 'returnUrl' => 'getReturnUrl', 'riskData' => 'getRiskData', + 'selectedRecurringDetailReference' => 'getSelectedRecurringDetailReference', 'sessionValidity' => 'getSessionValidity', 'shopperEmail' => 'getShopperEmail', 'shopperIP' => 'getShopperIP', @@ -634,6 +658,7 @@ public function getModelName() public const CHANNEL_WEB = 'Web'; public const ENTITY_TYPE_NATURAL_PERSON = 'NaturalPerson'; public const ENTITY_TYPE_COMPANY_NAME = 'CompanyName'; + public const FUNDING_SOURCE_DEBIT = 'debit'; public const INDUSTRY_USAGE_DELAYED_CHARGE = 'delayedCharge'; public const INDUSTRY_USAGE_INSTALLMENT = 'installment'; public const INDUSTRY_USAGE_NO_SHOW = 'noShow'; @@ -670,6 +695,17 @@ public function getEntityTypeAllowableValues() self::ENTITY_TYPE_COMPANY_NAME, ]; } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFundingSourceAllowableValues() + { + return [ + self::FUNDING_SOURCE_DEBIT, + ]; + } /** * Gets allowable values of the enum * @@ -728,10 +764,12 @@ public function __construct(array $data = null) $this->setIfExists('accountInfo', $data ?? [], null); $this->setIfExists('additionalAmount', $data ?? [], null); $this->setIfExists('additionalData', $data ?? [], null); + $this->setIfExists('allowedPaymentMethods', $data ?? [], null); $this->setIfExists('amount', $data ?? [], null); $this->setIfExists('applicationInfo', $data ?? [], null); $this->setIfExists('authenticationData', $data ?? [], null); $this->setIfExists('billingAddress', $data ?? [], null); + $this->setIfExists('blockedPaymentMethods', $data ?? [], null); $this->setIfExists('browserInfo', $data ?? [], null); $this->setIfExists('captureDelayHours', $data ?? [], null); $this->setIfExists('channel', $data ?? [], null); @@ -755,6 +793,7 @@ public function __construct(array $data = null) $this->setIfExists('fraudOffset', $data ?? [], null); $this->setIfExists('fundOrigin', $data ?? [], null); $this->setIfExists('fundRecipient', $data ?? [], null); + $this->setIfExists('fundingSource', $data ?? [], null); $this->setIfExists('industryUsage', $data ?? [], null); $this->setIfExists('installments', $data ?? [], null); $this->setIfExists('lineItems', $data ?? [], null); @@ -779,6 +818,7 @@ public function __construct(array $data = null) $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('returnUrl', $data ?? [], null); $this->setIfExists('riskData', $data ?? [], null); + $this->setIfExists('selectedRecurringDetailReference', $data ?? [], null); $this->setIfExists('sessionValidity', $data ?? [], null); $this->setIfExists('shopperEmail', $data ?? [], null); $this->setIfExists('shopperIP', $data ?? [], null); @@ -848,6 +888,15 @@ public function listInvalidProperties() ); } + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!is_null($this->container['fundingSource']) && !in_array($this->container['fundingSource'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'fundingSource', must be one of '%s'", + $this->container['fundingSource'], + implode("', '", $allowedValues) + ); + } + $allowedValues = $this->getIndustryUsageAllowableValues(); if (!is_null($this->container['industryUsage']) && !in_array($this->container['industryUsage'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -983,6 +1032,33 @@ public function setAdditionalData($additionalData) return $this; } + /** + * Gets allowedPaymentMethods + * + * @return string[]|null + */ + public function getAllowedPaymentMethods() + { + return $this->container['allowedPaymentMethods']; + } + + /** + * Sets allowedPaymentMethods + * + * @param string[]|null $allowedPaymentMethods List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * + * @return self + */ + public function setAllowedPaymentMethods($allowedPaymentMethods) + { + if (is_null($allowedPaymentMethods)) { + throw new \InvalidArgumentException('non-nullable allowedPaymentMethods cannot be null'); + } + $this->container['allowedPaymentMethods'] = $allowedPaymentMethods; + + return $this; + } + /** * Gets amount * @@ -1067,7 +1143,7 @@ public function setAuthenticationData($authenticationData) /** * Gets billingAddress * - * @return \Adyen\Model\Checkout\Address|null + * @return \Adyen\Model\Checkout\BillingAddress|null */ public function getBillingAddress() { @@ -1077,7 +1153,7 @@ public function getBillingAddress() /** * Sets billingAddress * - * @param \Adyen\Model\Checkout\Address|null $billingAddress billingAddress + * @param \Adyen\Model\Checkout\BillingAddress|null $billingAddress billingAddress * * @return self */ @@ -1091,6 +1167,33 @@ public function setBillingAddress($billingAddress) return $this; } + /** + * Gets blockedPaymentMethods + * + * @return string[]|null + */ + public function getBlockedPaymentMethods() + { + return $this->container['blockedPaymentMethods']; + } + + /** + * Sets blockedPaymentMethods + * + * @param string[]|null $blockedPaymentMethods List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * + * @return self + */ + public function setBlockedPaymentMethods($blockedPaymentMethods) + { + if (is_null($blockedPaymentMethods)) { + throw new \InvalidArgumentException('non-nullable blockedPaymentMethods cannot be null'); + } + $this->container['blockedPaymentMethods'] = $blockedPaymentMethods; + + return $this; + } + /** * Gets browserInfo * @@ -1374,7 +1477,7 @@ public function setDeliverAt($deliverAt) /** * Gets deliveryAddress * - * @return \Adyen\Model\Checkout\Address|null + * @return \Adyen\Model\Checkout\DeliveryAddress|null */ public function getDeliveryAddress() { @@ -1384,7 +1487,7 @@ public function getDeliveryAddress() /** * Sets deliveryAddress * - * @param \Adyen\Model\Checkout\Address|null $deliveryAddress deliveryAddress + * @param \Adyen\Model\Checkout\DeliveryAddress|null $deliveryAddress deliveryAddress * * @return self */ @@ -1402,7 +1505,6 @@ public function setDeliveryAddress($deliveryAddress) * Gets deliveryDate * * @return \DateTime|null - * @deprecated */ public function getDeliveryDate() { @@ -1415,7 +1517,6 @@ public function getDeliveryDate() * @param \DateTime|null $deliveryDate The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 * * @return self - * @deprecated */ public function setDeliveryDate($deliveryDate) { @@ -1732,6 +1833,43 @@ public function setFundRecipient($fundRecipient) return $this; } + /** + * Gets fundingSource + * + * @return string|null + */ + public function getFundingSource() + { + return $this->container['fundingSource']; + } + + /** + * Sets fundingSource + * + * @param string|null $fundingSource The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + * + * @return self + */ + public function setFundingSource($fundingSource) + { + if (is_null($fundingSource)) { + throw new \InvalidArgumentException('non-nullable fundingSource cannot be null'); + } + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!in_array($fundingSource, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'fundingSource', must be one of '%s'", + $fundingSource, + implode("', '", $allowedValues) + ) + ); + } + $this->container['fundingSource'] = $fundingSource; + + return $this; + } + /** * Gets industryUsage * @@ -2123,7 +2261,7 @@ public function setOrigin($origin) /** * Gets paymentMethod * - * @return \Adyen\Model\Checkout\CheckoutPaymentMethod + * @return \Adyen\Model\Checkout\DonationPaymentMethod */ public function getPaymentMethod() { @@ -2133,7 +2271,7 @@ public function getPaymentMethod() /** * Sets paymentMethod * - * @param \Adyen\Model\Checkout\CheckoutPaymentMethod $paymentMethod paymentMethod + * @param \Adyen\Model\Checkout\DonationPaymentMethod $paymentMethod paymentMethod * * @return self */ @@ -2400,6 +2538,33 @@ public function setRiskData($riskData) return $this; } + /** + * Gets selectedRecurringDetailReference + * + * @return string|null + */ + public function getSelectedRecurringDetailReference() + { + return $this->container['selectedRecurringDetailReference']; + } + + /** + * Sets selectedRecurringDetailReference + * + * @param string|null $selectedRecurringDetailReference The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. + * + * @return self + */ + public function setSelectedRecurringDetailReference($selectedRecurringDetailReference) + { + if (is_null($selectedRecurringDetailReference)) { + throw new \InvalidArgumentException('non-nullable selectedRecurringDetailReference cannot be null'); + } + $this->container['selectedRecurringDetailReference'] = $selectedRecurringDetailReference; + + return $this; + } + /** * Gets sessionValidity * diff --git a/src/Adyen/Model/Checkout/PaymentAmountUpdateRequest.php b/src/Adyen/Model/Checkout/PaymentAmountUpdateRequest.php index 315daaadf..c41746a3f 100644 --- a/src/Adyen/Model/Checkout/PaymentAmountUpdateRequest.php +++ b/src/Adyen/Model/Checkout/PaymentAmountUpdateRequest.php @@ -45,6 +45,7 @@ class PaymentAmountUpdateRequest implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPITypes = [ 'amount' => '\Adyen\Model\Checkout\Amount', + 'applicationInfo' => '\Adyen\Model\Checkout\ApplicationInfo', 'industryUsage' => 'string', 'lineItems' => '\Adyen\Model\Checkout\LineItem[]', 'merchantAccount' => 'string', @@ -61,6 +62,7 @@ class PaymentAmountUpdateRequest implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPIFormats = [ 'amount' => null, + 'applicationInfo' => null, 'industryUsage' => null, 'lineItems' => null, 'merchantAccount' => null, @@ -75,6 +77,7 @@ class PaymentAmountUpdateRequest implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPINullables = [ 'amount' => false, + 'applicationInfo' => false, 'industryUsage' => false, 'lineItems' => false, 'merchantAccount' => false, @@ -169,6 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'amount' => 'amount', + 'applicationInfo' => 'applicationInfo', 'industryUsage' => 'industryUsage', 'lineItems' => 'lineItems', 'merchantAccount' => 'merchantAccount', @@ -183,6 +187,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'amount' => 'setAmount', + 'applicationInfo' => 'setApplicationInfo', 'industryUsage' => 'setIndustryUsage', 'lineItems' => 'setLineItems', 'merchantAccount' => 'setMerchantAccount', @@ -197,6 +202,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'amount' => 'getAmount', + 'applicationInfo' => 'getApplicationInfo', 'industryUsage' => 'getIndustryUsage', 'lineItems' => 'getLineItems', 'merchantAccount' => 'getMerchantAccount', @@ -278,6 +284,7 @@ public function getIndustryUsageAllowableValues() public function __construct(array $data = null) { $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('applicationInfo', $data ?? [], null); $this->setIfExists('industryUsage', $data ?? [], null); $this->setIfExists('lineItems', $data ?? [], null); $this->setIfExists('merchantAccount', $data ?? [], null); @@ -369,6 +376,33 @@ public function setAmount($amount) return $this; } + /** + * Gets applicationInfo + * + * @return \Adyen\Model\Checkout\ApplicationInfo|null + */ + public function getApplicationInfo() + { + return $this->container['applicationInfo']; + } + + /** + * Sets applicationInfo + * + * @param \Adyen\Model\Checkout\ApplicationInfo|null $applicationInfo applicationInfo + * + * @return self + */ + public function setApplicationInfo($applicationInfo) + { + if (is_null($applicationInfo)) { + throw new \InvalidArgumentException('non-nullable applicationInfo cannot be null'); + } + $this->container['applicationInfo'] = $applicationInfo; + + return $this; + } + /** * Gets industryUsage * diff --git a/src/Adyen/Model/Checkout/PaymentCancelRequest.php b/src/Adyen/Model/Checkout/PaymentCancelRequest.php index ccda5f499..2253442c5 100644 --- a/src/Adyen/Model/Checkout/PaymentCancelRequest.php +++ b/src/Adyen/Model/Checkout/PaymentCancelRequest.php @@ -44,6 +44,7 @@ class PaymentCancelRequest implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ + 'applicationInfo' => '\Adyen\Model\Checkout\ApplicationInfo', 'merchantAccount' => 'string', 'reference' => 'string' ]; @@ -56,6 +57,7 @@ class PaymentCancelRequest implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ + 'applicationInfo' => null, 'merchantAccount' => null, 'reference' => null ]; @@ -66,6 +68,7 @@ class PaymentCancelRequest implements ModelInterface, ArrayAccess, \JsonSerializ * @var boolean[] */ protected static $openAPINullables = [ + 'applicationInfo' => false, 'merchantAccount' => false, 'reference' => false ]; @@ -156,6 +159,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'applicationInfo' => 'applicationInfo', 'merchantAccount' => 'merchantAccount', 'reference' => 'reference' ]; @@ -166,6 +170,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'applicationInfo' => 'setApplicationInfo', 'merchantAccount' => 'setMerchantAccount', 'reference' => 'setReference' ]; @@ -176,6 +181,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'applicationInfo' => 'getApplicationInfo', 'merchantAccount' => 'getMerchantAccount', 'reference' => 'getReference' ]; @@ -237,6 +243,7 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('applicationInfo', $data ?? [], null); $this->setIfExists('merchantAccount', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); } @@ -286,6 +293,33 @@ public function valid() } + /** + * Gets applicationInfo + * + * @return \Adyen\Model\Checkout\ApplicationInfo|null + */ + public function getApplicationInfo() + { + return $this->container['applicationInfo']; + } + + /** + * Sets applicationInfo + * + * @param \Adyen\Model\Checkout\ApplicationInfo|null $applicationInfo applicationInfo + * + * @return self + */ + public function setApplicationInfo($applicationInfo) + { + if (is_null($applicationInfo)) { + throw new \InvalidArgumentException('non-nullable applicationInfo cannot be null'); + } + $this->container['applicationInfo'] = $applicationInfo; + + return $this; + } + /** * Gets merchantAccount * diff --git a/src/Adyen/Model/Checkout/PaymentCaptureRequest.php b/src/Adyen/Model/Checkout/PaymentCaptureRequest.php index ada5f794f..67fd2378d 100644 --- a/src/Adyen/Model/Checkout/PaymentCaptureRequest.php +++ b/src/Adyen/Model/Checkout/PaymentCaptureRequest.php @@ -45,6 +45,7 @@ class PaymentCaptureRequest implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPITypes = [ 'amount' => '\Adyen\Model\Checkout\Amount', + 'applicationInfo' => '\Adyen\Model\Checkout\ApplicationInfo', 'lineItems' => '\Adyen\Model\Checkout\LineItem[]', 'merchantAccount' => 'string', 'platformChargebackLogic' => '\Adyen\Model\Checkout\PlatformChargebackLogic', @@ -62,6 +63,7 @@ class PaymentCaptureRequest implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPIFormats = [ 'amount' => null, + 'applicationInfo' => null, 'lineItems' => null, 'merchantAccount' => null, 'platformChargebackLogic' => null, @@ -77,6 +79,7 @@ class PaymentCaptureRequest implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPINullables = [ 'amount' => false, + 'applicationInfo' => false, 'lineItems' => false, 'merchantAccount' => false, 'platformChargebackLogic' => false, @@ -172,6 +175,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'amount' => 'amount', + 'applicationInfo' => 'applicationInfo', 'lineItems' => 'lineItems', 'merchantAccount' => 'merchantAccount', 'platformChargebackLogic' => 'platformChargebackLogic', @@ -187,6 +191,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'amount' => 'setAmount', + 'applicationInfo' => 'setApplicationInfo', 'lineItems' => 'setLineItems', 'merchantAccount' => 'setMerchantAccount', 'platformChargebackLogic' => 'setPlatformChargebackLogic', @@ -202,6 +207,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'amount' => 'getAmount', + 'applicationInfo' => 'getApplicationInfo', 'lineItems' => 'getLineItems', 'merchantAccount' => 'getMerchantAccount', 'platformChargebackLogic' => 'getPlatformChargebackLogic', @@ -268,6 +274,7 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('applicationInfo', $data ?? [], null); $this->setIfExists('lineItems', $data ?? [], null); $this->setIfExists('merchantAccount', $data ?? [], null); $this->setIfExists('platformChargebackLogic', $data ?? [], null); @@ -351,6 +358,33 @@ public function setAmount($amount) return $this; } + /** + * Gets applicationInfo + * + * @return \Adyen\Model\Checkout\ApplicationInfo|null + */ + public function getApplicationInfo() + { + return $this->container['applicationInfo']; + } + + /** + * Sets applicationInfo + * + * @param \Adyen\Model\Checkout\ApplicationInfo|null $applicationInfo applicationInfo + * + * @return self + */ + public function setApplicationInfo($applicationInfo) + { + if (is_null($applicationInfo)) { + throw new \InvalidArgumentException('non-nullable applicationInfo cannot be null'); + } + $this->container['applicationInfo'] = $applicationInfo; + + return $this; + } + /** * Gets lineItems * diff --git a/src/Adyen/Model/Checkout/PaymentDetails.php b/src/Adyen/Model/Checkout/PaymentDetails.php index a71b5f3ca..6b5565c7e 100644 --- a/src/Adyen/Model/Checkout/PaymentDetails.php +++ b/src/Adyen/Model/Checkout/PaymentDetails.php @@ -260,6 +260,7 @@ public function getModelName() public const TYPE_WALLEY = 'walley'; public const TYPE_WALLEY_B2B = 'walley_b2b'; public const TYPE_ALMA = 'alma'; + public const TYPE_PAYPO = 'paypo'; public const TYPE_MOLPAY_FPX = 'molpay_fpx'; public const TYPE_KONBINI = 'konbini'; public const TYPE_DIRECT_EBANKING = 'directEbanking'; @@ -356,6 +357,7 @@ public function getTypeAllowableValues() self::TYPE_WALLEY, self::TYPE_WALLEY_B2B, self::TYPE_ALMA, + self::TYPE_PAYPO, self::TYPE_MOLPAY_FPX, self::TYPE_KONBINI, self::TYPE_DIRECT_EBANKING, diff --git a/src/Adyen/Model/Checkout/PaymentRefundRequest.php b/src/Adyen/Model/Checkout/PaymentRefundRequest.php index 656df4ae6..614a912f0 100644 --- a/src/Adyen/Model/Checkout/PaymentRefundRequest.php +++ b/src/Adyen/Model/Checkout/PaymentRefundRequest.php @@ -45,6 +45,7 @@ class PaymentRefundRequest implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPITypes = [ 'amount' => '\Adyen\Model\Checkout\Amount', + 'applicationInfo' => '\Adyen\Model\Checkout\ApplicationInfo', 'lineItems' => '\Adyen\Model\Checkout\LineItem[]', 'merchantAccount' => 'string', 'merchantRefundReason' => 'string', @@ -61,6 +62,7 @@ class PaymentRefundRequest implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPIFormats = [ 'amount' => null, + 'applicationInfo' => null, 'lineItems' => null, 'merchantAccount' => null, 'merchantRefundReason' => null, @@ -75,6 +77,7 @@ class PaymentRefundRequest implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'amount' => false, + 'applicationInfo' => false, 'lineItems' => false, 'merchantAccount' => false, 'merchantRefundReason' => false, @@ -169,6 +172,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'amount' => 'amount', + 'applicationInfo' => 'applicationInfo', 'lineItems' => 'lineItems', 'merchantAccount' => 'merchantAccount', 'merchantRefundReason' => 'merchantRefundReason', @@ -183,6 +187,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'amount' => 'setAmount', + 'applicationInfo' => 'setApplicationInfo', 'lineItems' => 'setLineItems', 'merchantAccount' => 'setMerchantAccount', 'merchantRefundReason' => 'setMerchantRefundReason', @@ -197,6 +202,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'amount' => 'getAmount', + 'applicationInfo' => 'getApplicationInfo', 'lineItems' => 'getLineItems', 'merchantAccount' => 'getMerchantAccount', 'merchantRefundReason' => 'getMerchantRefundReason', @@ -282,6 +288,7 @@ public function getMerchantRefundReasonAllowableValues() public function __construct(array $data = null) { $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('applicationInfo', $data ?? [], null); $this->setIfExists('lineItems', $data ?? [], null); $this->setIfExists('merchantAccount', $data ?? [], null); $this->setIfExists('merchantRefundReason', $data ?? [], null); @@ -373,6 +380,33 @@ public function setAmount($amount) return $this; } + /** + * Gets applicationInfo + * + * @return \Adyen\Model\Checkout\ApplicationInfo|null + */ + public function getApplicationInfo() + { + return $this->container['applicationInfo']; + } + + /** + * Sets applicationInfo + * + * @param \Adyen\Model\Checkout\ApplicationInfo|null $applicationInfo applicationInfo + * + * @return self + */ + public function setApplicationInfo($applicationInfo) + { + if (is_null($applicationInfo)) { + throw new \InvalidArgumentException('non-nullable applicationInfo cannot be null'); + } + $this->container['applicationInfo'] = $applicationInfo; + + return $this; + } + /** * Gets lineItems * diff --git a/src/Adyen/Model/Checkout/PaymentRequest.php b/src/Adyen/Model/Checkout/PaymentRequest.php index 7d6e6d4b7..19a7ae727 100644 --- a/src/Adyen/Model/Checkout/PaymentRequest.php +++ b/src/Adyen/Model/Checkout/PaymentRequest.php @@ -50,7 +50,7 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'amount' => '\Adyen\Model\Checkout\Amount', 'applicationInfo' => '\Adyen\Model\Checkout\ApplicationInfo', 'authenticationData' => '\Adyen\Model\Checkout\AuthenticationData', - 'billingAddress' => '\Adyen\Model\Checkout\Address', + 'billingAddress' => '\Adyen\Model\Checkout\BillingAddress', 'browserInfo' => '\Adyen\Model\Checkout\BrowserInfo', 'captureDelayHours' => 'int', 'channel' => 'string', @@ -61,7 +61,7 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'dateOfBirth' => '\DateTime', 'dccQuote' => '\Adyen\Model\Checkout\ForexQuote', 'deliverAt' => '\DateTime', - 'deliveryAddress' => '\Adyen\Model\Checkout\Address', + 'deliveryAddress' => '\Adyen\Model\Checkout\DeliveryAddress', 'deliveryDate' => '\DateTime', 'deviceFingerprint' => 'string', 'enableOneClick' => 'bool', @@ -1043,7 +1043,7 @@ public function setAuthenticationData($authenticationData) /** * Gets billingAddress * - * @return \Adyen\Model\Checkout\Address|null + * @return \Adyen\Model\Checkout\BillingAddress|null */ public function getBillingAddress() { @@ -1053,7 +1053,7 @@ public function getBillingAddress() /** * Sets billingAddress * - * @param \Adyen\Model\Checkout\Address|null $billingAddress billingAddress + * @param \Adyen\Model\Checkout\BillingAddress|null $billingAddress billingAddress * * @return self */ @@ -1350,7 +1350,7 @@ public function setDeliverAt($deliverAt) /** * Gets deliveryAddress * - * @return \Adyen\Model\Checkout\Address|null + * @return \Adyen\Model\Checkout\DeliveryAddress|null */ public function getDeliveryAddress() { @@ -1360,7 +1360,7 @@ public function getDeliveryAddress() /** * Sets deliveryAddress * - * @param \Adyen\Model\Checkout\Address|null $deliveryAddress deliveryAddress + * @param \Adyen\Model\Checkout\DeliveryAddress|null $deliveryAddress deliveryAddress * * @return self */ @@ -2254,7 +2254,7 @@ public function getReturnUrl() /** * Sets returnUrl * - * @param string $returnUrl The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` + * @param string $returnUrl The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` * * @return self */ diff --git a/src/Adyen/Model/Checkout/PaymentReversalRequest.php b/src/Adyen/Model/Checkout/PaymentReversalRequest.php index 40773fc49..383d6228c 100644 --- a/src/Adyen/Model/Checkout/PaymentReversalRequest.php +++ b/src/Adyen/Model/Checkout/PaymentReversalRequest.php @@ -44,6 +44,7 @@ class PaymentReversalRequest implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $openAPITypes = [ + 'applicationInfo' => '\Adyen\Model\Checkout\ApplicationInfo', 'merchantAccount' => 'string', 'reference' => 'string' ]; @@ -56,6 +57,7 @@ class PaymentReversalRequest implements ModelInterface, ArrayAccess, \JsonSerial * @psalm-var array */ protected static $openAPIFormats = [ + 'applicationInfo' => null, 'merchantAccount' => null, 'reference' => null ]; @@ -66,6 +68,7 @@ class PaymentReversalRequest implements ModelInterface, ArrayAccess, \JsonSerial * @var boolean[] */ protected static $openAPINullables = [ + 'applicationInfo' => false, 'merchantAccount' => false, 'reference' => false ]; @@ -156,6 +159,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'applicationInfo' => 'applicationInfo', 'merchantAccount' => 'merchantAccount', 'reference' => 'reference' ]; @@ -166,6 +170,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'applicationInfo' => 'setApplicationInfo', 'merchantAccount' => 'setMerchantAccount', 'reference' => 'setReference' ]; @@ -176,6 +181,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'applicationInfo' => 'getApplicationInfo', 'merchantAccount' => 'getMerchantAccount', 'reference' => 'getReference' ]; @@ -237,6 +243,7 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('applicationInfo', $data ?? [], null); $this->setIfExists('merchantAccount', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); } @@ -286,6 +293,33 @@ public function valid() } + /** + * Gets applicationInfo + * + * @return \Adyen\Model\Checkout\ApplicationInfo|null + */ + public function getApplicationInfo() + { + return $this->container['applicationInfo']; + } + + /** + * Sets applicationInfo + * + * @param \Adyen\Model\Checkout\ApplicationInfo|null $applicationInfo applicationInfo + * + * @return self + */ + public function setApplicationInfo($applicationInfo) + { + if (is_null($applicationInfo)) { + throw new \InvalidArgumentException('non-nullable applicationInfo cannot be null'); + } + $this->container['applicationInfo'] = $applicationInfo; + + return $this; + } + /** * Gets merchantAccount * diff --git a/src/Adyen/Model/Checkout/Split.php b/src/Adyen/Model/Checkout/Split.php index c0c3203a3..70d50cc31 100644 --- a/src/Adyen/Model/Checkout/Split.php +++ b/src/Adyen/Model/Checkout/Split.php @@ -317,9 +317,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['amount'] === null) { - $invalidProperties[] = "'amount' can't be null"; - } if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } @@ -360,7 +357,7 @@ public function getAccount() /** * Sets account * - * @param string|null $account Unique identifier of the account where the split amount should be sent. This is required if `type` is **MarketPlace** or **BalanceAccount**. + * @param string|null $account The unique identifier of the account to which the split amount is booked. Required if `type` is **MarketPlace** or **BalanceAccount**. * [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic): The [`accountCode`](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccount#request-accountCode) of the account to which the split amount is booked. * [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms): The [`balanceAccountId`](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/balanceAccounts/_id_#path-id) of the account to which the split amount is booked. * * @return self */ @@ -377,7 +374,7 @@ public function setAccount($account) /** * Gets amount * - * @return \Adyen\Model\Checkout\SplitAmount + * @return \Adyen\Model\Checkout\SplitAmount|null */ public function getAmount() { @@ -387,7 +384,7 @@ public function getAmount() /** * Sets amount * - * @param \Adyen\Model\Checkout\SplitAmount $amount amount + * @param \Adyen\Model\Checkout\SplitAmount|null $amount amount * * @return self */ @@ -414,7 +411,7 @@ public function getDescription() /** * Sets description * - * @param string|null $description A description of this split. + * @param string|null $description Your description for the split item. * * @return self */ @@ -441,7 +438,7 @@ public function getReference() /** * Sets reference * - * @param string|null $reference Your reference for the split, which you can use to link the split to other operations such as captures and refunds. This is required if `type` is **MarketPlace** or **BalanceAccount**. For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. If the reference is not provided, the split is reported as part of the aggregated [TransferBalance record type](https://docs.adyen.com/reporting/marketpay-payments-accounting-report) in Adyen for Platforms. + * @param string|null $reference Your reference for the split item. This is required if `type` is **MarketPlace** ([Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic)) or **BalanceAccount** ([Balance Platform](https://docs.adyen.com/marketplaces-and-platforms)). For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. * * @return self */ @@ -468,7 +465,7 @@ public function getType() /** * Sets type * - * @param string $type The type of split. Possible values: **Default**, **PaymentFee**, **VAT**, **Commission**, **MarketPlace**, **BalanceAccount**, **Remainder**, **Surcharge**, **Tip**. + * @param string $type The type of the split item. Possible values: * [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic): **Commission**, **Default**, **Marketplace**, **PaymentFee**, **VAT**. * [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms): **BalanceAccount**, **Commission**, **Default**, **PaymentFee**, **Remainder**, **Surcharge**, **Tip**, **VAT**. * * @return self */ diff --git a/src/Adyen/Model/Checkout/SplitAmount.php b/src/Adyen/Model/Checkout/SplitAmount.php index 659cdab46..ff24e24c8 100644 --- a/src/Adyen/Model/Checkout/SplitAmount.php +++ b/src/Adyen/Model/Checkout/SplitAmount.php @@ -299,7 +299,7 @@ public function getCurrency() /** * Sets currency * - * @param string|null $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). If this value is not provided, the currency in which the payment is made will be used. + * @param string|null $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). By default, this is the original payment currency. * * @return self */ @@ -326,7 +326,7 @@ public function getValue() /** * Sets value * - * @param int $value The amount in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * @param int $value The value of the split amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * * @return self */ diff --git a/src/Adyen/Model/Checkout/StandalonePaymentCancelRequest.php b/src/Adyen/Model/Checkout/StandalonePaymentCancelRequest.php index 422c10704..aab63f829 100644 --- a/src/Adyen/Model/Checkout/StandalonePaymentCancelRequest.php +++ b/src/Adyen/Model/Checkout/StandalonePaymentCancelRequest.php @@ -44,6 +44,7 @@ class StandalonePaymentCancelRequest implements ModelInterface, ArrayAccess, \Js * @var string[] */ protected static $openAPITypes = [ + 'applicationInfo' => '\Adyen\Model\Checkout\ApplicationInfo', 'merchantAccount' => 'string', 'paymentReference' => 'string', 'reference' => 'string' @@ -57,6 +58,7 @@ class StandalonePaymentCancelRequest implements ModelInterface, ArrayAccess, \Js * @psalm-var array */ protected static $openAPIFormats = [ + 'applicationInfo' => null, 'merchantAccount' => null, 'paymentReference' => null, 'reference' => null @@ -68,6 +70,7 @@ class StandalonePaymentCancelRequest implements ModelInterface, ArrayAccess, \Js * @var boolean[] */ protected static $openAPINullables = [ + 'applicationInfo' => false, 'merchantAccount' => false, 'paymentReference' => false, 'reference' => false @@ -159,6 +162,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'applicationInfo' => 'applicationInfo', 'merchantAccount' => 'merchantAccount', 'paymentReference' => 'paymentReference', 'reference' => 'reference' @@ -170,6 +174,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'applicationInfo' => 'setApplicationInfo', 'merchantAccount' => 'setMerchantAccount', 'paymentReference' => 'setPaymentReference', 'reference' => 'setReference' @@ -181,6 +186,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'applicationInfo' => 'getApplicationInfo', 'merchantAccount' => 'getMerchantAccount', 'paymentReference' => 'getPaymentReference', 'reference' => 'getReference' @@ -243,6 +249,7 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('applicationInfo', $data ?? [], null); $this->setIfExists('merchantAccount', $data ?? [], null); $this->setIfExists('paymentReference', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); @@ -296,6 +303,33 @@ public function valid() } + /** + * Gets applicationInfo + * + * @return \Adyen\Model\Checkout\ApplicationInfo|null + */ + public function getApplicationInfo() + { + return $this->container['applicationInfo']; + } + + /** + * Sets applicationInfo + * + * @param \Adyen\Model\Checkout\ApplicationInfo|null $applicationInfo applicationInfo + * + * @return self + */ + public function setApplicationInfo($applicationInfo) + { + if (is_null($applicationInfo)) { + throw new \InvalidArgumentException('non-nullable applicationInfo cannot be null'); + } + $this->container['applicationInfo'] = $applicationInfo; + + return $this; + } + /** * Gets merchantAccount * diff --git a/src/Adyen/Model/Checkout/SubMerchantInfo.php b/src/Adyen/Model/Checkout/SubMerchantInfo.php index e41e335da..2a95eb4db 100644 --- a/src/Adyen/Model/Checkout/SubMerchantInfo.php +++ b/src/Adyen/Model/Checkout/SubMerchantInfo.php @@ -44,7 +44,7 @@ class SubMerchantInfo implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'address' => '\Adyen\Model\Checkout\Address', + 'address' => '\Adyen\Model\Checkout\BillingAddress', 'id' => 'string', 'mcc' => 'string', 'name' => 'string', @@ -307,7 +307,7 @@ public function valid() /** * Gets address * - * @return \Adyen\Model\Checkout\Address|null + * @return \Adyen\Model\Checkout\BillingAddress|null */ public function getAddress() { @@ -317,7 +317,7 @@ public function getAddress() /** * Sets address * - * @param \Adyen\Model\Checkout\Address|null $address address + * @param \Adyen\Model\Checkout\BillingAddress|null $address address * * @return self */