diff --git a/src/Adyen/Model/AcsWebhooks/BalancePlatformNotificationResponse.php b/src/Adyen/Model/AcsWebhooks/BalancePlatformNotificationResponse.php index 5b4fb6c78..a7c82cbac 100644 --- a/src/Adyen/Model/AcsWebhooks/BalancePlatformNotificationResponse.php +++ b/src/Adyen/Model/AcsWebhooks/BalancePlatformNotificationResponse.php @@ -289,7 +289,7 @@ public function getNotificationResponse() /** * Sets notificationResponse * - * @param string|null $notificationResponse Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). * * @return self */ diff --git a/src/Adyen/Model/AcsWebhooks/ObjectSerializer.php b/src/Adyen/Model/AcsWebhooks/ObjectSerializer.php index 755ed1ce8..e14421342 100644 --- a/src/Adyen/Model/AcsWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/AcsWebhooks/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/BalanceControl/ObjectSerializer.php b/src/Adyen/Model/BalanceControl/ObjectSerializer.php index b5ae3313d..2ed0eb3a0 100644 --- a/src/Adyen/Model/BalanceControl/ObjectSerializer.php +++ b/src/Adyen/Model/BalanceControl/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/BalancePlatform/CapabilitySettings.php b/src/Adyen/Model/BalancePlatform/CapabilitySettings.php index 95ce38222..c1302d647 100644 --- a/src/Adyen/Model/BalancePlatform/CapabilitySettings.php +++ b/src/Adyen/Model/BalancePlatform/CapabilitySettings.php @@ -358,7 +358,7 @@ public function getAmountPerIndustry() /** * Sets amountPerIndustry * - * @param array|null $amountPerIndustry + * @param array|null $amountPerIndustry * * @return self */ @@ -385,7 +385,7 @@ public function getAuthorizedCardUsers() /** * Sets authorizedCardUsers * - * @param bool|null $authorizedCardUsers + * @param bool|null $authorizedCardUsers * * @return self */ @@ -412,7 +412,7 @@ public function getFundingSource() /** * Sets fundingSource * - * @param string[]|null $fundingSource + * @param string[]|null $fundingSource * * @return self */ @@ -448,7 +448,7 @@ public function getInterval() /** * Sets interval * - * @param string|null $interval + * @param string|null $interval * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php index 141ec623e..fa9af7e82 100644 --- a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php +++ b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/BinLookup/ObjectSerializer.php b/src/Adyen/Model/BinLookup/ObjectSerializer.php index 4bdfceeda..09437b7d8 100644 --- a/src/Adyen/Model/BinLookup/ObjectSerializer.php +++ b/src/Adyen/Model/BinLookup/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Checkout/AdditionalDataAirline.php b/src/Adyen/Model/Checkout/AdditionalDataAirline.php index 72566f5d8..35af80d8d 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataAirline.php +++ b/src/Adyen/Model/Checkout/AdditionalDataAirline.php @@ -53,6 +53,7 @@ class AdditionalDataAirline implements ModelInterface, ArrayAccess, \JsonSeriali 'airlineCustomerReferenceNumber' => 'string', 'airlineDocumentType' => 'string', 'airlineFlightDate' => 'string', + 'airlineIssueDate' => 'string', 'airlineLegCarrierCode' => 'string', 'airlineLegClassOfTravel' => 'string', 'airlineLegDateOfTravel' => 'string', @@ -91,6 +92,7 @@ class AdditionalDataAirline implements ModelInterface, ArrayAccess, \JsonSeriali 'airlineCustomerReferenceNumber' => null, 'airlineDocumentType' => null, 'airlineFlightDate' => null, + 'airlineIssueDate' => null, 'airlineLegCarrierCode' => null, 'airlineLegClassOfTravel' => null, 'airlineLegDateOfTravel' => null, @@ -127,6 +129,7 @@ class AdditionalDataAirline implements ModelInterface, ArrayAccess, \JsonSeriali 'airlineCustomerReferenceNumber' => false, 'airlineDocumentType' => false, 'airlineFlightDate' => false, + 'airlineIssueDate' => false, 'airlineLegCarrierCode' => false, 'airlineLegClassOfTravel' => false, 'airlineLegDateOfTravel' => false, @@ -243,6 +246,7 @@ public function isNullableSetToNull(string $property): bool 'airlineCustomerReferenceNumber' => 'airline.customer_reference_number', 'airlineDocumentType' => 'airline.document_type', 'airlineFlightDate' => 'airline.flight_date', + 'airlineIssueDate' => 'airline.issue_date', 'airlineLegCarrierCode' => 'airline.leg.carrier_code', 'airlineLegClassOfTravel' => 'airline.leg.class_of_travel', 'airlineLegDateOfTravel' => 'airline.leg.date_of_travel', @@ -279,6 +283,7 @@ public function isNullableSetToNull(string $property): bool 'airlineCustomerReferenceNumber' => 'setAirlineCustomerReferenceNumber', 'airlineDocumentType' => 'setAirlineDocumentType', 'airlineFlightDate' => 'setAirlineFlightDate', + 'airlineIssueDate' => 'setAirlineIssueDate', 'airlineLegCarrierCode' => 'setAirlineLegCarrierCode', 'airlineLegClassOfTravel' => 'setAirlineLegClassOfTravel', 'airlineLegDateOfTravel' => 'setAirlineLegDateOfTravel', @@ -315,6 +320,7 @@ public function isNullableSetToNull(string $property): bool 'airlineCustomerReferenceNumber' => 'getAirlineCustomerReferenceNumber', 'airlineDocumentType' => 'getAirlineDocumentType', 'airlineFlightDate' => 'getAirlineFlightDate', + 'airlineIssueDate' => 'getAirlineIssueDate', 'airlineLegCarrierCode' => 'getAirlineLegCarrierCode', 'airlineLegClassOfTravel' => 'getAirlineLegClassOfTravel', 'airlineLegDateOfTravel' => 'getAirlineLegDateOfTravel', @@ -402,6 +408,7 @@ public function __construct(array $data = null) $this->setIfExists('airlineCustomerReferenceNumber', $data ?? [], null); $this->setIfExists('airlineDocumentType', $data ?? [], null); $this->setIfExists('airlineFlightDate', $data ?? [], null); + $this->setIfExists('airlineIssueDate', $data ?? [], null); $this->setIfExists('airlineLegCarrierCode', $data ?? [], null); $this->setIfExists('airlineLegClassOfTravel', $data ?? [], null); $this->setIfExists('airlineLegDateOfTravel', $data ?? [], null); @@ -711,6 +718,33 @@ public function setAirlineFlightDate($airlineFlightDate) return $this; } + /** + * Gets airlineIssueDate + * + * @return string|null + */ + public function getAirlineIssueDate() + { + return $this->container['airlineIssueDate']; + } + + /** + * Sets airlineIssueDate + * + * @param string|null $airlineIssueDate The date that the ticket was issued to the passenger. * minLength: 6 characters * maxLength: 6 characters * Date format: YYMMDD + * + * @return self + */ + public function setAirlineIssueDate($airlineIssueDate) + { + if (is_null($airlineIssueDate)) { + throw new \InvalidArgumentException('non-nullable airlineIssueDate cannot be null'); + } + $this->container['airlineIssueDate'] = $airlineIssueDate; + + return $this; + } + /** * Gets airlineLegCarrierCode * diff --git a/src/Adyen/Model/Checkout/AdditionalDataLodging.php b/src/Adyen/Model/Checkout/AdditionalDataLodging.php index f509dbb0b..fb107fdd3 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataLodging.php +++ b/src/Adyen/Model/Checkout/AdditionalDataLodging.php @@ -44,6 +44,7 @@ class AdditionalDataLodging implements ModelInterface, ArrayAccess, \JsonSeriali * @var string[] */ protected static $openAPITypes = [ + 'lodgingSpecialProgramCode' => 'string', 'lodgingCheckInDate' => 'string', 'lodgingCheckOutDate' => 'string', 'lodgingCustomerServiceTollFreeNumber' => 'string', @@ -70,6 +71,7 @@ class AdditionalDataLodging implements ModelInterface, ArrayAccess, \JsonSeriali * @psalm-var array */ protected static $openAPIFormats = [ + 'lodgingSpecialProgramCode' => null, 'lodgingCheckInDate' => null, 'lodgingCheckOutDate' => null, 'lodgingCustomerServiceTollFreeNumber' => null, @@ -94,6 +96,7 @@ class AdditionalDataLodging implements ModelInterface, ArrayAccess, \JsonSeriali * @var boolean[] */ protected static $openAPINullables = [ + 'lodgingSpecialProgramCode' => false, 'lodgingCheckInDate' => false, 'lodgingCheckOutDate' => false, 'lodgingCustomerServiceTollFreeNumber' => false, @@ -198,6 +201,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'lodgingSpecialProgramCode' => 'lodging.SpecialProgramCode', 'lodgingCheckInDate' => 'lodging.checkInDate', 'lodgingCheckOutDate' => 'lodging.checkOutDate', 'lodgingCustomerServiceTollFreeNumber' => 'lodging.customerServiceTollFreeNumber', @@ -222,6 +226,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'lodgingSpecialProgramCode' => 'setLodgingSpecialProgramCode', 'lodgingCheckInDate' => 'setLodgingCheckInDate', 'lodgingCheckOutDate' => 'setLodgingCheckOutDate', 'lodgingCustomerServiceTollFreeNumber' => 'setLodgingCustomerServiceTollFreeNumber', @@ -246,6 +251,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'lodgingSpecialProgramCode' => 'getLodgingSpecialProgramCode', 'lodgingCheckInDate' => 'getLodgingCheckInDate', 'lodgingCheckOutDate' => 'getLodgingCheckOutDate', 'lodgingCustomerServiceTollFreeNumber' => 'getLodgingCustomerServiceTollFreeNumber', @@ -321,6 +327,7 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('lodgingSpecialProgramCode', $data ?? [], null); $this->setIfExists('lodgingCheckInDate', $data ?? [], null); $this->setIfExists('lodgingCheckOutDate', $data ?? [], null); $this->setIfExists('lodgingCustomerServiceTollFreeNumber', $data ?? [], null); @@ -381,6 +388,33 @@ public function valid() } + /** + * Gets lodgingSpecialProgramCode + * + * @return string|null + */ + public function getLodgingSpecialProgramCode() + { + return $this->container['lodgingSpecialProgramCode']; + } + + /** + * Sets lodgingSpecialProgramCode + * + * @param string|null $lodgingSpecialProgramCode A code that corresponds to the category of lodging charges for the payment. Possible values: * 1: Lodging * 2: No show reservation * 3: Advanced deposit + * + * @return self + */ + public function setLodgingSpecialProgramCode($lodgingSpecialProgramCode) + { + if (is_null($lodgingSpecialProgramCode)) { + throw new \InvalidArgumentException('non-nullable lodgingSpecialProgramCode cannot be null'); + } + $this->container['lodgingSpecialProgramCode'] = $lodgingSpecialProgramCode; + + return $this; + } + /** * Gets lodgingCheckInDate * diff --git a/src/Adyen/Model/Checkout/CardDetails.php b/src/Adyen/Model/Checkout/CardDetails.php index 62bd62714..36354f95b 100644 --- a/src/Adyen/Model/Checkout/CardDetails.php +++ b/src/Adyen/Model/Checkout/CardDetails.php @@ -60,6 +60,9 @@ class CardDetails implements ModelInterface, ArrayAccess, \JsonSerializable 'number' => 'string', 'recurringDetailReference' => 'string', 'shopperNotificationReference' => 'string', + 'srcCorrelationId' => 'string', + 'srcScheme' => 'string', + 'srcTokenReference' => 'string', 'storedPaymentMethodId' => 'string', 'threeDS2SdkVersion' => 'string', 'type' => 'string' @@ -89,6 +92,9 @@ class CardDetails implements ModelInterface, ArrayAccess, \JsonSerializable 'number' => null, 'recurringDetailReference' => null, 'shopperNotificationReference' => null, + 'srcCorrelationId' => null, + 'srcScheme' => null, + 'srcTokenReference' => null, 'storedPaymentMethodId' => null, 'threeDS2SdkVersion' => null, 'type' => null @@ -116,6 +122,9 @@ class CardDetails implements ModelInterface, ArrayAccess, \JsonSerializable 'number' => false, 'recurringDetailReference' => false, 'shopperNotificationReference' => false, + 'srcCorrelationId' => false, + 'srcScheme' => false, + 'srcTokenReference' => false, 'storedPaymentMethodId' => false, 'threeDS2SdkVersion' => false, 'type' => false @@ -223,6 +232,9 @@ public function isNullableSetToNull(string $property): bool 'number' => 'number', 'recurringDetailReference' => 'recurringDetailReference', 'shopperNotificationReference' => 'shopperNotificationReference', + 'srcCorrelationId' => 'srcCorrelationId', + 'srcScheme' => 'srcScheme', + 'srcTokenReference' => 'srcTokenReference', 'storedPaymentMethodId' => 'storedPaymentMethodId', 'threeDS2SdkVersion' => 'threeDS2SdkVersion', 'type' => 'type' @@ -250,6 +262,9 @@ public function isNullableSetToNull(string $property): bool 'number' => 'setNumber', 'recurringDetailReference' => 'setRecurringDetailReference', 'shopperNotificationReference' => 'setShopperNotificationReference', + 'srcCorrelationId' => 'setSrcCorrelationId', + 'srcScheme' => 'setSrcScheme', + 'srcTokenReference' => 'setSrcTokenReference', 'storedPaymentMethodId' => 'setStoredPaymentMethodId', 'threeDS2SdkVersion' => 'setThreeDS2SdkVersion', 'type' => 'setType' @@ -277,6 +292,9 @@ public function isNullableSetToNull(string $property): bool 'number' => 'getNumber', 'recurringDetailReference' => 'getRecurringDetailReference', 'shopperNotificationReference' => 'getShopperNotificationReference', + 'srcCorrelationId' => 'getSrcCorrelationId', + 'srcScheme' => 'getSrcScheme', + 'srcTokenReference' => 'getSrcTokenReference', 'storedPaymentMethodId' => 'getStoredPaymentMethodId', 'threeDS2SdkVersion' => 'getThreeDS2SdkVersion', 'type' => 'getType' @@ -389,6 +407,9 @@ public function __construct(array $data = null) $this->setIfExists('number', $data ?? [], null); $this->setIfExists('recurringDetailReference', $data ?? [], null); $this->setIfExists('shopperNotificationReference', $data ?? [], null); + $this->setIfExists('srcCorrelationId', $data ?? [], null); + $this->setIfExists('srcScheme', $data ?? [], null); + $this->setIfExists('srcTokenReference', $data ?? [], null); $this->setIfExists('storedPaymentMethodId', $data ?? [], null); $this->setIfExists('threeDS2SdkVersion', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); @@ -900,6 +921,87 @@ public function setShopperNotificationReference($shopperNotificationReference) return $this; } + /** + * Gets srcCorrelationId + * + * @return string|null + */ + public function getSrcCorrelationId() + { + return $this->container['srcCorrelationId']; + } + + /** + * Sets srcCorrelationId + * + * @param string|null $srcCorrelationId An identifier used for the Click to Pay transaction. + * + * @return self + */ + public function setSrcCorrelationId($srcCorrelationId) + { + if (is_null($srcCorrelationId)) { + throw new \InvalidArgumentException('non-nullable srcCorrelationId cannot be null'); + } + $this->container['srcCorrelationId'] = $srcCorrelationId; + + return $this; + } + + /** + * Gets srcScheme + * + * @return string|null + */ + public function getSrcScheme() + { + return $this->container['srcScheme']; + } + + /** + * Sets srcScheme + * + * @param string|null $srcScheme The scheme that is being used for Click to Pay. + * + * @return self + */ + public function setSrcScheme($srcScheme) + { + if (is_null($srcScheme)) { + throw new \InvalidArgumentException('non-nullable srcScheme cannot be null'); + } + $this->container['srcScheme'] = $srcScheme; + + return $this; + } + + /** + * Gets srcTokenReference + * + * @return string|null + */ + public function getSrcTokenReference() + { + return $this->container['srcTokenReference']; + } + + /** + * Sets srcTokenReference + * + * @param string|null $srcTokenReference The reference for the Click to Pay token. + * + * @return self + */ + public function setSrcTokenReference($srcTokenReference) + { + if (is_null($srcTokenReference)) { + throw new \InvalidArgumentException('non-nullable srcTokenReference cannot be null'); + } + $this->container['srcTokenReference'] = $srcTokenReference; + + return $this; + } + /** * Gets storedPaymentMethodId * diff --git a/src/Adyen/Model/Checkout/CardDonations.php b/src/Adyen/Model/Checkout/CardDonations.php index 34dfc88ea..1998e7669 100644 --- a/src/Adyen/Model/Checkout/CardDonations.php +++ b/src/Adyen/Model/Checkout/CardDonations.php @@ -60,6 +60,9 @@ class CardDonations implements ModelInterface, ArrayAccess, \JsonSerializable 'number' => 'string', 'recurringDetailReference' => 'string', 'shopperNotificationReference' => 'string', + 'srcCorrelationId' => 'string', + 'srcScheme' => 'string', + 'srcTokenReference' => 'string', 'storedPaymentMethodId' => 'string', 'threeDS2SdkVersion' => 'string', 'type' => 'string' @@ -89,6 +92,9 @@ class CardDonations implements ModelInterface, ArrayAccess, \JsonSerializable 'number' => null, 'recurringDetailReference' => null, 'shopperNotificationReference' => null, + 'srcCorrelationId' => null, + 'srcScheme' => null, + 'srcTokenReference' => null, 'storedPaymentMethodId' => null, 'threeDS2SdkVersion' => null, 'type' => null @@ -116,6 +122,9 @@ class CardDonations implements ModelInterface, ArrayAccess, \JsonSerializable 'number' => false, 'recurringDetailReference' => false, 'shopperNotificationReference' => false, + 'srcCorrelationId' => false, + 'srcScheme' => false, + 'srcTokenReference' => false, 'storedPaymentMethodId' => false, 'threeDS2SdkVersion' => false, 'type' => false @@ -223,6 +232,9 @@ public function isNullableSetToNull(string $property): bool 'number' => 'number', 'recurringDetailReference' => 'recurringDetailReference', 'shopperNotificationReference' => 'shopperNotificationReference', + 'srcCorrelationId' => 'srcCorrelationId', + 'srcScheme' => 'srcScheme', + 'srcTokenReference' => 'srcTokenReference', 'storedPaymentMethodId' => 'storedPaymentMethodId', 'threeDS2SdkVersion' => 'threeDS2SdkVersion', 'type' => 'type' @@ -250,6 +262,9 @@ public function isNullableSetToNull(string $property): bool 'number' => 'setNumber', 'recurringDetailReference' => 'setRecurringDetailReference', 'shopperNotificationReference' => 'setShopperNotificationReference', + 'srcCorrelationId' => 'setSrcCorrelationId', + 'srcScheme' => 'setSrcScheme', + 'srcTokenReference' => 'setSrcTokenReference', 'storedPaymentMethodId' => 'setStoredPaymentMethodId', 'threeDS2SdkVersion' => 'setThreeDS2SdkVersion', 'type' => 'setType' @@ -277,6 +292,9 @@ public function isNullableSetToNull(string $property): bool 'number' => 'getNumber', 'recurringDetailReference' => 'getRecurringDetailReference', 'shopperNotificationReference' => 'getShopperNotificationReference', + 'srcCorrelationId' => 'getSrcCorrelationId', + 'srcScheme' => 'getSrcScheme', + 'srcTokenReference' => 'getSrcTokenReference', 'storedPaymentMethodId' => 'getStoredPaymentMethodId', 'threeDS2SdkVersion' => 'getThreeDS2SdkVersion', 'type' => 'getType' @@ -389,6 +407,9 @@ public function __construct(array $data = null) $this->setIfExists('number', $data ?? [], null); $this->setIfExists('recurringDetailReference', $data ?? [], null); $this->setIfExists('shopperNotificationReference', $data ?? [], null); + $this->setIfExists('srcCorrelationId', $data ?? [], null); + $this->setIfExists('srcScheme', $data ?? [], null); + $this->setIfExists('srcTokenReference', $data ?? [], null); $this->setIfExists('storedPaymentMethodId', $data ?? [], null); $this->setIfExists('threeDS2SdkVersion', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); @@ -900,6 +921,87 @@ public function setShopperNotificationReference($shopperNotificationReference) return $this; } + /** + * Gets srcCorrelationId + * + * @return string|null + */ + public function getSrcCorrelationId() + { + return $this->container['srcCorrelationId']; + } + + /** + * Sets srcCorrelationId + * + * @param string|null $srcCorrelationId An identifier used for the Click to Pay transaction. + * + * @return self + */ + public function setSrcCorrelationId($srcCorrelationId) + { + if (is_null($srcCorrelationId)) { + throw new \InvalidArgumentException('non-nullable srcCorrelationId cannot be null'); + } + $this->container['srcCorrelationId'] = $srcCorrelationId; + + return $this; + } + + /** + * Gets srcScheme + * + * @return string|null + */ + public function getSrcScheme() + { + return $this->container['srcScheme']; + } + + /** + * Sets srcScheme + * + * @param string|null $srcScheme The scheme that is being used for Click to Pay. + * + * @return self + */ + public function setSrcScheme($srcScheme) + { + if (is_null($srcScheme)) { + throw new \InvalidArgumentException('non-nullable srcScheme cannot be null'); + } + $this->container['srcScheme'] = $srcScheme; + + return $this; + } + + /** + * Gets srcTokenReference + * + * @return string|null + */ + public function getSrcTokenReference() + { + return $this->container['srcTokenReference']; + } + + /** + * Sets srcTokenReference + * + * @param string|null $srcTokenReference The reference for the Click to Pay token. + * + * @return self + */ + public function setSrcTokenReference($srcTokenReference) + { + if (is_null($srcTokenReference)) { + throw new \InvalidArgumentException('non-nullable srcTokenReference cannot be null'); + } + $this->container['srcTokenReference'] = $srcTokenReference; + + return $this; + } + /** * Gets storedPaymentMethodId * diff --git a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php index cb856866a..44c41e671 100644 --- a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php +++ b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php @@ -78,6 +78,9 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'networkPaymentReference' => 'string', 'number' => 'string', 'shopperNotificationReference' => 'string', + 'srcCorrelationId' => 'string', + 'srcScheme' => 'string', + 'srcTokenReference' => 'string', 'threeDS2SdkVersion' => 'string', 'cashtag' => 'string', 'customerId' => 'string', @@ -147,6 +150,9 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'networkPaymentReference' => null, 'number' => null, 'shopperNotificationReference' => null, + 'srcCorrelationId' => null, + 'srcScheme' => null, + 'srcTokenReference' => null, 'threeDS2SdkVersion' => null, 'cashtag' => null, 'customerId' => null, @@ -214,6 +220,9 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'networkPaymentReference' => false, 'number' => false, 'shopperNotificationReference' => false, + 'srcCorrelationId' => false, + 'srcScheme' => false, + 'srcTokenReference' => false, 'threeDS2SdkVersion' => false, 'cashtag' => false, 'customerId' => false, @@ -361,6 +370,9 @@ public function isNullableSetToNull(string $property): bool 'networkPaymentReference' => 'networkPaymentReference', 'number' => 'number', 'shopperNotificationReference' => 'shopperNotificationReference', + 'srcCorrelationId' => 'srcCorrelationId', + 'srcScheme' => 'srcScheme', + 'srcTokenReference' => 'srcTokenReference', 'threeDS2SdkVersion' => 'threeDS2SdkVersion', 'cashtag' => 'cashtag', 'customerId' => 'customerId', @@ -428,6 +440,9 @@ public function isNullableSetToNull(string $property): bool 'networkPaymentReference' => 'setNetworkPaymentReference', 'number' => 'setNumber', 'shopperNotificationReference' => 'setShopperNotificationReference', + 'srcCorrelationId' => 'setSrcCorrelationId', + 'srcScheme' => 'setSrcScheme', + 'srcTokenReference' => 'setSrcTokenReference', 'threeDS2SdkVersion' => 'setThreeDS2SdkVersion', 'cashtag' => 'setCashtag', 'customerId' => 'setCustomerId', @@ -495,6 +510,9 @@ public function isNullableSetToNull(string $property): bool 'networkPaymentReference' => 'getNetworkPaymentReference', 'number' => 'getNumber', 'shopperNotificationReference' => 'getShopperNotificationReference', + 'srcCorrelationId' => 'getSrcCorrelationId', + 'srcScheme' => 'getSrcScheme', + 'srcTokenReference' => 'getSrcTokenReference', 'threeDS2SdkVersion' => 'getThreeDS2SdkVersion', 'cashtag' => 'getCashtag', 'customerId' => 'getCustomerId', @@ -612,6 +630,9 @@ public function __construct(array $data = null) $this->setIfExists('networkPaymentReference', $data ?? [], null); $this->setIfExists('number', $data ?? [], null); $this->setIfExists('shopperNotificationReference', $data ?? [], null); + $this->setIfExists('srcCorrelationId', $data ?? [], null); + $this->setIfExists('srcScheme', $data ?? [], null); + $this->setIfExists('srcTokenReference', $data ?? [], null); $this->setIfExists('threeDS2SdkVersion', $data ?? [], null); $this->setIfExists('cashtag', $data ?? [], null); $this->setIfExists('customerId', $data ?? [], null); @@ -1623,6 +1644,87 @@ public function setShopperNotificationReference($shopperNotificationReference) return $this; } + /** + * Gets srcCorrelationId + * + * @return string|null + */ + public function getSrcCorrelationId() + { + return $this->container['srcCorrelationId']; + } + + /** + * Sets srcCorrelationId + * + * @param string|null $srcCorrelationId An identifier used for the Click to Pay transaction. + * + * @return self + */ + public function setSrcCorrelationId($srcCorrelationId) + { + if (is_null($srcCorrelationId)) { + throw new \InvalidArgumentException('non-nullable srcCorrelationId cannot be null'); + } + $this->container['srcCorrelationId'] = $srcCorrelationId; + + return $this; + } + + /** + * Gets srcScheme + * + * @return string|null + */ + public function getSrcScheme() + { + return $this->container['srcScheme']; + } + + /** + * Sets srcScheme + * + * @param string|null $srcScheme The scheme that is being used for Click to Pay. + * + * @return self + */ + public function setSrcScheme($srcScheme) + { + if (is_null($srcScheme)) { + throw new \InvalidArgumentException('non-nullable srcScheme cannot be null'); + } + $this->container['srcScheme'] = $srcScheme; + + return $this; + } + + /** + * Gets srcTokenReference + * + * @return string|null + */ + public function getSrcTokenReference() + { + return $this->container['srcTokenReference']; + } + + /** + * Sets srcTokenReference + * + * @param string|null $srcTokenReference The reference for the Click to Pay token. + * + * @return self + */ + public function setSrcTokenReference($srcTokenReference) + { + if (is_null($srcTokenReference)) { + throw new \InvalidArgumentException('non-nullable srcTokenReference cannot be null'); + } + $this->container['srcTokenReference'] = $srcTokenReference; + + return $this; + } + /** * Gets threeDS2SdkVersion * @@ -1852,7 +1954,7 @@ public function getShopperEmail() /** * Sets shopperEmail * - * @param string $shopperEmail + * @param string $shopperEmail * * @return self */ @@ -1879,7 +1981,7 @@ public function getTelephoneNumber() /** * Sets telephoneNumber * - * @param string $telephoneNumber + * @param string $telephoneNumber * * @return self */ diff --git a/src/Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.php b/src/Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.php new file mode 100644 index 000000000..e81a2f281 --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.php @@ -0,0 +1,553 @@ + + */ +class CheckoutSessionThreeDS2RequestData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutSessionThreeDS2RequestData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'homePhone' => '\Adyen\Model\Checkout\Phone', + 'mobilePhone' => '\Adyen\Model\Checkout\Phone', + 'threeDSRequestorChallengeInd' => 'string', + 'workPhone' => '\Adyen\Model\Checkout\Phone' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'homePhone' => null, + 'mobilePhone' => null, + 'threeDSRequestorChallengeInd' => null, + 'workPhone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'homePhone' => false, + 'mobilePhone' => false, + 'threeDSRequestorChallengeInd' => false, + 'workPhone' => 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 = [ + 'homePhone' => 'homePhone', + 'mobilePhone' => 'mobilePhone', + 'threeDSRequestorChallengeInd' => 'threeDSRequestorChallengeInd', + 'workPhone' => 'workPhone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'homePhone' => 'setHomePhone', + 'mobilePhone' => 'setMobilePhone', + 'threeDSRequestorChallengeInd' => 'setThreeDSRequestorChallengeInd', + 'workPhone' => 'setWorkPhone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'homePhone' => 'getHomePhone', + 'mobilePhone' => 'getMobilePhone', + 'threeDSRequestorChallengeInd' => 'getThreeDSRequestorChallengeInd', + 'workPhone' => 'getWorkPhone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const THREE_DS_REQUESTOR_CHALLENGE_IND__01 = '01'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__02 = '02'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__03 = '03'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__04 = '04'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__05 = '05'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__06 = '06'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getThreeDSRequestorChallengeIndAllowableValues() + { + return [ + self::THREE_DS_REQUESTOR_CHALLENGE_IND__01, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__02, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__03, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__04, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__05, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__06, + ]; + } + /** + * 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('homePhone', $data ?? [], null); + $this->setIfExists('mobilePhone', $data ?? [], null); + $this->setIfExists('threeDSRequestorChallengeInd', $data ?? [], null); + $this->setIfExists('workPhone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getThreeDSRequestorChallengeIndAllowableValues(); + if (!is_null($this->container['threeDSRequestorChallengeInd']) && !in_array($this->container['threeDSRequestorChallengeInd'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'threeDSRequestorChallengeInd', must be one of '%s'", + $this->container['threeDSRequestorChallengeInd'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets homePhone + * + * @return \Adyen\Model\Checkout\Phone|null + */ + public function getHomePhone() + { + return $this->container['homePhone']; + } + + /** + * Sets homePhone + * + * @param \Adyen\Model\Checkout\Phone|null $homePhone homePhone + * + * @return self + */ + public function setHomePhone($homePhone) + { + if (is_null($homePhone)) { + throw new \InvalidArgumentException('non-nullable homePhone cannot be null'); + } + $this->container['homePhone'] = $homePhone; + + return $this; + } + + /** + * Gets mobilePhone + * + * @return \Adyen\Model\Checkout\Phone|null + */ + public function getMobilePhone() + { + return $this->container['mobilePhone']; + } + + /** + * Sets mobilePhone + * + * @param \Adyen\Model\Checkout\Phone|null $mobilePhone mobilePhone + * + * @return self + */ + public function setMobilePhone($mobilePhone) + { + if (is_null($mobilePhone)) { + throw new \InvalidArgumentException('non-nullable mobilePhone cannot be null'); + } + $this->container['mobilePhone'] = $mobilePhone; + + return $this; + } + + /** + * Gets threeDSRequestorChallengeInd + * + * @return string|null + */ + public function getThreeDSRequestorChallengeInd() + { + return $this->container['threeDSRequestorChallengeInd']; + } + + /** + * Sets threeDSRequestorChallengeInd + * + * @param string|null $threeDSRequestorChallengeInd Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only + * + * @return self + */ + public function setThreeDSRequestorChallengeInd($threeDSRequestorChallengeInd) + { + if (is_null($threeDSRequestorChallengeInd)) { + throw new \InvalidArgumentException('non-nullable threeDSRequestorChallengeInd cannot be null'); + } + $allowedValues = $this->getThreeDSRequestorChallengeIndAllowableValues(); + if (!in_array($threeDSRequestorChallengeInd, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'threeDSRequestorChallengeInd', must be one of '%s'", + $threeDSRequestorChallengeInd, + implode("', '", $allowedValues) + ) + ); + } + $this->container['threeDSRequestorChallengeInd'] = $threeDSRequestorChallengeInd; + + return $this; + } + + /** + * Gets workPhone + * + * @return \Adyen\Model\Checkout\Phone|null + */ + public function getWorkPhone() + { + return $this->container['workPhone']; + } + + /** + * Sets workPhone + * + * @param \Adyen\Model\Checkout\Phone|null $workPhone workPhone + * + * @return self + */ + public function setWorkPhone($workPhone) + { + if (is_null($workPhone)) { + throw new \InvalidArgumentException('non-nullable workPhone cannot be null'); + } + $this->container['workPhone'] = $workPhone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php b/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php index 036901f4d..db8bbc5d8 100644 --- a/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php +++ b/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php @@ -101,6 +101,7 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'storePaymentMethodMode' => 'string', 'telephoneNumber' => 'string', 'themeId' => 'string', + 'threeDS2RequestData' => '\Adyen\Model\Checkout\CheckoutSessionThreeDS2RequestData', 'threeDSAuthenticationOnly' => 'bool', 'trustedShopper' => 'bool' ]; @@ -170,6 +171,7 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'storePaymentMethodMode' => null, 'telephoneNumber' => null, 'themeId' => null, + 'threeDS2RequestData' => null, 'threeDSAuthenticationOnly' => null, 'trustedShopper' => null ]; @@ -237,6 +239,7 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'storePaymentMethodMode' => false, 'telephoneNumber' => false, 'themeId' => false, + 'threeDS2RequestData' => false, 'threeDSAuthenticationOnly' => false, 'trustedShopper' => false ]; @@ -384,6 +387,7 @@ public function isNullableSetToNull(string $property): bool 'storePaymentMethodMode' => 'storePaymentMethodMode', 'telephoneNumber' => 'telephoneNumber', 'themeId' => 'themeId', + 'threeDS2RequestData' => 'threeDS2RequestData', 'threeDSAuthenticationOnly' => 'threeDSAuthenticationOnly', 'trustedShopper' => 'trustedShopper' ]; @@ -451,6 +455,7 @@ public function isNullableSetToNull(string $property): bool 'storePaymentMethodMode' => 'setStorePaymentMethodMode', 'telephoneNumber' => 'setTelephoneNumber', 'themeId' => 'setThemeId', + 'threeDS2RequestData' => 'setThreeDS2RequestData', 'threeDSAuthenticationOnly' => 'setThreeDSAuthenticationOnly', 'trustedShopper' => 'setTrustedShopper' ]; @@ -518,6 +523,7 @@ public function isNullableSetToNull(string $property): bool 'storePaymentMethodMode' => 'getStorePaymentMethodMode', 'telephoneNumber' => 'getTelephoneNumber', 'themeId' => 'getThemeId', + 'threeDS2RequestData' => 'getThreeDS2RequestData', 'threeDSAuthenticationOnly' => 'getThreeDSAuthenticationOnly', 'trustedShopper' => 'getTrustedShopper' ]; @@ -716,6 +722,7 @@ public function __construct(array $data = null) $this->setIfExists('storePaymentMethodMode', $data ?? [], null); $this->setIfExists('telephoneNumber', $data ?? [], null); $this->setIfExists('themeId', $data ?? [], null); + $this->setIfExists('threeDS2RequestData', $data ?? [], null); $this->setIfExists('threeDSAuthenticationOnly', $data ?? [], null); $this->setIfExists('trustedShopper', $data ?? [], null); } @@ -1272,7 +1279,7 @@ public function getEnableOneClick() /** * Sets enableOneClick * - * @param bool|null $enableOneClick When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. + * @param bool|null $enableOneClick When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). * * @return self */ @@ -1326,7 +1333,7 @@ public function getEnableRecurring() /** * Sets enableRecurring * - * @param bool|null $enableRecurring When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. + * @param bool|null $enableRecurring When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. * * @return self */ @@ -2301,7 +2308,7 @@ public function getStorePaymentMethod() /** * Sets storePaymentMethod * - * @param bool|null $storePaymentMethod When this is set to **true** and the `shopperReference` is provided, the payment details will be stored. + * @param bool|null $storePaymentMethod When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). * * @return self */ @@ -2406,6 +2413,33 @@ public function setThemeId($themeId) return $this; } + /** + * Gets threeDS2RequestData + * + * @return \Adyen\Model\Checkout\CheckoutSessionThreeDS2RequestData|null + */ + public function getThreeDS2RequestData() + { + return $this->container['threeDS2RequestData']; + } + + /** + * Sets threeDS2RequestData + * + * @param \Adyen\Model\Checkout\CheckoutSessionThreeDS2RequestData|null $threeDS2RequestData threeDS2RequestData + * + * @return self + */ + public function setThreeDS2RequestData($threeDS2RequestData) + { + if (is_null($threeDS2RequestData)) { + throw new \InvalidArgumentException('non-nullable threeDS2RequestData cannot be null'); + } + $this->container['threeDS2RequestData'] = $threeDS2RequestData; + + return $this; + } + /** * Gets threeDSAuthenticationOnly * diff --git a/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php b/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php index 9daafa5a3..dcabd4da4 100644 --- a/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php +++ b/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php @@ -103,6 +103,7 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'storePaymentMethodMode' => 'string', 'telephoneNumber' => 'string', 'themeId' => 'string', + 'threeDS2RequestData' => '\Adyen\Model\Checkout\CheckoutSessionThreeDS2RequestData', 'threeDSAuthenticationOnly' => 'bool', 'trustedShopper' => 'bool', 'url' => 'string' @@ -175,6 +176,7 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'storePaymentMethodMode' => null, 'telephoneNumber' => null, 'themeId' => null, + 'threeDS2RequestData' => null, 'threeDSAuthenticationOnly' => null, 'trustedShopper' => null, 'url' => null @@ -245,6 +247,7 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'storePaymentMethodMode' => false, 'telephoneNumber' => false, 'themeId' => false, + 'threeDS2RequestData' => false, 'threeDSAuthenticationOnly' => false, 'trustedShopper' => false, 'url' => false @@ -395,6 +398,7 @@ public function isNullableSetToNull(string $property): bool 'storePaymentMethodMode' => 'storePaymentMethodMode', 'telephoneNumber' => 'telephoneNumber', 'themeId' => 'themeId', + 'threeDS2RequestData' => 'threeDS2RequestData', 'threeDSAuthenticationOnly' => 'threeDSAuthenticationOnly', 'trustedShopper' => 'trustedShopper', 'url' => 'url' @@ -465,6 +469,7 @@ public function isNullableSetToNull(string $property): bool 'storePaymentMethodMode' => 'setStorePaymentMethodMode', 'telephoneNumber' => 'setTelephoneNumber', 'themeId' => 'setThemeId', + 'threeDS2RequestData' => 'setThreeDS2RequestData', 'threeDSAuthenticationOnly' => 'setThreeDSAuthenticationOnly', 'trustedShopper' => 'setTrustedShopper', 'url' => 'setUrl' @@ -535,6 +540,7 @@ public function isNullableSetToNull(string $property): bool 'storePaymentMethodMode' => 'getStorePaymentMethodMode', 'telephoneNumber' => 'getTelephoneNumber', 'themeId' => 'getThemeId', + 'threeDS2RequestData' => 'getThreeDS2RequestData', 'threeDSAuthenticationOnly' => 'getThreeDSAuthenticationOnly', 'trustedShopper' => 'getTrustedShopper', 'url' => 'getUrl' @@ -736,6 +742,7 @@ public function __construct(array $data = null) $this->setIfExists('storePaymentMethodMode', $data ?? [], null); $this->setIfExists('telephoneNumber', $data ?? [], null); $this->setIfExists('themeId', $data ?? [], null); + $this->setIfExists('threeDS2RequestData', $data ?? [], null); $this->setIfExists('threeDSAuthenticationOnly', $data ?? [], null); $this->setIfExists('trustedShopper', $data ?? [], null); $this->setIfExists('url', $data ?? [], null); @@ -1299,7 +1306,7 @@ public function getEnableOneClick() /** * Sets enableOneClick * - * @param bool|null $enableOneClick When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. + * @param bool|null $enableOneClick When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). * * @return self */ @@ -1353,7 +1360,7 @@ public function getEnableRecurring() /** * Sets enableRecurring * - * @param bool|null $enableRecurring When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. + * @param bool|null $enableRecurring When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. * * @return self */ @@ -2382,7 +2389,7 @@ public function getStorePaymentMethod() /** * Sets storePaymentMethod * - * @param bool|null $storePaymentMethod When this is set to **true** and the `shopperReference` is provided, the payment details will be stored. + * @param bool|null $storePaymentMethod When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). * * @return self */ @@ -2487,6 +2494,33 @@ public function setThemeId($themeId) return $this; } + /** + * Gets threeDS2RequestData + * + * @return \Adyen\Model\Checkout\CheckoutSessionThreeDS2RequestData|null + */ + public function getThreeDS2RequestData() + { + return $this->container['threeDS2RequestData']; + } + + /** + * Sets threeDS2RequestData + * + * @param \Adyen\Model\Checkout\CheckoutSessionThreeDS2RequestData|null $threeDS2RequestData threeDS2RequestData + * + * @return self + */ + public function setThreeDS2RequestData($threeDS2RequestData) + { + if (is_null($threeDS2RequestData)) { + throw new \InvalidArgumentException('non-nullable threeDS2RequestData cannot be null'); + } + $this->container['threeDS2RequestData'] = $threeDS2RequestData; + + return $this; + } + /** * Gets threeDSAuthenticationOnly * diff --git a/src/Adyen/Model/Checkout/DonationPaymentMethod.php b/src/Adyen/Model/Checkout/DonationPaymentMethod.php index e5728f121..400a6a5dc 100644 --- a/src/Adyen/Model/Checkout/DonationPaymentMethod.php +++ b/src/Adyen/Model/Checkout/DonationPaymentMethod.php @@ -64,6 +64,9 @@ class DonationPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'networkPaymentReference' => 'string', 'number' => 'string', 'shopperNotificationReference' => 'string', + 'srcCorrelationId' => 'string', + 'srcScheme' => 'string', + 'srcTokenReference' => 'string', 'threeDS2SdkVersion' => 'string', 'googlePayCardNetwork' => 'string', 'googlePayToken' => 'string', @@ -97,6 +100,9 @@ class DonationPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'networkPaymentReference' => null, 'number' => null, 'shopperNotificationReference' => null, + 'srcCorrelationId' => null, + 'srcScheme' => null, + 'srcTokenReference' => null, 'threeDS2SdkVersion' => null, 'googlePayCardNetwork' => null, 'googlePayToken' => null, @@ -128,6 +134,9 @@ class DonationPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'networkPaymentReference' => false, 'number' => false, 'shopperNotificationReference' => false, + 'srcCorrelationId' => false, + 'srcScheme' => false, + 'srcTokenReference' => false, 'threeDS2SdkVersion' => false, 'googlePayCardNetwork' => false, 'googlePayToken' => false, @@ -239,6 +248,9 @@ public function isNullableSetToNull(string $property): bool 'networkPaymentReference' => 'networkPaymentReference', 'number' => 'number', 'shopperNotificationReference' => 'shopperNotificationReference', + 'srcCorrelationId' => 'srcCorrelationId', + 'srcScheme' => 'srcScheme', + 'srcTokenReference' => 'srcTokenReference', 'threeDS2SdkVersion' => 'threeDS2SdkVersion', 'googlePayCardNetwork' => 'googlePayCardNetwork', 'googlePayToken' => 'googlePayToken', @@ -270,6 +282,9 @@ public function isNullableSetToNull(string $property): bool 'networkPaymentReference' => 'setNetworkPaymentReference', 'number' => 'setNumber', 'shopperNotificationReference' => 'setShopperNotificationReference', + 'srcCorrelationId' => 'setSrcCorrelationId', + 'srcScheme' => 'setSrcScheme', + 'srcTokenReference' => 'setSrcTokenReference', 'threeDS2SdkVersion' => 'setThreeDS2SdkVersion', 'googlePayCardNetwork' => 'setGooglePayCardNetwork', 'googlePayToken' => 'setGooglePayToken', @@ -301,6 +316,9 @@ public function isNullableSetToNull(string $property): bool 'networkPaymentReference' => 'getNetworkPaymentReference', 'number' => 'getNumber', 'shopperNotificationReference' => 'getShopperNotificationReference', + 'srcCorrelationId' => 'getSrcCorrelationId', + 'srcScheme' => 'getSrcScheme', + 'srcTokenReference' => 'getSrcTokenReference', 'threeDS2SdkVersion' => 'getThreeDS2SdkVersion', 'googlePayCardNetwork' => 'getGooglePayCardNetwork', 'googlePayToken' => 'getGooglePayToken', @@ -382,6 +400,9 @@ public function __construct(array $data = null) $this->setIfExists('networkPaymentReference', $data ?? [], null); $this->setIfExists('number', $data ?? [], null); $this->setIfExists('shopperNotificationReference', $data ?? [], null); + $this->setIfExists('srcCorrelationId', $data ?? [], null); + $this->setIfExists('srcScheme', $data ?? [], null); + $this->setIfExists('srcTokenReference', $data ?? [], null); $this->setIfExists('threeDS2SdkVersion', $data ?? [], null); $this->setIfExists('googlePayCardNetwork', $data ?? [], null); $this->setIfExists('googlePayToken', $data ?? [], null); @@ -958,6 +979,87 @@ public function setShopperNotificationReference($shopperNotificationReference) return $this; } + /** + * Gets srcCorrelationId + * + * @return string|null + */ + public function getSrcCorrelationId() + { + return $this->container['srcCorrelationId']; + } + + /** + * Sets srcCorrelationId + * + * @param string|null $srcCorrelationId An identifier used for the Click to Pay transaction. + * + * @return self + */ + public function setSrcCorrelationId($srcCorrelationId) + { + if (is_null($srcCorrelationId)) { + throw new \InvalidArgumentException('non-nullable srcCorrelationId cannot be null'); + } + $this->container['srcCorrelationId'] = $srcCorrelationId; + + return $this; + } + + /** + * Gets srcScheme + * + * @return string|null + */ + public function getSrcScheme() + { + return $this->container['srcScheme']; + } + + /** + * Sets srcScheme + * + * @param string|null $srcScheme The scheme that is being used for Click to Pay. + * + * @return self + */ + public function setSrcScheme($srcScheme) + { + if (is_null($srcScheme)) { + throw new \InvalidArgumentException('non-nullable srcScheme cannot be null'); + } + $this->container['srcScheme'] = $srcScheme; + + return $this; + } + + /** + * Gets srcTokenReference + * + * @return string|null + */ + public function getSrcTokenReference() + { + return $this->container['srcTokenReference']; + } + + /** + * Sets srcTokenReference + * + * @param string|null $srcTokenReference The reference for the Click to Pay token. + * + * @return self + */ + public function setSrcTokenReference($srcTokenReference) + { + if (is_null($srcTokenReference)) { + throw new \InvalidArgumentException('non-nullable srcTokenReference cannot be null'); + } + $this->container['srcTokenReference'] = $srcTokenReference; + + return $this; + } + /** * Gets threeDS2SdkVersion * diff --git a/src/Adyen/Model/Checkout/EcontextVoucherDetails.php b/src/Adyen/Model/Checkout/EcontextVoucherDetails.php index 8be09c4e5..b1cf9ee8a 100644 --- a/src/Adyen/Model/Checkout/EcontextVoucherDetails.php +++ b/src/Adyen/Model/Checkout/EcontextVoucherDetails.php @@ -245,8 +245,11 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_SEVENELEVEN = 'econtext_seveneleven'; - public const TYPE_STORES = 'econtext_stores'; + public const TYPE_ECONTEXT_SEVEN_ELEVEN = 'econtext_seven_eleven'; + public const TYPE_ECONTEXT_ONLINE = 'econtext_online'; + public const TYPE_ECONTEXT = 'econtext'; + public const TYPE_ECONTEXT_STORES = 'econtext_stores'; + public const TYPE_ECONTEXT_ATM = 'econtext_atm'; /** * Gets allowable values of the enum @@ -256,8 +259,11 @@ public function getModelName() public function getTypeAllowableValues() { return [ - self::TYPE_SEVENELEVEN, - self::TYPE_STORES, + self::TYPE_ECONTEXT_SEVEN_ELEVEN, + self::TYPE_ECONTEXT_ONLINE, + self::TYPE_ECONTEXT, + self::TYPE_ECONTEXT_STORES, + self::TYPE_ECONTEXT_ATM, ]; } /** diff --git a/src/Adyen/Model/Checkout/Installments.php b/src/Adyen/Model/Checkout/Installments.php index 6b84d0b74..4a82c1ef2 100644 --- a/src/Adyen/Model/Checkout/Installments.php +++ b/src/Adyen/Model/Checkout/Installments.php @@ -368,7 +368,7 @@ public function getPlan() /** * Sets plan * - * @param string|null $plan The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. + * @param string|null $plan The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. * * @return self */ @@ -405,7 +405,7 @@ public function getValue() /** * Sets value * - * @param int $value Defines the number of installments. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. This value can be zero for Installments processed in Mexico + * @param int $value Defines the number of installments. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. This value can be zero for Installments processed in Mexico. * * @return self */ diff --git a/src/Adyen/Model/Checkout/LineItem.php b/src/Adyen/Model/Checkout/LineItem.php index 7e18f262f..be4773087 100644 --- a/src/Adyen/Model/Checkout/LineItem.php +++ b/src/Adyen/Model/Checkout/LineItem.php @@ -53,6 +53,7 @@ class LineItem implements ModelInterface, ArrayAccess, \JsonSerializable 'imageUrl' => 'string', 'itemCategory' => 'string', 'manufacturer' => 'string', + 'marketplaceSellerId' => 'string', 'productUrl' => 'string', 'quantity' => 'int', 'receiverEmail' => 'string', @@ -80,6 +81,7 @@ class LineItem implements ModelInterface, ArrayAccess, \JsonSerializable 'imageUrl' => null, 'itemCategory' => null, 'manufacturer' => null, + 'marketplaceSellerId' => null, 'productUrl' => null, 'quantity' => 'int64', 'receiverEmail' => null, @@ -105,6 +107,7 @@ class LineItem implements ModelInterface, ArrayAccess, \JsonSerializable 'imageUrl' => false, 'itemCategory' => false, 'manufacturer' => false, + 'marketplaceSellerId' => false, 'productUrl' => false, 'quantity' => false, 'receiverEmail' => false, @@ -210,6 +213,7 @@ public function isNullableSetToNull(string $property): bool 'imageUrl' => 'imageUrl', 'itemCategory' => 'itemCategory', 'manufacturer' => 'manufacturer', + 'marketplaceSellerId' => 'marketplaceSellerId', 'productUrl' => 'productUrl', 'quantity' => 'quantity', 'receiverEmail' => 'receiverEmail', @@ -235,6 +239,7 @@ public function isNullableSetToNull(string $property): bool 'imageUrl' => 'setImageUrl', 'itemCategory' => 'setItemCategory', 'manufacturer' => 'setManufacturer', + 'marketplaceSellerId' => 'setMarketplaceSellerId', 'productUrl' => 'setProductUrl', 'quantity' => 'setQuantity', 'receiverEmail' => 'setReceiverEmail', @@ -260,6 +265,7 @@ public function isNullableSetToNull(string $property): bool 'imageUrl' => 'getImageUrl', 'itemCategory' => 'getItemCategory', 'manufacturer' => 'getManufacturer', + 'marketplaceSellerId' => 'getMarketplaceSellerId', 'productUrl' => 'getProductUrl', 'quantity' => 'getQuantity', 'receiverEmail' => 'getReceiverEmail', @@ -336,6 +342,7 @@ public function __construct(array $data = null) $this->setIfExists('imageUrl', $data ?? [], null); $this->setIfExists('itemCategory', $data ?? [], null); $this->setIfExists('manufacturer', $data ?? [], null); + $this->setIfExists('marketplaceSellerId', $data ?? [], null); $this->setIfExists('productUrl', $data ?? [], null); $this->setIfExists('quantity', $data ?? [], null); $this->setIfExists('receiverEmail', $data ?? [], null); @@ -631,6 +638,33 @@ public function setManufacturer($manufacturer) return $this; } + /** + * Gets marketplaceSellerId + * + * @return string|null + */ + public function getMarketplaceSellerId() + { + return $this->container['marketplaceSellerId']; + } + + /** + * Sets marketplaceSellerId + * + * @param string|null $marketplaceSellerId Marketplace seller id. + * + * @return self + */ + public function setMarketplaceSellerId($marketplaceSellerId) + { + if (is_null($marketplaceSellerId)) { + throw new \InvalidArgumentException('non-nullable marketplaceSellerId cannot be null'); + } + $this->container['marketplaceSellerId'] = $marketplaceSellerId; + + return $this; + } + /** * Gets productUrl * diff --git a/src/Adyen/Model/Checkout/MbwayDetails.php b/src/Adyen/Model/Checkout/MbwayDetails.php index b55de8e2f..feec9e45a 100644 --- a/src/Adyen/Model/Checkout/MbwayDetails.php +++ b/src/Adyen/Model/Checkout/MbwayDetails.php @@ -364,7 +364,7 @@ public function getShopperEmail() /** * Sets shopperEmail * - * @param string $shopperEmail + * @param string $shopperEmail * * @return self */ @@ -391,7 +391,7 @@ public function getTelephoneNumber() /** * Sets telephoneNumber * - * @param string $telephoneNumber + * @param string $telephoneNumber * * @return self */ diff --git a/src/Adyen/Model/Checkout/ObjectSerializer.php b/src/Adyen/Model/Checkout/ObjectSerializer.php index 2b682c18f..628f63adc 100644 --- a/src/Adyen/Model/Checkout/ObjectSerializer.php +++ b/src/Adyen/Model/Checkout/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Checkout/PaymentCompletionDetails.php b/src/Adyen/Model/Checkout/PaymentCompletionDetails.php index f043363ce..17a52e5d5 100644 --- a/src/Adyen/Model/Checkout/PaymentCompletionDetails.php +++ b/src/Adyen/Model/Checkout/PaymentCompletionDetails.php @@ -59,6 +59,7 @@ class PaymentCompletionDetails implements ModelInterface, ArrayAccess, \JsonSeri 'paymentStatus' => 'string', 'redirectResult' => 'string', 'resultCode' => 'string', + 'returnUrlQueryString' => 'string', 'threeDSResult' => 'string', 'threeds2ChallengeResult' => 'string', 'threeds2Fingerprint' => 'string', @@ -88,6 +89,7 @@ class PaymentCompletionDetails implements ModelInterface, ArrayAccess, \JsonSeri 'paymentStatus' => null, 'redirectResult' => null, 'resultCode' => null, + 'returnUrlQueryString' => null, 'threeDSResult' => null, 'threeds2ChallengeResult' => null, 'threeds2Fingerprint' => null, @@ -115,6 +117,7 @@ class PaymentCompletionDetails implements ModelInterface, ArrayAccess, \JsonSeri 'paymentStatus' => false, 'redirectResult' => false, 'resultCode' => false, + 'returnUrlQueryString' => false, 'threeDSResult' => false, 'threeds2ChallengeResult' => false, 'threeds2Fingerprint' => false, @@ -222,6 +225,7 @@ public function isNullableSetToNull(string $property): bool 'paymentStatus' => 'paymentStatus', 'redirectResult' => 'redirectResult', 'resultCode' => 'resultCode', + 'returnUrlQueryString' => 'returnUrlQueryString', 'threeDSResult' => 'threeDSResult', 'threeds2ChallengeResult' => 'threeds2.challengeResult', 'threeds2Fingerprint' => 'threeds2.fingerprint', @@ -249,6 +253,7 @@ public function isNullableSetToNull(string $property): bool 'paymentStatus' => 'setPaymentStatus', 'redirectResult' => 'setRedirectResult', 'resultCode' => 'setResultCode', + 'returnUrlQueryString' => 'setReturnUrlQueryString', 'threeDSResult' => 'setThreeDSResult', 'threeds2ChallengeResult' => 'setThreeds2ChallengeResult', 'threeds2Fingerprint' => 'setThreeds2Fingerprint', @@ -276,6 +281,7 @@ public function isNullableSetToNull(string $property): bool 'paymentStatus' => 'getPaymentStatus', 'redirectResult' => 'getRedirectResult', 'resultCode' => 'getResultCode', + 'returnUrlQueryString' => 'getReturnUrlQueryString', 'threeDSResult' => 'getThreeDSResult', 'threeds2ChallengeResult' => 'getThreeds2ChallengeResult', 'threeds2Fingerprint' => 'getThreeds2Fingerprint', @@ -354,6 +360,7 @@ public function __construct(array $data = null) $this->setIfExists('paymentStatus', $data ?? [], null); $this->setIfExists('redirectResult', $data ?? [], null); $this->setIfExists('resultCode', $data ?? [], null); + $this->setIfExists('returnUrlQueryString', $data ?? [], null); $this->setIfExists('threeDSResult', $data ?? [], null); $this->setIfExists('threeds2ChallengeResult', $data ?? [], null); $this->setIfExists('threeds2Fingerprint', $data ?? [], null); @@ -807,6 +814,33 @@ public function setResultCode($resultCode) return $this; } + /** + * Gets returnUrlQueryString + * + * @return string|null + */ + public function getReturnUrlQueryString() + { + return $this->container['returnUrlQueryString']; + } + + /** + * Sets returnUrlQueryString + * + * @param string|null $returnUrlQueryString The query string as appended to the `returnURL` when using direct issuer links . + * + * @return self + */ + public function setReturnUrlQueryString($returnUrlQueryString) + { + if (is_null($returnUrlQueryString)) { + throw new \InvalidArgumentException('non-nullable returnUrlQueryString cannot be null'); + } + $this->container['returnUrlQueryString'] = $returnUrlQueryString; + + return $this; + } + /** * Gets threeDSResult * diff --git a/src/Adyen/Model/Checkout/PaymentDetails.php b/src/Adyen/Model/Checkout/PaymentDetails.php index c744616a5..8c5ec4511 100644 --- a/src/Adyen/Model/Checkout/PaymentDetails.php +++ b/src/Adyen/Model/Checkout/PaymentDetails.php @@ -261,6 +261,9 @@ public function getModelName() public const TYPE_WALLEY_B2B = 'walley_b2b'; public const TYPE_ALMA = 'alma'; public const TYPE_PAYPO = 'paypo'; + public const TYPE_SCALAPAY = 'scalapay'; + public const TYPE_SCALAPAY_3X = 'scalapay_3x'; + public const TYPE_SCALAPAY_4X = 'scalapay_4x'; public const TYPE_MOLPAY_FPX = 'molpay_fpx'; public const TYPE_KONBINI = 'konbini'; public const TYPE_DIRECT_EBANKING = 'directEbanking'; @@ -358,6 +361,9 @@ public function getTypeAllowableValues() self::TYPE_WALLEY_B2B, self::TYPE_ALMA, self::TYPE_PAYPO, + self::TYPE_SCALAPAY, + self::TYPE_SCALAPAY_3X, + self::TYPE_SCALAPAY_4X, self::TYPE_MOLPAY_FPX, self::TYPE_KONBINI, self::TYPE_DIRECT_EBANKING, diff --git a/src/Adyen/Model/Checkout/PaymentLinkRequest.php b/src/Adyen/Model/Checkout/PaymentLinkRequest.php index 60792fa10..7ab395bfb 100644 --- a/src/Adyen/Model/Checkout/PaymentLinkRequest.php +++ b/src/Adyen/Model/Checkout/PaymentLinkRequest.php @@ -81,7 +81,8 @@ class PaymentLinkRequest implements ModelInterface, ArrayAccess, \JsonSerializab 'store' => 'string', 'storePaymentMethodMode' => 'string', 'telephoneNumber' => 'string', - 'themeId' => 'string' + 'themeId' => 'string', + 'threeDS2RequestData' => '\Adyen\Model\Checkout\CheckoutSessionThreeDS2RequestData' ]; /** @@ -129,7 +130,8 @@ class PaymentLinkRequest implements ModelInterface, ArrayAccess, \JsonSerializab 'store' => null, 'storePaymentMethodMode' => null, 'telephoneNumber' => null, - 'themeId' => null + 'themeId' => null, + 'threeDS2RequestData' => null ]; /** @@ -175,7 +177,8 @@ class PaymentLinkRequest implements ModelInterface, ArrayAccess, \JsonSerializab 'store' => false, 'storePaymentMethodMode' => false, 'telephoneNumber' => false, - 'themeId' => false + 'themeId' => false, + 'threeDS2RequestData' => false ]; /** @@ -301,7 +304,8 @@ public function isNullableSetToNull(string $property): bool 'store' => 'store', 'storePaymentMethodMode' => 'storePaymentMethodMode', 'telephoneNumber' => 'telephoneNumber', - 'themeId' => 'themeId' + 'themeId' => 'themeId', + 'threeDS2RequestData' => 'threeDS2RequestData' ]; /** @@ -347,7 +351,8 @@ public function isNullableSetToNull(string $property): bool 'store' => 'setStore', 'storePaymentMethodMode' => 'setStorePaymentMethodMode', 'telephoneNumber' => 'setTelephoneNumber', - 'themeId' => 'setThemeId' + 'themeId' => 'setThemeId', + 'threeDS2RequestData' => 'setThreeDS2RequestData' ]; /** @@ -393,7 +398,8 @@ public function isNullableSetToNull(string $property): bool 'store' => 'getStore', 'storePaymentMethodMode' => 'getStorePaymentMethodMode', 'telephoneNumber' => 'getTelephoneNumber', - 'themeId' => 'getThemeId' + 'themeId' => 'getThemeId', + 'threeDS2RequestData' => 'getThreeDS2RequestData' ]; /** @@ -543,6 +549,7 @@ public function __construct(array $data = null) $this->setIfExists('storePaymentMethodMode', $data ?? [], null); $this->setIfExists('telephoneNumber', $data ?? [], null); $this->setIfExists('themeId', $data ?? [], null); + $this->setIfExists('threeDS2RequestData', $data ?? [], null); } /** @@ -1666,6 +1673,33 @@ public function setThemeId($themeId) return $this; } + + /** + * Gets threeDS2RequestData + * + * @return \Adyen\Model\Checkout\CheckoutSessionThreeDS2RequestData|null + */ + public function getThreeDS2RequestData() + { + return $this->container['threeDS2RequestData']; + } + + /** + * Sets threeDS2RequestData + * + * @param \Adyen\Model\Checkout\CheckoutSessionThreeDS2RequestData|null $threeDS2RequestData threeDS2RequestData + * + * @return self + */ + public function setThreeDS2RequestData($threeDS2RequestData) + { + if (is_null($threeDS2RequestData)) { + throw new \InvalidArgumentException('non-nullable threeDS2RequestData cannot be null'); + } + $this->container['threeDS2RequestData'] = $threeDS2RequestData; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Checkout/PaymentLinkResponse.php b/src/Adyen/Model/Checkout/PaymentLinkResponse.php index abbf689fe..775f72ad6 100644 --- a/src/Adyen/Model/Checkout/PaymentLinkResponse.php +++ b/src/Adyen/Model/Checkout/PaymentLinkResponse.php @@ -84,6 +84,7 @@ class PaymentLinkResponse implements ModelInterface, ArrayAccess, \JsonSerializa 'storePaymentMethodMode' => 'string', 'telephoneNumber' => 'string', 'themeId' => 'string', + 'threeDS2RequestData' => '\Adyen\Model\Checkout\CheckoutSessionThreeDS2RequestData', 'updatedAt' => '\DateTime', 'url' => 'string' ]; @@ -136,6 +137,7 @@ class PaymentLinkResponse implements ModelInterface, ArrayAccess, \JsonSerializa 'storePaymentMethodMode' => null, 'telephoneNumber' => null, 'themeId' => null, + 'threeDS2RequestData' => null, 'updatedAt' => 'date-time', 'url' => null ]; @@ -186,6 +188,7 @@ class PaymentLinkResponse implements ModelInterface, ArrayAccess, \JsonSerializa 'storePaymentMethodMode' => false, 'telephoneNumber' => false, 'themeId' => false, + 'threeDS2RequestData' => false, 'updatedAt' => false, 'url' => false ]; @@ -316,6 +319,7 @@ public function isNullableSetToNull(string $property): bool 'storePaymentMethodMode' => 'storePaymentMethodMode', 'telephoneNumber' => 'telephoneNumber', 'themeId' => 'themeId', + 'threeDS2RequestData' => 'threeDS2RequestData', 'updatedAt' => 'updatedAt', 'url' => 'url' ]; @@ -366,6 +370,7 @@ public function isNullableSetToNull(string $property): bool 'storePaymentMethodMode' => 'setStorePaymentMethodMode', 'telephoneNumber' => 'setTelephoneNumber', 'themeId' => 'setThemeId', + 'threeDS2RequestData' => 'setThreeDS2RequestData', 'updatedAt' => 'setUpdatedAt', 'url' => 'setUrl' ]; @@ -416,6 +421,7 @@ public function isNullableSetToNull(string $property): bool 'storePaymentMethodMode' => 'getStorePaymentMethodMode', 'telephoneNumber' => 'getTelephoneNumber', 'themeId' => 'getThemeId', + 'threeDS2RequestData' => 'getThreeDS2RequestData', 'updatedAt' => 'getUpdatedAt', 'url' => 'getUrl' ]; @@ -589,6 +595,7 @@ public function __construct(array $data = null) $this->setIfExists('storePaymentMethodMode', $data ?? [], null); $this->setIfExists('telephoneNumber', $data ?? [], null); $this->setIfExists('themeId', $data ?? [], null); + $this->setIfExists('threeDS2RequestData', $data ?? [], null); $this->setIfExists('updatedAt', $data ?? [], null); $this->setIfExists('url', $data ?? [], null); } @@ -1797,6 +1804,33 @@ public function setThemeId($themeId) return $this; } + /** + * Gets threeDS2RequestData + * + * @return \Adyen\Model\Checkout\CheckoutSessionThreeDS2RequestData|null + */ + public function getThreeDS2RequestData() + { + return $this->container['threeDS2RequestData']; + } + + /** + * Sets threeDS2RequestData + * + * @param \Adyen\Model\Checkout\CheckoutSessionThreeDS2RequestData|null $threeDS2RequestData threeDS2RequestData + * + * @return self + */ + public function setThreeDS2RequestData($threeDS2RequestData) + { + if (is_null($threeDS2RequestData)) { + throw new \InvalidArgumentException('non-nullable threeDS2RequestData cannot be null'); + } + $this->container['threeDS2RequestData'] = $threeDS2RequestData; + + return $this; + } + /** * Gets updatedAt * diff --git a/src/Adyen/Model/Checkout/PaymentMethod.php b/src/Adyen/Model/Checkout/PaymentMethod.php index faf17b42f..98982731f 100644 --- a/src/Adyen/Model/Checkout/PaymentMethod.php +++ b/src/Adyen/Model/Checkout/PaymentMethod.php @@ -44,6 +44,7 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'apps' => '\Adyen\Model\Checkout\PaymentMethodUPIApps[]', 'brand' => 'string', 'brands' => 'string[]', 'configuration' => 'array', @@ -63,6 +64,7 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'apps' => null, 'brand' => null, 'brands' => null, 'configuration' => null, @@ -80,6 +82,7 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ + 'apps' => false, 'brand' => false, 'brands' => false, 'configuration' => false, @@ -177,6 +180,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'apps' => 'apps', 'brand' => 'brand', 'brands' => 'brands', 'configuration' => 'configuration', @@ -194,6 +198,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'apps' => 'setApps', 'brand' => 'setBrand', 'brands' => 'setBrands', 'configuration' => 'setConfiguration', @@ -211,6 +216,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'apps' => 'getApps', 'brand' => 'getBrand', 'brands' => 'getBrands', 'configuration' => 'getConfiguration', @@ -293,6 +299,7 @@ public function getFundingSourceAllowableValues() */ public function __construct(array $data = null) { + $this->setIfExists('apps', $data ?? [], null); $this->setIfExists('brand', $data ?? [], null); $this->setIfExists('brands', $data ?? [], null); $this->setIfExists('configuration', $data ?? [], null); @@ -355,6 +362,33 @@ public function valid() } + /** + * Gets apps + * + * @return \Adyen\Model\Checkout\PaymentMethodUPIApps[]|null + */ + public function getApps() + { + return $this->container['apps']; + } + + /** + * Sets apps + * + * @param \Adyen\Model\Checkout\PaymentMethodUPIApps[]|null $apps A list of apps for this payment method. + * + * @return self + */ + public function setApps($apps) + { + if (is_null($apps)) { + throw new \InvalidArgumentException('non-nullable apps cannot be null'); + } + $this->container['apps'] = $apps; + + return $this; + } + /** * Gets brand * diff --git a/src/Adyen/Model/Checkout/PaymentMethodToStore.php b/src/Adyen/Model/Checkout/PaymentMethodToStore.php index 8854fda2f..f07893078 100644 --- a/src/Adyen/Model/Checkout/PaymentMethodToStore.php +++ b/src/Adyen/Model/Checkout/PaymentMethodToStore.php @@ -53,7 +53,8 @@ class PaymentMethodToStore implements ModelInterface, ArrayAccess, \JsonSerializ 'expiryMonth' => 'string', 'expiryYear' => 'string', 'holderName' => 'string', - 'number' => 'string' + 'number' => 'string', + 'type' => 'string' ]; /** @@ -73,7 +74,8 @@ class PaymentMethodToStore implements ModelInterface, ArrayAccess, \JsonSerializ 'expiryMonth' => null, 'expiryYear' => null, 'holderName' => null, - 'number' => null + 'number' => null, + 'type' => null ]; /** @@ -91,7 +93,8 @@ class PaymentMethodToStore implements ModelInterface, ArrayAccess, \JsonSerializ 'expiryMonth' => false, 'expiryYear' => false, 'holderName' => false, - 'number' => false + 'number' => false, + 'type' => false ]; /** @@ -189,7 +192,8 @@ public function isNullableSetToNull(string $property): bool 'expiryMonth' => 'expiryMonth', 'expiryYear' => 'expiryYear', 'holderName' => 'holderName', - 'number' => 'number' + 'number' => 'number', + 'type' => 'type' ]; /** @@ -207,7 +211,8 @@ public function isNullableSetToNull(string $property): bool 'expiryMonth' => 'setExpiryMonth', 'expiryYear' => 'setExpiryYear', 'holderName' => 'setHolderName', - 'number' => 'setNumber' + 'number' => 'setNumber', + 'type' => 'setType' ]; /** @@ -225,7 +230,8 @@ public function isNullableSetToNull(string $property): bool 'expiryMonth' => 'getExpiryMonth', 'expiryYear' => 'getExpiryYear', 'holderName' => 'getHolderName', - 'number' => 'getNumber' + 'number' => 'getNumber', + 'type' => 'getType' ]; /** @@ -295,6 +301,7 @@ public function __construct(array $data = null) $this->setIfExists('expiryYear', $data ?? [], null); $this->setIfExists('holderName', $data ?? [], null); $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); } /** @@ -608,6 +615,33 @@ public function setNumber($number) return $this; } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Set to **scheme**. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Checkout/PaymentMethodUPIApps.php b/src/Adyen/Model/Checkout/PaymentMethodUPIApps.php new file mode 100644 index 000000000..03dd0a77a --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentMethodUPIApps.php @@ -0,0 +1,450 @@ + + */ +class PaymentMethodUPIApps implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentMethodUPIApps'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'name' => 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 = [ + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName' + ]; + + /** + * 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('id', $data ?? [], null); + $this->setIfExists('name', $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['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' 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 id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of this app, to submit in requests to /payments. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name A localized name of the app. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentRequest.php b/src/Adyen/Model/Checkout/PaymentRequest.php index d653d9e0e..d303dbd5c 100644 --- a/src/Adyen/Model/Checkout/PaymentRequest.php +++ b/src/Adyen/Model/Checkout/PaymentRequest.php @@ -1443,7 +1443,7 @@ public function getEnableOneClick() /** * Sets enableOneClick * - * @param bool|null $enableOneClick When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. + * @param bool|null $enableOneClick When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). * * @return self */ @@ -1497,7 +1497,7 @@ public function getEnableRecurring() /** * Sets enableRecurring * - * @param bool|null $enableRecurring When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. + * @param bool|null $enableRecurring When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. * * @return self */ @@ -2615,7 +2615,7 @@ public function getStorePaymentMethod() /** * Sets storePaymentMethod * - * @param bool|null $storePaymentMethod When true and `shopperReference` is provided, the payment details will be stored. + * @param bool|null $storePaymentMethod When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). * * @return self */ diff --git a/src/Adyen/Model/Checkout/PaymentSetupRequest.php b/src/Adyen/Model/Checkout/PaymentSetupRequest.php index 4b4880814..7de0ae1dc 100644 --- a/src/Adyen/Model/Checkout/PaymentSetupRequest.php +++ b/src/Adyen/Model/Checkout/PaymentSetupRequest.php @@ -84,6 +84,7 @@ class PaymentSetupRequest implements ModelInterface, ArrayAccess, \JsonSerializa 'returnUrl' => 'string', 'riskData' => '\Adyen\Model\Checkout\RiskData', 'sdkVersion' => 'string', + 'secureRemoteCommerceCheckoutData' => '\Adyen\Model\Checkout\SecureRemoteCommerceCheckoutData', 'sessionValidity' => 'string', 'shopperEmail' => 'string', 'shopperIP' => 'string', @@ -150,6 +151,7 @@ class PaymentSetupRequest implements ModelInterface, ArrayAccess, \JsonSerializa 'returnUrl' => null, 'riskData' => null, 'sdkVersion' => null, + 'secureRemoteCommerceCheckoutData' => null, 'sessionValidity' => null, 'shopperEmail' => null, 'shopperIP' => null, @@ -214,6 +216,7 @@ class PaymentSetupRequest implements ModelInterface, ArrayAccess, \JsonSerializa 'returnUrl' => false, 'riskData' => false, 'sdkVersion' => false, + 'secureRemoteCommerceCheckoutData' => false, 'sessionValidity' => false, 'shopperEmail' => false, 'shopperIP' => false, @@ -358,6 +361,7 @@ public function isNullableSetToNull(string $property): bool 'returnUrl' => 'returnUrl', 'riskData' => 'riskData', 'sdkVersion' => 'sdkVersion', + 'secureRemoteCommerceCheckoutData' => 'secureRemoteCommerceCheckoutData', 'sessionValidity' => 'sessionValidity', 'shopperEmail' => 'shopperEmail', 'shopperIP' => 'shopperIP', @@ -422,6 +426,7 @@ public function isNullableSetToNull(string $property): bool 'returnUrl' => 'setReturnUrl', 'riskData' => 'setRiskData', 'sdkVersion' => 'setSdkVersion', + 'secureRemoteCommerceCheckoutData' => 'setSecureRemoteCommerceCheckoutData', 'sessionValidity' => 'setSessionValidity', 'shopperEmail' => 'setShopperEmail', 'shopperIP' => 'setShopperIP', @@ -486,6 +491,7 @@ public function isNullableSetToNull(string $property): bool 'returnUrl' => 'getReturnUrl', 'riskData' => 'getRiskData', 'sdkVersion' => 'getSdkVersion', + 'secureRemoteCommerceCheckoutData' => 'getSecureRemoteCommerceCheckoutData', 'sessionValidity' => 'getSessionValidity', 'shopperEmail' => 'getShopperEmail', 'shopperIP' => 'getShopperIP', @@ -649,6 +655,7 @@ public function __construct(array $data = null) $this->setIfExists('returnUrl', $data ?? [], null); $this->setIfExists('riskData', $data ?? [], null); $this->setIfExists('sdkVersion', $data ?? [], null); + $this->setIfExists('secureRemoteCommerceCheckoutData', $data ?? [], null); $this->setIfExists('sessionValidity', $data ?? [], null); $this->setIfExists('shopperEmail', $data ?? [], null); $this->setIfExists('shopperIP', $data ?? [], null); @@ -1849,6 +1856,33 @@ public function setSdkVersion($sdkVersion) return $this; } + /** + * Gets secureRemoteCommerceCheckoutData + * + * @return \Adyen\Model\Checkout\SecureRemoteCommerceCheckoutData|null + */ + public function getSecureRemoteCommerceCheckoutData() + { + return $this->container['secureRemoteCommerceCheckoutData']; + } + + /** + * Sets secureRemoteCommerceCheckoutData + * + * @param \Adyen\Model\Checkout\SecureRemoteCommerceCheckoutData|null $secureRemoteCommerceCheckoutData secureRemoteCommerceCheckoutData + * + * @return self + */ + public function setSecureRemoteCommerceCheckoutData($secureRemoteCommerceCheckoutData) + { + if (is_null($secureRemoteCommerceCheckoutData)) { + throw new \InvalidArgumentException('non-nullable secureRemoteCommerceCheckoutData cannot be null'); + } + $this->container['secureRemoteCommerceCheckoutData'] = $secureRemoteCommerceCheckoutData; + + return $this; + } + /** * Gets sessionValidity * diff --git a/src/Adyen/Model/Checkout/PaypalUpdateOrderRequest.php b/src/Adyen/Model/Checkout/PaypalUpdateOrderRequest.php index 790afa127..3d8117772 100644 --- a/src/Adyen/Model/Checkout/PaypalUpdateOrderRequest.php +++ b/src/Adyen/Model/Checkout/PaypalUpdateOrderRequest.php @@ -48,7 +48,8 @@ class PaypalUpdateOrderRequest implements ModelInterface, ArrayAccess, \JsonSeri 'deliveryMethods' => '\Adyen\Model\Checkout\DeliveryMethod[]', 'paymentData' => 'string', 'pspReference' => 'string', - 'sessionId' => 'string' + 'sessionId' => 'string', + 'taxTotal' => '\Adyen\Model\Checkout\TaxTotal' ]; /** @@ -63,7 +64,8 @@ class PaypalUpdateOrderRequest implements ModelInterface, ArrayAccess, \JsonSeri 'deliveryMethods' => null, 'paymentData' => null, 'pspReference' => null, - 'sessionId' => null + 'sessionId' => null, + 'taxTotal' => null ]; /** @@ -76,7 +78,8 @@ class PaypalUpdateOrderRequest implements ModelInterface, ArrayAccess, \JsonSeri 'deliveryMethods' => false, 'paymentData' => false, 'pspReference' => false, - 'sessionId' => false + 'sessionId' => false, + 'taxTotal' => false ]; /** @@ -169,7 +172,8 @@ public function isNullableSetToNull(string $property): bool 'deliveryMethods' => 'deliveryMethods', 'paymentData' => 'paymentData', 'pspReference' => 'pspReference', - 'sessionId' => 'sessionId' + 'sessionId' => 'sessionId', + 'taxTotal' => 'taxTotal' ]; /** @@ -182,7 +186,8 @@ public function isNullableSetToNull(string $property): bool 'deliveryMethods' => 'setDeliveryMethods', 'paymentData' => 'setPaymentData', 'pspReference' => 'setPspReference', - 'sessionId' => 'setSessionId' + 'sessionId' => 'setSessionId', + 'taxTotal' => 'setTaxTotal' ]; /** @@ -195,7 +200,8 @@ public function isNullableSetToNull(string $property): bool 'deliveryMethods' => 'getDeliveryMethods', 'paymentData' => 'getPaymentData', 'pspReference' => 'getPspReference', - 'sessionId' => 'getSessionId' + 'sessionId' => 'getSessionId', + 'taxTotal' => 'getTaxTotal' ]; /** @@ -260,6 +266,7 @@ public function __construct(array $data = null) $this->setIfExists('paymentData', $data ?? [], null); $this->setIfExists('pspReference', $data ?? [], null); $this->setIfExists('sessionId', $data ?? [], null); + $this->setIfExists('taxTotal', $data ?? [], null); } /** @@ -438,6 +445,33 @@ public function setSessionId($sessionId) return $this; } + + /** + * Gets taxTotal + * + * @return \Adyen\Model\Checkout\TaxTotal|null + */ + public function getTaxTotal() + { + return $this->container['taxTotal']; + } + + /** + * Sets taxTotal + * + * @param \Adyen\Model\Checkout\TaxTotal|null $taxTotal taxTotal + * + * @return self + */ + public function setTaxTotal($taxTotal) + { + if (is_null($taxTotal)) { + throw new \InvalidArgumentException('non-nullable taxTotal cannot be null'); + } + $this->container['taxTotal'] = $taxTotal; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Checkout/RecurringDetail.php b/src/Adyen/Model/Checkout/RecurringDetail.php index 707898987..cb1fc3886 100644 --- a/src/Adyen/Model/Checkout/RecurringDetail.php +++ b/src/Adyen/Model/Checkout/RecurringDetail.php @@ -44,6 +44,7 @@ class RecurringDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'apps' => '\Adyen\Model\Checkout\PaymentMethodUPIApps[]', 'brand' => 'string', 'brands' => 'string[]', 'configuration' => 'array', @@ -65,6 +66,7 @@ class RecurringDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'apps' => null, 'brand' => null, 'brands' => null, 'configuration' => null, @@ -84,6 +86,7 @@ class RecurringDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ + 'apps' => false, 'brand' => false, 'brands' => false, 'configuration' => false, @@ -183,6 +186,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'apps' => 'apps', 'brand' => 'brand', 'brands' => 'brands', 'configuration' => 'configuration', @@ -202,6 +206,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'apps' => 'setApps', 'brand' => 'setBrand', 'brands' => 'setBrands', 'configuration' => 'setConfiguration', @@ -221,6 +226,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'apps' => 'getApps', 'brand' => 'getBrand', 'brands' => 'getBrands', 'configuration' => 'getConfiguration', @@ -305,6 +311,7 @@ public function getFundingSourceAllowableValues() */ public function __construct(array $data = null) { + $this->setIfExists('apps', $data ?? [], null); $this->setIfExists('brand', $data ?? [], null); $this->setIfExists('brands', $data ?? [], null); $this->setIfExists('configuration', $data ?? [], null); @@ -369,6 +376,33 @@ public function valid() } + /** + * Gets apps + * + * @return \Adyen\Model\Checkout\PaymentMethodUPIApps[]|null + */ + public function getApps() + { + return $this->container['apps']; + } + + /** + * Sets apps + * + * @param \Adyen\Model\Checkout\PaymentMethodUPIApps[]|null $apps A list of apps for this payment method. + * + * @return self + */ + public function setApps($apps) + { + if (is_null($apps)) { + throw new \InvalidArgumentException('non-nullable apps cannot be null'); + } + $this->container['apps'] = $apps; + + return $this; + } + /** * Gets brand * diff --git a/src/Adyen/Model/Checkout/SecureRemoteCommerceCheckoutData.php b/src/Adyen/Model/Checkout/SecureRemoteCommerceCheckoutData.php new file mode 100644 index 000000000..14ba3b4b1 --- /dev/null +++ b/src/Adyen/Model/Checkout/SecureRemoteCommerceCheckoutData.php @@ -0,0 +1,613 @@ + + */ +class SecureRemoteCommerceCheckoutData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SecureRemoteCommerceCheckoutData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkoutPayload' => 'string', + 'correlationId' => 'string', + 'cvc' => 'string', + 'digitalCardId' => 'string', + 'scheme' => 'string', + 'tokenReference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkoutPayload' => null, + 'correlationId' => null, + 'cvc' => null, + 'digitalCardId' => null, + 'scheme' => null, + 'tokenReference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkoutPayload' => false, + 'correlationId' => false, + 'cvc' => false, + 'digitalCardId' => false, + 'scheme' => false, + 'tokenReference' => 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 = [ + 'checkoutPayload' => 'checkoutPayload', + 'correlationId' => 'correlationId', + 'cvc' => 'cvc', + 'digitalCardId' => 'digitalCardId', + 'scheme' => 'scheme', + 'tokenReference' => 'tokenReference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkoutPayload' => 'setCheckoutPayload', + 'correlationId' => 'setCorrelationId', + 'cvc' => 'setCvc', + 'digitalCardId' => 'setDigitalCardId', + 'scheme' => 'setScheme', + 'tokenReference' => 'setTokenReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkoutPayload' => 'getCheckoutPayload', + 'correlationId' => 'getCorrelationId', + 'cvc' => 'getCvc', + 'digitalCardId' => 'getDigitalCardId', + 'scheme' => 'getScheme', + 'tokenReference' => 'getTokenReference' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const SCHEME_MC = 'mc'; + public const SCHEME_VISA = 'visa'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSchemeAllowableValues() + { + return [ + self::SCHEME_MC, + self::SCHEME_VISA, + ]; + } + /** + * 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('checkoutPayload', $data ?? [], null); + $this->setIfExists('correlationId', $data ?? [], null); + $this->setIfExists('cvc', $data ?? [], null); + $this->setIfExists('digitalCardId', $data ?? [], null); + $this->setIfExists('scheme', $data ?? [], null); + $this->setIfExists('tokenReference', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getSchemeAllowableValues(); + if (!is_null($this->container['scheme']) && !in_array($this->container['scheme'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'scheme', must be one of '%s'", + $this->container['scheme'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkoutPayload + * + * @return string|null + */ + public function getCheckoutPayload() + { + return $this->container['checkoutPayload']; + } + + /** + * Sets checkoutPayload + * + * @param string|null $checkoutPayload The Secure Remote Commerce checkout payload to process the payment with. + * + * @return self + */ + public function setCheckoutPayload($checkoutPayload) + { + if (is_null($checkoutPayload)) { + throw new \InvalidArgumentException('non-nullable checkoutPayload cannot be null'); + } + $this->container['checkoutPayload'] = $checkoutPayload; + + return $this; + } + + /** + * Gets correlationId + * + * @return string|null + */ + public function getCorrelationId() + { + return $this->container['correlationId']; + } + + /** + * Sets correlationId + * + * @param string|null $correlationId This is the unique identifier generated by SRC system to track and link SRC messages. Available within the present checkout session (e.g. received in an earlier API response during the present session). + * + * @return self + */ + public function setCorrelationId($correlationId) + { + if (is_null($correlationId)) { + throw new \InvalidArgumentException('non-nullable correlationId cannot be null'); + } + $this->container['correlationId'] = $correlationId; + + return $this; + } + + /** + * Gets cvc + * + * @return string|null + */ + public function getCvc() + { + return $this->container['cvc']; + } + + /** + * Sets cvc + * + * @param string|null $cvc The [card verification code](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#card-security-code-cvc-cvv-cid). + * + * @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 digitalCardId + * + * @return string|null + */ + public function getDigitalCardId() + { + return $this->container['digitalCardId']; + } + + /** + * Sets digitalCardId + * + * @param string|null $digitalCardId A unique identifier that represents the token associated with a card enrolled. Required for scheme 'mc'. + * + * @return self + */ + public function setDigitalCardId($digitalCardId) + { + if (is_null($digitalCardId)) { + throw new \InvalidArgumentException('non-nullable digitalCardId cannot be null'); + } + $this->container['digitalCardId'] = $digitalCardId; + + return $this; + } + + /** + * Gets scheme + * + * @return string|null + */ + public function getScheme() + { + return $this->container['scheme']; + } + + /** + * Sets scheme + * + * @param string|null $scheme The Secure Remote Commerce scheme. + * + * @return self + */ + public function setScheme($scheme) + { + if (is_null($scheme)) { + throw new \InvalidArgumentException('non-nullable scheme cannot be null'); + } + $allowedValues = $this->getSchemeAllowableValues(); + if (!in_array($scheme, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'scheme', must be one of '%s'", + $scheme, + implode("', '", $allowedValues) + ) + ); + } + $this->container['scheme'] = $scheme; + + return $this; + } + + /** + * Gets tokenReference + * + * @return string|null + */ + public function getTokenReference() + { + return $this->container['tokenReference']; + } + + /** + * Sets tokenReference + * + * @param string|null $tokenReference A unique identifier that represents the token associated with a card enrolled. Required for scheme 'visa'. + * + * @return self + */ + public function setTokenReference($tokenReference) + { + if (is_null($tokenReference)) { + throw new \InvalidArgumentException('non-nullable tokenReference cannot be null'); + } + $this->container['tokenReference'] = $tokenReference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/SubMerchantInfo.php b/src/Adyen/Model/Checkout/SubMerchantInfo.php index cc9ee57b1..c01a0e8d6 100644 --- a/src/Adyen/Model/Checkout/SubMerchantInfo.php +++ b/src/Adyen/Model/Checkout/SubMerchantInfo.php @@ -48,6 +48,7 @@ class SubMerchantInfo implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'string', 'mcc' => 'string', 'name' => 'string', + 'registeredSince' => 'string', 'taxId' => 'string' ]; @@ -63,6 +64,7 @@ class SubMerchantInfo implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => null, 'mcc' => null, 'name' => null, + 'registeredSince' => null, 'taxId' => null ]; @@ -76,6 +78,7 @@ class SubMerchantInfo implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => false, 'mcc' => false, 'name' => false, + 'registeredSince' => false, 'taxId' => false ]; @@ -169,6 +172,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'id', 'mcc' => 'mcc', 'name' => 'name', + 'registeredSince' => 'registeredSince', 'taxId' => 'taxId' ]; @@ -182,6 +186,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'setId', 'mcc' => 'setMcc', 'name' => 'setName', + 'registeredSince' => 'setRegisteredSince', 'taxId' => 'setTaxId' ]; @@ -195,6 +200,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'getId', 'mcc' => 'getMcc', 'name' => 'getName', + 'registeredSince' => 'getRegisteredSince', 'taxId' => 'getTaxId' ]; @@ -259,6 +265,7 @@ public function __construct(array $data = null) $this->setIfExists('id', $data ?? [], null); $this->setIfExists('mcc', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('registeredSince', $data ?? [], null); $this->setIfExists('taxId', $data ?? [], null); } @@ -412,6 +419,33 @@ public function setName($name) return $this; } + /** + * Gets registeredSince + * + * @return string|null + */ + public function getRegisteredSince() + { + return $this->container['registeredSince']; + } + + /** + * Sets registeredSince + * + * @param string|null $registeredSince registeredSince + * + * @return self + */ + public function setRegisteredSince($registeredSince) + { + if (is_null($registeredSince)) { + throw new \InvalidArgumentException('non-nullable registeredSince cannot be null'); + } + $this->container['registeredSince'] = $registeredSince; + + return $this; + } + /** * Gets taxId * diff --git a/src/Adyen/Model/Checkout/TaxTotal.php b/src/Adyen/Model/Checkout/TaxTotal.php new file mode 100644 index 000000000..7e2fccf63 --- /dev/null +++ b/src/Adyen/Model/Checkout/TaxTotal.php @@ -0,0 +1,410 @@ + + */ +class TaxTotal implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TaxTotal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Checkout\Amount' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => 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 = [ + 'amount' => 'amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount' + ]; + + /** + * 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('amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount|null $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/VippsDetails.php b/src/Adyen/Model/Checkout/VippsDetails.php index 143c331a7..25819f922 100644 --- a/src/Adyen/Model/Checkout/VippsDetails.php +++ b/src/Adyen/Model/Checkout/VippsDetails.php @@ -424,7 +424,7 @@ public function getTelephoneNumber() /** * Sets telephoneNumber * - * @param string $telephoneNumber + * @param string $telephoneNumber * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php b/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php index f8fd8bc67..e89f34bd5 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php +++ b/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php @@ -358,7 +358,7 @@ public function getAmountPerIndustry() /** * Sets amountPerIndustry * - * @param array|null $amountPerIndustry + * @param array|null $amountPerIndustry * * @return self */ @@ -385,7 +385,7 @@ public function getAuthorizedCardUsers() /** * Sets authorizedCardUsers * - * @param bool|null $authorizedCardUsers + * @param bool|null $authorizedCardUsers * * @return self */ @@ -412,7 +412,7 @@ public function getFundingSource() /** * Sets fundingSource * - * @param string[]|null $fundingSource + * @param string[]|null $fundingSource * * @return self */ @@ -448,7 +448,7 @@ public function getInterval() /** * Sets interval * - * @param string|null $interval + * @param string|null $interval * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php b/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php index 6629bee4b..2d912cd58 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/DataProtection/ObjectSerializer.php b/src/Adyen/Model/DataProtection/ObjectSerializer.php index 1b86733ae..fe8491817 100644 --- a/src/Adyen/Model/DataProtection/ObjectSerializer.php +++ b/src/Adyen/Model/DataProtection/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Disputes/ObjectSerializer.php b/src/Adyen/Model/Disputes/ObjectSerializer.php index 5ef9f66af..d363f9e2a 100644 --- a/src/Adyen/Model/Disputes/ObjectSerializer.php +++ b/src/Adyen/Model/Disputes/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.php b/src/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.php index edb900bd9..cb1bf1e8a 100644 --- a/src/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.php +++ b/src/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.php @@ -253,6 +253,7 @@ public function getModelName() public const TYPE_DEFINED_BENEFICIARY = 'definedBeneficiary'; public const TYPE_DIRECTOR = 'director'; + public const TYPE_IMMEDIATE_PARENT_COMPANY = 'immediateParentCompany'; public const TYPE_PCI_SIGNATORY = 'pciSignatory'; public const TYPE_PROTECTOR = 'protector'; public const TYPE_SECONDARY_TRUSTEE = 'secondaryTrustee'; @@ -276,6 +277,7 @@ public function getTypeAllowableValues() return [ self::TYPE_DEFINED_BENEFICIARY, self::TYPE_DIRECTOR, + self::TYPE_IMMEDIATE_PARENT_COMPANY, self::TYPE_PCI_SIGNATORY, self::TYPE_PROTECTOR, self::TYPE_SECONDARY_TRUSTEE, diff --git a/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php b/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php index d25ad19d7..66642b915 100644 --- a/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php +++ b/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/LegalEntityManagement/TaxReportingClassification.php b/src/Adyen/Model/LegalEntityManagement/TaxReportingClassification.php index d3549e506..fb8303c81 100644 --- a/src/Adyen/Model/LegalEntityManagement/TaxReportingClassification.php +++ b/src/Adyen/Model/LegalEntityManagement/TaxReportingClassification.php @@ -461,7 +461,7 @@ public function getMainSourceOfIncome() /** * Sets mainSourceOfIncome * - * @param string|null $mainSourceOfIncome The organization's main source of income. Possible values: **businessOperation**, **realEstateSales**, **investmentInterestOrRoyalty**, **propertyRental**, **other**. + * @param string|null $mainSourceOfIncome The organization's main source of income. Only required if `businessType` is **other**. Possible values: **businessOperation**, **realEstateSales**, **investmentInterestOrRoyalty**, **propertyRental**, **other**. * * @return self */ diff --git a/src/Adyen/Model/Management/BcmcInfo.php b/src/Adyen/Model/Management/BcmcInfo.php index 09487fd0c..168620464 100644 --- a/src/Adyen/Model/Management/BcmcInfo.php +++ b/src/Adyen/Model/Management/BcmcInfo.php @@ -44,8 +44,7 @@ class BcmcInfo implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'enableBcmcMobile' => 'bool', - 'transactionDescription' => '\Adyen\Model\Management\TransactionDescriptionInfo' + 'enableBcmcMobile' => 'bool' ]; /** @@ -56,8 +55,7 @@ class BcmcInfo implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'enableBcmcMobile' => null, - 'transactionDescription' => null + 'enableBcmcMobile' => null ]; /** @@ -66,8 +64,7 @@ class BcmcInfo implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ - 'enableBcmcMobile' => false, - 'transactionDescription' => false + 'enableBcmcMobile' => false ]; /** @@ -156,8 +153,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'enableBcmcMobile' => 'enableBcmcMobile', - 'transactionDescription' => 'transactionDescription' + 'enableBcmcMobile' => 'enableBcmcMobile' ]; /** @@ -166,8 +162,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'enableBcmcMobile' => 'setEnableBcmcMobile', - 'transactionDescription' => 'setTransactionDescription' + 'enableBcmcMobile' => 'setEnableBcmcMobile' ]; /** @@ -176,8 +171,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'enableBcmcMobile' => 'getEnableBcmcMobile', - 'transactionDescription' => 'getTransactionDescription' + 'enableBcmcMobile' => 'getEnableBcmcMobile' ]; /** @@ -238,7 +232,6 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('enableBcmcMobile', $data ?? [], null); - $this->setIfExists('transactionDescription', $data ?? [], null); } /** @@ -309,33 +302,6 @@ public function setEnableBcmcMobile($enableBcmcMobile) return $this; } - - /** - * Gets transactionDescription - * - * @return \Adyen\Model\Management\TransactionDescriptionInfo|null - */ - public function getTransactionDescription() - { - return $this->container['transactionDescription']; - } - - /** - * Sets transactionDescription - * - * @param \Adyen\Model\Management\TransactionDescriptionInfo|null $transactionDescription transactionDescription - * - * @return self - */ - public function setTransactionDescription($transactionDescription) - { - if (is_null($transactionDescription)) { - throw new \InvalidArgumentException('non-nullable transactionDescription cannot be null'); - } - $this->container['transactionDescription'] = $transactionDescription; - - return $this; - } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Management/ObjectSerializer.php b/src/Adyen/Model/Management/ObjectSerializer.php index cc5272bf9..2ff0b7ef6 100644 --- a/src/Adyen/Model/Management/ObjectSerializer.php +++ b/src/Adyen/Model/Management/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Management/PaymentMethod.php b/src/Adyen/Model/Management/PaymentMethod.php index b2f759d13..34927aeb4 100644 --- a/src/Adyen/Model/Management/PaymentMethod.php +++ b/src/Adyen/Model/Management/PaymentMethod.php @@ -81,7 +81,9 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'type' => 'string', 'verificationStatus' => 'string', 'vipps' => '\Adyen\Model\Management\VippsInfo', - 'visa' => '\Adyen\Model\Management\GenericPmWithTdiInfo' + 'visa' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'wechatpay' => '\Adyen\Model\Management\WeChatPayInfo', + 'wechatpayPos' => '\Adyen\Model\Management\WeChatPayPosInfo' ]; /** @@ -129,7 +131,9 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'type' => null, 'verificationStatus' => null, 'vipps' => null, - 'visa' => null + 'visa' => null, + 'wechatpay' => null, + 'wechatpayPos' => null ]; /** @@ -175,7 +179,9 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'type' => false, 'verificationStatus' => false, 'vipps' => false, - 'visa' => false + 'visa' => false, + 'wechatpay' => false, + 'wechatpayPos' => false ]; /** @@ -301,7 +307,9 @@ public function isNullableSetToNull(string $property): bool 'type' => 'type', 'verificationStatus' => 'verificationStatus', 'vipps' => 'vipps', - 'visa' => 'visa' + 'visa' => 'visa', + 'wechatpay' => 'wechatpay', + 'wechatpayPos' => 'wechatpay_pos' ]; /** @@ -347,7 +355,9 @@ public function isNullableSetToNull(string $property): bool 'type' => 'setType', 'verificationStatus' => 'setVerificationStatus', 'vipps' => 'setVipps', - 'visa' => 'setVisa' + 'visa' => 'setVisa', + 'wechatpay' => 'setWechatpay', + 'wechatpayPos' => 'setWechatpayPos' ]; /** @@ -393,7 +403,9 @@ public function isNullableSetToNull(string $property): bool 'type' => 'getType', 'verificationStatus' => 'getVerificationStatus', 'vipps' => 'getVipps', - 'visa' => 'getVisa' + 'visa' => 'getVisa', + 'wechatpay' => 'getWechatpay', + 'wechatpayPos' => 'getWechatpayPos' ]; /** @@ -509,6 +521,8 @@ public function __construct(array $data = null) $this->setIfExists('verificationStatus', $data ?? [], null); $this->setIfExists('vipps', $data ?? [], null); $this->setIfExists('visa', $data ?? [], null); + $this->setIfExists('wechatpay', $data ?? [], null); + $this->setIfExists('wechatpayPos', $data ?? [], null); } /** @@ -1600,6 +1614,60 @@ public function setVisa($visa) return $this; } + + /** + * Gets wechatpay + * + * @return \Adyen\Model\Management\WeChatPayInfo|null + */ + public function getWechatpay() + { + return $this->container['wechatpay']; + } + + /** + * Sets wechatpay + * + * @param \Adyen\Model\Management\WeChatPayInfo|null $wechatpay wechatpay + * + * @return self + */ + public function setWechatpay($wechatpay) + { + if (is_null($wechatpay)) { + throw new \InvalidArgumentException('non-nullable wechatpay cannot be null'); + } + $this->container['wechatpay'] = $wechatpay; + + return $this; + } + + /** + * Gets wechatpayPos + * + * @return \Adyen\Model\Management\WeChatPayPosInfo|null + */ + public function getWechatpayPos() + { + return $this->container['wechatpayPos']; + } + + /** + * Sets wechatpayPos + * + * @param \Adyen\Model\Management\WeChatPayPosInfo|null $wechatpayPos wechatpayPos + * + * @return self + */ + public function setWechatpayPos($wechatpayPos) + { + if (is_null($wechatpayPos)) { + throw new \InvalidArgumentException('non-nullable wechatpayPos cannot be null'); + } + $this->container['wechatpayPos'] = $wechatpayPos; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Management/PaymentMethodSetupInfo.php b/src/Adyen/Model/Management/PaymentMethodSetupInfo.php index 3adf915c8..bd66f8821 100644 --- a/src/Adyen/Model/Management/PaymentMethodSetupInfo.php +++ b/src/Adyen/Model/Management/PaymentMethodSetupInfo.php @@ -77,7 +77,9 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'twint' => '\Adyen\Model\Management\TwintInfo', 'type' => 'string', 'vipps' => '\Adyen\Model\Management\VippsInfo', - 'visa' => '\Adyen\Model\Management\GenericPmWithTdiInfo' + 'visa' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'wechatpay' => '\Adyen\Model\Management\WeChatPayInfo', + 'wechatpayPos' => '\Adyen\Model\Management\WeChatPayPosInfo' ]; /** @@ -121,7 +123,9 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'twint' => null, 'type' => null, 'vipps' => null, - 'visa' => null + 'visa' => null, + 'wechatpay' => null, + 'wechatpayPos' => null ]; /** @@ -163,7 +167,9 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'twint' => false, 'type' => false, 'vipps' => false, - 'visa' => false + 'visa' => false, + 'wechatpay' => false, + 'wechatpayPos' => false ]; /** @@ -285,7 +291,9 @@ public function isNullableSetToNull(string $property): bool 'twint' => 'twint', 'type' => 'type', 'vipps' => 'vipps', - 'visa' => 'visa' + 'visa' => 'visa', + 'wechatpay' => 'wechatpay', + 'wechatpayPos' => 'wechatpay_pos' ]; /** @@ -327,7 +335,9 @@ public function isNullableSetToNull(string $property): bool 'twint' => 'setTwint', 'type' => 'setType', 'vipps' => 'setVipps', - 'visa' => 'setVisa' + 'visa' => 'setVisa', + 'wechatpay' => 'setWechatpay', + 'wechatpayPos' => 'setWechatpayPos' ]; /** @@ -369,7 +379,9 @@ public function isNullableSetToNull(string $property): bool 'twint' => 'getTwint', 'type' => 'getType', 'vipps' => 'getVipps', - 'visa' => 'getVisa' + 'visa' => 'getVisa', + 'wechatpay' => 'getWechatpay', + 'wechatpayPos' => 'getWechatpayPos' ]; /** @@ -591,6 +603,8 @@ public function __construct(array $data = null) $this->setIfExists('type', $data ?? [], null); $this->setIfExists('vipps', $data ?? [], null); $this->setIfExists('visa', $data ?? [], null); + $this->setIfExists('wechatpay', $data ?? [], null); + $this->setIfExists('wechatpayPos', $data ?? [], null); } /** @@ -1593,6 +1607,60 @@ public function setVisa($visa) return $this; } + + /** + * Gets wechatpay + * + * @return \Adyen\Model\Management\WeChatPayInfo|null + */ + public function getWechatpay() + { + return $this->container['wechatpay']; + } + + /** + * Sets wechatpay + * + * @param \Adyen\Model\Management\WeChatPayInfo|null $wechatpay wechatpay + * + * @return self + */ + public function setWechatpay($wechatpay) + { + if (is_null($wechatpay)) { + throw new \InvalidArgumentException('non-nullable wechatpay cannot be null'); + } + $this->container['wechatpay'] = $wechatpay; + + return $this; + } + + /** + * Gets wechatpayPos + * + * @return \Adyen\Model\Management\WeChatPayPosInfo|null + */ + public function getWechatpayPos() + { + return $this->container['wechatpayPos']; + } + + /** + * Sets wechatpayPos + * + * @param \Adyen\Model\Management\WeChatPayPosInfo|null $wechatpayPos wechatpayPos + * + * @return self + */ + public function setWechatpayPos($wechatpayPos) + { + if (is_null($wechatpayPos)) { + throw new \InvalidArgumentException('non-nullable wechatpayPos cannot be null'); + } + $this->container['wechatpayPos'] = $wechatpayPos; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Management/ReprocessAndroidAppResponse.php b/src/Adyen/Model/Management/ReprocessAndroidAppResponse.php new file mode 100644 index 000000000..ec739c955 --- /dev/null +++ b/src/Adyen/Model/Management/ReprocessAndroidAppResponse.php @@ -0,0 +1,410 @@ + + */ +class ReprocessAndroidAppResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ReprocessAndroidAppResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'message' => 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 = [ + 'message' => 'Message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage' + ]; + + /** + * 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('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message The result of the reprocess. + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/WeChatPayInfo.php b/src/Adyen/Model/Management/WeChatPayInfo.php new file mode 100644 index 000000000..b99d7372d --- /dev/null +++ b/src/Adyen/Model/Management/WeChatPayInfo.php @@ -0,0 +1,450 @@ + + */ +class WeChatPayInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WeChatPayInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'contactPersonName' => 'string', + 'email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'contactPersonName' => null, + 'email' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'contactPersonName' => false, + 'email' => 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 = [ + 'contactPersonName' => 'contactPersonName', + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'contactPersonName' => 'setContactPersonName', + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'contactPersonName' => 'getContactPersonName', + 'email' => 'getEmail' + ]; + + /** + * 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('contactPersonName', $data ?? [], null); + $this->setIfExists('email', $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['contactPersonName'] === null) { + $invalidProperties[] = "'contactPersonName' can't be null"; + } + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' 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 contactPersonName + * + * @return string + */ + public function getContactPersonName() + { + return $this->container['contactPersonName']; + } + + /** + * Sets contactPersonName + * + * @param string $contactPersonName The name of the contact person from merchant support. + * + * @return self + */ + public function setContactPersonName($contactPersonName) + { + if (is_null($contactPersonName)) { + throw new \InvalidArgumentException('non-nullable contactPersonName cannot be null'); + } + $this->container['contactPersonName'] = $contactPersonName; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email The email address of merchant support. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/WeChatPayPosInfo.php b/src/Adyen/Model/Management/WeChatPayPosInfo.php new file mode 100644 index 000000000..07023029b --- /dev/null +++ b/src/Adyen/Model/Management/WeChatPayPosInfo.php @@ -0,0 +1,450 @@ + + */ +class WeChatPayPosInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WeChatPayPosInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'contactPersonName' => 'string', + 'email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'contactPersonName' => null, + 'email' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'contactPersonName' => false, + 'email' => 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 = [ + 'contactPersonName' => 'contactPersonName', + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'contactPersonName' => 'setContactPersonName', + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'contactPersonName' => 'getContactPersonName', + 'email' => 'getEmail' + ]; + + /** + * 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('contactPersonName', $data ?? [], null); + $this->setIfExists('email', $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['contactPersonName'] === null) { + $invalidProperties[] = "'contactPersonName' can't be null"; + } + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' 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 contactPersonName + * + * @return string + */ + public function getContactPersonName() + { + return $this->container['contactPersonName']; + } + + /** + * Sets contactPersonName + * + * @param string $contactPersonName The name of the contact person from merchant support. + * + * @return self + */ + public function setContactPersonName($contactPersonName) + { + if (is_null($contactPersonName)) { + throw new \InvalidArgumentException('non-nullable contactPersonName cannot be null'); + } + $this->container['contactPersonName'] = $contactPersonName; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email The email address of merchant support. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ManagementWebhooks/AccountNotificationResponse.php b/src/Adyen/Model/ManagementWebhooks/AccountNotificationResponse.php index 282e18cba..a9e40d578 100644 --- a/src/Adyen/Model/ManagementWebhooks/AccountNotificationResponse.php +++ b/src/Adyen/Model/ManagementWebhooks/AccountNotificationResponse.php @@ -289,7 +289,7 @@ public function getNotificationResponse() /** * Sets notificationResponse * - * @param string|null $notificationResponse Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). * * @return self */ diff --git a/src/Adyen/Model/ManagementWebhooks/ObjectSerializer.php b/src/Adyen/Model/ManagementWebhooks/ObjectSerializer.php index 9c73e94b9..a3626e45d 100644 --- a/src/Adyen/Model/ManagementWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/ManagementWebhooks/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/ManagementWebhooks/PaymentMethodNotificationResponse.php b/src/Adyen/Model/ManagementWebhooks/PaymentMethodNotificationResponse.php index ea362cf76..e9e7293a3 100644 --- a/src/Adyen/Model/ManagementWebhooks/PaymentMethodNotificationResponse.php +++ b/src/Adyen/Model/ManagementWebhooks/PaymentMethodNotificationResponse.php @@ -289,7 +289,7 @@ public function getNotificationResponse() /** * Sets notificationResponse * - * @param string|null $notificationResponse Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). * * @return self */ diff --git a/src/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.php b/src/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.php index 64104d998..d6b4bf31f 100644 --- a/src/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.php +++ b/src/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.php @@ -289,7 +289,7 @@ public function getNotificationResponse() /** * Sets notificationResponse * - * @param string|null $notificationResponse Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). * * @return self */ diff --git a/src/Adyen/Model/POSTerminalManagement/ObjectSerializer.php b/src/Adyen/Model/POSTerminalManagement/ObjectSerializer.php index 8032f208b..b6a5027ee 100644 --- a/src/Adyen/Model/POSTerminalManagement/ObjectSerializer.php +++ b/src/Adyen/Model/POSTerminalManagement/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Payments/ObjectSerializer.php b/src/Adyen/Model/Payments/ObjectSerializer.php index 4e217461d..ae7a870cb 100644 --- a/src/Adyen/Model/Payments/ObjectSerializer.php +++ b/src/Adyen/Model/Payments/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Payout/ObjectSerializer.php b/src/Adyen/Model/Payout/ObjectSerializer.php index ad1c991ab..0d50f4363 100644 --- a/src/Adyen/Model/Payout/ObjectSerializer.php +++ b/src/Adyen/Model/Payout/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/PosMobile/ObjectSerializer.php b/src/Adyen/Model/PosMobile/ObjectSerializer.php index ae87baef9..ba0e91ceb 100644 --- a/src/Adyen/Model/PosMobile/ObjectSerializer.php +++ b/src/Adyen/Model/PosMobile/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Recurring/ObjectSerializer.php b/src/Adyen/Model/Recurring/ObjectSerializer.php index 7adbf8e59..3b2a857bf 100644 --- a/src/Adyen/Model/Recurring/ObjectSerializer.php +++ b/src/Adyen/Model/Recurring/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/ReportWebhooks/ObjectSerializer.php b/src/Adyen/Model/ReportWebhooks/ObjectSerializer.php index 97f670389..a8a265ce9 100644 --- a/src/Adyen/Model/ReportWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/ReportWebhooks/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/StoredValue/ObjectSerializer.php b/src/Adyen/Model/StoredValue/ObjectSerializer.php index ed3372fb3..934975452 100644 --- a/src/Adyen/Model/StoredValue/ObjectSerializer.php +++ b/src/Adyen/Model/StoredValue/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/TransactionWebhooks/ObjectSerializer.php b/src/Adyen/Model/TransactionWebhooks/ObjectSerializer.php index 6592bf84d..9ccc67586 100644 --- a/src/Adyen/Model/TransactionWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/TransactionWebhooks/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/TransferWebhooks/BalancePlatformNotificationResponse.php b/src/Adyen/Model/TransferWebhooks/BalancePlatformNotificationResponse.php index c1e5ee6d5..cb53d5b3b 100644 --- a/src/Adyen/Model/TransferWebhooks/BalancePlatformNotificationResponse.php +++ b/src/Adyen/Model/TransferWebhooks/BalancePlatformNotificationResponse.php @@ -289,7 +289,7 @@ public function getNotificationResponse() /** * Sets notificationResponse * - * @param string|null $notificationResponse Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/ConfirmationTrackingData.php b/src/Adyen/Model/TransferWebhooks/ConfirmationTrackingData.php index 1e641fbe2..323408f74 100644 --- a/src/Adyen/Model/TransferWebhooks/ConfirmationTrackingData.php +++ b/src/Adyen/Model/TransferWebhooks/ConfirmationTrackingData.php @@ -344,7 +344,7 @@ public function getStatus() /** * Sets status * - * @param string $status Possible values: - **credited**: Transfer is credited to beneficiary. + * @param string $status The status of the transfer. Possible values: - **credited**: the funds are credited to your user's transfer instrument or bank account. * * @return self */ @@ -381,7 +381,7 @@ public function getType() /** * Sets type * - * @param string $type **confirmation** + * @param string $type The type of the tracking event. Possible values: - **confirmation**: the transfer passed Adyen's internal review. * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/EstimationTrackingData.php b/src/Adyen/Model/TransferWebhooks/EstimationTrackingData.php index 795ce43fa..58cff5a8b 100644 --- a/src/Adyen/Model/TransferWebhooks/EstimationTrackingData.php +++ b/src/Adyen/Model/TransferWebhooks/EstimationTrackingData.php @@ -350,7 +350,7 @@ public function getType() /** * Sets type * - * @param string $type **estimation** + * @param string $type The type of tracking event. Possible values: - **estimation**: the estimated date and time of when the funds will be credited has been determined. * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/InternalReviewTrackingData.php b/src/Adyen/Model/TransferWebhooks/InternalReviewTrackingData.php index fe58a0f2c..e38ded969 100644 --- a/src/Adyen/Model/TransferWebhooks/InternalReviewTrackingData.php +++ b/src/Adyen/Model/TransferWebhooks/InternalReviewTrackingData.php @@ -374,7 +374,7 @@ public function getReason() /** * Sets reason * - * @param string|null $reason Possible values: - **refusedForRegulatoryReasons**. + * @param string|null $reason The reason why the transfer failed Adyen's internal review. Possible values: - **refusedForRegulatoryReasons**: the transfer does not comply with Adyen's risk policy. For more information, [contact the Support Team](https://www.adyen.help/hc/en-us/requests/new). * * @return self */ @@ -411,7 +411,7 @@ public function getStatus() /** * Sets status * - * @param string $status Possible values: - **pending**: Transfer is under internal review. - **failed**: Transfer failed to pass internal review. See field **reason** for details. + * @param string $status The status of the transfer. Possible values: - **pending**: the transfer is under internal review. - **failed**: the transfer failed Adyen's internal review. For details, see `reason`. * * @return self */ @@ -448,7 +448,7 @@ public function getType() /** * Sets type * - * @param string $type **internalReview** + * @param string $type The type of tracking event. Possible values: - **internalReview**: the transfer was flagged because it does not comply with Adyen's risk policy. * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/ObjectSerializer.php b/src/Adyen/Model/TransferWebhooks/ObjectSerializer.php index 01b25bf23..d05b26906 100644 --- a/src/Adyen/Model/TransferWebhooks/ObjectSerializer.php +++ b/src/Adyen/Model/TransferWebhooks/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/TransferWebhooks/PlatformPayment.php b/src/Adyen/Model/TransferWebhooks/PlatformPayment.php index d0aaf015d..e16fa09f6 100644 --- a/src/Adyen/Model/TransferWebhooks/PlatformPayment.php +++ b/src/Adyen/Model/TransferWebhooks/PlatformPayment.php @@ -256,6 +256,8 @@ public function getModelName() public const PLATFORM_PAYMENT_TYPE_PAYMENT_FEE = 'PaymentFee'; public const PLATFORM_PAYMENT_TYPE_REMAINDER = 'Remainder'; public const PLATFORM_PAYMENT_TYPE_SCHEME_FEE = 'SchemeFee'; + public const PLATFORM_PAYMENT_TYPE_SURCHARGE = 'Surcharge'; + public const PLATFORM_PAYMENT_TYPE_TIP = 'Tip'; public const PLATFORM_PAYMENT_TYPE_TOP_UP = 'TopUp'; public const PLATFORM_PAYMENT_TYPE_VAT = 'VAT'; public const TYPE_PLATFORM_PAYMENT = 'platformPayment'; @@ -279,6 +281,8 @@ public function getPlatformPaymentTypeAllowableValues() self::PLATFORM_PAYMENT_TYPE_PAYMENT_FEE, self::PLATFORM_PAYMENT_TYPE_REMAINDER, self::PLATFORM_PAYMENT_TYPE_SCHEME_FEE, + self::PLATFORM_PAYMENT_TYPE_SURCHARGE, + self::PLATFORM_PAYMENT_TYPE_TIP, self::PLATFORM_PAYMENT_TYPE_TOP_UP, self::PLATFORM_PAYMENT_TYPE_VAT, ]; diff --git a/src/Adyen/Model/TransferWebhooks/TransferData.php b/src/Adyen/Model/TransferWebhooks/TransferData.php index 1ca1fb974..41e1d667c 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferData.php +++ b/src/Adyen/Model/TransferWebhooks/TransferData.php @@ -1252,7 +1252,7 @@ public function getReferenceForBeneficiary() /** * Sets referenceForBeneficiary * - * @param string|null $referenceForBeneficiary A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. + * @param string|null $referenceForBeneficiary A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**.The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/TransferDataTracking.php b/src/Adyen/Model/TransferWebhooks/TransferDataTracking.php index 60ee502e4..bd6c72c8f 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferDataTracking.php +++ b/src/Adyen/Model/TransferWebhooks/TransferDataTracking.php @@ -22,7 +22,7 @@ * TransferDataTracking Class Doc Comment * * @category Class - * @description Most recent tracking information for the transfer. + * @description The latest tracking information of the transfer. * @package Adyen * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -322,7 +322,7 @@ public function getStatus() /** * Sets status * - * @param string $status Possible values: - **pending**: Transfer is under internal review. - **failed**: Transfer failed to pass internal review. See field **reason** for details. + * @param string $status The status of the transfer. Possible values: - **pending**: the transfer is under internal review. - **failed**: the transfer failed Adyen's internal review. For details, see `reason`. * * @return self */ @@ -349,7 +349,7 @@ public function getType() /** * Sets type * - * @param string $type **internalReview** + * @param string $type The type of tracking event. Possible values: - **internalReview**: the transfer was flagged because it does not comply with Adyen's risk policy. * * @return self */ @@ -403,7 +403,7 @@ public function getReason() /** * Sets reason * - * @param string|null $reason Possible values: - **refusedForRegulatoryReasons**. + * @param string|null $reason The reason why the transfer failed Adyen's internal review. Possible values: - **refusedForRegulatoryReasons**: the transfer does not comply with Adyen's risk policy. For more information, [contact the Support Team](https://www.adyen.help/hc/en-us/requests/new). * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/TransferEvent.php b/src/Adyen/Model/TransferWebhooks/TransferEvent.php index a9d8177b3..5c2d98007 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferEvent.php +++ b/src/Adyen/Model/TransferWebhooks/TransferEvent.php @@ -691,7 +691,6 @@ public function setBookingDate($bookingDate) * Gets estimatedArrivalTime * * @return \DateTime|null - * @deprecated */ public function getEstimatedArrivalTime() { @@ -704,7 +703,6 @@ public function getEstimatedArrivalTime() * @param \DateTime|null $estimatedArrivalTime The estimated time the beneficiary should have access to the funds. * * @return self - * @deprecated */ public function setEstimatedArrivalTime($estimatedArrivalTime) { diff --git a/src/Adyen/Model/TransferWebhooks/TransferEventTrackingData.php b/src/Adyen/Model/TransferWebhooks/TransferEventTrackingData.php index 948cffdc6..3196460c3 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferEventTrackingData.php +++ b/src/Adyen/Model/TransferWebhooks/TransferEventTrackingData.php @@ -322,7 +322,7 @@ public function getStatus() /** * Sets status * - * @param string $status Possible values: - **pending**: Transfer is under internal review. - **failed**: Transfer failed to pass internal review. See field **reason** for details. + * @param string $status The status of the transfer. Possible values: - **pending**: the transfer is under internal review. - **failed**: the transfer failed Adyen's internal review. For details, see `reason`. * * @return self */ @@ -349,7 +349,7 @@ public function getType() /** * Sets type * - * @param string $type **internalReview** + * @param string $type The type of tracking event. Possible values: - **internalReview**: the transfer was flagged because it does not comply with Adyen's risk policy. * * @return self */ @@ -403,7 +403,7 @@ public function getReason() /** * Sets reason * - * @param string|null $reason Possible values: - **refusedForRegulatoryReasons**. + * @param string|null $reason The reason why the transfer failed Adyen's internal review. Possible values: - **refusedForRegulatoryReasons**: the transfer does not comply with Adyen's risk policy. For more information, [contact the Support Team](https://www.adyen.help/hc/en-us/requests/new). * * @return self */ diff --git a/src/Adyen/Model/Transfers/ConfirmationTrackingData.php b/src/Adyen/Model/Transfers/ConfirmationTrackingData.php index 30d4a533e..20ac4ec45 100644 --- a/src/Adyen/Model/Transfers/ConfirmationTrackingData.php +++ b/src/Adyen/Model/Transfers/ConfirmationTrackingData.php @@ -344,7 +344,7 @@ public function getStatus() /** * Sets status * - * @param string $status Possible values: - **credited**: Transfer is credited to beneficiary. + * @param string $status The status of the transfer. Possible values: - **credited**: the funds are credited to your user's transfer instrument or bank account. * * @return self */ @@ -381,7 +381,7 @@ public function getType() /** * Sets type * - * @param string $type **confirmation** + * @param string $type The type of the tracking event. Possible values: - **confirmation**: the transfer passed Adyen's internal review. * * @return self */ diff --git a/src/Adyen/Model/Transfers/EstimationTrackingData.php b/src/Adyen/Model/Transfers/EstimationTrackingData.php index ce74ea2d8..ce5101a65 100644 --- a/src/Adyen/Model/Transfers/EstimationTrackingData.php +++ b/src/Adyen/Model/Transfers/EstimationTrackingData.php @@ -350,7 +350,7 @@ public function getType() /** * Sets type * - * @param string $type **estimation** + * @param string $type The type of tracking event. Possible values: - **estimation**: the estimated date and time of when the funds will be credited has been determined. * * @return self */ diff --git a/src/Adyen/Model/Transfers/InternalReviewTrackingData.php b/src/Adyen/Model/Transfers/InternalReviewTrackingData.php index e2c1a7af2..4d1a647f7 100644 --- a/src/Adyen/Model/Transfers/InternalReviewTrackingData.php +++ b/src/Adyen/Model/Transfers/InternalReviewTrackingData.php @@ -374,7 +374,7 @@ public function getReason() /** * Sets reason * - * @param string|null $reason Possible values: - **refusedForRegulatoryReasons**. + * @param string|null $reason The reason why the transfer failed Adyen's internal review. Possible values: - **refusedForRegulatoryReasons**: the transfer does not comply with Adyen's risk policy. For more information, [contact the Support Team](https://www.adyen.help/hc/en-us/requests/new). * * @return self */ @@ -411,7 +411,7 @@ public function getStatus() /** * Sets status * - * @param string $status Possible values: - **pending**: Transfer is under internal review. - **failed**: Transfer failed to pass internal review. See field **reason** for details. + * @param string $status The status of the transfer. Possible values: - **pending**: the transfer is under internal review. - **failed**: the transfer failed Adyen's internal review. For details, see `reason`. * * @return self */ @@ -448,7 +448,7 @@ public function getType() /** * Sets type * - * @param string $type **internalReview** + * @param string $type The type of tracking event. Possible values: - **internalReview**: the transfer was flagged because it does not comply with Adyen's risk policy. * * @return self */ diff --git a/src/Adyen/Model/Transfers/ObjectSerializer.php b/src/Adyen/Model/Transfers/ObjectSerializer.php index b9cbe36bf..349b367b3 100644 --- a/src/Adyen/Model/Transfers/ObjectSerializer.php +++ b/src/Adyen/Model/Transfers/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Transfers/PlatformPayment.php b/src/Adyen/Model/Transfers/PlatformPayment.php index 3782fad86..86d6f6ee2 100644 --- a/src/Adyen/Model/Transfers/PlatformPayment.php +++ b/src/Adyen/Model/Transfers/PlatformPayment.php @@ -256,6 +256,8 @@ public function getModelName() public const PLATFORM_PAYMENT_TYPE_PAYMENT_FEE = 'PaymentFee'; public const PLATFORM_PAYMENT_TYPE_REMAINDER = 'Remainder'; public const PLATFORM_PAYMENT_TYPE_SCHEME_FEE = 'SchemeFee'; + public const PLATFORM_PAYMENT_TYPE_SURCHARGE = 'Surcharge'; + public const PLATFORM_PAYMENT_TYPE_TIP = 'Tip'; public const PLATFORM_PAYMENT_TYPE_TOP_UP = 'TopUp'; public const PLATFORM_PAYMENT_TYPE_VAT = 'VAT'; public const TYPE_PLATFORM_PAYMENT = 'platformPayment'; @@ -279,6 +281,8 @@ public function getPlatformPaymentTypeAllowableValues() self::PLATFORM_PAYMENT_TYPE_PAYMENT_FEE, self::PLATFORM_PAYMENT_TYPE_REMAINDER, self::PLATFORM_PAYMENT_TYPE_SCHEME_FEE, + self::PLATFORM_PAYMENT_TYPE_SURCHARGE, + self::PLATFORM_PAYMENT_TYPE_TIP, self::PLATFORM_PAYMENT_TYPE_TOP_UP, self::PLATFORM_PAYMENT_TYPE_VAT, ]; diff --git a/src/Adyen/Model/Transfers/RoutingDetails.php b/src/Adyen/Model/Transfers/RoutingDetails.php new file mode 100644 index 000000000..665eac244 --- /dev/null +++ b/src/Adyen/Model/Transfers/RoutingDetails.php @@ -0,0 +1,553 @@ + + */ +class RoutingDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RoutingDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'detail' => 'string', + 'errorCode' => 'string', + 'priority' => 'string', + 'title' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'detail' => null, + 'errorCode' => null, + 'priority' => null, + 'title' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'detail' => false, + 'errorCode' => false, + 'priority' => false, + 'title' => 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 = [ + 'detail' => 'detail', + 'errorCode' => 'errorCode', + 'priority' => 'priority', + 'title' => 'title' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'detail' => 'setDetail', + 'errorCode' => 'setErrorCode', + 'priority' => 'setPriority', + 'title' => 'setTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'detail' => 'getDetail', + 'errorCode' => 'getErrorCode', + 'priority' => 'getPriority', + 'title' => 'getTitle' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const PRIORITY_CROSS_BORDER = 'crossBorder'; + public const PRIORITY_FAST = 'fast'; + public const PRIORITY_INSTANT = 'instant'; + public const PRIORITY_INTERNAL = 'internal'; + public const PRIORITY_REGULAR = 'regular'; + public const PRIORITY_WIRE = 'wire'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPriorityAllowableValues() + { + return [ + self::PRIORITY_CROSS_BORDER, + self::PRIORITY_FAST, + self::PRIORITY_INSTANT, + self::PRIORITY_INTERNAL, + self::PRIORITY_REGULAR, + self::PRIORITY_WIRE, + ]; + } + /** + * 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('detail', $data ?? [], null); + $this->setIfExists('errorCode', $data ?? [], null); + $this->setIfExists('priority', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getPriorityAllowableValues(); + if (!is_null($this->container['priority']) && !in_array($this->container['priority'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'priority', must be one of '%s'", + $this->container['priority'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets detail + * + * @return string|null + */ + public function getDetail() + { + return $this->container['detail']; + } + + /** + * Sets detail + * + * @param string|null $detail A human-readable explanation specific to this occurrence of the problem. + * + * @return self + */ + public function setDetail($detail) + { + if (is_null($detail)) { + throw new \InvalidArgumentException('non-nullable detail cannot be null'); + } + $this->container['detail'] = $detail; + + return $this; + } + + /** + * Gets errorCode + * + * @return string|null + */ + public function getErrorCode() + { + return $this->container['errorCode']; + } + + /** + * Sets errorCode + * + * @param string|null $errorCode A code that identifies the problem type. + * + * @return self + */ + public function setErrorCode($errorCode) + { + if (is_null($errorCode)) { + throw new \InvalidArgumentException('non-nullable errorCode cannot be null'); + } + $this->container['errorCode'] = $errorCode; + + return $this; + } + + /** + * Gets priority + * + * @return string|null + */ + public function getPriority() + { + return $this->container['priority']; + } + + /** + * Sets priority + * + * @param string|null $priority The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). + * + * @return self + */ + public function setPriority($priority) + { + if (is_null($priority)) { + throw new \InvalidArgumentException('non-nullable priority cannot be null'); + } + $allowedValues = $this->getPriorityAllowableValues(); + if (!in_array($priority, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'priority', must be one of '%s'", + $priority, + implode("', '", $allowedValues) + ) + ); + } + $this->container['priority'] = $priority; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title A short, human-readable summary of the problem type. + * + * @return self + */ + public function setTitle($title) + { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/Transfer.php b/src/Adyen/Model/Transfers/Transfer.php index 9423b6179..bc3ef97cf 100644 --- a/src/Adyen/Model/Transfers/Transfer.php +++ b/src/Adyen/Model/Transfers/Transfer.php @@ -1132,7 +1132,7 @@ public function getReferenceForBeneficiary() /** * Sets referenceForBeneficiary * - * @param string|null $referenceForBeneficiary A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. + * @param string|null $referenceForBeneficiary A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**.The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. * * @return self */ diff --git a/src/Adyen/Model/Transfers/TransferData.php b/src/Adyen/Model/Transfers/TransferData.php index 0868cab88..5fc4f12fc 100644 --- a/src/Adyen/Model/Transfers/TransferData.php +++ b/src/Adyen/Model/Transfers/TransferData.php @@ -1252,7 +1252,7 @@ public function getReferenceForBeneficiary() /** * Sets referenceForBeneficiary * - * @param string|null $referenceForBeneficiary A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. + * @param string|null $referenceForBeneficiary A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**.The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. * * @return self */ diff --git a/src/Adyen/Model/Transfers/TransferDataTracking.php b/src/Adyen/Model/Transfers/TransferDataTracking.php index 876e49902..c610fcbe8 100644 --- a/src/Adyen/Model/Transfers/TransferDataTracking.php +++ b/src/Adyen/Model/Transfers/TransferDataTracking.php @@ -22,7 +22,7 @@ * TransferDataTracking Class Doc Comment * * @category Class - * @description Most recent tracking information for the transfer. + * @description The latest tracking information of the transfer. * @package Adyen * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -322,7 +322,7 @@ public function getStatus() /** * Sets status * - * @param string $status Possible values: - **pending**: Transfer is under internal review. - **failed**: Transfer failed to pass internal review. See field **reason** for details. + * @param string $status The status of the transfer. Possible values: - **pending**: the transfer is under internal review. - **failed**: the transfer failed Adyen's internal review. For details, see `reason`. * * @return self */ @@ -349,7 +349,7 @@ public function getType() /** * Sets type * - * @param string $type **internalReview** + * @param string $type The type of tracking event. Possible values: - **internalReview**: the transfer was flagged because it does not comply with Adyen's risk policy. * * @return self */ @@ -403,7 +403,7 @@ public function getReason() /** * Sets reason * - * @param string|null $reason Possible values: - **refusedForRegulatoryReasons**. + * @param string|null $reason The reason why the transfer failed Adyen's internal review. Possible values: - **refusedForRegulatoryReasons**: the transfer does not comply with Adyen's risk policy. For more information, [contact the Support Team](https://www.adyen.help/hc/en-us/requests/new). * * @return self */ diff --git a/src/Adyen/Model/Transfers/TransferEvent.php b/src/Adyen/Model/Transfers/TransferEvent.php index f95a41d1f..4fbc2f41d 100644 --- a/src/Adyen/Model/Transfers/TransferEvent.php +++ b/src/Adyen/Model/Transfers/TransferEvent.php @@ -691,7 +691,6 @@ public function setBookingDate($bookingDate) * Gets estimatedArrivalTime * * @return \DateTime|null - * @deprecated */ public function getEstimatedArrivalTime() { @@ -704,7 +703,6 @@ public function getEstimatedArrivalTime() * @param \DateTime|null $estimatedArrivalTime The estimated time the beneficiary should have access to the funds. * * @return self - * @deprecated */ public function setEstimatedArrivalTime($estimatedArrivalTime) { diff --git a/src/Adyen/Model/Transfers/TransferEventTrackingData.php b/src/Adyen/Model/Transfers/TransferEventTrackingData.php index b993d3f25..b21083cc5 100644 --- a/src/Adyen/Model/Transfers/TransferEventTrackingData.php +++ b/src/Adyen/Model/Transfers/TransferEventTrackingData.php @@ -322,7 +322,7 @@ public function getStatus() /** * Sets status * - * @param string $status Possible values: - **pending**: Transfer is under internal review. - **failed**: Transfer failed to pass internal review. See field **reason** for details. + * @param string $status The status of the transfer. Possible values: - **pending**: the transfer is under internal review. - **failed**: the transfer failed Adyen's internal review. For details, see `reason`. * * @return self */ @@ -349,7 +349,7 @@ public function getType() /** * Sets type * - * @param string $type **internalReview** + * @param string $type The type of tracking event. Possible values: - **internalReview**: the transfer was flagged because it does not comply with Adyen's risk policy. * * @return self */ @@ -403,7 +403,7 @@ public function getReason() /** * Sets reason * - * @param string|null $reason Possible values: - **refusedForRegulatoryReasons**. + * @param string|null $reason The reason why the transfer failed Adyen's internal review. Possible values: - **refusedForRegulatoryReasons**: the transfer does not comply with Adyen's risk policy. For more information, [contact the Support Team](https://www.adyen.help/hc/en-us/requests/new). * * @return self */ diff --git a/src/Adyen/Model/Transfers/TransferServiceRestServiceError.php b/src/Adyen/Model/Transfers/TransferServiceRestServiceError.php new file mode 100644 index 000000000..d4495168e --- /dev/null +++ b/src/Adyen/Model/Transfers/TransferServiceRestServiceError.php @@ -0,0 +1,729 @@ + + */ +class TransferServiceRestServiceError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferServiceRestServiceError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'detail' => 'string', + 'errorCode' => 'string', + 'instance' => 'string', + 'invalidFields' => '\Adyen\Model\Transfers\InvalidField[]', + 'requestId' => 'string', + 'response' => 'object', + 'routingDetails' => '\Adyen\Model\Transfers\RoutingDetails[]', + 'status' => 'int', + 'title' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'detail' => null, + 'errorCode' => null, + 'instance' => null, + 'invalidFields' => null, + 'requestId' => null, + 'response' => null, + 'routingDetails' => null, + 'status' => 'int32', + 'title' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'detail' => false, + 'errorCode' => false, + 'instance' => false, + 'invalidFields' => false, + 'requestId' => false, + 'response' => false, + 'routingDetails' => false, + 'status' => true, + 'title' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'detail' => 'detail', + 'errorCode' => 'errorCode', + 'instance' => 'instance', + 'invalidFields' => 'invalidFields', + 'requestId' => 'requestId', + 'response' => 'response', + 'routingDetails' => 'routingDetails', + 'status' => 'status', + 'title' => 'title', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'detail' => 'setDetail', + 'errorCode' => 'setErrorCode', + 'instance' => 'setInstance', + 'invalidFields' => 'setInvalidFields', + 'requestId' => 'setRequestId', + 'response' => 'setResponse', + 'routingDetails' => 'setRoutingDetails', + 'status' => 'setStatus', + 'title' => 'setTitle', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'detail' => 'getDetail', + 'errorCode' => 'getErrorCode', + 'instance' => 'getInstance', + 'invalidFields' => 'getInvalidFields', + 'requestId' => 'getRequestId', + 'response' => 'getResponse', + 'routingDetails' => 'getRoutingDetails', + 'status' => 'getStatus', + 'title' => 'getTitle', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * 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('detail', $data ?? [], null); + $this->setIfExists('errorCode', $data ?? [], null); + $this->setIfExists('instance', $data ?? [], null); + $this->setIfExists('invalidFields', $data ?? [], null); + $this->setIfExists('requestId', $data ?? [], null); + $this->setIfExists('response', $data ?? [], null); + $this->setIfExists('routingDetails', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['detail'] === null) { + $invalidProperties[] = "'detail' can't be null"; + } + if ($this->container['errorCode'] === null) { + $invalidProperties[] = "'errorCode' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' 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 detail + * + * @return string + */ + public function getDetail() + { + return $this->container['detail']; + } + + /** + * Sets detail + * + * @param string $detail A human-readable explanation specific to this occurrence of the problem. + * + * @return self + */ + public function setDetail($detail) + { + if (is_null($detail)) { + throw new \InvalidArgumentException('non-nullable detail cannot be null'); + } + $this->container['detail'] = $detail; + + return $this; + } + + /** + * Gets errorCode + * + * @return string + */ + public function getErrorCode() + { + return $this->container['errorCode']; + } + + /** + * Sets errorCode + * + * @param string $errorCode A code that identifies the problem type. + * + * @return self + */ + public function setErrorCode($errorCode) + { + if (is_null($errorCode)) { + throw new \InvalidArgumentException('non-nullable errorCode cannot be null'); + } + $this->container['errorCode'] = $errorCode; + + return $this; + } + + /** + * Gets instance + * + * @return string|null + */ + public function getInstance() + { + return $this->container['instance']; + } + + /** + * Sets instance + * + * @param string|null $instance A unique URI that identifies the specific occurrence of the problem. + * + * @return self + */ + public function setInstance($instance) + { + if (is_null($instance)) { + throw new \InvalidArgumentException('non-nullable instance cannot be null'); + } + $this->container['instance'] = $instance; + + return $this; + } + + /** + * Gets invalidFields + * + * @return \Adyen\Model\Transfers\InvalidField[]|null + */ + public function getInvalidFields() + { + return $this->container['invalidFields']; + } + + /** + * Sets invalidFields + * + * @param \Adyen\Model\Transfers\InvalidField[]|null $invalidFields Detailed explanation of each validation error, when applicable. + * + * @return self + */ + public function setInvalidFields($invalidFields) + { + if (is_null($invalidFields)) { + throw new \InvalidArgumentException('non-nullable invalidFields cannot be null'); + } + $this->container['invalidFields'] = $invalidFields; + + return $this; + } + + /** + * Gets requestId + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['requestId']; + } + + /** + * Sets requestId + * + * @param string|null $requestId A unique reference for the request, essentially the same as `pspReference`. + * + * @return self + */ + public function setRequestId($requestId) + { + if (is_null($requestId)) { + throw new \InvalidArgumentException('non-nullable requestId cannot be null'); + } + $this->container['requestId'] = $requestId; + + return $this; + } + + /** + * Gets response + * + * @return object|null + */ + public function getResponse() + { + return $this->container['response']; + } + + /** + * Sets response + * + * @param object|null $response response + * + * @return self + */ + public function setResponse($response) + { + if (is_null($response)) { + throw new \InvalidArgumentException('non-nullable response cannot be null'); + } + $this->container['response'] = $response; + + return $this; + } + + /** + * Gets routingDetails + * + * @return \Adyen\Model\Transfers\RoutingDetails[]|null + */ + public function getRoutingDetails() + { + return $this->container['routingDetails']; + } + + /** + * Sets routingDetails + * + * @param \Adyen\Model\Transfers\RoutingDetails[]|null $routingDetails Detailed explanation of each attempt to route the transfer with the priorities from the request. + * + * @return self + */ + public function setRoutingDetails($routingDetails) + { + if (is_null($routingDetails)) { + throw new \InvalidArgumentException('non-nullable routingDetails cannot be null'); + } + $this->container['routingDetails'] = $routingDetails; + + return $this; + } + + /** + * Gets status + * + * @return int + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param int $status The HTTP status code. + * + * @return self + */ + public function setStatus($status) + { + // Do nothing for nullable integers + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title A short, human-readable summary of the problem type. + * + * @return self + */ + public function setTitle($title) + { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type A URI that identifies the problem type, pointing to human-readable documentation on this problem type. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php index 980edd95b..bcb0276b3 100644 --- a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php +++ b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php @@ -76,13 +76,14 @@ public function createSweep(string $balanceAccountId, \Adyen\Model\BalancePlatfo * @param string $balanceAccountId * @param string $sweepId * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteSweep(string $balanceAccountId, string $sweepId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php index c61143563..99bc3b6bd 100644 --- a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php +++ b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php @@ -44,12 +44,13 @@ public function __construct(Client $client) * * @param \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function validateBankAccountIdentification(\Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest, array $requestOptions = null) { $endpoint = $this->baseURL . "/validateBankAccountIdentification"; $this->requestHttp($endpoint, strtolower('POST'), (array) $bankAccountIdentificationValidationRequest->jsonSerialize(), $requestOptions); + } } diff --git a/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php b/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php index df3b7a28a..50ba91f10 100644 --- a/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php +++ b/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php @@ -60,13 +60,14 @@ public function completeRegistrationOfScaDevice(string $id, \Adyen\Model\Balance * * @param string $id * @param array|null $requestOptions ['queryParams' => ['paymentInstrumentId'=> string]] - + * @throws AdyenException */ public function deleteRegistrationOfScaDevice(string $id, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/registeredDevices/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php b/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php index ad86f1206..2e704599b 100644 --- a/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php +++ b/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php @@ -60,12 +60,13 @@ public function getNetworkToken(string $networkTokenId, array $requestOptions = * @param string $networkTokenId * @param \Adyen\Model\BalancePlatform\UpdateNetworkTokenRequest $updateNetworkTokenRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function updateNetworkToken(string $networkTokenId, \Adyen\Model\BalancePlatform\UpdateNetworkTokenRequest $updateNetworkTokenRequest, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{networkTokenId}'], [$networkTokenId], "/networkTokens/{networkTokenId}"); $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateNetworkTokenRequest->jsonSerialize(), $requestOptions); + } } diff --git a/src/Adyen/Service/Checkout/RecurringApi.php b/src/Adyen/Service/Checkout/RecurringApi.php index 233c09180..72b257fdc 100644 --- a/src/Adyen/Service/Checkout/RecurringApi.php +++ b/src/Adyen/Service/Checkout/RecurringApi.php @@ -44,13 +44,14 @@ public function __construct(Client $client) * * @param string $storedPaymentMethodId * @param array|null $requestOptions ['queryParams' => ['shopperReference'=> string, 'merchantAccount'=> string]] - + * @throws AdyenException */ public function deleteTokenForStoredPaymentDetails(string $storedPaymentMethodId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{storedPaymentMethodId}'], [$storedPaymentMethodId], "/storedPaymentMethods/{storedPaymentMethodId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php b/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php index f94b39ed9..2551bbc54 100644 --- a/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php +++ b/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php @@ -59,13 +59,14 @@ public function createBusinessLine(\Adyen\Model\LegalEntityManagement\BusinessLi * * @param string $id * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteBusinessLine(string $id, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/businessLines/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php b/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php index d834bf550..9a6ea1756 100644 --- a/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php +++ b/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php @@ -44,13 +44,14 @@ public function __construct(Client $client) * * @param string $id * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteDocument(string $id, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/documents/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php b/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php index 70c2e0769..3bf8aeaa4 100644 --- a/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php +++ b/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php @@ -59,13 +59,14 @@ public function createTransferInstrument(\Adyen\Model\LegalEntityManagement\Tran * * @param string $id * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteTransferInstrument(string $id, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/transferInstruments/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/Management/AllowedOriginsCompanyLevelApi.php b/src/Adyen/Service/Management/AllowedOriginsCompanyLevelApi.php index c2557d39d..608130253 100644 --- a/src/Adyen/Service/Management/AllowedOriginsCompanyLevelApi.php +++ b/src/Adyen/Service/Management/AllowedOriginsCompanyLevelApi.php @@ -63,13 +63,14 @@ public function createAllowedOrigin(string $companyId, string $apiCredentialId, * @param string $apiCredentialId * @param string $originId * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteAllowedOrigin(string $companyId, string $apiCredentialId, string $originId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{companyId}', '{apiCredentialId}', '{originId}'], [$companyId, $apiCredentialId, $originId], "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/Management/AllowedOriginsMerchantLevelApi.php b/src/Adyen/Service/Management/AllowedOriginsMerchantLevelApi.php index 1b40d271f..ec0d042af 100644 --- a/src/Adyen/Service/Management/AllowedOriginsMerchantLevelApi.php +++ b/src/Adyen/Service/Management/AllowedOriginsMerchantLevelApi.php @@ -63,13 +63,14 @@ public function createAllowedOrigin(string $merchantId, string $apiCredentialId, * @param string $apiCredentialId * @param string $originId * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteAllowedOrigin(string $merchantId, string $apiCredentialId, string $originId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{merchantId}', '{apiCredentialId}', '{originId}'], [$merchantId, $apiCredentialId, $originId], "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/Management/AndroidFilesCompanyLevelApi.php b/src/Adyen/Service/Management/AndroidFilesCompanyLevelApi.php index 70abcebc0..c93d735d2 100644 --- a/src/Adyen/Service/Management/AndroidFilesCompanyLevelApi.php +++ b/src/Adyen/Service/Management/AndroidFilesCompanyLevelApi.php @@ -85,6 +85,22 @@ public function listAndroidCertificates(string $companyId, array $requestOptions return ObjectSerializer::deserialize($response, \Adyen\Model\Management\AndroidCertificatesResponse::class); } + /** + * Reprocess Android App + * + * @param string $companyId + * @param string $id + * @param array|null $requestOptions + * @return \Adyen\Model\Management\ReprocessAndroidAppResponse + * @throws AdyenException + */ + public function reprocessAndroidApp(string $companyId, string $id, array $requestOptions = null): \Adyen\Model\Management\ReprocessAndroidAppResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{id}'], [$companyId, $id], "/companies/{companyId}/androidApps/{id}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ReprocessAndroidAppResponse::class); + } + /** * Upload Android App * diff --git a/src/Adyen/Service/Management/MyAPICredentialApi.php b/src/Adyen/Service/Management/MyAPICredentialApi.php index 54005b35b..65cdadc59 100644 --- a/src/Adyen/Service/Management/MyAPICredentialApi.php +++ b/src/Adyen/Service/Management/MyAPICredentialApi.php @@ -116,12 +116,13 @@ public function getApiCredentialDetails(array $requestOptions = null): \Adyen\Mo * * @param string $originId * @param array|null $requestOptions - + * @throws AdyenException */ public function removeAllowedOrigin(string $originId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{originId}'], [$originId], "/me/allowedOrigins/{originId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } } diff --git a/src/Adyen/Service/Management/PaymentMethodsMerchantLevelApi.php b/src/Adyen/Service/Management/PaymentMethodsMerchantLevelApi.php index f8b7cc0b0..4f955b8ba 100644 --- a/src/Adyen/Service/Management/PaymentMethodsMerchantLevelApi.php +++ b/src/Adyen/Service/Management/PaymentMethodsMerchantLevelApi.php @@ -46,13 +46,14 @@ public function __construct(Client $client) * @param string $paymentMethodId * @param \Adyen\Model\Management\ApplePayInfo $applePayInfo * @param array|null $requestOptions - + * @throws AdyenException */ public function addApplePayDomain(string $merchantId, string $paymentMethodId, \Adyen\Model\Management\ApplePayInfo $applePayInfo, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{merchantId}', '{paymentMethodId}'], [$merchantId, $paymentMethodId], "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/addApplePayDomains"); $this->requestHttp($endpoint, strtolower('POST'), (array) $applePayInfo->jsonSerialize(), $requestOptions); + } /** diff --git a/src/Adyen/Service/Management/PayoutSettingsMerchantLevelApi.php b/src/Adyen/Service/Management/PayoutSettingsMerchantLevelApi.php index efff80b67..499e78957 100644 --- a/src/Adyen/Service/Management/PayoutSettingsMerchantLevelApi.php +++ b/src/Adyen/Service/Management/PayoutSettingsMerchantLevelApi.php @@ -61,13 +61,14 @@ public function addPayoutSetting(string $merchantId, \Adyen\Model\Management\Pay * @param string $merchantId * @param string $payoutSettingsId * @param array|null $requestOptions - + * @throws AdyenException */ public function deletePayoutSetting(string $merchantId, string $payoutSettingsId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{merchantId}', '{payoutSettingsId}'], [$merchantId, $payoutSettingsId], "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php b/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php index 8a7c5e731..8b6d78c7f 100644 --- a/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php +++ b/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php @@ -59,12 +59,13 @@ public function listTerminals(array $requestOptions = null): \Adyen\Model\Manage * @param string $terminalId * @param \Adyen\Model\Management\TerminalReassignmentRequest $terminalReassignmentRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function reassignTerminal(string $terminalId, \Adyen\Model\Management\TerminalReassignmentRequest $terminalReassignmentRequest, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{terminalId}'], [$terminalId], "/terminals/{terminalId}/reassign"); $this->requestHttp($endpoint, strtolower('POST'), (array) $terminalReassignmentRequest->jsonSerialize(), $requestOptions); + } } diff --git a/src/Adyen/Service/Management/WebhooksCompanyLevelApi.php b/src/Adyen/Service/Management/WebhooksCompanyLevelApi.php index cfe85a383..6caa292a6 100644 --- a/src/Adyen/Service/Management/WebhooksCompanyLevelApi.php +++ b/src/Adyen/Service/Management/WebhooksCompanyLevelApi.php @@ -92,13 +92,14 @@ public function listAllWebhooks(string $companyId, array $requestOptions = null) * @param string $companyId * @param string $webhookId * @param array|null $requestOptions - + * @throws AdyenException */ public function removeWebhook(string $companyId, string $webhookId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{companyId}', '{webhookId}'], [$companyId, $webhookId], "/companies/{companyId}/webhooks/{webhookId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/Management/WebhooksMerchantLevelApi.php b/src/Adyen/Service/Management/WebhooksMerchantLevelApi.php index 968e9c614..7113c9c39 100644 --- a/src/Adyen/Service/Management/WebhooksMerchantLevelApi.php +++ b/src/Adyen/Service/Management/WebhooksMerchantLevelApi.php @@ -92,13 +92,14 @@ public function listAllWebhooks(string $merchantId, array $requestOptions = null * @param string $merchantId * @param string $webhookId * @param array|null $requestOptions - + * @throws AdyenException */ public function removeWebhook(string $merchantId, string $webhookId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{merchantId}', '{webhookId}'], [$merchantId, $webhookId], "/merchants/{merchantId}/webhooks/{webhookId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /**