From 4c277c36a7f03d697bb1a13f1c9eeb72a1adb9d0 Mon Sep 17 00:00:00 2001 From: Adyen Automation Date: Mon, 9 Dec 2024 14:39:06 +0000 Subject: [PATCH] [reformat][adyen-sdk-automation] automated change --- src/Adyen/Model/AcsWebhooks/Amount.php | 4 +- .../AuthenticationNotificationRequest.php | 31 + .../Model/AcsWebhooks/ObjectSerializer.php | 9 +- .../Model/BalanceControl/ObjectSerializer.php | 9 +- .../BalancePlatform/CapabilitySettings.php | 8 +- .../BalancePlatform/ObjectSerializer.php | 9 +- .../Model/BinLookup/ObjectSerializer.php | 9 +- src/Adyen/Model/Checkout/Amount.php | 4 +- src/Adyen/Model/Checkout/CardDetails.php | 33 + src/Adyen/Model/Checkout/CardDonations.php | 33 + .../Model/Checkout/CheckoutPaymentMethod.php | 171 +++- .../Model/Checkout/DonationPaymentMethod.php | 31 + src/Adyen/Model/Checkout/MbwayDetails.php | 4 +- src/Adyen/Model/Checkout/ObjectSerializer.php | 9 +- src/Adyen/Model/Checkout/PseDetails.php | 605 ++++++++++++ src/Adyen/Model/Checkout/VippsDetails.php | 2 +- .../CapabilitySettings.php | 8 +- .../ObjectSerializer.php | 9 +- .../Model/DataProtection/ObjectSerializer.php | 9 +- src/Adyen/Model/DisputeWebhooks/Amount.php | 444 +++++++++ .../BalancePlatformNotificationResponse.php | 407 ++++++++ .../DisputeEventNotification.php | 719 ++++++++++++++ .../DisputeNotificationRequest.php | 477 ++++++++++ .../Model/DisputeWebhooks/ModelInterface.php | 92 ++ .../DisputeWebhooks/ObjectSerializer.php | 316 +++++++ src/Adyen/Model/Disputes/ObjectSerializer.php | 9 +- .../CalculatePciStatusRequest.php | 434 +++++++++ .../CalculatePciStatusResponse.php | 407 ++++++++ .../Model/LegalEntityManagement/Document.php | 2 +- .../GeneratePciDescriptionResponse.php | 2 +- .../IdentificationData.php | 2 +- .../LegalEntityManagement/LegalEntity.php | 31 + .../LegalEntityAssociation.php | 8 +- .../LegalEntityManagement/LegalEntityInfo.php | 31 + .../LegalEntityInfoRequiredType.php | 31 + .../ObjectSerializer.php | 9 +- .../OnboardingLinkSettings.php | 31 + .../LegalEntityManagement/PhoneNumber.php | 31 + .../Model/LegalEntityManagement/Trust.php | 82 +- .../UnincorporatedPartnership.php | 875 ++++++++++++++++++ src/Adyen/Model/Management/AmexInfo.php | 6 +- src/Adyen/Model/Management/DinersInfo.php | 536 +++++++++++ src/Adyen/Model/Management/JCBInfo.php | 11 +- .../Model/Management/ObjectSerializer.php | 9 +- src/Adyen/Model/Management/PaymentMethod.php | 6 +- .../Management/PaymentMethodResponse.php | 2 + .../Management/PaymentMethodSetupInfo.php | 8 +- .../ManagementWebhooks/ObjectSerializer.php | 9 +- .../ObjectSerializer.php | 9 +- src/Adyen/Model/Payments/ObjectSerializer.php | 9 +- .../Model/PaymentsApp/ObjectSerializer.php | 9 +- src/Adyen/Model/Payout/ObjectSerializer.php | 9 +- .../Model/PosMobile/ObjectSerializer.php | 9 +- src/Adyen/Model/Recurring/Amount.php | 4 +- .../Model/Recurring/ObjectSerializer.php | 9 +- .../Model/ReportWebhooks/ObjectSerializer.php | 9 +- .../Model/StoredValue/ObjectSerializer.php | 9 +- .../Model/TransactionWebhooks/Amount.php | 4 +- .../TransactionWebhooks/ObjectSerializer.php | 9 +- .../TransactionWebhooks/PlatformPayment.php | 2 +- .../TransactionNotificationRequestV4.php | 31 + .../TransferViewCategoryData.php | 2 +- src/Adyen/Model/TransferWebhooks/Airline.php | 438 +++++++++ src/Adyen/Model/TransferWebhooks/Amount.php | 4 +- src/Adyen/Model/TransferWebhooks/Leg.php | 562 +++++++++++ .../TransferWebhooks/MerchantPurchaseData.php | 472 ++++++++++ .../TransferWebhooks/ObjectSerializer.php | 9 +- .../TransferWebhooks/PlatformPayment.php | 2 +- .../Model/TransferWebhooks/TransferData.php | 35 +- .../TransferDataCategoryData.php | 2 +- .../Model/TransferWebhooks/TransferEvent.php | 31 + .../TransferEventEventsDataInner.php | 441 +++++++++ .../TransferNotificationRequest.php | 31 + src/Adyen/Model/Transfers/Airline.php | 438 +++++++++ src/Adyen/Model/Transfers/Amount.php | 4 +- src/Adyen/Model/Transfers/Leg.php | 562 +++++++++++ .../Model/Transfers/MerchantPurchaseData.php | 472 ++++++++++ .../Model/Transfers/ObjectSerializer.php | 9 +- src/Adyen/Model/Transfers/PlatformPayment.php | 2 +- src/Adyen/Model/Transfers/Transfer.php | 4 +- .../Model/Transfers/TransferCategoryData.php | 2 +- src/Adyen/Model/Transfers/TransferData.php | 35 +- src/Adyen/Model/Transfers/TransferEvent.php | 31 + .../TransferEventEventsDataInner.php | 441 +++++++++ src/Adyen/Model/Transfers/TransferInfo.php | 4 +- .../BalancePlatform/BalanceAccountsApi.php | 3 +- .../BankAccountValidationApi.php | 3 +- .../BalancePlatform/ManageSCADevicesApi.php | 3 +- .../BalancePlatform/NetworkTokensApi.php | 3 +- src/Adyen/Service/Checkout/RecurringApi.php | 3 +- .../BusinessLinesApi.php | 3 +- .../LegalEntityManagement/DocumentsApi.php | 3 +- .../PCIQuestionnairesApi.php | 16 + .../TaxEDeliveryConsentApi.php | 3 +- .../TransferInstrumentsApi.php | 3 +- .../AllowedOriginsCompanyLevelApi.php | 3 +- .../AllowedOriginsMerchantLevelApi.php | 3 +- .../Service/Management/MyAPICredentialApi.php | 3 +- .../PaymentMethodsMerchantLevelApi.php | 3 +- .../PayoutSettingsMerchantLevelApi.php | 3 +- .../Management/TerminalsTerminalLevelApi.php | 3 +- .../Management/WebhooksCompanyLevelApi.php | 3 +- .../Management/WebhooksMerchantLevelApi.php | 3 +- src/Adyen/Service/Transfers/TransfersApi.php | 6 +- 104 files changed, 10025 insertions(+), 227 deletions(-) create mode 100644 src/Adyen/Model/Checkout/PseDetails.php create mode 100644 src/Adyen/Model/DisputeWebhooks/Amount.php create mode 100644 src/Adyen/Model/DisputeWebhooks/BalancePlatformNotificationResponse.php create mode 100644 src/Adyen/Model/DisputeWebhooks/DisputeEventNotification.php create mode 100644 src/Adyen/Model/DisputeWebhooks/DisputeNotificationRequest.php create mode 100644 src/Adyen/Model/DisputeWebhooks/ModelInterface.php create mode 100644 src/Adyen/Model/DisputeWebhooks/ObjectSerializer.php create mode 100644 src/Adyen/Model/LegalEntityManagement/CalculatePciStatusRequest.php create mode 100644 src/Adyen/Model/LegalEntityManagement/CalculatePciStatusResponse.php create mode 100644 src/Adyen/Model/LegalEntityManagement/UnincorporatedPartnership.php create mode 100644 src/Adyen/Model/Management/DinersInfo.php create mode 100644 src/Adyen/Model/TransferWebhooks/Airline.php create mode 100644 src/Adyen/Model/TransferWebhooks/Leg.php create mode 100644 src/Adyen/Model/TransferWebhooks/MerchantPurchaseData.php create mode 100644 src/Adyen/Model/TransferWebhooks/TransferEventEventsDataInner.php create mode 100644 src/Adyen/Model/Transfers/Airline.php create mode 100644 src/Adyen/Model/Transfers/Leg.php create mode 100644 src/Adyen/Model/Transfers/MerchantPurchaseData.php create mode 100644 src/Adyen/Model/Transfers/TransferEventEventsDataInner.php diff --git a/src/Adyen/Model/AcsWebhooks/Amount.php b/src/Adyen/Model/AcsWebhooks/Amount.php index ef0eef5a5..b55bfe661 100644 --- a/src/Adyen/Model/AcsWebhooks/Amount.php +++ b/src/Adyen/Model/AcsWebhooks/Amount.php @@ -302,7 +302,7 @@ public function getCurrency() /** * Sets currency * - * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). * * @return self */ @@ -326,7 +326,7 @@ public function getValue() /** * Sets value * - * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * * @return self */ diff --git a/src/Adyen/Model/AcsWebhooks/AuthenticationNotificationRequest.php b/src/Adyen/Model/AcsWebhooks/AuthenticationNotificationRequest.php index 84be4d642..6f1aa77e2 100644 --- a/src/Adyen/Model/AcsWebhooks/AuthenticationNotificationRequest.php +++ b/src/Adyen/Model/AcsWebhooks/AuthenticationNotificationRequest.php @@ -46,6 +46,7 @@ class AuthenticationNotificationRequest implements ModelInterface, ArrayAccess, protected static $openAPITypes = [ 'data' => '\Adyen\Model\AcsWebhooks\AuthenticationNotificationData', 'environment' => 'string', + 'timestamp' => '\DateTime', 'type' => 'string' ]; @@ -59,6 +60,7 @@ class AuthenticationNotificationRequest implements ModelInterface, ArrayAccess, protected static $openAPIFormats = [ 'data' => null, 'environment' => null, + 'timestamp' => 'date-time', 'type' => null ]; @@ -70,6 +72,7 @@ class AuthenticationNotificationRequest implements ModelInterface, ArrayAccess, protected static $openAPINullables = [ 'data' => false, 'environment' => false, + 'timestamp' => false, 'type' => false ]; @@ -161,6 +164,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'data' => 'data', 'environment' => 'environment', + 'timestamp' => 'timestamp', 'type' => 'type' ]; @@ -172,6 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'data' => 'setData', 'environment' => 'setEnvironment', + 'timestamp' => 'setTimestamp', 'type' => 'setType' ]; @@ -183,6 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'data' => 'getData', 'environment' => 'getEnvironment', + 'timestamp' => 'getTimestamp', 'type' => 'getType' ]; @@ -257,6 +263,7 @@ public function __construct(array $data = null) { $this->setIfExists('data', $data ?? [], null); $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -368,6 +375,30 @@ public function setEnvironment($environment) return $this; } + /** + * Gets timestamp + * + * @return \DateTime|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param \DateTime|null $timestamp When the event was queued. + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + /** * Gets type * 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 67e88b5f9..ada0db0b3 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 */ @@ -382,7 +382,7 @@ public function getAuthorizedCardUsers() /** * Sets authorizedCardUsers * - * @param bool|null $authorizedCardUsers + * @param bool|null $authorizedCardUsers * * @return self */ @@ -406,7 +406,7 @@ public function getFundingSource() /** * Sets fundingSource * - * @param string[]|null $fundingSource + * @param string[]|null $fundingSource * * @return self */ @@ -439,7 +439,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/Amount.php b/src/Adyen/Model/Checkout/Amount.php index 5fff0b129..4a9a247ed 100644 --- a/src/Adyen/Model/Checkout/Amount.php +++ b/src/Adyen/Model/Checkout/Amount.php @@ -302,7 +302,7 @@ public function getCurrency() /** * Sets currency * - * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). * * @return self */ @@ -326,7 +326,7 @@ public function getValue() /** * Sets value * - * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * * @return self */ diff --git a/src/Adyen/Model/Checkout/CardDetails.php b/src/Adyen/Model/Checkout/CardDetails.php index cf89dd002..65a2cadf6 100644 --- a/src/Adyen/Model/Checkout/CardDetails.php +++ b/src/Adyen/Model/Checkout/CardDetails.php @@ -48,6 +48,7 @@ class CardDetails implements ModelInterface, ArrayAccess, \JsonSerializable 'checkoutAttemptId' => 'string', 'cupsecureplusSmscode' => 'string', 'cvc' => 'string', + 'encryptedCard' => 'string', 'encryptedCardNumber' => 'string', 'encryptedExpiryMonth' => 'string', 'encryptedExpiryYear' => 'string', @@ -81,6 +82,7 @@ class CardDetails implements ModelInterface, ArrayAccess, \JsonSerializable 'checkoutAttemptId' => null, 'cupsecureplusSmscode' => null, 'cvc' => null, + 'encryptedCard' => null, 'encryptedCardNumber' => null, 'encryptedExpiryMonth' => null, 'encryptedExpiryYear' => null, @@ -112,6 +114,7 @@ class CardDetails implements ModelInterface, ArrayAccess, \JsonSerializable 'checkoutAttemptId' => false, 'cupsecureplusSmscode' => false, 'cvc' => false, + 'encryptedCard' => false, 'encryptedCardNumber' => false, 'encryptedExpiryMonth' => false, 'encryptedExpiryYear' => false, @@ -223,6 +226,7 @@ public function isNullableSetToNull(string $property): bool 'checkoutAttemptId' => 'checkoutAttemptId', 'cupsecureplusSmscode' => 'cupsecureplus.smscode', 'cvc' => 'cvc', + 'encryptedCard' => 'encryptedCard', 'encryptedCardNumber' => 'encryptedCardNumber', 'encryptedExpiryMonth' => 'encryptedExpiryMonth', 'encryptedExpiryYear' => 'encryptedExpiryYear', @@ -254,6 +258,7 @@ public function isNullableSetToNull(string $property): bool 'checkoutAttemptId' => 'setCheckoutAttemptId', 'cupsecureplusSmscode' => 'setCupsecureplusSmscode', 'cvc' => 'setCvc', + 'encryptedCard' => 'setEncryptedCard', 'encryptedCardNumber' => 'setEncryptedCardNumber', 'encryptedExpiryMonth' => 'setEncryptedExpiryMonth', 'encryptedExpiryYear' => 'setEncryptedExpiryYear', @@ -285,6 +290,7 @@ public function isNullableSetToNull(string $property): bool 'checkoutAttemptId' => 'getCheckoutAttemptId', 'cupsecureplusSmscode' => 'getCupsecureplusSmscode', 'cvc' => 'getCvc', + 'encryptedCard' => 'getEncryptedCard', 'encryptedCardNumber' => 'getEncryptedCardNumber', 'encryptedExpiryMonth' => 'getEncryptedExpiryMonth', 'encryptedExpiryYear' => 'getEncryptedExpiryYear', @@ -354,6 +360,7 @@ public function getModelName() public const TYPE_NETWORK_TOKEN = 'networkToken'; public const TYPE_GIFTCARD = 'giftcard'; public const TYPE_CARD = 'card'; + public const TYPE_CLICKTOPAY = 'clicktopay'; /** * Gets allowable values of the enum @@ -380,6 +387,7 @@ public function getTypeAllowableValues() self::TYPE_NETWORK_TOKEN, self::TYPE_GIFTCARD, self::TYPE_CARD, + self::TYPE_CLICKTOPAY, ]; } /** @@ -401,6 +409,7 @@ public function __construct(array $data = null) $this->setIfExists('checkoutAttemptId', $data ?? [], null); $this->setIfExists('cupsecureplusSmscode', $data ?? [], null); $this->setIfExists('cvc', $data ?? [], null); + $this->setIfExists('encryptedCard', $data ?? [], null); $this->setIfExists('encryptedCardNumber', $data ?? [], null); $this->setIfExists('encryptedExpiryMonth', $data ?? [], null); $this->setIfExists('encryptedExpiryYear', $data ?? [], null); @@ -580,6 +589,30 @@ public function setCvc($cvc) return $this; } + /** + * Gets encryptedCard + * + * @return string|null + */ + public function getEncryptedCard() + { + return $this->container['encryptedCard']; + } + + /** + * Sets encryptedCard + * + * @param string|null $encryptedCard Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details. + * + * @return self + */ + public function setEncryptedCard($encryptedCard) + { + $this->container['encryptedCard'] = $encryptedCard; + + return $this; + } + /** * Gets encryptedCardNumber * diff --git a/src/Adyen/Model/Checkout/CardDonations.php b/src/Adyen/Model/Checkout/CardDonations.php index 776194ed1..c0a650847 100644 --- a/src/Adyen/Model/Checkout/CardDonations.php +++ b/src/Adyen/Model/Checkout/CardDonations.php @@ -48,6 +48,7 @@ class CardDonations implements ModelInterface, ArrayAccess, \JsonSerializable 'checkoutAttemptId' => 'string', 'cupsecureplusSmscode' => 'string', 'cvc' => 'string', + 'encryptedCard' => 'string', 'encryptedCardNumber' => 'string', 'encryptedExpiryMonth' => 'string', 'encryptedExpiryYear' => 'string', @@ -81,6 +82,7 @@ class CardDonations implements ModelInterface, ArrayAccess, \JsonSerializable 'checkoutAttemptId' => null, 'cupsecureplusSmscode' => null, 'cvc' => null, + 'encryptedCard' => null, 'encryptedCardNumber' => null, 'encryptedExpiryMonth' => null, 'encryptedExpiryYear' => null, @@ -112,6 +114,7 @@ class CardDonations implements ModelInterface, ArrayAccess, \JsonSerializable 'checkoutAttemptId' => false, 'cupsecureplusSmscode' => false, 'cvc' => false, + 'encryptedCard' => false, 'encryptedCardNumber' => false, 'encryptedExpiryMonth' => false, 'encryptedExpiryYear' => false, @@ -223,6 +226,7 @@ public function isNullableSetToNull(string $property): bool 'checkoutAttemptId' => 'checkoutAttemptId', 'cupsecureplusSmscode' => 'cupsecureplus.smscode', 'cvc' => 'cvc', + 'encryptedCard' => 'encryptedCard', 'encryptedCardNumber' => 'encryptedCardNumber', 'encryptedExpiryMonth' => 'encryptedExpiryMonth', 'encryptedExpiryYear' => 'encryptedExpiryYear', @@ -254,6 +258,7 @@ public function isNullableSetToNull(string $property): bool 'checkoutAttemptId' => 'setCheckoutAttemptId', 'cupsecureplusSmscode' => 'setCupsecureplusSmscode', 'cvc' => 'setCvc', + 'encryptedCard' => 'setEncryptedCard', 'encryptedCardNumber' => 'setEncryptedCardNumber', 'encryptedExpiryMonth' => 'setEncryptedExpiryMonth', 'encryptedExpiryYear' => 'setEncryptedExpiryYear', @@ -285,6 +290,7 @@ public function isNullableSetToNull(string $property): bool 'checkoutAttemptId' => 'getCheckoutAttemptId', 'cupsecureplusSmscode' => 'getCupsecureplusSmscode', 'cvc' => 'getCvc', + 'encryptedCard' => 'getEncryptedCard', 'encryptedCardNumber' => 'getEncryptedCardNumber', 'encryptedExpiryMonth' => 'getEncryptedExpiryMonth', 'encryptedExpiryYear' => 'getEncryptedExpiryYear', @@ -354,6 +360,7 @@ public function getModelName() public const TYPE_NETWORK_TOKEN = 'networkToken'; public const TYPE_GIFTCARD = 'giftcard'; public const TYPE_CARD = 'card'; + public const TYPE_CLICKTOPAY = 'clicktopay'; /** * Gets allowable values of the enum @@ -380,6 +387,7 @@ public function getTypeAllowableValues() self::TYPE_NETWORK_TOKEN, self::TYPE_GIFTCARD, self::TYPE_CARD, + self::TYPE_CLICKTOPAY, ]; } /** @@ -401,6 +409,7 @@ public function __construct(array $data = null) $this->setIfExists('checkoutAttemptId', $data ?? [], null); $this->setIfExists('cupsecureplusSmscode', $data ?? [], null); $this->setIfExists('cvc', $data ?? [], null); + $this->setIfExists('encryptedCard', $data ?? [], null); $this->setIfExists('encryptedCardNumber', $data ?? [], null); $this->setIfExists('encryptedExpiryMonth', $data ?? [], null); $this->setIfExists('encryptedExpiryYear', $data ?? [], null); @@ -580,6 +589,30 @@ public function setCvc($cvc) return $this; } + /** + * Gets encryptedCard + * + * @return string|null + */ + public function getEncryptedCard() + { + return $this->container['encryptedCard']; + } + + /** + * Sets encryptedCard + * + * @param string|null $encryptedCard Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details. + * + * @return self + */ + public function setEncryptedCard($encryptedCard) + { + $this->container['encryptedCard'] = $encryptedCard; + + return $this; + } + /** * Gets encryptedCardNumber * diff --git a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php index 50e4731f4..64d6e8039 100644 --- a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php +++ b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php @@ -70,6 +70,7 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'brand' => 'string', 'cupsecureplusSmscode' => 'string', 'cvc' => 'string', + 'encryptedCard' => 'string', 'encryptedCardNumber' => 'string', 'encryptedExpiryMonth' => 'string', 'encryptedExpiryYear' => 'string', @@ -104,6 +105,10 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'payerSelected' => 'string', 'shopperAccountIdentifier' => 'string', 'virtualPaymentAddress' => 'string', + 'bank' => 'string', + 'clientType' => 'string', + 'identification' => 'string', + 'identificationType' => 'string', 'deviceFingerprint' => 'string', 'iban' => 'string', 'samsungPayToken' => 'string', @@ -147,6 +152,7 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'brand' => null, 'cupsecureplusSmscode' => null, 'cvc' => null, + 'encryptedCard' => null, 'encryptedCardNumber' => null, 'encryptedExpiryMonth' => null, 'encryptedExpiryYear' => null, @@ -181,6 +187,10 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'payerSelected' => null, 'shopperAccountIdentifier' => null, 'virtualPaymentAddress' => null, + 'bank' => null, + 'clientType' => null, + 'identification' => null, + 'identificationType' => null, 'deviceFingerprint' => null, 'iban' => null, 'samsungPayToken' => null, @@ -222,6 +232,7 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'brand' => false, 'cupsecureplusSmscode' => false, 'cvc' => false, + 'encryptedCard' => false, 'encryptedCardNumber' => false, 'encryptedExpiryMonth' => false, 'encryptedExpiryYear' => false, @@ -256,6 +267,10 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'payerSelected' => false, 'shopperAccountIdentifier' => false, 'virtualPaymentAddress' => false, + 'bank' => false, + 'clientType' => false, + 'identification' => false, + 'identificationType' => false, 'deviceFingerprint' => false, 'iban' => false, 'samsungPayToken' => false, @@ -377,6 +392,7 @@ public function isNullableSetToNull(string $property): bool 'brand' => 'brand', 'cupsecureplusSmscode' => 'cupsecureplus.smscode', 'cvc' => 'cvc', + 'encryptedCard' => 'encryptedCard', 'encryptedCardNumber' => 'encryptedCardNumber', 'encryptedExpiryMonth' => 'encryptedExpiryMonth', 'encryptedExpiryYear' => 'encryptedExpiryYear', @@ -411,6 +427,10 @@ public function isNullableSetToNull(string $property): bool 'payerSelected' => 'payerSelected', 'shopperAccountIdentifier' => 'shopperAccountIdentifier', 'virtualPaymentAddress' => 'virtualPaymentAddress', + 'bank' => 'bank', + 'clientType' => 'clientType', + 'identification' => 'identification', + 'identificationType' => 'identificationType', 'deviceFingerprint' => 'deviceFingerprint', 'iban' => 'iban', 'samsungPayToken' => 'samsungPayToken', @@ -452,6 +472,7 @@ public function isNullableSetToNull(string $property): bool 'brand' => 'setBrand', 'cupsecureplusSmscode' => 'setCupsecureplusSmscode', 'cvc' => 'setCvc', + 'encryptedCard' => 'setEncryptedCard', 'encryptedCardNumber' => 'setEncryptedCardNumber', 'encryptedExpiryMonth' => 'setEncryptedExpiryMonth', 'encryptedExpiryYear' => 'setEncryptedExpiryYear', @@ -486,6 +507,10 @@ public function isNullableSetToNull(string $property): bool 'payerSelected' => 'setPayerSelected', 'shopperAccountIdentifier' => 'setShopperAccountIdentifier', 'virtualPaymentAddress' => 'setVirtualPaymentAddress', + 'bank' => 'setBank', + 'clientType' => 'setClientType', + 'identification' => 'setIdentification', + 'identificationType' => 'setIdentificationType', 'deviceFingerprint' => 'setDeviceFingerprint', 'iban' => 'setIban', 'samsungPayToken' => 'setSamsungPayToken', @@ -527,6 +552,7 @@ public function isNullableSetToNull(string $property): bool 'brand' => 'getBrand', 'cupsecureplusSmscode' => 'getCupsecureplusSmscode', 'cvc' => 'getCvc', + 'encryptedCard' => 'getEncryptedCard', 'encryptedCardNumber' => 'getEncryptedCardNumber', 'encryptedExpiryMonth' => 'getEncryptedExpiryMonth', 'encryptedExpiryYear' => 'getEncryptedExpiryYear', @@ -561,6 +587,10 @@ public function isNullableSetToNull(string $property): bool 'payerSelected' => 'getPayerSelected', 'shopperAccountIdentifier' => 'getShopperAccountIdentifier', 'virtualPaymentAddress' => 'getVirtualPaymentAddress', + 'bank' => 'getBank', + 'clientType' => 'getClientType', + 'identification' => 'getIdentification', + 'identificationType' => 'getIdentificationType', 'deviceFingerprint' => 'getDeviceFingerprint', 'iban' => 'getIban', 'samsungPayToken' => 'getSamsungPayToken', @@ -652,6 +682,7 @@ public function __construct(array $data = null) $this->setIfExists('brand', $data ?? [], null); $this->setIfExists('cupsecureplusSmscode', $data ?? [], null); $this->setIfExists('cvc', $data ?? [], null); + $this->setIfExists('encryptedCard', $data ?? [], null); $this->setIfExists('encryptedCardNumber', $data ?? [], null); $this->setIfExists('encryptedExpiryMonth', $data ?? [], null); $this->setIfExists('encryptedExpiryYear', $data ?? [], null); @@ -686,6 +717,10 @@ public function __construct(array $data = null) $this->setIfExists('payerSelected', $data ?? [], null); $this->setIfExists('shopperAccountIdentifier', $data ?? [], null); $this->setIfExists('virtualPaymentAddress', $data ?? [], null); + $this->setIfExists('bank', $data ?? [], null); + $this->setIfExists('clientType', $data ?? [], null); + $this->setIfExists('identification', $data ?? [], null); + $this->setIfExists('identificationType', $data ?? [], null); $this->setIfExists('deviceFingerprint', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); $this->setIfExists('samsungPayToken', $data ?? [], null); @@ -756,6 +791,18 @@ public function listInvalidProperties() if ($this->container['masterpassTransactionId'] === null) { $invalidProperties[] = "'masterpassTransactionId' can't be null"; } + if ($this->container['bank'] === null) { + $invalidProperties[] = "'bank' can't be null"; + } + if ($this->container['clientType'] === null) { + $invalidProperties[] = "'clientType' can't be null"; + } + if ($this->container['identification'] === null) { + $invalidProperties[] = "'identification' can't be null"; + } + if ($this->container['identificationType'] === null) { + $invalidProperties[] = "'identificationType' can't be null"; + } if ($this->container['iban'] === null) { $invalidProperties[] = "'iban' can't be null"; } @@ -1387,6 +1434,30 @@ public function setCvc($cvc) return $this; } + /** + * Gets encryptedCard + * + * @return string|null + */ + public function getEncryptedCard() + { + return $this->container['encryptedCard']; + } + + /** + * Sets encryptedCard + * + * @param string|null $encryptedCard Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details. + * + * @return self + */ + public function setEncryptedCard($encryptedCard) + { + $this->container['encryptedCard'] = $encryptedCard; + + return $this; + } + /** * Gets encryptedCardNumber * @@ -1928,7 +1999,7 @@ public function getShopperEmail() /** * Sets shopperEmail * - * @param string $shopperEmail + * @param string $shopperEmail * * @return self */ @@ -1952,7 +2023,7 @@ public function getTelephoneNumber() /** * Sets telephoneNumber * - * @param string $telephoneNumber + * @param string $telephoneNumber * * @return self */ @@ -2203,6 +2274,102 @@ public function setVirtualPaymentAddress($virtualPaymentAddress) return $this; } + /** + * Gets bank + * + * @return string + */ + public function getBank() + { + return $this->container['bank']; + } + + /** + * Sets bank + * + * @param string $bank The shopper's bank. + * + * @return self + */ + public function setBank($bank) + { + $this->container['bank'] = $bank; + + return $this; + } + + /** + * Gets clientType + * + * @return string + */ + public function getClientType() + { + return $this->container['clientType']; + } + + /** + * Sets clientType + * + * @param string $clientType The client type. + * + * @return self + */ + public function setClientType($clientType) + { + $this->container['clientType'] = $clientType; + + return $this; + } + + /** + * Gets identification + * + * @return string + */ + public function getIdentification() + { + return $this->container['identification']; + } + + /** + * Sets identification + * + * @param string $identification The identification code. + * + * @return self + */ + public function setIdentification($identification) + { + $this->container['identification'] = $identification; + + return $this; + } + + /** + * Gets identificationType + * + * @return string + */ + public function getIdentificationType() + { + return $this->container['identificationType']; + } + + /** + * Sets identificationType + * + * @param string $identificationType The identification type. + * + * @return self + */ + public function setIdentificationType($identificationType) + { + $this->container['identificationType'] = $identificationType; + + return $this; + } + /** * Gets deviceFingerprint * diff --git a/src/Adyen/Model/Checkout/DonationPaymentMethod.php b/src/Adyen/Model/Checkout/DonationPaymentMethod.php index 33043d30a..bb077483f 100644 --- a/src/Adyen/Model/Checkout/DonationPaymentMethod.php +++ b/src/Adyen/Model/Checkout/DonationPaymentMethod.php @@ -54,6 +54,7 @@ class DonationPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'brand' => 'string', 'cupsecureplusSmscode' => 'string', 'cvc' => 'string', + 'encryptedCard' => 'string', 'encryptedCardNumber' => 'string', 'encryptedExpiryMonth' => 'string', 'encryptedExpiryYear' => 'string', @@ -91,6 +92,7 @@ class DonationPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'brand' => null, 'cupsecureplusSmscode' => null, 'cvc' => null, + 'encryptedCard' => null, 'encryptedCardNumber' => null, 'encryptedExpiryMonth' => null, 'encryptedExpiryYear' => null, @@ -126,6 +128,7 @@ class DonationPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'brand' => false, 'cupsecureplusSmscode' => false, 'cvc' => false, + 'encryptedCard' => false, 'encryptedCardNumber' => false, 'encryptedExpiryMonth' => false, 'encryptedExpiryYear' => false, @@ -241,6 +244,7 @@ public function isNullableSetToNull(string $property): bool 'brand' => 'brand', 'cupsecureplusSmscode' => 'cupsecureplus.smscode', 'cvc' => 'cvc', + 'encryptedCard' => 'encryptedCard', 'encryptedCardNumber' => 'encryptedCardNumber', 'encryptedExpiryMonth' => 'encryptedExpiryMonth', 'encryptedExpiryYear' => 'encryptedExpiryYear', @@ -276,6 +280,7 @@ public function isNullableSetToNull(string $property): bool 'brand' => 'setBrand', 'cupsecureplusSmscode' => 'setCupsecureplusSmscode', 'cvc' => 'setCvc', + 'encryptedCard' => 'setEncryptedCard', 'encryptedCardNumber' => 'setEncryptedCardNumber', 'encryptedExpiryMonth' => 'setEncryptedExpiryMonth', 'encryptedExpiryYear' => 'setEncryptedExpiryYear', @@ -311,6 +316,7 @@ public function isNullableSetToNull(string $property): bool 'brand' => 'getBrand', 'cupsecureplusSmscode' => 'getCupsecureplusSmscode', 'cvc' => 'getCvc', + 'encryptedCard' => 'getEncryptedCard', 'encryptedCardNumber' => 'getEncryptedCardNumber', 'encryptedExpiryMonth' => 'getEncryptedExpiryMonth', 'encryptedExpiryYear' => 'getEncryptedExpiryYear', @@ -396,6 +402,7 @@ public function __construct(array $data = null) $this->setIfExists('brand', $data ?? [], null); $this->setIfExists('cupsecureplusSmscode', $data ?? [], null); $this->setIfExists('cvc', $data ?? [], null); + $this->setIfExists('encryptedCard', $data ?? [], null); $this->setIfExists('encryptedCardNumber', $data ?? [], null); $this->setIfExists('encryptedExpiryMonth', $data ?? [], null); $this->setIfExists('encryptedExpiryYear', $data ?? [], null); @@ -686,6 +693,30 @@ public function setCvc($cvc) return $this; } + /** + * Gets encryptedCard + * + * @return string|null + */ + public function getEncryptedCard() + { + return $this->container['encryptedCard']; + } + + /** + * Sets encryptedCard + * + * @param string|null $encryptedCard Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details. + * + * @return self + */ + public function setEncryptedCard($encryptedCard) + { + $this->container['encryptedCard'] = $encryptedCard; + + return $this; + } + /** * Gets encryptedCardNumber * diff --git a/src/Adyen/Model/Checkout/MbwayDetails.php b/src/Adyen/Model/Checkout/MbwayDetails.php index dc73d3c30..becc716f0 100644 --- a/src/Adyen/Model/Checkout/MbwayDetails.php +++ b/src/Adyen/Model/Checkout/MbwayDetails.php @@ -361,7 +361,7 @@ public function getShopperEmail() /** * Sets shopperEmail * - * @param string $shopperEmail + * @param string $shopperEmail * * @return self */ @@ -385,7 +385,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/PseDetails.php b/src/Adyen/Model/Checkout/PseDetails.php new file mode 100644 index 000000000..2012309d3 --- /dev/null +++ b/src/Adyen/Model/Checkout/PseDetails.php @@ -0,0 +1,605 @@ + + */ +class PseDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PseDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'bank' => 'string', + 'checkoutAttemptId' => 'string', + 'clientType' => 'string', + 'identification' => 'string', + 'identificationType' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'bank' => null, + 'checkoutAttemptId' => null, + 'clientType' => null, + 'identification' => null, + 'identificationType' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'bank' => false, + 'checkoutAttemptId' => false, + 'clientType' => false, + 'identification' => false, + 'identificationType' => 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 = [ + 'bank' => 'bank', + 'checkoutAttemptId' => 'checkoutAttemptId', + 'clientType' => 'clientType', + 'identification' => 'identification', + 'identificationType' => 'identificationType', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'bank' => 'setBank', + 'checkoutAttemptId' => 'setCheckoutAttemptId', + 'clientType' => 'setClientType', + 'identification' => 'setIdentification', + 'identificationType' => 'setIdentificationType', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'bank' => 'getBank', + 'checkoutAttemptId' => 'getCheckoutAttemptId', + 'clientType' => 'getClientType', + 'identification' => 'getIdentification', + 'identificationType' => 'getIdentificationType', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_PSE_PAYULATAM = 'pse_payulatam'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_PSE_PAYULATAM, + ]; + } + /** + * 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('bank', $data ?? [], null); + $this->setIfExists('checkoutAttemptId', $data ?? [], null); + $this->setIfExists('clientType', $data ?? [], null); + $this->setIfExists('identification', $data ?? [], null); + $this->setIfExists('identificationType', $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['bank'] === null) { + $invalidProperties[] = "'bank' can't be null"; + } + if ($this->container['clientType'] === null) { + $invalidProperties[] = "'clientType' can't be null"; + } + if ($this->container['identification'] === null) { + $invalidProperties[] = "'identification' can't be null"; + } + if ($this->container['identificationType'] === null) { + $invalidProperties[] = "'identificationType' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bank + * + * @return string + */ + public function getBank() + { + return $this->container['bank']; + } + + /** + * Sets bank + * + * @param string $bank The shopper's bank. + * + * @return self + */ + public function setBank($bank) + { + $this->container['bank'] = $bank; + + return $this; + } + + /** + * Gets checkoutAttemptId + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkoutAttemptId']; + } + + /** + * Sets checkoutAttemptId + * + * @param string|null $checkoutAttemptId The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkoutAttemptId) + { + $this->container['checkoutAttemptId'] = $checkoutAttemptId; + + return $this; + } + + /** + * Gets clientType + * + * @return string + */ + public function getClientType() + { + return $this->container['clientType']; + } + + /** + * Sets clientType + * + * @param string $clientType The client type. + * + * @return self + */ + public function setClientType($clientType) + { + $this->container['clientType'] = $clientType; + + return $this; + } + + /** + * Gets identification + * + * @return string + */ + public function getIdentification() + { + return $this->container['identification']; + } + + /** + * Sets identification + * + * @param string $identification The identification code. + * + * @return self + */ + public function setIdentification($identification) + { + $this->container['identification'] = $identification; + + return $this; + } + + /** + * Gets identificationType + * + * @return string + */ + public function getIdentificationType() + { + return $this->container['identificationType']; + } + + /** + * Sets identificationType + * + * @param string $identificationType The identification type. + * + * @return self + */ + public function setIdentificationType($identificationType) + { + $this->container['identificationType'] = $identificationType; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The payment method type. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/VippsDetails.php b/src/Adyen/Model/Checkout/VippsDetails.php index 6787fd034..a5087a929 100644 --- a/src/Adyen/Model/Checkout/VippsDetails.php +++ b/src/Adyen/Model/Checkout/VippsDetails.php @@ -415,7 +415,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 77bba385d..478ff8914 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 */ @@ -382,7 +382,7 @@ public function getAuthorizedCardUsers() /** * Sets authorizedCardUsers * - * @param bool|null $authorizedCardUsers + * @param bool|null $authorizedCardUsers * * @return self */ @@ -406,7 +406,7 @@ public function getFundingSource() /** * Sets fundingSource * - * @param string[]|null $fundingSource + * @param string[]|null $fundingSource * * @return self */ @@ -439,7 +439,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/DisputeWebhooks/Amount.php b/src/Adyen/Model/DisputeWebhooks/Amount.php new file mode 100644 index 000000000..4aa85c4c6 --- /dev/null +++ b/src/Adyen/Model/DisputeWebhooks/Amount.php @@ -0,0 +1,444 @@ + + */ +class Amount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Amount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'value' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * + * @return self + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/DisputeWebhooks/BalancePlatformNotificationResponse.php b/src/Adyen/Model/DisputeWebhooks/BalancePlatformNotificationResponse.php new file mode 100644 index 000000000..7289f2e3d --- /dev/null +++ b/src/Adyen/Model/DisputeWebhooks/BalancePlatformNotificationResponse.php @@ -0,0 +1,407 @@ + + */ +class BalancePlatformNotificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalancePlatformNotificationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'notificationResponse' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'notificationResponse' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'notificationResponse' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'notificationResponse' => 'notificationResponse' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'notificationResponse' => 'setNotificationResponse' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'notificationResponse' => 'getNotificationResponse' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('notificationResponse', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets notificationResponse + * + * @return string|null + */ + public function getNotificationResponse() + { + return $this->container['notificationResponse']; + } + + /** + * Sets notificationResponse + * + * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * + * @return self + */ + public function setNotificationResponse($notificationResponse) + { + $this->container['notificationResponse'] = $notificationResponse; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/DisputeWebhooks/DisputeEventNotification.php b/src/Adyen/Model/DisputeWebhooks/DisputeEventNotification.php new file mode 100644 index 000000000..b4d25ead8 --- /dev/null +++ b/src/Adyen/Model/DisputeWebhooks/DisputeEventNotification.php @@ -0,0 +1,719 @@ + + */ +class DisputeEventNotification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DisputeEventNotification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'arn' => 'string', + 'balancePlatform' => 'string', + 'creationDate' => '\DateTime', + 'description' => 'string', + 'disputedAmount' => '\Adyen\Model\DisputeWebhooks\Amount', + 'id' => 'string', + 'status' => 'string', + 'statusDetail' => 'string', + 'transactionId' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'arn' => null, + 'balancePlatform' => null, + 'creationDate' => 'date-time', + 'description' => null, + 'disputedAmount' => null, + 'id' => null, + 'status' => null, + 'statusDetail' => null, + 'transactionId' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'arn' => false, + 'balancePlatform' => false, + 'creationDate' => false, + 'description' => false, + 'disputedAmount' => false, + 'id' => false, + 'status' => false, + 'statusDetail' => false, + 'transactionId' => 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 = [ + 'arn' => 'arn', + 'balancePlatform' => 'balancePlatform', + 'creationDate' => 'creationDate', + 'description' => 'description', + 'disputedAmount' => 'disputedAmount', + 'id' => 'id', + 'status' => 'status', + 'statusDetail' => 'statusDetail', + 'transactionId' => 'transactionId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'arn' => 'setArn', + 'balancePlatform' => 'setBalancePlatform', + 'creationDate' => 'setCreationDate', + 'description' => 'setDescription', + 'disputedAmount' => 'setDisputedAmount', + 'id' => 'setId', + 'status' => 'setStatus', + 'statusDetail' => 'setStatusDetail', + 'transactionId' => 'setTransactionId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'arn' => 'getArn', + 'balancePlatform' => 'getBalancePlatform', + 'creationDate' => 'getCreationDate', + 'description' => 'getDescription', + 'disputedAmount' => 'getDisputedAmount', + 'id' => 'getId', + 'status' => 'getStatus', + 'statusDetail' => 'getStatusDetail', + 'transactionId' => 'getTransactionId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_FRAUD = 'fraud'; + public const TYPE_NOT_DELIVERED = 'notDelivered'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_FRAUD, + self::TYPE_NOT_DELIVERED, + ]; + } + /** + * 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('arn', $data ?? [], null); + $this->setIfExists('balancePlatform', $data ?? [], null); + $this->setIfExists('creationDate', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('disputedAmount', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('statusDetail', $data ?? [], null); + $this->setIfExists('transactionId', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets arn + * + * @return string|null + */ + public function getArn() + { + return $this->container['arn']; + } + + /** + * Sets arn + * + * @param string|null $arn The unique Acquirer Reference Number (arn) generated by the card scheme for each capture. You can use the arn to trace the transaction through its lifecycle. + * + * @return self + */ + public function setArn($arn) + { + $this->container['arn'] = $arn; + + return $this; + } + + /** + * Gets balancePlatform + * + * @return string|null + */ + public function getBalancePlatform() + { + return $this->container['balancePlatform']; + } + + /** + * Sets balancePlatform + * + * @param string|null $balancePlatform The unique identifier of the balance platform. + * + * @return self + */ + public function setBalancePlatform($balancePlatform) + { + $this->container['balancePlatform'] = $balancePlatform; + + return $this; + } + + /** + * Gets creationDate + * + * @return \DateTime|null + */ + public function getCreationDate() + { + return $this->container['creationDate']; + } + + /** + * Sets creationDate + * + * @param \DateTime|null $creationDate The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + * + * @return self + */ + public function setCreationDate($creationDate) + { + $this->container['creationDate'] = $creationDate; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Contains information about the dispute. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets disputedAmount + * + * @return \Adyen\Model\DisputeWebhooks\Amount|null + */ + public function getDisputedAmount() + { + return $this->container['disputedAmount']; + } + + /** + * Sets disputedAmount + * + * @param \Adyen\Model\DisputeWebhooks\Amount|null $disputedAmount disputedAmount + * + * @return self + */ + public function setDisputedAmount($disputedAmount) + { + $this->container['disputedAmount'] = $disputedAmount; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The ID of the resource. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The current status of the dispute. + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets statusDetail + * + * @return string|null + */ + public function getStatusDetail() + { + return $this->container['statusDetail']; + } + + /** + * Sets statusDetail + * + * @param string|null $statusDetail Additional information about the status of the dispute, when available. + * + * @return self + */ + public function setStatusDetail($statusDetail) + { + $this->container['statusDetail'] = $statusDetail; + + return $this; + } + + /** + * Gets transactionId + * + * @return string|null + */ + public function getTransactionId() + { + return $this->container['transactionId']; + } + + /** + * Sets transactionId + * + * @param string|null $transactionId The unique reference of the transaction for which the dispute is requested. + * + * @return self + */ + public function setTransactionId($transactionId) + { + $this->container['transactionId'] = $transactionId; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of dispute raised for the transaction. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/DisputeWebhooks/DisputeNotificationRequest.php b/src/Adyen/Model/DisputeWebhooks/DisputeNotificationRequest.php new file mode 100644 index 000000000..889afb297 --- /dev/null +++ b/src/Adyen/Model/DisputeWebhooks/DisputeNotificationRequest.php @@ -0,0 +1,477 @@ + + */ +class DisputeNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DisputeNotificationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\DisputeWebhooks\DisputeEventNotification', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => 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 = [ + 'data' => 'data', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_CREATED = 'balancePlatform.dispute.created'; + public const TYPE_UPDATED = 'balancePlatform.dispute.updated'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CREATED, + self::TYPE_UPDATED, + ]; + } + /** + * 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('data', $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['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\DisputeWebhooks\DisputeEventNotification + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\DisputeWebhooks\DisputeEventNotification $data data + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of webhook. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/DisputeWebhooks/ModelInterface.php b/src/Adyen/Model/DisputeWebhooks/ModelInterface.php new file mode 100644 index 000000000..eb9d6f593 --- /dev/null +++ b/src/Adyen/Model/DisputeWebhooks/ModelInterface.php @@ -0,0 +1,92 @@ +format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) return $timestamp; + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if ( + is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Adyen\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} 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/CalculatePciStatusRequest.php b/src/Adyen/Model/LegalEntityManagement/CalculatePciStatusRequest.php new file mode 100644 index 000000000..b3c961e2b --- /dev/null +++ b/src/Adyen/Model/LegalEntityManagement/CalculatePciStatusRequest.php @@ -0,0 +1,434 @@ + + */ +class CalculatePciStatusRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CalculatePciStatusRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additionalSalesChannels' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additionalSalesChannels' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additionalSalesChannels' => 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 = [ + 'additionalSalesChannels' => 'additionalSalesChannels' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additionalSalesChannels' => 'setAdditionalSalesChannels' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additionalSalesChannels' => 'getAdditionalSalesChannels' + ]; + + /** + * 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 ADDITIONAL_SALES_CHANNELS_E_COMMERCE = 'eCommerce'; + public const ADDITIONAL_SALES_CHANNELS_ECOM_MOTO = 'ecomMoto'; + public const ADDITIONAL_SALES_CHANNELS_POS = 'pos'; + public const ADDITIONAL_SALES_CHANNELS_POS_MOTO = 'posMoto'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAdditionalSalesChannelsAllowableValues() + { + return [ + self::ADDITIONAL_SALES_CHANNELS_E_COMMERCE, + self::ADDITIONAL_SALES_CHANNELS_ECOM_MOTO, + self::ADDITIONAL_SALES_CHANNELS_POS, + self::ADDITIONAL_SALES_CHANNELS_POS_MOTO, + ]; + } + /** + * 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('additionalSalesChannels', $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 additionalSalesChannels + * + * @return string[]|null + */ + public function getAdditionalSalesChannels() + { + return $this->container['additionalSalesChannels']; + } + + /** + * Sets additionalSalesChannels + * + * @param string[]|null $additionalSalesChannels An array of additional sales channels to generate PCI questionnaires. Include the relevant sales channels if you need your user to sign PCI questionnaires. Not required if you [create stores](https://docs.adyen.com/platforms) and [add payment methods](https://docs.adyen.com/adyen-for-platforms-model) before you generate the questionnaires. Possible values: * **eCommerce** * **pos** * **ecomMoto** * **posMoto** + * + * @return self + */ + public function setAdditionalSalesChannels($additionalSalesChannels) + { + $allowedValues = $this->getAdditionalSalesChannelsAllowableValues(); + if (array_diff($additionalSalesChannels, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'additionalSalesChannels', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['additionalSalesChannels'] = $additionalSalesChannels; + + 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/LegalEntityManagement/CalculatePciStatusResponse.php b/src/Adyen/Model/LegalEntityManagement/CalculatePciStatusResponse.php new file mode 100644 index 000000000..2020be5c9 --- /dev/null +++ b/src/Adyen/Model/LegalEntityManagement/CalculatePciStatusResponse.php @@ -0,0 +1,407 @@ + + */ +class CalculatePciStatusResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CalculatePciStatusResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'signingRequired' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'signingRequired' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'signingRequired' => 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 = [ + 'signingRequired' => 'signingRequired' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'signingRequired' => 'setSigningRequired' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'signingRequired' => 'getSigningRequired' + ]; + + /** + * 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('signingRequired', $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 signingRequired + * + * @return bool|null + */ + public function getSigningRequired() + { + return $this->container['signingRequired']; + } + + /** + * Sets signingRequired + * + * @param bool|null $signingRequired Indicates if the user is required to sign PCI questionnaires. If **false**, they do not need to sign any questionnaires. + * + * @return self + */ + public function setSigningRequired($signingRequired) + { + $this->container['signingRequired'] = $signingRequired; + + 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/LegalEntityManagement/Document.php b/src/Adyen/Model/LegalEntityManagement/Document.php index bbb19a997..6c05e3a29 100644 --- a/src/Adyen/Model/LegalEntityManagement/Document.php +++ b/src/Adyen/Model/LegalEntityManagement/Document.php @@ -730,7 +730,7 @@ public function getType() /** * Sets type * - * @param string $type Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, **proofOfIndustry**, **proofOfSignatory**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **liveSelfie**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, **proofOfFundingOrWealthSource** or **proofOfRelationship**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * For **trust**, the `type` value can be **constitutionalDocument**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * @param string $type Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, **proofOfIndustry**, **proofOfSignatory**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **liveSelfie**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, **proofOfFundingOrWealthSource** or **proofOfRelationship**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * For **trust**, the `type` value is **constitutionalDocument**. * For **unincorporatedPartnership**, the `type` value is **constitutionalDocument**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/GeneratePciDescriptionResponse.php b/src/Adyen/Model/LegalEntityManagement/GeneratePciDescriptionResponse.php index c17a519ba..e16e44a45 100644 --- a/src/Adyen/Model/LegalEntityManagement/GeneratePciDescriptionResponse.php +++ b/src/Adyen/Model/LegalEntityManagement/GeneratePciDescriptionResponse.php @@ -351,7 +351,7 @@ public function getPciTemplateReferences() /** * Sets pciTemplateReferences * - * @param string[]|null $pciTemplateReferences The array of Adyen-generated unique identifiers for the questionnaires. + * @param string[]|null $pciTemplateReferences The array of Adyen-generated unique identifiers for the questionnaires. If empty, the user is not required to sign questionnaires. * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/IdentificationData.php b/src/Adyen/Model/LegalEntityManagement/IdentificationData.php index 28bb60f48..cc41558c7 100644 --- a/src/Adyen/Model/LegalEntityManagement/IdentificationData.php +++ b/src/Adyen/Model/LegalEntityManagement/IdentificationData.php @@ -507,7 +507,7 @@ public function getType() /** * Sets type * - * @param string $type Type of identity data. For individuals, the following types are supported: - Australia: **driversLicense**, **passport** - Hong Kong: **driversLicense**, **nationalIdNumber**, **passport** - New Zealand: **driversLicense**, **passport** - Singapore: **driversLicense**, **nationalIdNumber**, **passport** - All other supported countries: **nationalIdNumber** + * @param string $type Type of identity data. For individuals, the following types are supported. See our [onboarding guide](https://docs.adyen.com/platforms/onboard-users/onboarding-steps/?onboarding_type=custom) for other supported countries. - Australia: **driversLicense**, **passport** - Hong Kong: **driversLicense**, **nationalIdNumber**, **passport** - New Zealand: **driversLicense**, **passport** - Singapore: **driversLicense**, **nationalIdNumber**, **passport** - All other supported countries: **nationalIdNumber** * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/LegalEntity.php b/src/Adyen/Model/LegalEntityManagement/LegalEntity.php index ae12241ca..3b05f00be 100644 --- a/src/Adyen/Model/LegalEntityManagement/LegalEntity.php +++ b/src/Adyen/Model/LegalEntityManagement/LegalEntity.php @@ -57,6 +57,7 @@ class LegalEntity implements ModelInterface, ArrayAccess, \JsonSerializable 'transferInstruments' => '\Adyen\Model\LegalEntityManagement\TransferInstrumentReference[]', 'trust' => '\Adyen\Model\LegalEntityManagement\Trust', 'type' => 'string', + 'unincorporatedPartnership' => '\Adyen\Model\LegalEntityManagement\UnincorporatedPartnership', 'verificationDeadlines' => '\Adyen\Model\LegalEntityManagement\VerificationDeadline[]', 'verificationPlan' => 'string' ]; @@ -82,6 +83,7 @@ class LegalEntity implements ModelInterface, ArrayAccess, \JsonSerializable 'transferInstruments' => null, 'trust' => null, 'type' => null, + 'unincorporatedPartnership' => null, 'verificationDeadlines' => null, 'verificationPlan' => null ]; @@ -105,6 +107,7 @@ class LegalEntity implements ModelInterface, ArrayAccess, \JsonSerializable 'transferInstruments' => false, 'trust' => false, 'type' => false, + 'unincorporatedPartnership' => false, 'verificationDeadlines' => false, 'verificationPlan' => false ]; @@ -208,6 +211,7 @@ public function isNullableSetToNull(string $property): bool 'transferInstruments' => 'transferInstruments', 'trust' => 'trust', 'type' => 'type', + 'unincorporatedPartnership' => 'unincorporatedPartnership', 'verificationDeadlines' => 'verificationDeadlines', 'verificationPlan' => 'verificationPlan' ]; @@ -231,6 +235,7 @@ public function isNullableSetToNull(string $property): bool 'transferInstruments' => 'setTransferInstruments', 'trust' => 'setTrust', 'type' => 'setType', + 'unincorporatedPartnership' => 'setUnincorporatedPartnership', 'verificationDeadlines' => 'setVerificationDeadlines', 'verificationPlan' => 'setVerificationPlan' ]; @@ -254,6 +259,7 @@ public function isNullableSetToNull(string $property): bool 'transferInstruments' => 'getTransferInstruments', 'trust' => 'getTrust', 'type' => 'getType', + 'unincorporatedPartnership' => 'getUnincorporatedPartnership', 'verificationDeadlines' => 'getVerificationDeadlines', 'verificationPlan' => 'getVerificationPlan' ]; @@ -348,6 +354,7 @@ public function __construct(array $data = null) $this->setIfExists('transferInstruments', $data ?? [], null); $this->setIfExists('trust', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('unincorporatedPartnership', $data ?? [], null); $this->setIfExists('verificationDeadlines', $data ?? [], null); $this->setIfExists('verificationPlan', $data ?? [], null); } @@ -730,6 +737,30 @@ public function setType($type) return $this; } + /** + * Gets unincorporatedPartnership + * + * @return \Adyen\Model\LegalEntityManagement\UnincorporatedPartnership|null + */ + public function getUnincorporatedPartnership() + { + return $this->container['unincorporatedPartnership']; + } + + /** + * Sets unincorporatedPartnership + * + * @param \Adyen\Model\LegalEntityManagement\UnincorporatedPartnership|null $unincorporatedPartnership unincorporatedPartnership + * + * @return self + */ + public function setUnincorporatedPartnership($unincorporatedPartnership) + { + $this->container['unincorporatedPartnership'] = $unincorporatedPartnership; + + return $this; + } + /** * Gets verificationDeadlines * diff --git a/src/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.php b/src/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.php index ac4738f9c..a6881fee3 100644 --- a/src/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.php +++ b/src/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.php @@ -263,6 +263,7 @@ public function getModelName() public const TYPE_LEGAL_REPRESENTATIVE = 'legalRepresentative'; public const TYPE_PCI_SIGNATORY = 'pciSignatory'; public const TYPE_PROTECTOR = 'protector'; + public const TYPE_SECONDARY_PARTNER = 'secondaryPartner'; public const TYPE_SECONDARY_TRUSTEE = 'secondaryTrustee'; public const TYPE_SETTLOR = 'settlor'; public const TYPE_SIGNATORY = 'signatory'; @@ -273,6 +274,7 @@ public function getModelName() public const TYPE_UBO_THROUGH_OWNERSHIP = 'uboThroughOwnership'; public const TYPE_ULTIMATE_PARENT_COMPANY = 'ultimateParentCompany'; public const TYPE_UNDEFINED_BENEFICIARY = 'undefinedBeneficiary'; + public const TYPE_UNINCORPORATED_PARTNERSHIP = 'unincorporatedPartnership'; /** * Gets allowable values of the enum @@ -288,6 +290,7 @@ public function getTypeAllowableValues() self::TYPE_LEGAL_REPRESENTATIVE, self::TYPE_PCI_SIGNATORY, self::TYPE_PROTECTOR, + self::TYPE_SECONDARY_PARTNER, self::TYPE_SECONDARY_TRUSTEE, self::TYPE_SETTLOR, self::TYPE_SIGNATORY, @@ -298,6 +301,7 @@ public function getTypeAllowableValues() self::TYPE_UBO_THROUGH_OWNERSHIP, self::TYPE_ULTIMATE_PARENT_COMPANY, self::TYPE_UNDEFINED_BENEFICIARY, + self::TYPE_UNINCORPORATED_PARTNERSHIP, ]; } /** @@ -539,7 +543,7 @@ public function getSettlorExemptionReason() /** * Sets settlorExemptionReason * - * @param string[]|null $settlorExemptionReason Defines the Kyc Exemption Reason for a Settlor associated with a trust. For example, **professionalServiceProvider**, **deceased**, or **contributionBelowThreshold**. + * @param string[]|null $settlorExemptionReason Defines the KYC exemption reason for a settlor associated with a trust. Only applicable to trusts in Australia. For example, **professionalServiceProvider**, **deceased**, or **contributionBelowThreshold**. * * @return self */ @@ -563,7 +567,7 @@ public function getType() /** * Sets type * - * @param string $type Defines the relationship of the legal entity to the current legal entity. Possible value for individuals: **legalRepresentative**. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **director**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. Possible value for trusts: **trust**. Possible values for trust members: **definedBeneficiary**, **protector**, **secondaryTrustee**, **settlor**, **uboThroughControl**, or **uboThroughOwnership**. + * @param string $type Defines the relationship of the legal entity to the current legal entity. Possible value for individuals: **legalRepresentative**. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **director**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. Possible value for trusts: **trust**. Possible values for trust members: **definedBeneficiary**, **protector**, **secondaryTrustee**, **settlor**, **uboThroughControl**, or **uboThroughOwnership**. Possible value for unincorporated partnership: **unincorporatedPartnership**. Possible values for unincorporated partnership members: **secondaryPartner**, **uboThroughControl**, **uboThroughOwnership** * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/LegalEntityInfo.php b/src/Adyen/Model/LegalEntityManagement/LegalEntityInfo.php index 5f52c1576..b672aafd2 100644 --- a/src/Adyen/Model/LegalEntityManagement/LegalEntityInfo.php +++ b/src/Adyen/Model/LegalEntityManagement/LegalEntityInfo.php @@ -52,6 +52,7 @@ class LegalEntityInfo implements ModelInterface, ArrayAccess, \JsonSerializable 'soleProprietorship' => '\Adyen\Model\LegalEntityManagement\SoleProprietorship', 'trust' => '\Adyen\Model\LegalEntityManagement\Trust', 'type' => 'string', + 'unincorporatedPartnership' => '\Adyen\Model\LegalEntityManagement\UnincorporatedPartnership', 'verificationPlan' => 'string' ]; @@ -71,6 +72,7 @@ class LegalEntityInfo implements ModelInterface, ArrayAccess, \JsonSerializable 'soleProprietorship' => null, 'trust' => null, 'type' => null, + 'unincorporatedPartnership' => null, 'verificationPlan' => null ]; @@ -88,6 +90,7 @@ class LegalEntityInfo implements ModelInterface, ArrayAccess, \JsonSerializable 'soleProprietorship' => false, 'trust' => false, 'type' => false, + 'unincorporatedPartnership' => false, 'verificationPlan' => false ]; @@ -185,6 +188,7 @@ public function isNullableSetToNull(string $property): bool 'soleProprietorship' => 'soleProprietorship', 'trust' => 'trust', 'type' => 'type', + 'unincorporatedPartnership' => 'unincorporatedPartnership', 'verificationPlan' => 'verificationPlan' ]; @@ -202,6 +206,7 @@ public function isNullableSetToNull(string $property): bool 'soleProprietorship' => 'setSoleProprietorship', 'trust' => 'setTrust', 'type' => 'setType', + 'unincorporatedPartnership' => 'setUnincorporatedPartnership', 'verificationPlan' => 'setVerificationPlan' ]; @@ -219,6 +224,7 @@ public function isNullableSetToNull(string $property): bool 'soleProprietorship' => 'getSoleProprietorship', 'trust' => 'getTrust', 'type' => 'getType', + 'unincorporatedPartnership' => 'getUnincorporatedPartnership', 'verificationPlan' => 'getVerificationPlan' ]; @@ -307,6 +313,7 @@ public function __construct(array $data = null) $this->setIfExists('soleProprietorship', $data ?? [], null); $this->setIfExists('trust', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('unincorporatedPartnership', $data ?? [], null); $this->setIfExists('verificationPlan', $data ?? [], null); } @@ -563,6 +570,30 @@ public function setType($type) return $this; } + /** + * Gets unincorporatedPartnership + * + * @return \Adyen\Model\LegalEntityManagement\UnincorporatedPartnership|null + */ + public function getUnincorporatedPartnership() + { + return $this->container['unincorporatedPartnership']; + } + + /** + * Sets unincorporatedPartnership + * + * @param \Adyen\Model\LegalEntityManagement\UnincorporatedPartnership|null $unincorporatedPartnership unincorporatedPartnership + * + * @return self + */ + public function setUnincorporatedPartnership($unincorporatedPartnership) + { + $this->container['unincorporatedPartnership'] = $unincorporatedPartnership; + + return $this; + } + /** * Gets verificationPlan * diff --git a/src/Adyen/Model/LegalEntityManagement/LegalEntityInfoRequiredType.php b/src/Adyen/Model/LegalEntityManagement/LegalEntityInfoRequiredType.php index 2c675ae22..6a33228d5 100644 --- a/src/Adyen/Model/LegalEntityManagement/LegalEntityInfoRequiredType.php +++ b/src/Adyen/Model/LegalEntityManagement/LegalEntityInfoRequiredType.php @@ -52,6 +52,7 @@ class LegalEntityInfoRequiredType implements ModelInterface, ArrayAccess, \JsonS 'soleProprietorship' => '\Adyen\Model\LegalEntityManagement\SoleProprietorship', 'trust' => '\Adyen\Model\LegalEntityManagement\Trust', 'type' => 'string', + 'unincorporatedPartnership' => '\Adyen\Model\LegalEntityManagement\UnincorporatedPartnership', 'verificationPlan' => 'string' ]; @@ -71,6 +72,7 @@ class LegalEntityInfoRequiredType implements ModelInterface, ArrayAccess, \JsonS 'soleProprietorship' => null, 'trust' => null, 'type' => null, + 'unincorporatedPartnership' => null, 'verificationPlan' => null ]; @@ -88,6 +90,7 @@ class LegalEntityInfoRequiredType implements ModelInterface, ArrayAccess, \JsonS 'soleProprietorship' => false, 'trust' => false, 'type' => false, + 'unincorporatedPartnership' => false, 'verificationPlan' => false ]; @@ -185,6 +188,7 @@ public function isNullableSetToNull(string $property): bool 'soleProprietorship' => 'soleProprietorship', 'trust' => 'trust', 'type' => 'type', + 'unincorporatedPartnership' => 'unincorporatedPartnership', 'verificationPlan' => 'verificationPlan' ]; @@ -202,6 +206,7 @@ public function isNullableSetToNull(string $property): bool 'soleProprietorship' => 'setSoleProprietorship', 'trust' => 'setTrust', 'type' => 'setType', + 'unincorporatedPartnership' => 'setUnincorporatedPartnership', 'verificationPlan' => 'setVerificationPlan' ]; @@ -219,6 +224,7 @@ public function isNullableSetToNull(string $property): bool 'soleProprietorship' => 'getSoleProprietorship', 'trust' => 'getTrust', 'type' => 'getType', + 'unincorporatedPartnership' => 'getUnincorporatedPartnership', 'verificationPlan' => 'getVerificationPlan' ]; @@ -307,6 +313,7 @@ public function __construct(array $data = null) $this->setIfExists('soleProprietorship', $data ?? [], null); $this->setIfExists('trust', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('unincorporatedPartnership', $data ?? [], null); $this->setIfExists('verificationPlan', $data ?? [], null); } @@ -566,6 +573,30 @@ public function setType($type) return $this; } + /** + * Gets unincorporatedPartnership + * + * @return \Adyen\Model\LegalEntityManagement\UnincorporatedPartnership|null + */ + public function getUnincorporatedPartnership() + { + return $this->container['unincorporatedPartnership']; + } + + /** + * Sets unincorporatedPartnership + * + * @param \Adyen\Model\LegalEntityManagement\UnincorporatedPartnership|null $unincorporatedPartnership unincorporatedPartnership + * + * @return self + */ + public function setUnincorporatedPartnership($unincorporatedPartnership) + { + $this->container['unincorporatedPartnership'] = $unincorporatedPartnership; + + return $this; + } + /** * Gets verificationPlan * 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/OnboardingLinkSettings.php b/src/Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.php index 23fcae758..4149ba9df 100644 --- a/src/Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.php +++ b/src/Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.php @@ -49,6 +49,7 @@ class OnboardingLinkSettings implements ModelInterface, ArrayAccess, \JsonSerial 'allowIntraRegionCrossBorderPayout' => 'bool', 'changeLegalEntityType' => 'bool', 'editPrefilledCountry' => 'bool', + 'enforceLegalAge' => 'bool', 'hideOnboardingIntroductionIndividual' => 'bool', 'hideOnboardingIntroductionOrganization' => 'bool', 'hideOnboardingIntroductionSoleProprietor' => 'bool', @@ -74,6 +75,7 @@ class OnboardingLinkSettings implements ModelInterface, ArrayAccess, \JsonSerial 'allowIntraRegionCrossBorderPayout' => null, 'changeLegalEntityType' => null, 'editPrefilledCountry' => null, + 'enforceLegalAge' => null, 'hideOnboardingIntroductionIndividual' => null, 'hideOnboardingIntroductionOrganization' => null, 'hideOnboardingIntroductionSoleProprietor' => null, @@ -97,6 +99,7 @@ class OnboardingLinkSettings implements ModelInterface, ArrayAccess, \JsonSerial 'allowIntraRegionCrossBorderPayout' => false, 'changeLegalEntityType' => false, 'editPrefilledCountry' => false, + 'enforceLegalAge' => false, 'hideOnboardingIntroductionIndividual' => false, 'hideOnboardingIntroductionOrganization' => false, 'hideOnboardingIntroductionSoleProprietor' => false, @@ -200,6 +203,7 @@ public function isNullableSetToNull(string $property): bool 'allowIntraRegionCrossBorderPayout' => 'allowIntraRegionCrossBorderPayout', 'changeLegalEntityType' => 'changeLegalEntityType', 'editPrefilledCountry' => 'editPrefilledCountry', + 'enforceLegalAge' => 'enforceLegalAge', 'hideOnboardingIntroductionIndividual' => 'hideOnboardingIntroductionIndividual', 'hideOnboardingIntroductionOrganization' => 'hideOnboardingIntroductionOrganization', 'hideOnboardingIntroductionSoleProprietor' => 'hideOnboardingIntroductionSoleProprietor', @@ -223,6 +227,7 @@ public function isNullableSetToNull(string $property): bool 'allowIntraRegionCrossBorderPayout' => 'setAllowIntraRegionCrossBorderPayout', 'changeLegalEntityType' => 'setChangeLegalEntityType', 'editPrefilledCountry' => 'setEditPrefilledCountry', + 'enforceLegalAge' => 'setEnforceLegalAge', 'hideOnboardingIntroductionIndividual' => 'setHideOnboardingIntroductionIndividual', 'hideOnboardingIntroductionOrganization' => 'setHideOnboardingIntroductionOrganization', 'hideOnboardingIntroductionSoleProprietor' => 'setHideOnboardingIntroductionSoleProprietor', @@ -246,6 +251,7 @@ public function isNullableSetToNull(string $property): bool 'allowIntraRegionCrossBorderPayout' => 'getAllowIntraRegionCrossBorderPayout', 'changeLegalEntityType' => 'getChangeLegalEntityType', 'editPrefilledCountry' => 'getEditPrefilledCountry', + 'enforceLegalAge' => 'getEnforceLegalAge', 'hideOnboardingIntroductionIndividual' => 'getHideOnboardingIntroductionIndividual', 'hideOnboardingIntroductionOrganization' => 'getHideOnboardingIntroductionOrganization', 'hideOnboardingIntroductionSoleProprietor' => 'getHideOnboardingIntroductionSoleProprietor', @@ -320,6 +326,7 @@ public function __construct(array $data = null) $this->setIfExists('allowIntraRegionCrossBorderPayout', $data ?? [], null); $this->setIfExists('changeLegalEntityType', $data ?? [], null); $this->setIfExists('editPrefilledCountry', $data ?? [], null); + $this->setIfExists('enforceLegalAge', $data ?? [], null); $this->setIfExists('hideOnboardingIntroductionIndividual', $data ?? [], null); $this->setIfExists('hideOnboardingIntroductionOrganization', $data ?? [], null); $this->setIfExists('hideOnboardingIntroductionSoleProprietor', $data ?? [], null); @@ -494,6 +501,30 @@ public function setEditPrefilledCountry($editPrefilledCountry) return $this; } + /** + * Gets enforceLegalAge + * + * @return bool|null + */ + public function getEnforceLegalAge() + { + return $this->container['enforceLegalAge']; + } + + /** + * Sets enforceLegalAge + * + * @param bool|null $enforceLegalAge Default value: **false** Indicates if only users above the age of 18 can be onboarded. + * + * @return self + */ + public function setEnforceLegalAge($enforceLegalAge) + { + $this->container['enforceLegalAge'] = $enforceLegalAge; + + return $this; + } + /** * Gets hideOnboardingIntroductionIndividual * diff --git a/src/Adyen/Model/LegalEntityManagement/PhoneNumber.php b/src/Adyen/Model/LegalEntityManagement/PhoneNumber.php index a01b31eb9..3c9c644c0 100644 --- a/src/Adyen/Model/LegalEntityManagement/PhoneNumber.php +++ b/src/Adyen/Model/LegalEntityManagement/PhoneNumber.php @@ -45,6 +45,7 @@ class PhoneNumber implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'number' => 'string', + 'phoneCountryCode' => 'string', 'type' => 'string' ]; @@ -57,6 +58,7 @@ class PhoneNumber implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'number' => null, + 'phoneCountryCode' => null, 'type' => null ]; @@ -67,6 +69,7 @@ class PhoneNumber implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'number' => false, + 'phoneCountryCode' => false, 'type' => false ]; @@ -157,6 +160,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'number' => 'number', + 'phoneCountryCode' => 'phoneCountryCode', 'type' => 'type' ]; @@ -167,6 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'number' => 'setNumber', + 'phoneCountryCode' => 'setPhoneCountryCode', 'type' => 'setType' ]; @@ -177,6 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'number' => 'getNumber', + 'phoneCountryCode' => 'getPhoneCountryCode', 'type' => 'getType' ]; @@ -238,6 +244,7 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('phoneCountryCode', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -310,6 +317,30 @@ public function setNumber($number) return $this; } + /** + * Gets phoneCountryCode + * + * @return string|null + */ + public function getPhoneCountryCode() + { + return $this->container['phoneCountryCode']; + } + + /** + * Sets phoneCountryCode + * + * @param string|null $phoneCountryCode The two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code prefix of the phone number. For example, **US** or **NL**. The value of the `phoneCountryCode` is determined by the country code digit(s) of `phone.number` + * + * @return self + */ + public function setPhoneCountryCode($phoneCountryCode) + { + $this->container['phoneCountryCode'] = $phoneCountryCode; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/LegalEntityManagement/Trust.php b/src/Adyen/Model/LegalEntityManagement/Trust.php index b6b425ff0..2362049c0 100644 --- a/src/Adyen/Model/LegalEntityManagement/Trust.php +++ b/src/Adyen/Model/LegalEntityManagement/Trust.php @@ -46,12 +46,12 @@ class Trust implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'countryOfGoverningLaw' => 'string', 'dateOfIncorporation' => 'string', + 'description' => 'string', 'doingBusinessAs' => 'string', 'name' => 'string', 'principalPlaceOfBusiness' => '\Adyen\Model\LegalEntityManagement\Address', 'registeredAddress' => '\Adyen\Model\LegalEntityManagement\Address', 'registrationNumber' => 'string', - 'taxAbsent' => 'bool', 'taxInformation' => '\Adyen\Model\LegalEntityManagement\TaxInformation[]', 'type' => 'string', 'undefinedBeneficiaryInfo' => '\Adyen\Model\LegalEntityManagement\UndefinedBeneficiary[]', @@ -69,12 +69,12 @@ class Trust implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'countryOfGoverningLaw' => null, 'dateOfIncorporation' => null, + 'description' => null, 'doingBusinessAs' => null, 'name' => null, 'principalPlaceOfBusiness' => null, 'registeredAddress' => null, 'registrationNumber' => null, - 'taxAbsent' => null, 'taxInformation' => null, 'type' => null, 'undefinedBeneficiaryInfo' => null, @@ -90,12 +90,12 @@ class Trust implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPINullables = [ 'countryOfGoverningLaw' => false, 'dateOfIncorporation' => false, + 'description' => false, 'doingBusinessAs' => false, 'name' => false, 'principalPlaceOfBusiness' => false, 'registeredAddress' => false, 'registrationNumber' => false, - 'taxAbsent' => true, 'taxInformation' => false, 'type' => false, 'undefinedBeneficiaryInfo' => false, @@ -191,12 +191,12 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'countryOfGoverningLaw' => 'countryOfGoverningLaw', 'dateOfIncorporation' => 'dateOfIncorporation', + 'description' => 'description', 'doingBusinessAs' => 'doingBusinessAs', 'name' => 'name', 'principalPlaceOfBusiness' => 'principalPlaceOfBusiness', 'registeredAddress' => 'registeredAddress', 'registrationNumber' => 'registrationNumber', - 'taxAbsent' => 'taxAbsent', 'taxInformation' => 'taxInformation', 'type' => 'type', 'undefinedBeneficiaryInfo' => 'undefinedBeneficiaryInfo', @@ -212,12 +212,12 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'countryOfGoverningLaw' => 'setCountryOfGoverningLaw', 'dateOfIncorporation' => 'setDateOfIncorporation', + 'description' => 'setDescription', 'doingBusinessAs' => 'setDoingBusinessAs', 'name' => 'setName', 'principalPlaceOfBusiness' => 'setPrincipalPlaceOfBusiness', 'registeredAddress' => 'setRegisteredAddress', 'registrationNumber' => 'setRegistrationNumber', - 'taxAbsent' => 'setTaxAbsent', 'taxInformation' => 'setTaxInformation', 'type' => 'setType', 'undefinedBeneficiaryInfo' => 'setUndefinedBeneficiaryInfo', @@ -233,12 +233,12 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'countryOfGoverningLaw' => 'getCountryOfGoverningLaw', 'dateOfIncorporation' => 'getDateOfIncorporation', + 'description' => 'getDescription', 'doingBusinessAs' => 'getDoingBusinessAs', 'name' => 'getName', 'principalPlaceOfBusiness' => 'getPrincipalPlaceOfBusiness', 'registeredAddress' => 'getRegisteredAddress', 'registrationNumber' => 'getRegistrationNumber', - 'taxAbsent' => 'getTaxAbsent', 'taxInformation' => 'getTaxInformation', 'type' => 'getType', 'undefinedBeneficiaryInfo' => 'getUndefinedBeneficiaryInfo', @@ -287,12 +287,16 @@ public function getModelName() return self::$openAPIModelName; } + public const TYPE_BUSINESS_TRUST = 'businessTrust'; public const TYPE_CASH_MANAGEMENT_TRUST = 'cashManagementTrust'; + public const TYPE_CHARITABLE_TRUST = 'charitableTrust'; public const TYPE_CORPORATE_UNIT_TRUST = 'corporateUnitTrust'; public const TYPE_DECEASED_ESTATE = 'deceasedEstate'; + public const TYPE_DISCRETIONARY_TRUST = 'discretionaryTrust'; public const TYPE_DISCRETIONARY_INVESTMENT_TRUST = 'discretionaryInvestmentTrust'; public const TYPE_DISCRETIONARY_SERVICES_MANAGEMENT_TRUST = 'discretionaryServicesManagementTrust'; public const TYPE_DISCRETIONARY_TRADING_TRUST = 'discretionaryTradingTrust'; + public const TYPE_FAMILY_TRUST = 'familyTrust'; public const TYPE_FIRST_HOME_SAVER_ACCOUNTS_TRUST = 'firstHomeSaverAccountsTrust'; public const TYPE_FIXED_TRUST = 'fixedTrust'; public const TYPE_FIXED_UNIT_TRUST = 'fixedUnitTrust'; @@ -313,12 +317,16 @@ public function getModelName() public function getTypeAllowableValues() { return [ + self::TYPE_BUSINESS_TRUST, self::TYPE_CASH_MANAGEMENT_TRUST, + self::TYPE_CHARITABLE_TRUST, self::TYPE_CORPORATE_UNIT_TRUST, self::TYPE_DECEASED_ESTATE, + self::TYPE_DISCRETIONARY_TRUST, self::TYPE_DISCRETIONARY_INVESTMENT_TRUST, self::TYPE_DISCRETIONARY_SERVICES_MANAGEMENT_TRUST, self::TYPE_DISCRETIONARY_TRADING_TRUST, + self::TYPE_FAMILY_TRUST, self::TYPE_FIRST_HOME_SAVER_ACCOUNTS_TRUST, self::TYPE_FIXED_TRUST, self::TYPE_FIXED_UNIT_TRUST, @@ -359,12 +367,12 @@ public function __construct(array $data = null) { $this->setIfExists('countryOfGoverningLaw', $data ?? [], null); $this->setIfExists('dateOfIncorporation', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); $this->setIfExists('doingBusinessAs', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); $this->setIfExists('principalPlaceOfBusiness', $data ?? [], null); $this->setIfExists('registeredAddress', $data ?? [], null); $this->setIfExists('registrationNumber', $data ?? [], null); - $this->setIfExists('taxAbsent', $data ?? [], null); $this->setIfExists('taxInformation', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('undefinedBeneficiaryInfo', $data ?? [], null); @@ -492,6 +500,30 @@ public function setDateOfIncorporation($dateOfIncorporation) return $this; } + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A short description about the trust. Only applicable for charitable trusts in New Zealand. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + /** * Gets doingBusinessAs * @@ -612,40 +644,6 @@ public function setRegistrationNumber($registrationNumber) return $this; } - /** - * Gets taxAbsent - * - * @return bool|null - */ - public function getTaxAbsent() - { - return $this->container['taxAbsent']; - } - - /** - * Sets taxAbsent - * - * @param bool|null $taxAbsent The tax information is absent. - * - * @return self - */ - public function setTaxAbsent($taxAbsent) - { - if (is_null($taxAbsent)) { - array_push($this->openAPINullablesSetToNull, 'taxAbsent'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('taxAbsent', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['taxAbsent'] = $taxAbsent; - - return $this; - } - /** * Gets taxInformation * @@ -683,7 +681,7 @@ public function getType() /** * Sets type * - * @param string $type Type of trust. Possible values for Australian trusts: **cashManagementTrust**, **corporateUnitTrust**, **deceasedEstate**, **discretionaryInvestmentTrust**, **discretionaryServicesManagementTrust**, **discretionaryTradingTrust**, **firstHomeSaverAccountsTrust**, **fixedTrust**, **fixedUnitTrust**, **hybridTrust**, **listedPublicUnitTrust**, **otherTrust**, **pooledSuperannuationTrust**, **publicTradingTrust**, **unlistedPublicUnitTrust**. + * @param string $type Type of trust. See possible values for trusts in [Australia](https://docs.adyen.com/platforms/verification-requirements/?tab=trust_3_4#trust-types-in-australia) and [New Zealand](https://docs.adyen.com/platforms/verification-requirements/?tab=trust_3_4#trust-types-in-new-zealand). * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/UnincorporatedPartnership.php b/src/Adyen/Model/LegalEntityManagement/UnincorporatedPartnership.php new file mode 100644 index 000000000..b0227e76a --- /dev/null +++ b/src/Adyen/Model/LegalEntityManagement/UnincorporatedPartnership.php @@ -0,0 +1,875 @@ + + */ +class UnincorporatedPartnership implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UnincorporatedPartnership'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'countryOfGoverningLaw' => 'string', + 'dateOfIncorporation' => 'string', + 'description' => 'string', + 'doingBusinessAs' => 'string', + 'name' => 'string', + 'principalPlaceOfBusiness' => '\Adyen\Model\LegalEntityManagement\Address', + 'registeredAddress' => '\Adyen\Model\LegalEntityManagement\Address', + 'registrationNumber' => 'string', + 'taxInformation' => '\Adyen\Model\LegalEntityManagement\TaxInformation[]', + 'type' => 'string', + 'vatAbsenceReason' => 'string', + 'vatNumber' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'countryOfGoverningLaw' => null, + 'dateOfIncorporation' => null, + 'description' => null, + 'doingBusinessAs' => null, + 'name' => null, + 'principalPlaceOfBusiness' => null, + 'registeredAddress' => null, + 'registrationNumber' => null, + 'taxInformation' => null, + 'type' => null, + 'vatAbsenceReason' => null, + 'vatNumber' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'countryOfGoverningLaw' => false, + 'dateOfIncorporation' => false, + 'description' => false, + 'doingBusinessAs' => false, + 'name' => false, + 'principalPlaceOfBusiness' => false, + 'registeredAddress' => false, + 'registrationNumber' => false, + 'taxInformation' => false, + 'type' => false, + 'vatAbsenceReason' => false, + 'vatNumber' => 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 = [ + 'countryOfGoverningLaw' => 'countryOfGoverningLaw', + 'dateOfIncorporation' => 'dateOfIncorporation', + 'description' => 'description', + 'doingBusinessAs' => 'doingBusinessAs', + 'name' => 'name', + 'principalPlaceOfBusiness' => 'principalPlaceOfBusiness', + 'registeredAddress' => 'registeredAddress', + 'registrationNumber' => 'registrationNumber', + 'taxInformation' => 'taxInformation', + 'type' => 'type', + 'vatAbsenceReason' => 'vatAbsenceReason', + 'vatNumber' => 'vatNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'countryOfGoverningLaw' => 'setCountryOfGoverningLaw', + 'dateOfIncorporation' => 'setDateOfIncorporation', + 'description' => 'setDescription', + 'doingBusinessAs' => 'setDoingBusinessAs', + 'name' => 'setName', + 'principalPlaceOfBusiness' => 'setPrincipalPlaceOfBusiness', + 'registeredAddress' => 'setRegisteredAddress', + 'registrationNumber' => 'setRegistrationNumber', + 'taxInformation' => 'setTaxInformation', + 'type' => 'setType', + 'vatAbsenceReason' => 'setVatAbsenceReason', + 'vatNumber' => 'setVatNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'countryOfGoverningLaw' => 'getCountryOfGoverningLaw', + 'dateOfIncorporation' => 'getDateOfIncorporation', + 'description' => 'getDescription', + 'doingBusinessAs' => 'getDoingBusinessAs', + 'name' => 'getName', + 'principalPlaceOfBusiness' => 'getPrincipalPlaceOfBusiness', + 'registeredAddress' => 'getRegisteredAddress', + 'registrationNumber' => 'getRegistrationNumber', + 'taxInformation' => 'getTaxInformation', + 'type' => 'getType', + 'vatAbsenceReason' => 'getVatAbsenceReason', + 'vatNumber' => 'getVatNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_LIMITED_PARTNERSHIP = 'limitedPartnership'; + public const TYPE_GENERAL_PARTNERSHIP = 'generalPartnership'; + public const TYPE_FAMILY_PARTNERSHIP = 'familyPartnership'; + public const TYPE_COMMERCIAL_PARTNERSHIP = 'commercialPartnership'; + public const TYPE_PUBLIC_PARTNERSHIP = 'publicPartnership'; + public const TYPE_OTHER_PARTNERSHIP = 'otherPartnership'; + public const TYPE_GBR = 'gbr'; + public const TYPE_GMBH = 'gmbh'; + public const TYPE_KGAA = 'kgaa'; + public const TYPE_CV = 'cv'; + public const TYPE_VOF = 'vof'; + public const TYPE_MAATSCHAP = 'maatschap'; + public const TYPE_PRIVATE_FUND_LIMITED_PARTNERSHIP = 'privateFundLimitedPartnership'; + public const TYPE_BUSINESS_TRUST_ENTITY = 'businessTrustEntity'; + public const TYPE_BUSINESS_PARTNERSHIP = 'businessPartnership'; + public const TYPE_LIMITED_LIABILITY_PARTNERSHIP = 'limitedLiabilityPartnership'; + public const TYPE_EG = 'eg'; + public const TYPE_COOPERATIVE = 'cooperative'; + public const TYPE_VOS = 'vos'; + public const TYPE_COMUNIDAD_DE_BIENES = 'comunidadDeBienes'; + public const TYPE_HERENCIA_YACENTE = 'herenciaYacente'; + public const TYPE_COMUNIDAD_DE_PROPIETARIOS = 'comunidadDePropietarios'; + public const TYPE_SEP = 'sep'; + public const TYPE_SCA = 'sca'; + public const TYPE_BT = 'bt'; + public const TYPE_KKT = 'kkt'; + public const TYPE_SCS = 'scs'; + public const TYPE_SNC = 'snc'; + public const VAT_ABSENCE_REASON_INDUSTRY_EXEMPTION = 'industryExemption'; + public const VAT_ABSENCE_REASON_BELOW_TAX_THRESHOLD = 'belowTaxThreshold'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_LIMITED_PARTNERSHIP, + self::TYPE_GENERAL_PARTNERSHIP, + self::TYPE_FAMILY_PARTNERSHIP, + self::TYPE_COMMERCIAL_PARTNERSHIP, + self::TYPE_PUBLIC_PARTNERSHIP, + self::TYPE_OTHER_PARTNERSHIP, + self::TYPE_GBR, + self::TYPE_GMBH, + self::TYPE_KGAA, + self::TYPE_CV, + self::TYPE_VOF, + self::TYPE_MAATSCHAP, + self::TYPE_PRIVATE_FUND_LIMITED_PARTNERSHIP, + self::TYPE_BUSINESS_TRUST_ENTITY, + self::TYPE_BUSINESS_PARTNERSHIP, + self::TYPE_LIMITED_LIABILITY_PARTNERSHIP, + self::TYPE_EG, + self::TYPE_COOPERATIVE, + self::TYPE_VOS, + self::TYPE_COMUNIDAD_DE_BIENES, + self::TYPE_HERENCIA_YACENTE, + self::TYPE_COMUNIDAD_DE_PROPIETARIOS, + self::TYPE_SEP, + self::TYPE_SCA, + self::TYPE_BT, + self::TYPE_KKT, + self::TYPE_SCS, + self::TYPE_SNC, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getVatAbsenceReasonAllowableValues() + { + return [ + self::VAT_ABSENCE_REASON_INDUSTRY_EXEMPTION, + self::VAT_ABSENCE_REASON_BELOW_TAX_THRESHOLD, + ]; + } + /** + * 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('countryOfGoverningLaw', $data ?? [], null); + $this->setIfExists('dateOfIncorporation', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('doingBusinessAs', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('principalPlaceOfBusiness', $data ?? [], null); + $this->setIfExists('registeredAddress', $data ?? [], null); + $this->setIfExists('registrationNumber', $data ?? [], null); + $this->setIfExists('taxInformation', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('vatAbsenceReason', $data ?? [], null); + $this->setIfExists('vatNumber', $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['countryOfGoverningLaw'] === null) { + $invalidProperties[] = "'countryOfGoverningLaw' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['registeredAddress'] === null) { + $invalidProperties[] = "'registeredAddress' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getVatAbsenceReasonAllowableValues(); + if (!is_null($this->container['vatAbsenceReason']) && !in_array($this->container['vatAbsenceReason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'vatAbsenceReason', must be one of '%s'", + $this->container['vatAbsenceReason'], + 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 countryOfGoverningLaw + * + * @return string + */ + public function getCountryOfGoverningLaw() + { + return $this->container['countryOfGoverningLaw']; + } + + /** + * Sets countryOfGoverningLaw + * + * @param string $countryOfGoverningLaw The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the governing country. + * + * @return self + */ + public function setCountryOfGoverningLaw($countryOfGoverningLaw) + { + $this->container['countryOfGoverningLaw'] = $countryOfGoverningLaw; + + return $this; + } + + /** + * Gets dateOfIncorporation + * + * @return string|null + */ + public function getDateOfIncorporation() + { + return $this->container['dateOfIncorporation']; + } + + /** + * Sets dateOfIncorporation + * + * @param string|null $dateOfIncorporation The date when the legal arrangement was incorporated in YYYY-MM-DD format. + * + * @return self + */ + public function setDateOfIncorporation($dateOfIncorporation) + { + $this->container['dateOfIncorporation'] = $dateOfIncorporation; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Short description about the Legal Arrangement. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets doingBusinessAs + * + * @return string|null + */ + public function getDoingBusinessAs() + { + return $this->container['doingBusinessAs']; + } + + /** + * Sets doingBusinessAs + * + * @param string|null $doingBusinessAs The registered name, if different from the `name`. + * + * @return self + */ + public function setDoingBusinessAs($doingBusinessAs) + { + $this->container['doingBusinessAs'] = $doingBusinessAs; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The legal name. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets principalPlaceOfBusiness + * + * @return \Adyen\Model\LegalEntityManagement\Address|null + */ + public function getPrincipalPlaceOfBusiness() + { + return $this->container['principalPlaceOfBusiness']; + } + + /** + * Sets principalPlaceOfBusiness + * + * @param \Adyen\Model\LegalEntityManagement\Address|null $principalPlaceOfBusiness principalPlaceOfBusiness + * + * @return self + */ + public function setPrincipalPlaceOfBusiness($principalPlaceOfBusiness) + { + $this->container['principalPlaceOfBusiness'] = $principalPlaceOfBusiness; + + return $this; + } + + /** + * Gets registeredAddress + * + * @return \Adyen\Model\LegalEntityManagement\Address + */ + public function getRegisteredAddress() + { + return $this->container['registeredAddress']; + } + + /** + * Sets registeredAddress + * + * @param \Adyen\Model\LegalEntityManagement\Address $registeredAddress registeredAddress + * + * @return self + */ + public function setRegisteredAddress($registeredAddress) + { + $this->container['registeredAddress'] = $registeredAddress; + + return $this; + } + + /** + * Gets registrationNumber + * + * @return string|null + */ + public function getRegistrationNumber() + { + return $this->container['registrationNumber']; + } + + /** + * Sets registrationNumber + * + * @param string|null $registrationNumber The registration number. + * + * @return self + */ + public function setRegistrationNumber($registrationNumber) + { + $this->container['registrationNumber'] = $registrationNumber; + + return $this; + } + + /** + * Gets taxInformation + * + * @return \Adyen\Model\LegalEntityManagement\TaxInformation[]|null + */ + public function getTaxInformation() + { + return $this->container['taxInformation']; + } + + /** + * Sets taxInformation + * + * @param \Adyen\Model\LegalEntityManagement\TaxInformation[]|null $taxInformation The tax information of the entity. + * + * @return self + */ + public function setTaxInformation($taxInformation) + { + $this->container['taxInformation'] = $taxInformation; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Type of Partnership. Possible values: * **limitedPartnership** * **generalPartnership** * **familyPartnership** * **commercialPartnership** * **publicPartnership** * **otherPartnership** * **gbr** * **gmbh** * **kgaa** * **cv** * **vof** * **maatschap** * **privateFundLimitedPartnership** * **businessTrustEntity** * **businessPartnership** * **limitedLiabilityPartnership** * **eg** * **cooperative** * **vos** * **comunidadDeBienes** * **herenciaYacente** * **comunidadDePropietarios** * **sep** * **sca** * **bt** * **kkt** * **scs** * **snc** + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets vatAbsenceReason + * + * @return string|null + */ + public function getVatAbsenceReason() + { + return $this->container['vatAbsenceReason']; + } + + /** + * Sets vatAbsenceReason + * + * @param string|null $vatAbsenceReason The reason for not providing a VAT number. Possible values: **industryExemption**, **belowTaxThreshold**. + * + * @return self + */ + public function setVatAbsenceReason($vatAbsenceReason) + { + $allowedValues = $this->getVatAbsenceReasonAllowableValues(); + if (!in_array($vatAbsenceReason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'vatAbsenceReason', must be one of '%s'", + $vatAbsenceReason, + implode("', '", $allowedValues) + ) + ); + } + $this->container['vatAbsenceReason'] = $vatAbsenceReason; + + return $this; + } + + /** + * Gets vatNumber + * + * @return string|null + */ + public function getVatNumber() + { + return $this->container['vatNumber']; + } + + /** + * Sets vatNumber + * + * @param string|null $vatNumber The VAT number. + * + * @return self + */ + public function setVatNumber($vatNumber) + { + $this->container['vatNumber'] = $vatNumber; + + 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/AmexInfo.php b/src/Adyen/Model/Management/AmexInfo.php index 922eb29b4..10d62094e 100644 --- a/src/Adyen/Model/Management/AmexInfo.php +++ b/src/Adyen/Model/Management/AmexInfo.php @@ -331,7 +331,7 @@ public function getMidNumber() /** * Sets midNumber * - * @param string|null $midNumber MID (Merchant ID) number. Format: 10 numeric characters. Must be provided only when requesting `gatewayContract` or `paymentDesignatorContract` service levels. + * @param string|null $midNumber Merchant ID (MID) number. Format: 10 numeric characters. You must provide this field when you request `gatewayContract` or `paymentDesignatorContract` service levels. * * @return self */ @@ -355,7 +355,7 @@ public function getReuseMidNumber() /** * Sets reuseMidNumber * - * @param bool|null $reuseMidNumber Indicates whether the Amex Merchant ID is reused from a previously setup Amex payment method. This is only applicable for `gatewayContract` and `paymentDesignatorContract` service levels. The default value is `false`. + * @param bool|null $reuseMidNumber Indicates whether the Amex Merchant ID is reused from a previously setup Amex payment method. This is only applicable for `gatewayContract` and `paymentDesignatorContract` service levels. The default value is **false**. * * @return self */ @@ -379,7 +379,7 @@ public function getServiceLevel() /** * Sets serviceLevel * - * @param string $serviceLevel Specifies the service level (settlement type) of this payment method. Possible values: * **noContract** — Adyen holds the contract with American Express. * **gatewayContract** — American Express receives the settlement and handles disputes. They then pay out to the merchant directly. * **paymentDesignatorContract** — Adyen receives the settlement and handles disputes. Adyen then pays out to the merchant. + * @param string $serviceLevel Specifies the service level (settlement type) of this payment method. Possible values: * **noContract**: Adyen holds the contract with American Express. * **gatewayContract**: American Express receives the settlement and handles disputes, then pays out to you or your sub-merchant directly. * **paymentDesignatorContract**: Adyen receives the settlement, and handles disputes and payouts. * * @return self */ diff --git a/src/Adyen/Model/Management/DinersInfo.php b/src/Adyen/Model/Management/DinersInfo.php new file mode 100644 index 000000000..f063288b4 --- /dev/null +++ b/src/Adyen/Model/Management/DinersInfo.php @@ -0,0 +1,536 @@ + + */ +class DinersInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DinersInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'midNumber' => 'string', + 'reuseMidNumber' => 'bool', + 'serviceLevel' => 'string', + 'transactionDescription' => '\Adyen\Model\Management\TransactionDescriptionInfo' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'midNumber' => null, + 'reuseMidNumber' => null, + 'serviceLevel' => null, + 'transactionDescription' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'midNumber' => false, + 'reuseMidNumber' => false, + 'serviceLevel' => false, + 'transactionDescription' => 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 = [ + 'midNumber' => 'midNumber', + 'reuseMidNumber' => 'reuseMidNumber', + 'serviceLevel' => 'serviceLevel', + 'transactionDescription' => 'transactionDescription' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'midNumber' => 'setMidNumber', + 'reuseMidNumber' => 'setReuseMidNumber', + 'serviceLevel' => 'setServiceLevel', + 'transactionDescription' => 'setTransactionDescription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'midNumber' => 'getMidNumber', + 'reuseMidNumber' => 'getReuseMidNumber', + 'serviceLevel' => 'getServiceLevel', + 'transactionDescription' => 'getTransactionDescription' + ]; + + /** + * 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 SERVICE_LEVEL_NO_CONTRACT = 'noContract'; + public const SERVICE_LEVEL_GATEWAY_CONTRACT = 'gatewayContract'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getServiceLevelAllowableValues() + { + return [ + self::SERVICE_LEVEL_NO_CONTRACT, + self::SERVICE_LEVEL_GATEWAY_CONTRACT, + ]; + } + /** + * 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('midNumber', $data ?? [], null); + $this->setIfExists('reuseMidNumber', $data ?? [], null); + $this->setIfExists('serviceLevel', $data ?? [], null); + $this->setIfExists('transactionDescription', $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['reuseMidNumber'] === null) { + $invalidProperties[] = "'reuseMidNumber' can't be null"; + } + $allowedValues = $this->getServiceLevelAllowableValues(); + if (!is_null($this->container['serviceLevel']) && !in_array($this->container['serviceLevel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'serviceLevel', must be one of '%s'", + $this->container['serviceLevel'], + 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 midNumber + * + * @return string|null + */ + public function getMidNumber() + { + return $this->container['midNumber']; + } + + /** + * Sets midNumber + * + * @param string|null $midNumber MID (Merchant ID) number. Required for merchants operating in Japan. Format: 14 numeric characters. + * + * @return self + */ + public function setMidNumber($midNumber) + { + $this->container['midNumber'] = $midNumber; + + return $this; + } + + /** + * Gets reuseMidNumber + * + * @return bool + */ + public function getReuseMidNumber() + { + return $this->container['reuseMidNumber']; + } + + /** + * Sets reuseMidNumber + * + * @param bool $reuseMidNumber Indicates whether the JCB Merchant ID is reused from a previously configured JCB payment method. The default value is **false**. For merchants operating in Japan, this field is required and must be set to **true**. + * + * @return self + */ + public function setReuseMidNumber($reuseMidNumber) + { + $this->container['reuseMidNumber'] = $reuseMidNumber; + + return $this; + } + + /** + * Gets serviceLevel + * + * @return string|null + */ + public function getServiceLevel() + { + return $this->container['serviceLevel']; + } + + /** + * Sets serviceLevel + * + * @param string|null $serviceLevel Specifies the service level (settlement type) of this payment method. Required for merchants operating in Japan. Possible values: * **noContract**: Adyen holds the contract with JCB. * **gatewayContract**: JCB receives the settlement and handles disputes, then pays out to you or your sub-merchant directly. + * + * @return self + */ + public function setServiceLevel($serviceLevel) + { + $allowedValues = $this->getServiceLevelAllowableValues(); + if (!in_array($serviceLevel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'serviceLevel', must be one of '%s'", + $serviceLevel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['serviceLevel'] = $serviceLevel; + + 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) + { + $this->container['transactionDescription'] = $transactionDescription; + + 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/JCBInfo.php b/src/Adyen/Model/Management/JCBInfo.php index ee0d0678e..d87833d38 100644 --- a/src/Adyen/Model/Management/JCBInfo.php +++ b/src/Adyen/Model/Management/JCBInfo.php @@ -296,9 +296,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['serviceLevel'] === null) { - $invalidProperties[] = "'serviceLevel' can't be null"; - } $allowedValues = $this->getServiceLevelAllowableValues(); if (!is_null($this->container['serviceLevel']) && !in_array($this->container['serviceLevel'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -336,7 +333,7 @@ public function getMidNumber() /** * Sets midNumber * - * @param string|null $midNumber MID (Merchant ID) number. Format: 10 numeric characters. Must be provided for both `noContract` and `gatewayContract` service levels. + * @param string|null $midNumber MID (Merchant ID) number. Required for merchants operating in Japan.Format: 14 numeric characters. * * @return self */ @@ -360,7 +357,7 @@ public function getReuseMidNumber() /** * Sets reuseMidNumber * - * @param bool|null $reuseMidNumber Indicates whether the JCB Merchant ID is reused from a previously setup JCB payment method. This is applicable for both `noContract` and `gatewayContract` service levels. The default value is `false`. + * @param bool|null $reuseMidNumber Indicates whether the JCB Merchant ID is reused from a previously setup JCB payment method. The default value is **false**.For merchants operating in Japan, this field is required and must be set to **true**. * * @return self */ @@ -374,7 +371,7 @@ public function setReuseMidNumber($reuseMidNumber) /** * Gets serviceLevel * - * @return string + * @return string|null */ public function getServiceLevel() { @@ -384,7 +381,7 @@ public function getServiceLevel() /** * Sets serviceLevel * - * @param string $serviceLevel Specifies the service level (settlement type) of this payment method. Possible values: * **noContract** — Adyen holds the contract with JCB. * **gatewayContract** — JCB receives the settlement and handles disputes. They then pay out to the merchant directly. + * @param string|null $serviceLevel Specifies the service level (settlement type) of this payment method. Required for merchants operating in Japan. Possible values: * **noContract**: Adyen holds the contract with JCB. * **gatewayContract**: JCB receives the settlement and handles disputes, then pays out to you or your sub-merchant directly. * * @return self */ 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 8e0695acb..4779da28a 100644 --- a/src/Adyen/Model/Management/PaymentMethod.php +++ b/src/Adyen/Model/Management/PaymentMethod.php @@ -57,7 +57,7 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'cup' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'currencies' => 'string[]', 'customRoutingFlags' => 'string[]', - 'diners' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'diners' => '\Adyen\Model\Management\DinersInfo', 'discover' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'eftposAustralia' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'enabled' => 'bool', @@ -943,7 +943,7 @@ public function setCustomRoutingFlags($customRoutingFlags) /** * Gets diners * - * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + * @return \Adyen\Model\Management\DinersInfo|null */ public function getDiners() { @@ -953,7 +953,7 @@ public function getDiners() /** * Sets diners * - * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $diners diners + * @param \Adyen\Model\Management\DinersInfo|null $diners diners * * @return self */ diff --git a/src/Adyen/Model/Management/PaymentMethodResponse.php b/src/Adyen/Model/Management/PaymentMethodResponse.php index 6811b47dd..bd4b5a82e 100644 --- a/src/Adyen/Model/Management/PaymentMethodResponse.php +++ b/src/Adyen/Model/Management/PaymentMethodResponse.php @@ -240,6 +240,7 @@ public function getModelName() } public const TYPES_WITH_ERRORS_ACCEL = 'accel'; + public const TYPES_WITH_ERRORS_AFFIRM = 'affirm'; public const TYPES_WITH_ERRORS_AFTERPAYTOUCH = 'afterpaytouch'; public const TYPES_WITH_ERRORS_ALELO = 'alelo'; public const TYPES_WITH_ERRORS_ALIPAY = 'alipay'; @@ -321,6 +322,7 @@ public function getTypesWithErrorsAllowableValues() { return [ self::TYPES_WITH_ERRORS_ACCEL, + self::TYPES_WITH_ERRORS_AFFIRM, self::TYPES_WITH_ERRORS_AFTERPAYTOUCH, self::TYPES_WITH_ERRORS_ALELO, self::TYPES_WITH_ERRORS_ALIPAY, diff --git a/src/Adyen/Model/Management/PaymentMethodSetupInfo.php b/src/Adyen/Model/Management/PaymentMethodSetupInfo.php index 43abf3320..f8e264955 100644 --- a/src/Adyen/Model/Management/PaymentMethodSetupInfo.php +++ b/src/Adyen/Model/Management/PaymentMethodSetupInfo.php @@ -56,7 +56,7 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'cup' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'currencies' => 'string[]', 'customRoutingFlags' => 'string[]', - 'diners' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'diners' => '\Adyen\Model\Management\DinersInfo', 'discover' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'eftposAustralia' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'giroPay' => '\Adyen\Model\Management\GiroPayInfo', @@ -472,6 +472,7 @@ public function getModelName() public const SHOPPER_INTERACTION_MOTO = 'moto'; public const SHOPPER_INTERACTION_CONT_AUTH = 'contAuth'; public const TYPE_ACCEL = 'accel'; + public const TYPE_AFFIRM = 'affirm'; public const TYPE_AFTERPAYTOUCH = 'afterpaytouch'; public const TYPE_ALELO = 'alelo'; public const TYPE_ALIPAY = 'alipay'; @@ -567,6 +568,7 @@ public function getTypeAllowableValues() { return [ self::TYPE_ACCEL, + self::TYPE_AFFIRM, self::TYPE_AFTERPAYTOUCH, self::TYPE_ALELO, self::TYPE_ALIPAY, @@ -1054,7 +1056,7 @@ public function setCustomRoutingFlags($customRoutingFlags) /** * Gets diners * - * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + * @return \Adyen\Model\Management\DinersInfo|null */ public function getDiners() { @@ -1064,7 +1066,7 @@ public function getDiners() /** * Sets diners * - * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $diners diners + * @param \Adyen\Model\Management\DinersInfo|null $diners diners * * @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/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/PaymentsApp/ObjectSerializer.php b/src/Adyen/Model/PaymentsApp/ObjectSerializer.php index b900dc2bd..56c51256a 100644 --- a/src/Adyen/Model/PaymentsApp/ObjectSerializer.php +++ b/src/Adyen/Model/PaymentsApp/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/Amount.php b/src/Adyen/Model/Recurring/Amount.php index 2816ba55f..dc5d26723 100644 --- a/src/Adyen/Model/Recurring/Amount.php +++ b/src/Adyen/Model/Recurring/Amount.php @@ -302,7 +302,7 @@ public function getCurrency() /** * Sets currency * - * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). * * @return self */ @@ -326,7 +326,7 @@ public function getValue() /** * Sets value * - * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * * @return self */ diff --git a/src/Adyen/Model/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/Amount.php b/src/Adyen/Model/TransactionWebhooks/Amount.php index 31428b4cd..a89617041 100644 --- a/src/Adyen/Model/TransactionWebhooks/Amount.php +++ b/src/Adyen/Model/TransactionWebhooks/Amount.php @@ -302,7 +302,7 @@ public function getCurrency() /** * Sets currency * - * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). * * @return self */ @@ -326,7 +326,7 @@ public function getValue() /** * Sets value * - * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * * @return self */ diff --git a/src/Adyen/Model/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/TransactionWebhooks/PlatformPayment.php b/src/Adyen/Model/TransactionWebhooks/PlatformPayment.php index 970ea9e03..ef0529a22 100644 --- a/src/Adyen/Model/TransactionWebhooks/PlatformPayment.php +++ b/src/Adyen/Model/TransactionWebhooks/PlatformPayment.php @@ -466,7 +466,7 @@ public function getPlatformPaymentType() /** * Sets platformPaymentType * - * @param string|null $platformPaymentType The type of the related split. + * @param string|null $platformPaymentType Specifies the nature of the transfer. This parameter helps categorize transfers so you can reconcile transactions at a later time, using the Balance Platform Accounting Report for [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) or [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). Possible values: * **AcquiringFees**: for the acquiring fee incurred on a transaction. * **AdyenCommission**: for the transaction fee due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). * **AdyenFees**: for all the transaction fees due to Adyen. This is the sum of Adyen's commission and Adyen's markup. * **AdyenMarkup**: for the transaction fee due to Adyen under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: or the sale amount of a transaction. * **Commission**: for your platform's commission on a transaction. * **Interchange**: for the interchange fee (fee paid to the issuer) incurred on a transaction. * **PaymentFee**: for all of the transaction fees. * **Remainder**: for the left over amount after currency conversion. * **SchemeFee**: for the scheme fee incurred on a transaction. This is the sum of the interchange fees and the acquiring fees. * **Surcharge**: for the surcharge paid by the customer on a transaction. * **Tip**: for the tip paid by the customer. * **TopUp**: for an incoming transfer to top up your user's balance account. * **VAT**: for the Value Added Tax. * * @return self */ diff --git a/src/Adyen/Model/TransactionWebhooks/TransactionNotificationRequestV4.php b/src/Adyen/Model/TransactionWebhooks/TransactionNotificationRequestV4.php index 45a416170..0eb23d446 100644 --- a/src/Adyen/Model/TransactionWebhooks/TransactionNotificationRequestV4.php +++ b/src/Adyen/Model/TransactionWebhooks/TransactionNotificationRequestV4.php @@ -46,6 +46,7 @@ class TransactionNotificationRequestV4 implements ModelInterface, ArrayAccess, \ protected static $openAPITypes = [ 'data' => '\Adyen\Model\TransactionWebhooks\Transaction', 'environment' => 'string', + 'timestamp' => '\DateTime', 'type' => 'string' ]; @@ -59,6 +60,7 @@ class TransactionNotificationRequestV4 implements ModelInterface, ArrayAccess, \ protected static $openAPIFormats = [ 'data' => null, 'environment' => null, + 'timestamp' => 'date-time', 'type' => null ]; @@ -70,6 +72,7 @@ class TransactionNotificationRequestV4 implements ModelInterface, ArrayAccess, \ protected static $openAPINullables = [ 'data' => false, 'environment' => false, + 'timestamp' => false, 'type' => false ]; @@ -161,6 +164,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'data' => 'data', 'environment' => 'environment', + 'timestamp' => 'timestamp', 'type' => 'type' ]; @@ -172,6 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'data' => 'setData', 'environment' => 'setEnvironment', + 'timestamp' => 'setTimestamp', 'type' => 'setType' ]; @@ -183,6 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'data' => 'getData', 'environment' => 'getEnvironment', + 'timestamp' => 'getTimestamp', 'type' => 'getType' ]; @@ -257,6 +263,7 @@ public function __construct(array $data = null) { $this->setIfExists('data', $data ?? [], null); $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -365,6 +372,30 @@ public function setEnvironment($environment) return $this; } + /** + * Gets timestamp + * + * @return \DateTime|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param \DateTime|null $timestamp When the event was queued. + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/TransactionWebhooks/TransferViewCategoryData.php b/src/Adyen/Model/TransactionWebhooks/TransferViewCategoryData.php index 366a91d4c..586fbcbe8 100644 --- a/src/Adyen/Model/TransactionWebhooks/TransferViewCategoryData.php +++ b/src/Adyen/Model/TransactionWebhooks/TransferViewCategoryData.php @@ -673,7 +673,7 @@ public function getPlatformPaymentType() /** * Sets platformPaymentType * - * @param string|null $platformPaymentType The type of the related split. + * @param string|null $platformPaymentType Specifies the nature of the transfer. This parameter helps categorize transfers so you can reconcile transactions at a later time, using the Balance Platform Accounting Report for [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) or [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). Possible values: * **AcquiringFees**: for the acquiring fee incurred on a transaction. * **AdyenCommission**: for the transaction fee due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). * **AdyenFees**: for all the transaction fees due to Adyen. This is the sum of Adyen's commission and Adyen's markup. * **AdyenMarkup**: for the transaction fee due to Adyen under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: or the sale amount of a transaction. * **Commission**: for your platform's commission on a transaction. * **Interchange**: for the interchange fee (fee paid to the issuer) incurred on a transaction. * **PaymentFee**: for all of the transaction fees. * **Remainder**: for the left over amount after currency conversion. * **SchemeFee**: for the scheme fee incurred on a transaction. This is the sum of the interchange fees and the acquiring fees. * **Surcharge**: for the surcharge paid by the customer on a transaction. * **Tip**: for the tip paid by the customer. * **TopUp**: for an incoming transfer to top up your user's balance account. * **VAT**: for the Value Added Tax. * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/Airline.php b/src/Adyen/Model/TransferWebhooks/Airline.php new file mode 100644 index 000000000..0f0523b43 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/Airline.php @@ -0,0 +1,438 @@ + + */ +class Airline implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Airline'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'legs' => '\Adyen\Model\TransferWebhooks\Leg[]', + 'ticketNumber' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'legs' => null, + 'ticketNumber' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'legs' => false, + 'ticketNumber' => 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 = [ + 'legs' => 'legs', + 'ticketNumber' => 'ticketNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'legs' => 'setLegs', + 'ticketNumber' => 'setTicketNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'legs' => 'getLegs', + 'ticketNumber' => 'getTicketNumber' + ]; + + /** + * 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('legs', $data ?? [], null); + $this->setIfExists('ticketNumber', $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 legs + * + * @return \Adyen\Model\TransferWebhooks\Leg[]|null + */ + public function getLegs() + { + return $this->container['legs']; + } + + /** + * Sets legs + * + * @param \Adyen\Model\TransferWebhooks\Leg[]|null $legs Details about the flight legs for this ticket. + * + * @return self + */ + public function setLegs($legs) + { + $this->container['legs'] = $legs; + + return $this; + } + + /** + * Gets ticketNumber + * + * @return string|null + */ + public function getTicketNumber() + { + return $this->container['ticketNumber']; + } + + /** + * Sets ticketNumber + * + * @param string|null $ticketNumber The ticket's unique identifier + * + * @return self + */ + public function setTicketNumber($ticketNumber) + { + $this->container['ticketNumber'] = $ticketNumber; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/Amount.php b/src/Adyen/Model/TransferWebhooks/Amount.php index be11112e9..05b940cff 100644 --- a/src/Adyen/Model/TransferWebhooks/Amount.php +++ b/src/Adyen/Model/TransferWebhooks/Amount.php @@ -302,7 +302,7 @@ public function getCurrency() /** * Sets currency * - * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). * * @return self */ @@ -326,7 +326,7 @@ public function getValue() /** * Sets value * - * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/Leg.php b/src/Adyen/Model/TransferWebhooks/Leg.php new file mode 100644 index 000000000..860872bba --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/Leg.php @@ -0,0 +1,562 @@ + + */ +class Leg implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Leg'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'arrivalAirportCode' => 'string', + 'basicFareCode' => 'string', + 'carrierCode' => 'string', + 'departureAirportCode' => 'string', + 'departureDate' => 'string', + 'flightNumber' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'arrivalAirportCode' => null, + 'basicFareCode' => null, + 'carrierCode' => null, + 'departureAirportCode' => null, + 'departureDate' => null, + 'flightNumber' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'arrivalAirportCode' => false, + 'basicFareCode' => false, + 'carrierCode' => false, + 'departureAirportCode' => false, + 'departureDate' => false, + 'flightNumber' => 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 = [ + 'arrivalAirportCode' => 'arrivalAirportCode', + 'basicFareCode' => 'basicFareCode', + 'carrierCode' => 'carrierCode', + 'departureAirportCode' => 'departureAirportCode', + 'departureDate' => 'departureDate', + 'flightNumber' => 'flightNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'arrivalAirportCode' => 'setArrivalAirportCode', + 'basicFareCode' => 'setBasicFareCode', + 'carrierCode' => 'setCarrierCode', + 'departureAirportCode' => 'setDepartureAirportCode', + 'departureDate' => 'setDepartureDate', + 'flightNumber' => 'setFlightNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'arrivalAirportCode' => 'getArrivalAirportCode', + 'basicFareCode' => 'getBasicFareCode', + 'carrierCode' => 'getCarrierCode', + 'departureAirportCode' => 'getDepartureAirportCode', + 'departureDate' => 'getDepartureDate', + 'flightNumber' => 'getFlightNumber' + ]; + + /** + * 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('arrivalAirportCode', $data ?? [], null); + $this->setIfExists('basicFareCode', $data ?? [], null); + $this->setIfExists('carrierCode', $data ?? [], null); + $this->setIfExists('departureAirportCode', $data ?? [], null); + $this->setIfExists('departureDate', $data ?? [], null); + $this->setIfExists('flightNumber', $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 arrivalAirportCode + * + * @return string|null + */ + public function getArrivalAirportCode() + { + return $this->container['arrivalAirportCode']; + } + + /** + * Sets arrivalAirportCode + * + * @param string|null $arrivalAirportCode The IATA 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. + * + * @return self + */ + public function setArrivalAirportCode($arrivalAirportCode) + { + $this->container['arrivalAirportCode'] = $arrivalAirportCode; + + return $this; + } + + /** + * Gets basicFareCode + * + * @return string|null + */ + public function getBasicFareCode() + { + return $this->container['basicFareCode']; + } + + /** + * Sets basicFareCode + * + * @param string|null $basicFareCode The basic fare code for this leg. + * + * @return self + */ + public function setBasicFareCode($basicFareCode) + { + $this->container['basicFareCode'] = $basicFareCode; + + return $this; + } + + /** + * Gets carrierCode + * + * @return string|null + */ + public function getCarrierCode() + { + return $this->container['carrierCode']; + } + + /** + * Sets carrierCode + * + * @param string|null $carrierCode IATA code of the carrier operating the flight. + * + * @return self + */ + public function setCarrierCode($carrierCode) + { + $this->container['carrierCode'] = $carrierCode; + + return $this; + } + + /** + * Gets departureAirportCode + * + * @return string|null + */ + public function getDepartureAirportCode() + { + return $this->container['departureAirportCode']; + } + + /** + * Sets departureAirportCode + * + * @param string|null $departureAirportCode The IATA three-letter airport code of the departure airport. This field is required if the airline data includes leg details + * + * @return self + */ + public function setDepartureAirportCode($departureAirportCode) + { + $this->container['departureAirportCode'] = $departureAirportCode; + + return $this; + } + + /** + * Gets departureDate + * + * @return string|null + */ + public function getDepartureDate() + { + return $this->container['departureDate']; + } + + /** + * Sets departureDate + * + * @param string|null $departureDate The flight departure date. + * + * @return self + */ + public function setDepartureDate($departureDate) + { + $this->container['departureDate'] = $departureDate; + + return $this; + } + + /** + * Gets flightNumber + * + * @return string|null + */ + public function getFlightNumber() + { + return $this->container['flightNumber']; + } + + /** + * Sets flightNumber + * + * @param string|null $flightNumber The flight identifier. + * + * @return self + */ + public function setFlightNumber($flightNumber) + { + $this->container['flightNumber'] = $flightNumber; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/MerchantPurchaseData.php b/src/Adyen/Model/TransferWebhooks/MerchantPurchaseData.php new file mode 100644 index 000000000..eef6637f7 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/MerchantPurchaseData.php @@ -0,0 +1,472 @@ + + */ +class MerchantPurchaseData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MerchantPurchaseData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'airline' => '\Adyen\Model\TransferWebhooks\Airline', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'airline' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'airline' => 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 = [ + 'airline' => 'airline', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'airline' => 'setAirline', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'airline' => 'getAirline', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_MERCHANT_PURCHASE_DATA = 'merchantPurchaseData'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_MERCHANT_PURCHASE_DATA, + ]; + } + /** + * 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('airline', $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['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets airline + * + * @return \Adyen\Model\TransferWebhooks\Airline|null + */ + public function getAirline() + { + return $this->container['airline']; + } + + /** + * Sets airline + * + * @param \Adyen\Model\TransferWebhooks\Airline|null $airline airline + * + * @return self + */ + public function setAirline($airline) + { + $this->container['airline'] = $airline; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of events data. Possible values: - **merchantPurchaseData**: merchant purchase data + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/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 54a01aca3..c26510624 100644 --- a/src/Adyen/Model/TransferWebhooks/PlatformPayment.php +++ b/src/Adyen/Model/TransferWebhooks/PlatformPayment.php @@ -466,7 +466,7 @@ public function getPlatformPaymentType() /** * Sets platformPaymentType * - * @param string|null $platformPaymentType The type of the related split. + * @param string|null $platformPaymentType Specifies the nature of the transfer. This parameter helps categorize transfers so you can reconcile transactions at a later time, using the Balance Platform Accounting Report for [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) or [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). Possible values: * **AcquiringFees**: for the acquiring fee incurred on a transaction. * **AdyenCommission**: for the transaction fee due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). * **AdyenFees**: for all the transaction fees due to Adyen. This is the sum of Adyen's commission and Adyen's markup. * **AdyenMarkup**: for the transaction fee due to Adyen under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: or the sale amount of a transaction. * **Commission**: for your platform's commission on a transaction. * **Interchange**: for the interchange fee (fee paid to the issuer) incurred on a transaction. * **PaymentFee**: for all of the transaction fees. * **Remainder**: for the left over amount after currency conversion. * **SchemeFee**: for the scheme fee incurred on a transaction. This is the sum of the interchange fees and the acquiring fees. * **Surcharge**: for the surcharge paid by the customer on a transaction. * **Tip**: for the tip paid by the customer. * **TopUp**: for an incoming transfer to top up your user's balance account. * **VAT**: for the Value Added Tax. * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/TransferData.php b/src/Adyen/Model/TransferWebhooks/TransferData.php index ff4b2ab48..bf94fc5bb 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferData.php +++ b/src/Adyen/Model/TransferWebhooks/TransferData.php @@ -56,6 +56,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'description' => 'string', 'directDebitInformation' => '\Adyen\Model\TransferWebhooks\DirectDebitInformation', 'direction' => 'string', + 'eventId' => 'string', 'events' => '\Adyen\Model\TransferWebhooks\TransferEvent[]', 'id' => 'string', 'paymentInstrument' => '\Adyen\Model\TransferWebhooks\PaymentInstrument', @@ -90,6 +91,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'description' => null, 'directDebitInformation' => null, 'direction' => null, + 'eventId' => null, 'events' => null, 'id' => null, 'paymentInstrument' => null, @@ -122,6 +124,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'description' => false, 'directDebitInformation' => false, 'direction' => false, + 'eventId' => false, 'events' => false, 'id' => false, 'paymentInstrument' => false, @@ -234,6 +237,7 @@ public function isNullableSetToNull(string $property): bool 'description' => 'description', 'directDebitInformation' => 'directDebitInformation', 'direction' => 'direction', + 'eventId' => 'eventId', 'events' => 'events', 'id' => 'id', 'paymentInstrument' => 'paymentInstrument', @@ -266,6 +270,7 @@ public function isNullableSetToNull(string $property): bool 'description' => 'setDescription', 'directDebitInformation' => 'setDirectDebitInformation', 'direction' => 'setDirection', + 'eventId' => 'setEventId', 'events' => 'setEvents', 'id' => 'setId', 'paymentInstrument' => 'setPaymentInstrument', @@ -298,6 +303,7 @@ public function isNullableSetToNull(string $property): bool 'description' => 'getDescription', 'directDebitInformation' => 'getDirectDebitInformation', 'direction' => 'getDirection', + 'eventId' => 'getEventId', 'events' => 'getEvents', 'id' => 'getId', 'paymentInstrument' => 'getPaymentInstrument', @@ -358,6 +364,7 @@ public function getModelName() public const CATEGORY_INTERNAL = 'internal'; public const CATEGORY_ISSUED_CARD = 'issuedCard'; public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; + public const CATEGORY_TOP_UP = 'topUp'; public const DIRECTION_INCOMING = 'incoming'; public const DIRECTION_OUTGOING = 'outgoing'; public const REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE = 'accountHierarchyNotActive'; @@ -502,6 +509,7 @@ public function getCategoryAllowableValues() self::CATEGORY_INTERNAL, self::CATEGORY_ISSUED_CARD, self::CATEGORY_PLATFORM_PAYMENT, + self::CATEGORY_TOP_UP, ]; } /** @@ -701,6 +709,7 @@ public function __construct(array $data = null) $this->setIfExists('description', $data ?? [], null); $this->setIfExists('directDebitInformation', $data ?? [], null); $this->setIfExists('direction', $data ?? [], null); + $this->setIfExists('eventId', $data ?? [], null); $this->setIfExists('events', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('paymentInstrument', $data ?? [], null); @@ -944,7 +953,7 @@ public function getCategory() /** * Sets category * - * @param string $category The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. + * @param string $category The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by a Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. - **topUp**: an incoming transfer initiated by your user to top up their balance account. * * @return self */ @@ -1119,6 +1128,30 @@ public function setDirection($direction) return $this; } + /** + * Gets eventId + * + * @return string|null + */ + public function getEventId() + { + return $this->container['eventId']; + } + + /** + * Sets eventId + * + * @param string|null $eventId The event id listed under events, that triggered the notification. + * + * @return self + */ + public function setEventId($eventId) + { + $this->container['eventId'] = $eventId; + + return $this; + } + /** * Gets events * diff --git a/src/Adyen/Model/TransferWebhooks/TransferDataCategoryData.php b/src/Adyen/Model/TransferWebhooks/TransferDataCategoryData.php index 3de350782..415f1a461 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferDataCategoryData.php +++ b/src/Adyen/Model/TransferWebhooks/TransferDataCategoryData.php @@ -673,7 +673,7 @@ public function getPlatformPaymentType() /** * Sets platformPaymentType * - * @param string|null $platformPaymentType The type of the related split. + * @param string|null $platformPaymentType Specifies the nature of the transfer. This parameter helps categorize transfers so you can reconcile transactions at a later time, using the Balance Platform Accounting Report for [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) or [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). Possible values: * **AcquiringFees**: for the acquiring fee incurred on a transaction. * **AdyenCommission**: for the transaction fee due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). * **AdyenFees**: for all the transaction fees due to Adyen. This is the sum of Adyen's commission and Adyen's markup. * **AdyenMarkup**: for the transaction fee due to Adyen under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: or the sale amount of a transaction. * **Commission**: for your platform's commission on a transaction. * **Interchange**: for the interchange fee (fee paid to the issuer) incurred on a transaction. * **PaymentFee**: for all of the transaction fees. * **Remainder**: for the left over amount after currency conversion. * **SchemeFee**: for the scheme fee incurred on a transaction. This is the sum of the interchange fees and the acquiring fees. * **Surcharge**: for the surcharge paid by the customer on a transaction. * **Tip**: for the tip paid by the customer. * **TopUp**: for an incoming transfer to top up your user's balance account. * **VAT**: for the Value Added Tax. * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/TransferEvent.php b/src/Adyen/Model/TransferWebhooks/TransferEvent.php index 1875829e9..b01ca6d20 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferEvent.php +++ b/src/Adyen/Model/TransferWebhooks/TransferEvent.php @@ -49,6 +49,7 @@ class TransferEvent implements ModelInterface, ArrayAccess, \JsonSerializable 'arn' => 'string', 'bookingDate' => '\DateTime', 'estimatedArrivalTime' => '\DateTime', + 'eventsData' => '\Adyen\Model\TransferWebhooks\TransferEventEventsDataInner[]', 'externalReason' => '\Adyen\Model\TransferWebhooks\ExternalReason', 'id' => 'string', 'modification' => '\Adyen\Model\TransferWebhooks\Modification', @@ -76,6 +77,7 @@ class TransferEvent implements ModelInterface, ArrayAccess, \JsonSerializable 'arn' => null, 'bookingDate' => 'date-time', 'estimatedArrivalTime' => 'date-time', + 'eventsData' => null, 'externalReason' => null, 'id' => null, 'modification' => null, @@ -101,6 +103,7 @@ class TransferEvent implements ModelInterface, ArrayAccess, \JsonSerializable 'arn' => false, 'bookingDate' => false, 'estimatedArrivalTime' => false, + 'eventsData' => false, 'externalReason' => false, 'id' => false, 'modification' => false, @@ -206,6 +209,7 @@ public function isNullableSetToNull(string $property): bool 'arn' => 'arn', 'bookingDate' => 'bookingDate', 'estimatedArrivalTime' => 'estimatedArrivalTime', + 'eventsData' => 'eventsData', 'externalReason' => 'externalReason', 'id' => 'id', 'modification' => 'modification', @@ -231,6 +235,7 @@ public function isNullableSetToNull(string $property): bool 'arn' => 'setArn', 'bookingDate' => 'setBookingDate', 'estimatedArrivalTime' => 'setEstimatedArrivalTime', + 'eventsData' => 'setEventsData', 'externalReason' => 'setExternalReason', 'id' => 'setId', 'modification' => 'setModification', @@ -256,6 +261,7 @@ public function isNullableSetToNull(string $property): bool 'arn' => 'getArn', 'bookingDate' => 'getBookingDate', 'estimatedArrivalTime' => 'getEstimatedArrivalTime', + 'eventsData' => 'getEventsData', 'externalReason' => 'getExternalReason', 'id' => 'getId', 'modification' => 'getModification', @@ -546,6 +552,7 @@ public function __construct(array $data = null) $this->setIfExists('arn', $data ?? [], null); $this->setIfExists('bookingDate', $data ?? [], null); $this->setIfExists('estimatedArrivalTime', $data ?? [], null); + $this->setIfExists('eventsData', $data ?? [], null); $this->setIfExists('externalReason', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('modification', $data ?? [], null); @@ -749,6 +756,30 @@ public function setEstimatedArrivalTime($estimatedArrivalTime) return $this; } + /** + * Gets eventsData + * + * @return \Adyen\Model\TransferWebhooks\TransferEventEventsDataInner[]|null + */ + public function getEventsData() + { + return $this->container['eventsData']; + } + + /** + * Sets eventsData + * + * @param \Adyen\Model\TransferWebhooks\TransferEventEventsDataInner[]|null $eventsData A list of event data. + * + * @return self + */ + public function setEventsData($eventsData) + { + $this->container['eventsData'] = $eventsData; + + return $this; + } + /** * Gets externalReason * diff --git a/src/Adyen/Model/TransferWebhooks/TransferEventEventsDataInner.php b/src/Adyen/Model/TransferWebhooks/TransferEventEventsDataInner.php new file mode 100644 index 000000000..e4f94dcf1 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/TransferEventEventsDataInner.php @@ -0,0 +1,441 @@ + + */ +class TransferEventEventsDataInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferEvent_eventsData_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'airline' => '\Adyen\Model\TransferWebhooks\Airline', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'airline' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'airline' => 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 = [ + 'airline' => 'airline', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'airline' => 'setAirline', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'airline' => 'getAirline', + '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('airline', $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['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 airline + * + * @return \Adyen\Model\TransferWebhooks\Airline|null + */ + public function getAirline() + { + return $this->container['airline']; + } + + /** + * Sets airline + * + * @param \Adyen\Model\TransferWebhooks\Airline|null $airline airline + * + * @return self + */ + public function setAirline($airline) + { + $this->container['airline'] = $airline; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of events data. Possible values: - **merchantPurchaseData**: merchant purchase data + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/TransferNotificationRequest.php b/src/Adyen/Model/TransferWebhooks/TransferNotificationRequest.php index c1b277064..0cf9c0ac9 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferNotificationRequest.php +++ b/src/Adyen/Model/TransferWebhooks/TransferNotificationRequest.php @@ -46,6 +46,7 @@ class TransferNotificationRequest implements ModelInterface, ArrayAccess, \JsonS protected static $openAPITypes = [ 'data' => '\Adyen\Model\TransferWebhooks\TransferData', 'environment' => 'string', + 'timestamp' => '\DateTime', 'type' => 'string' ]; @@ -59,6 +60,7 @@ class TransferNotificationRequest implements ModelInterface, ArrayAccess, \JsonS protected static $openAPIFormats = [ 'data' => null, 'environment' => null, + 'timestamp' => 'date-time', 'type' => null ]; @@ -70,6 +72,7 @@ class TransferNotificationRequest implements ModelInterface, ArrayAccess, \JsonS protected static $openAPINullables = [ 'data' => false, 'environment' => false, + 'timestamp' => false, 'type' => false ]; @@ -161,6 +164,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'data' => 'data', 'environment' => 'environment', + 'timestamp' => 'timestamp', 'type' => 'type' ]; @@ -172,6 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'data' => 'setData', 'environment' => 'setEnvironment', + 'timestamp' => 'setTimestamp', 'type' => 'setType' ]; @@ -183,6 +188,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'data' => 'getData', 'environment' => 'getEnvironment', + 'timestamp' => 'getTimestamp', 'type' => 'getType' ]; @@ -259,6 +265,7 @@ public function __construct(array $data = null) { $this->setIfExists('data', $data ?? [], null); $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -367,6 +374,30 @@ public function setEnvironment($environment) return $this; } + /** + * Gets timestamp + * + * @return \DateTime|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param \DateTime|null $timestamp When the event was queued. + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/Transfers/Airline.php b/src/Adyen/Model/Transfers/Airline.php new file mode 100644 index 000000000..f89c418e6 --- /dev/null +++ b/src/Adyen/Model/Transfers/Airline.php @@ -0,0 +1,438 @@ + + */ +class Airline implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Airline'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'legs' => '\Adyen\Model\Transfers\Leg[]', + 'ticketNumber' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'legs' => null, + 'ticketNumber' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'legs' => false, + 'ticketNumber' => 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 = [ + 'legs' => 'legs', + 'ticketNumber' => 'ticketNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'legs' => 'setLegs', + 'ticketNumber' => 'setTicketNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'legs' => 'getLegs', + 'ticketNumber' => 'getTicketNumber' + ]; + + /** + * 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('legs', $data ?? [], null); + $this->setIfExists('ticketNumber', $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 legs + * + * @return \Adyen\Model\Transfers\Leg[]|null + */ + public function getLegs() + { + return $this->container['legs']; + } + + /** + * Sets legs + * + * @param \Adyen\Model\Transfers\Leg[]|null $legs Details about the flight legs for this ticket. + * + * @return self + */ + public function setLegs($legs) + { + $this->container['legs'] = $legs; + + return $this; + } + + /** + * Gets ticketNumber + * + * @return string|null + */ + public function getTicketNumber() + { + return $this->container['ticketNumber']; + } + + /** + * Sets ticketNumber + * + * @param string|null $ticketNumber The ticket's unique identifier + * + * @return self + */ + public function setTicketNumber($ticketNumber) + { + $this->container['ticketNumber'] = $ticketNumber; + + 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/Amount.php b/src/Adyen/Model/Transfers/Amount.php index f4bb0bd5e..33fc552c2 100644 --- a/src/Adyen/Model/Transfers/Amount.php +++ b/src/Adyen/Model/Transfers/Amount.php @@ -302,7 +302,7 @@ public function getCurrency() /** * Sets currency * - * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). * * @return self */ @@ -326,7 +326,7 @@ public function getValue() /** * Sets value * - * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * * @return self */ diff --git a/src/Adyen/Model/Transfers/Leg.php b/src/Adyen/Model/Transfers/Leg.php new file mode 100644 index 000000000..440dabcee --- /dev/null +++ b/src/Adyen/Model/Transfers/Leg.php @@ -0,0 +1,562 @@ + + */ +class Leg implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Leg'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'arrivalAirportCode' => 'string', + 'basicFareCode' => 'string', + 'carrierCode' => 'string', + 'departureAirportCode' => 'string', + 'departureDate' => 'string', + 'flightNumber' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'arrivalAirportCode' => null, + 'basicFareCode' => null, + 'carrierCode' => null, + 'departureAirportCode' => null, + 'departureDate' => null, + 'flightNumber' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'arrivalAirportCode' => false, + 'basicFareCode' => false, + 'carrierCode' => false, + 'departureAirportCode' => false, + 'departureDate' => false, + 'flightNumber' => 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 = [ + 'arrivalAirportCode' => 'arrivalAirportCode', + 'basicFareCode' => 'basicFareCode', + 'carrierCode' => 'carrierCode', + 'departureAirportCode' => 'departureAirportCode', + 'departureDate' => 'departureDate', + 'flightNumber' => 'flightNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'arrivalAirportCode' => 'setArrivalAirportCode', + 'basicFareCode' => 'setBasicFareCode', + 'carrierCode' => 'setCarrierCode', + 'departureAirportCode' => 'setDepartureAirportCode', + 'departureDate' => 'setDepartureDate', + 'flightNumber' => 'setFlightNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'arrivalAirportCode' => 'getArrivalAirportCode', + 'basicFareCode' => 'getBasicFareCode', + 'carrierCode' => 'getCarrierCode', + 'departureAirportCode' => 'getDepartureAirportCode', + 'departureDate' => 'getDepartureDate', + 'flightNumber' => 'getFlightNumber' + ]; + + /** + * 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('arrivalAirportCode', $data ?? [], null); + $this->setIfExists('basicFareCode', $data ?? [], null); + $this->setIfExists('carrierCode', $data ?? [], null); + $this->setIfExists('departureAirportCode', $data ?? [], null); + $this->setIfExists('departureDate', $data ?? [], null); + $this->setIfExists('flightNumber', $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 arrivalAirportCode + * + * @return string|null + */ + public function getArrivalAirportCode() + { + return $this->container['arrivalAirportCode']; + } + + /** + * Sets arrivalAirportCode + * + * @param string|null $arrivalAirportCode The IATA 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. + * + * @return self + */ + public function setArrivalAirportCode($arrivalAirportCode) + { + $this->container['arrivalAirportCode'] = $arrivalAirportCode; + + return $this; + } + + /** + * Gets basicFareCode + * + * @return string|null + */ + public function getBasicFareCode() + { + return $this->container['basicFareCode']; + } + + /** + * Sets basicFareCode + * + * @param string|null $basicFareCode The basic fare code for this leg. + * + * @return self + */ + public function setBasicFareCode($basicFareCode) + { + $this->container['basicFareCode'] = $basicFareCode; + + return $this; + } + + /** + * Gets carrierCode + * + * @return string|null + */ + public function getCarrierCode() + { + return $this->container['carrierCode']; + } + + /** + * Sets carrierCode + * + * @param string|null $carrierCode IATA code of the carrier operating the flight. + * + * @return self + */ + public function setCarrierCode($carrierCode) + { + $this->container['carrierCode'] = $carrierCode; + + return $this; + } + + /** + * Gets departureAirportCode + * + * @return string|null + */ + public function getDepartureAirportCode() + { + return $this->container['departureAirportCode']; + } + + /** + * Sets departureAirportCode + * + * @param string|null $departureAirportCode The IATA three-letter airport code of the departure airport. This field is required if the airline data includes leg details + * + * @return self + */ + public function setDepartureAirportCode($departureAirportCode) + { + $this->container['departureAirportCode'] = $departureAirportCode; + + return $this; + } + + /** + * Gets departureDate + * + * @return string|null + */ + public function getDepartureDate() + { + return $this->container['departureDate']; + } + + /** + * Sets departureDate + * + * @param string|null $departureDate The flight departure date. + * + * @return self + */ + public function setDepartureDate($departureDate) + { + $this->container['departureDate'] = $departureDate; + + return $this; + } + + /** + * Gets flightNumber + * + * @return string|null + */ + public function getFlightNumber() + { + return $this->container['flightNumber']; + } + + /** + * Sets flightNumber + * + * @param string|null $flightNumber The flight identifier. + * + * @return self + */ + public function setFlightNumber($flightNumber) + { + $this->container['flightNumber'] = $flightNumber; + + 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/MerchantPurchaseData.php b/src/Adyen/Model/Transfers/MerchantPurchaseData.php new file mode 100644 index 000000000..1adb1a5b0 --- /dev/null +++ b/src/Adyen/Model/Transfers/MerchantPurchaseData.php @@ -0,0 +1,472 @@ + + */ +class MerchantPurchaseData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MerchantPurchaseData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'airline' => '\Adyen\Model\Transfers\Airline', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'airline' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'airline' => 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 = [ + 'airline' => 'airline', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'airline' => 'setAirline', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'airline' => 'getAirline', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_MERCHANT_PURCHASE_DATA = 'merchantPurchaseData'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_MERCHANT_PURCHASE_DATA, + ]; + } + /** + * 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('airline', $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['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets airline + * + * @return \Adyen\Model\Transfers\Airline|null + */ + public function getAirline() + { + return $this->container['airline']; + } + + /** + * Sets airline + * + * @param \Adyen\Model\Transfers\Airline|null $airline airline + * + * @return self + */ + public function setAirline($airline) + { + $this->container['airline'] = $airline; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of events data. Possible values: - **merchantPurchaseData**: merchant purchase data + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/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 e07c95881..b2690a6b7 100644 --- a/src/Adyen/Model/Transfers/PlatformPayment.php +++ b/src/Adyen/Model/Transfers/PlatformPayment.php @@ -466,7 +466,7 @@ public function getPlatformPaymentType() /** * Sets platformPaymentType * - * @param string|null $platformPaymentType The type of the related split. + * @param string|null $platformPaymentType Specifies the nature of the transfer. This parameter helps categorize transfers so you can reconcile transactions at a later time, using the Balance Platform Accounting Report for [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) or [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). Possible values: * **AcquiringFees**: for the acquiring fee incurred on a transaction. * **AdyenCommission**: for the transaction fee due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). * **AdyenFees**: for all the transaction fees due to Adyen. This is the sum of Adyen's commission and Adyen's markup. * **AdyenMarkup**: for the transaction fee due to Adyen under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: or the sale amount of a transaction. * **Commission**: for your platform's commission on a transaction. * **Interchange**: for the interchange fee (fee paid to the issuer) incurred on a transaction. * **PaymentFee**: for all of the transaction fees. * **Remainder**: for the left over amount after currency conversion. * **SchemeFee**: for the scheme fee incurred on a transaction. This is the sum of the interchange fees and the acquiring fees. * **Surcharge**: for the surcharge paid by the customer on a transaction. * **Tip**: for the tip paid by the customer. * **TopUp**: for an incoming transfer to top up your user's balance account. * **VAT**: for the Value Added Tax. * * @return self */ diff --git a/src/Adyen/Model/Transfers/Transfer.php b/src/Adyen/Model/Transfers/Transfer.php index 88f38b303..a3a521a9f 100644 --- a/src/Adyen/Model/Transfers/Transfer.php +++ b/src/Adyen/Model/Transfers/Transfer.php @@ -322,6 +322,7 @@ public function getModelName() public const CATEGORY_INTERNAL = 'internal'; public const CATEGORY_ISSUED_CARD = 'issuedCard'; public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; + public const CATEGORY_TOP_UP = 'topUp'; public const DIRECTION_INCOMING = 'incoming'; public const DIRECTION_OUTGOING = 'outgoing'; public const REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE = 'accountHierarchyNotActive'; @@ -466,6 +467,7 @@ public function getCategoryAllowableValues() self::CATEGORY_INTERNAL, self::CATEGORY_ISSUED_CARD, self::CATEGORY_PLATFORM_PAYMENT, + self::CATEGORY_TOP_UP, ]; } /** @@ -857,7 +859,7 @@ public function getCategory() /** * Sets category * - * @param string $category The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. + * @param string $category The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by a Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. - **topUp**: an incoming transfer initiated by your user to top up their balance account. * * @return self */ diff --git a/src/Adyen/Model/Transfers/TransferCategoryData.php b/src/Adyen/Model/Transfers/TransferCategoryData.php index 3c2cc44b2..0f3d24100 100644 --- a/src/Adyen/Model/Transfers/TransferCategoryData.php +++ b/src/Adyen/Model/Transfers/TransferCategoryData.php @@ -673,7 +673,7 @@ public function getPlatformPaymentType() /** * Sets platformPaymentType * - * @param string|null $platformPaymentType The type of the related split. + * @param string|null $platformPaymentType Specifies the nature of the transfer. This parameter helps categorize transfers so you can reconcile transactions at a later time, using the Balance Platform Accounting Report for [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) or [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). Possible values: * **AcquiringFees**: for the acquiring fee incurred on a transaction. * **AdyenCommission**: for the transaction fee due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). * **AdyenFees**: for all the transaction fees due to Adyen. This is the sum of Adyen's commission and Adyen's markup. * **AdyenMarkup**: for the transaction fee due to Adyen under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: or the sale amount of a transaction. * **Commission**: for your platform's commission on a transaction. * **Interchange**: for the interchange fee (fee paid to the issuer) incurred on a transaction. * **PaymentFee**: for all of the transaction fees. * **Remainder**: for the left over amount after currency conversion. * **SchemeFee**: for the scheme fee incurred on a transaction. This is the sum of the interchange fees and the acquiring fees. * **Surcharge**: for the surcharge paid by the customer on a transaction. * **Tip**: for the tip paid by the customer. * **TopUp**: for an incoming transfer to top up your user's balance account. * **VAT**: for the Value Added Tax. * * @return self */ diff --git a/src/Adyen/Model/Transfers/TransferData.php b/src/Adyen/Model/Transfers/TransferData.php index 944792e46..44b277d59 100644 --- a/src/Adyen/Model/Transfers/TransferData.php +++ b/src/Adyen/Model/Transfers/TransferData.php @@ -56,6 +56,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'description' => 'string', 'directDebitInformation' => '\Adyen\Model\Transfers\DirectDebitInformation', 'direction' => 'string', + 'eventId' => 'string', 'events' => '\Adyen\Model\Transfers\TransferEvent[]', 'id' => 'string', 'paymentInstrument' => '\Adyen\Model\Transfers\PaymentInstrument', @@ -90,6 +91,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'description' => null, 'directDebitInformation' => null, 'direction' => null, + 'eventId' => null, 'events' => null, 'id' => null, 'paymentInstrument' => null, @@ -122,6 +124,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'description' => false, 'directDebitInformation' => false, 'direction' => false, + 'eventId' => false, 'events' => false, 'id' => false, 'paymentInstrument' => false, @@ -234,6 +237,7 @@ public function isNullableSetToNull(string $property): bool 'description' => 'description', 'directDebitInformation' => 'directDebitInformation', 'direction' => 'direction', + 'eventId' => 'eventId', 'events' => 'events', 'id' => 'id', 'paymentInstrument' => 'paymentInstrument', @@ -266,6 +270,7 @@ public function isNullableSetToNull(string $property): bool 'description' => 'setDescription', 'directDebitInformation' => 'setDirectDebitInformation', 'direction' => 'setDirection', + 'eventId' => 'setEventId', 'events' => 'setEvents', 'id' => 'setId', 'paymentInstrument' => 'setPaymentInstrument', @@ -298,6 +303,7 @@ public function isNullableSetToNull(string $property): bool 'description' => 'getDescription', 'directDebitInformation' => 'getDirectDebitInformation', 'direction' => 'getDirection', + 'eventId' => 'getEventId', 'events' => 'getEvents', 'id' => 'getId', 'paymentInstrument' => 'getPaymentInstrument', @@ -358,6 +364,7 @@ public function getModelName() public const CATEGORY_INTERNAL = 'internal'; public const CATEGORY_ISSUED_CARD = 'issuedCard'; public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; + public const CATEGORY_TOP_UP = 'topUp'; public const DIRECTION_INCOMING = 'incoming'; public const DIRECTION_OUTGOING = 'outgoing'; public const REASON_ACCOUNT_HIERARCHY_NOT_ACTIVE = 'accountHierarchyNotActive'; @@ -502,6 +509,7 @@ public function getCategoryAllowableValues() self::CATEGORY_INTERNAL, self::CATEGORY_ISSUED_CARD, self::CATEGORY_PLATFORM_PAYMENT, + self::CATEGORY_TOP_UP, ]; } /** @@ -701,6 +709,7 @@ public function __construct(array $data = null) $this->setIfExists('description', $data ?? [], null); $this->setIfExists('directDebitInformation', $data ?? [], null); $this->setIfExists('direction', $data ?? [], null); + $this->setIfExists('eventId', $data ?? [], null); $this->setIfExists('events', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('paymentInstrument', $data ?? [], null); @@ -944,7 +953,7 @@ public function getCategory() /** * Sets category * - * @param string $category The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. + * @param string $category The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by a Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. - **topUp**: an incoming transfer initiated by your user to top up their balance account. * * @return self */ @@ -1119,6 +1128,30 @@ public function setDirection($direction) return $this; } + /** + * Gets eventId + * + * @return string|null + */ + public function getEventId() + { + return $this->container['eventId']; + } + + /** + * Sets eventId + * + * @param string|null $eventId The event id listed under events, that triggered the notification. + * + * @return self + */ + public function setEventId($eventId) + { + $this->container['eventId'] = $eventId; + + return $this; + } + /** * Gets events * diff --git a/src/Adyen/Model/Transfers/TransferEvent.php b/src/Adyen/Model/Transfers/TransferEvent.php index 9fff596e4..04ea4f924 100644 --- a/src/Adyen/Model/Transfers/TransferEvent.php +++ b/src/Adyen/Model/Transfers/TransferEvent.php @@ -49,6 +49,7 @@ class TransferEvent implements ModelInterface, ArrayAccess, \JsonSerializable 'arn' => 'string', 'bookingDate' => '\DateTime', 'estimatedArrivalTime' => '\DateTime', + 'eventsData' => '\Adyen\Model\Transfers\TransferEventEventsDataInner[]', 'externalReason' => '\Adyen\Model\Transfers\ExternalReason', 'id' => 'string', 'modification' => '\Adyen\Model\Transfers\Modification', @@ -76,6 +77,7 @@ class TransferEvent implements ModelInterface, ArrayAccess, \JsonSerializable 'arn' => null, 'bookingDate' => 'date-time', 'estimatedArrivalTime' => 'date-time', + 'eventsData' => null, 'externalReason' => null, 'id' => null, 'modification' => null, @@ -101,6 +103,7 @@ class TransferEvent implements ModelInterface, ArrayAccess, \JsonSerializable 'arn' => false, 'bookingDate' => false, 'estimatedArrivalTime' => false, + 'eventsData' => false, 'externalReason' => false, 'id' => false, 'modification' => false, @@ -206,6 +209,7 @@ public function isNullableSetToNull(string $property): bool 'arn' => 'arn', 'bookingDate' => 'bookingDate', 'estimatedArrivalTime' => 'estimatedArrivalTime', + 'eventsData' => 'eventsData', 'externalReason' => 'externalReason', 'id' => 'id', 'modification' => 'modification', @@ -231,6 +235,7 @@ public function isNullableSetToNull(string $property): bool 'arn' => 'setArn', 'bookingDate' => 'setBookingDate', 'estimatedArrivalTime' => 'setEstimatedArrivalTime', + 'eventsData' => 'setEventsData', 'externalReason' => 'setExternalReason', 'id' => 'setId', 'modification' => 'setModification', @@ -256,6 +261,7 @@ public function isNullableSetToNull(string $property): bool 'arn' => 'getArn', 'bookingDate' => 'getBookingDate', 'estimatedArrivalTime' => 'getEstimatedArrivalTime', + 'eventsData' => 'getEventsData', 'externalReason' => 'getExternalReason', 'id' => 'getId', 'modification' => 'getModification', @@ -546,6 +552,7 @@ public function __construct(array $data = null) $this->setIfExists('arn', $data ?? [], null); $this->setIfExists('bookingDate', $data ?? [], null); $this->setIfExists('estimatedArrivalTime', $data ?? [], null); + $this->setIfExists('eventsData', $data ?? [], null); $this->setIfExists('externalReason', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('modification', $data ?? [], null); @@ -749,6 +756,30 @@ public function setEstimatedArrivalTime($estimatedArrivalTime) return $this; } + /** + * Gets eventsData + * + * @return \Adyen\Model\Transfers\TransferEventEventsDataInner[]|null + */ + public function getEventsData() + { + return $this->container['eventsData']; + } + + /** + * Sets eventsData + * + * @param \Adyen\Model\Transfers\TransferEventEventsDataInner[]|null $eventsData A list of event data. + * + * @return self + */ + public function setEventsData($eventsData) + { + $this->container['eventsData'] = $eventsData; + + return $this; + } + /** * Gets externalReason * diff --git a/src/Adyen/Model/Transfers/TransferEventEventsDataInner.php b/src/Adyen/Model/Transfers/TransferEventEventsDataInner.php new file mode 100644 index 000000000..2bc604385 --- /dev/null +++ b/src/Adyen/Model/Transfers/TransferEventEventsDataInner.php @@ -0,0 +1,441 @@ + + */ +class TransferEventEventsDataInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferEvent_eventsData_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'airline' => '\Adyen\Model\Transfers\Airline', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'airline' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'airline' => 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 = [ + 'airline' => 'airline', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'airline' => 'setAirline', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'airline' => 'getAirline', + '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('airline', $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['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 airline + * + * @return \Adyen\Model\Transfers\Airline|null + */ + public function getAirline() + { + return $this->container['airline']; + } + + /** + * Sets airline + * + * @param \Adyen\Model\Transfers\Airline|null $airline airline + * + * @return self + */ + public function setAirline($airline) + { + $this->container['airline'] = $airline; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of events data. Possible values: - **merchantPurchaseData**: merchant purchase data + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/TransferInfo.php b/src/Adyen/Model/Transfers/TransferInfo.php index 27069bfa6..edc804697 100644 --- a/src/Adyen/Model/Transfers/TransferInfo.php +++ b/src/Adyen/Model/Transfers/TransferInfo.php @@ -292,6 +292,7 @@ public function getModelName() public const CATEGORY_INTERNAL = 'internal'; public const CATEGORY_ISSUED_CARD = 'issuedCard'; public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; + public const CATEGORY_TOP_UP = 'topUp'; public const PRIORITIES_CROSS_BORDER = 'crossBorder'; public const PRIORITIES_FAST = 'fast'; public const PRIORITIES_INSTANT = 'instant'; @@ -321,6 +322,7 @@ public function getCategoryAllowableValues() self::CATEGORY_INTERNAL, self::CATEGORY_ISSUED_CARD, self::CATEGORY_PLATFORM_PAYMENT, + self::CATEGORY_TOP_UP, ]; } /** @@ -537,7 +539,7 @@ public function getCategory() /** * Sets category * - * @param string $category The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by a Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. + * @param string $category The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by a Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. - **topUp**: an incoming transfer initiated by your user to top up their balance account. * * @return self */ diff --git a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php index 7592a1286..6bb797d7d 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/PCIQuestionnairesApi.php b/src/Adyen/Service/LegalEntityManagement/PCIQuestionnairesApi.php index 4aa7683c8..b8619965e 100644 --- a/src/Adyen/Service/LegalEntityManagement/PCIQuestionnairesApi.php +++ b/src/Adyen/Service/LegalEntityManagement/PCIQuestionnairesApi.php @@ -39,6 +39,22 @@ public function __construct(Client $client) $this->baseURL = $this->createBaseUrl("https://kyc-test.adyen.com/lem/v3"); } + /** + * Calculate PCI status of a legal entity + * + * @param string $id + * @param \Adyen\Model\LegalEntityManagement\CalculatePciStatusRequest $calculatePciStatusRequest + * @param array|null $requestOptions + * @return \Adyen\Model\LegalEntityManagement\CalculatePciStatusResponse + * @throws AdyenException + */ + public function calculatePciStatusOfLegalEntity(string $id, \Adyen\Model\LegalEntityManagement\CalculatePciStatusRequest $calculatePciStatusRequest, array $requestOptions = null): \Adyen\Model\LegalEntityManagement\CalculatePciStatusResponse + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/legalEntities/{id}/pciQuestionnaires/signingRequired"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $calculatePciStatusRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\LegalEntityManagement\CalculatePciStatusResponse::class); + } + /** * Generate PCI questionnaire * diff --git a/src/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentApi.php b/src/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentApi.php index b61d2b239..714550af5 100644 --- a/src/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentApi.php +++ b/src/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentApi.php @@ -60,12 +60,13 @@ public function checkStatusOfConsentForElectronicDeliveryOfTaxForms(string $id, * @param string $id * @param \Adyen\Model\LegalEntityManagement\SetTaxElectronicDeliveryConsentRequest $setTaxElectronicDeliveryConsentRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function setConsentStatusForElectronicDeliveryOfTaxForms(string $id, \Adyen\Model\LegalEntityManagement\SetTaxElectronicDeliveryConsentRequest $setTaxElectronicDeliveryConsentRequest, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/legalEntities/{id}/setTaxElectronicDeliveryConsent"); $this->requestHttp($endpoint, strtolower('POST'), (array) $setTaxElectronicDeliveryConsentRequest->jsonSerialize(), $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/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); + } /** diff --git a/src/Adyen/Service/Transfers/TransfersApi.php b/src/Adyen/Service/Transfers/TransfersApi.php index 869e9d604..7b62cec32 100644 --- a/src/Adyen/Service/Transfers/TransfersApi.php +++ b/src/Adyen/Service/Transfers/TransfersApi.php @@ -44,13 +44,14 @@ public function __construct(Client $client) * * @param \Adyen\Model\Transfers\ApproveTransfersRequest $approveTransfersRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function approveInitiatedTransfers(\Adyen\Model\Transfers\ApproveTransfersRequest $approveTransfersRequest, array $requestOptions = null) { $endpoint = $this->baseURL . "/transfers/approve"; $this->requestHttp($endpoint, strtolower('POST'), (array) $approveTransfersRequest->jsonSerialize(), $requestOptions); + } /** @@ -58,13 +59,14 @@ public function approveInitiatedTransfers(\Adyen\Model\Transfers\ApproveTransfer * * @param \Adyen\Model\Transfers\CancelTransfersRequest $cancelTransfersRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function cancelInitiatedTransfers(\Adyen\Model\Transfers\CancelTransfersRequest $cancelTransfersRequest, array $requestOptions = null) { $endpoint = $this->baseURL . "/transfers/cancel"; $this->requestHttp($endpoint, strtolower('POST'), (array) $cancelTransfersRequest->jsonSerialize(), $requestOptions); + } /**