From 257655a8eb60120a8dd126af388acb24a7ace651 Mon Sep 17 00:00:00 2001 From: AdyenAutomationBot <38424300+AdyenAutomationBot@users.noreply.github.com> Date: Mon, 18 Nov 2024 19:12:30 +0100 Subject: [PATCH] Update all services (#706) * [reformat][adyen-sdk-automation] automated change * style(fmt): code formatted * removed unittest using removed ClassicCheckoutSDK --------- Co-authored-by: AdyenAutomationBot Co-authored-by: Djoyke Reijans <115019123+DjoykeAbyah@users.noreply.github.com> --- .../AmountNonZeroDecimalsRequirement.php} | 103 +- .../CreateSweepConfigurationV2.php | 2 + .../IbanAccountIdentificationRequirement.php | 503 ++++ .../BalancePlatform/PaymentInstrument.php | 2 +- .../PaymentInstrumentBankAccount.php | 638 ----- .../BalancePlatform/PaymentInstrumentInfo.php | 2 +- .../BalancePlatform/SweepConfigurationV2.php | 2 + .../Model/BalancePlatform/TransactionRule.php | 2 +- .../BalancePlatform/TransactionRuleInfo.php | 2 +- .../TransferRouteRequirements.php | 661 ----- .../TransferRouteRequirementsInner.php | 35 +- .../USInternationalAchAddressRequirement.php} | 105 +- .../UpdatePaymentInstrument.php | 2 +- .../UpdateSweepConfigurationV2.php | 2 + src/Adyen/Model/Checkout/Card.php | 624 ----- .../Model/Checkout/CardDetailsRequest.php | 2 +- ...ankAccount.php => CheckoutBankAccount.php} | 80 +- .../Model/Checkout/CheckoutPaymentMethod.php | 68 +- .../EBankingFinlandDetails.php} | 134 +- src/Adyen/Model/Checkout/FundRecipient.php | 8 +- src/Adyen/Model/Checkout/Mandate.php | 2 +- .../PayByBankAISDirectDebitDetails.php} | 135 +- src/Adyen/Model/Checkout/PaymentDetails.php | 2 - .../Model/Checkout/PaymentMethodsRequest.php | 31 + src/Adyen/Model/Checkout/PaymentRequest.php | 62 + .../Model/Checkout/PaymentSetupRequest.php | 2267 ----------------- .../Model/Checkout/PaymentSetupResponse.php | 440 ---- .../Checkout/PaymentVerificationResponse.php | 749 ------ .../Checkout/ResponseAdditionalDataCard.php | 82 + .../{ShopperInput.php => RivertyDetails.php} | 315 ++- src/Adyen/Model/Checkout/StoredDetails.php | 469 ---- .../Checkout/StoredPaymentMethodDetails.php | 2 - .../Model/Checkout/ThreeDSRequestData.php | 4 +- ...merceCheckoutData.php => TwintDetails.php} | 203 +- .../Model/ConfigurationWebhooks/Contact.php | 614 ----- .../PaymentInstrument.php | 2 +- .../PaymentInstrumentBankAccount.php | 638 ----- .../PaymentInstrumentReference.php | 413 --- .../ConfigurationWebhooks/PersonalData.php | 478 ---- .../SweepConfigurationV2.php | 2 + .../AcceptTermsOfServiceResponse.php | 4 +- .../LegalEntityManagement/BankAccount.php | 864 ------- .../CalculateTermsOfServiceStatusResponse.php | 2 + ...AcceptedTermsOfServiceDocumentResponse.php | 535 ++++ .../GetTermsOfServiceDocumentRequest.php | 4 +- .../GetTermsOfServiceDocumentResponse.php | 4 +- .../TermsOfServiceAcceptanceInfo.php | 4 +- .../UnincorporatedPartnership.php | 914 ------- .../Payments/ResponseAdditionalDataCard.php | 82 + .../BalancePlatformNotificationResponse.php | 2 +- .../BankCategoryData.php} | 201 +- .../InternalCategoryData.php | 500 ++++ .../IssuedCard.php} | 482 ++-- .../PaymentInstrument.php} | 126 +- .../PlatformPayment.php} | 262 +- .../RelayedAuthorisationData.php} | 78 +- .../Model/TransactionWebhooks/Transaction.php | 99 +- .../TransferNotificationValidationFact.php} | 78 +- .../{TransferData.php => TransferView.php} | 37 +- .../TransferViewCategoryData.php | 815 ++++++ .../Model/TransferWebhooks/TransferData.php | 2 + .../Model/TransferWebhooks/TransferEvent.php | 4 +- src/Adyen/Model/Transfers/Transfer.php | 2 + src/Adyen/Model/Transfers/TransferData.php | 2 + src/Adyen/Model/Transfers/TransferEvent.php | 4 +- .../BalancePlatform/AccountHoldersApi.php | 15 + .../BalancePlatform/BalanceAccountsApi.php | 15 + .../BalancePlatform/PINFunctionalityApi.php | 85 - .../Service/BalancePlatform/PlatformApi.php | 15 + .../Checkout/ClassicCheckoutSDKApi.php | 71 - src/Adyen/Service/Checkout/PaymentsApi.php | 2 +- .../TermsOfServiceApi.php | 16 + tests/Unit/ModelBasedCheckoutTest.php | 46 - 73 files changed, 4176 insertions(+), 11083 deletions(-) rename src/Adyen/Model/{Checkout/Avs.php => BalancePlatform/AmountNonZeroDecimalsRequirement.php} (79%) create mode 100644 src/Adyen/Model/BalancePlatform/IbanAccountIdentificationRequirement.php delete mode 100644 src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php delete mode 100644 src/Adyen/Model/BalancePlatform/TransferRouteRequirements.php rename src/Adyen/Model/{Transfers/TransferNotificationTransferTracking.php => BalancePlatform/USInternationalAchAddressRequirement.php} (79%) delete mode 100644 src/Adyen/Model/Checkout/Card.php rename src/Adyen/Model/Checkout/{BankAccount.php => CheckoutBankAccount.php} (86%) rename src/Adyen/Model/{TransferWebhooks/TransferNotificationTransferTracking.php => Checkout/EBankingFinlandDetails.php} (77%) rename src/Adyen/Model/{ConfigurationWebhooks/UKLocalAccountIdentification.php => Checkout/PayByBankAISDirectDebitDetails.php} (75%) delete mode 100644 src/Adyen/Model/Checkout/PaymentSetupRequest.php delete mode 100644 src/Adyen/Model/Checkout/PaymentSetupResponse.php delete mode 100644 src/Adyen/Model/Checkout/PaymentVerificationResponse.php rename src/Adyen/Model/Checkout/{ShopperInput.php => RivertyDetails.php} (63%) delete mode 100644 src/Adyen/Model/Checkout/StoredDetails.php rename src/Adyen/Model/Checkout/{SecureRemoteCommerceCheckoutData.php => TwintDetails.php} (67%) delete mode 100644 src/Adyen/Model/ConfigurationWebhooks/Contact.php delete mode 100644 src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentBankAccount.php delete mode 100644 src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentReference.php delete mode 100644 src/Adyen/Model/ConfigurationWebhooks/PersonalData.php delete mode 100644 src/Adyen/Model/LegalEntityManagement/BankAccount.php create mode 100644 src/Adyen/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.php delete mode 100644 src/Adyen/Model/LegalEntityManagement/UnincorporatedPartnership.php rename src/Adyen/Model/{Checkout/Configuration.php => TransactionWebhooks/BankCategoryData.php} (70%) create mode 100644 src/Adyen/Model/TransactionWebhooks/InternalCategoryData.php rename src/Adyen/Model/{Checkout/RecurringDetail.php => TransactionWebhooks/IssuedCard.php} (50%) rename src/Adyen/Model/{Checkout/ServiceErrorDetails.php => TransactionWebhooks/PaymentInstrument.php} (79%) rename src/Adyen/Model/{ConfigurationWebhooks/USLocalAccountIdentification.php => TransactionWebhooks/PlatformPayment.php} (61%) rename src/Adyen/Model/{Checkout/PaymentVerificationRequest.php => TransactionWebhooks/RelayedAuthorisationData.php} (83%) rename src/Adyen/Model/{Checkout/InstallmentsNumber.php => TransactionWebhooks/TransferNotificationValidationFact.php} (85%) rename src/Adyen/Model/TransactionWebhooks/{TransferData.php => TransferView.php} (91%) create mode 100644 src/Adyen/Model/TransactionWebhooks/TransferViewCategoryData.php delete mode 100644 src/Adyen/Service/BalancePlatform/PINFunctionalityApi.php delete mode 100644 src/Adyen/Service/Checkout/ClassicCheckoutSDKApi.php diff --git a/src/Adyen/Model/Checkout/Avs.php b/src/Adyen/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.php similarity index 79% rename from src/Adyen/Model/Checkout/Avs.php rename to src/Adyen/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.php index 0d3c36d9c..6c68c870f 100644 --- a/src/Adyen/Model/Checkout/Avs.php +++ b/src/Adyen/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.php @@ -1,9 +1,9 @@ */ -class Avs implements ModelInterface, ArrayAccess, \JsonSerializable +class AmountNonZeroDecimalsRequirement implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class Avs implements ModelInterface, ArrayAccess, \JsonSerializable * * @var string */ - protected static $openAPIModelName = 'Avs'; + protected static $openAPIModelName = 'AmountNonZeroDecimalsRequirement'; /** * Array of property to type mappings. Used for (de)serialization @@ -44,8 +44,8 @@ class Avs implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'addressEditable' => 'bool', - 'enabled' => 'string' + 'description' => 'string', + 'type' => 'string' ]; /** @@ -56,8 +56,8 @@ class Avs implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'addressEditable' => null, - 'enabled' => null + 'description' => null, + 'type' => null ]; /** @@ -66,8 +66,8 @@ class Avs implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ - 'addressEditable' => false, - 'enabled' => false + 'description' => false, + 'type' => false ]; /** @@ -156,8 +156,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'addressEditable' => 'addressEditable', - 'enabled' => 'enabled' + 'description' => 'description', + 'type' => 'type' ]; /** @@ -166,8 +166,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'addressEditable' => 'setAddressEditable', - 'enabled' => 'setEnabled' + 'description' => 'setDescription', + 'type' => 'setType' ]; /** @@ -176,8 +176,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'addressEditable' => 'getAddressEditable', - 'enabled' => 'getEnabled' + 'description' => 'getDescription', + 'type' => 'getType' ]; /** @@ -221,21 +221,17 @@ public function getModelName() return self::$openAPIModelName; } - public const ENABLED_YES = 'yes'; - public const ENABLED_NO = 'no'; - public const ENABLED_AUTOMATIC = 'automatic'; + public const TYPE_AMOUNT_NON_ZERO_DECIMALS_REQUIREMENT = 'amountNonZeroDecimalsRequirement'; /** * Gets allowable values of the enum * * @return string[] */ - public function getEnabledAllowableValues() + public function getTypeAllowableValues() { return [ - self::ENABLED_YES, - self::ENABLED_NO, - self::ENABLED_AUTOMATIC, + self::TYPE_AMOUNT_NON_ZERO_DECIMALS_REQUIREMENT, ]; } /** @@ -253,8 +249,8 @@ public function getEnabledAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('addressEditable', $data ?? [], null); - $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); } /** @@ -284,11 +280,14 @@ public function listInvalidProperties() { $invalidProperties = []; - $allowedValues = $this->getEnabledAllowableValues(); - if (!is_null($this->container['enabled']) && !in_array($this->container['enabled'], $allowedValues, true)) { + 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 'enabled', must be one of '%s'", - $this->container['enabled'], + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], implode("', '", $allowedValues) ); } @@ -309,59 +308,59 @@ public function valid() /** - * Gets addressEditable + * Gets description * - * @return bool|null + * @return string|null */ - public function getAddressEditable() + public function getDescription() { - return $this->container['addressEditable']; + return $this->container['description']; } /** - * Sets addressEditable + * Sets description * - * @param bool|null $addressEditable Indicates whether the shopper is allowed to modify the billing address for the current payment request. + * @param string|null $description Specifies for which routes the amount in a transfer request must have no non-zero decimal places, so the transfer can only be processed if the amount consists of round numbers. * * @return self */ - public function setAddressEditable($addressEditable) + public function setDescription($description) { - $this->container['addressEditable'] = $addressEditable; + $this->container['description'] = $description; return $this; } /** - * Gets enabled + * Gets type * - * @return string|null + * @return string */ - public function getEnabled() + public function getType() { - return $this->container['enabled']; + return $this->container['type']; } /** - * Sets enabled + * Sets type * - * @param string|null $enabled Specifies whether the shopper should enter their billing address during checkout. Allowed values: * yes — Perform AVS checks for every card payment. * automatic — Perform AVS checks only when required to optimize the conversion rate. * no — Do not perform AVS checks. + * @param string $type **amountNonZeroDecimalsRequirement** * * @return self */ - public function setEnabled($enabled) + public function setType($type) { - $allowedValues = $this->getEnabledAllowableValues(); - if (!in_array($enabled, $allowedValues, true)) { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'enabled', must be one of '%s'", - $enabled, + "Invalid value '%s' for 'type', must be one of '%s'", + $type, implode("', '", $allowedValues) ) ); } - $this->container['enabled'] = $enabled; + $this->container['type'] = $type; return $this; } diff --git a/src/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.php index 41a441268..7df0eebc0 100644 --- a/src/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.php +++ b/src/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.php @@ -320,6 +320,7 @@ public function getModelName() public const REASON_PENDING_APPROVAL = 'pendingApproval'; public const REASON_PENDING_EXECUTION = 'pendingExecution'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; + public const REASON_REFUSED_BY_CUSTOMER = 'refusedByCustomer'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; @@ -384,6 +385,7 @@ public function getReasonAllowableValues() self::REASON_PENDING_APPROVAL, self::REASON_PENDING_EXECUTION, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, + self::REASON_REFUSED_BY_CUSTOMER, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, diff --git a/src/Adyen/Model/BalancePlatform/IbanAccountIdentificationRequirement.php b/src/Adyen/Model/BalancePlatform/IbanAccountIdentificationRequirement.php new file mode 100644 index 000000000..16fc981f5 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/IbanAccountIdentificationRequirement.php @@ -0,0 +1,503 @@ + + */ +class IbanAccountIdentificationRequirement implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IbanAccountIdentificationRequirement'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'ibanPrefixes' => 'string[]', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'ibanPrefixes' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'ibanPrefixes' => 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 = [ + 'description' => 'description', + 'ibanPrefixes' => 'ibanPrefixes', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'ibanPrefixes' => 'setIbanPrefixes', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'ibanPrefixes' => 'getIbanPrefixes', + '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_IBAN_ACCOUNT_IDENTIFICATION_REQUIREMENT = 'ibanAccountIdentificationRequirement'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_IBAN_ACCOUNT_IDENTIFICATION_REQUIREMENT, + ]; + } + /** + * 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('description', $data ?? [], null); + $this->setIfExists('ibanPrefixes', $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 description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Specifies the allowed prefixes for the international bank account number as defined in the ISO-13616 standard. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets ibanPrefixes + * + * @return string[]|null + */ + public function getIbanPrefixes() + { + return $this->container['ibanPrefixes']; + } + + /** + * Sets ibanPrefixes + * + * @param string[]|null $ibanPrefixes Contains the list of allowed prefixes for international bank accounts. For example: NL, US, UK. + * + * @return self + */ + public function setIbanPrefixes($ibanPrefixes) + { + $this->container['ibanPrefixes'] = $ibanPrefixes; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **ibanAccountIdentificationRequirement** + * + * @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/BalancePlatform/PaymentInstrument.php b/src/Adyen/Model/BalancePlatform/PaymentInstrument.php index 3c45f22b9..659e2faca 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrument.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrument.php @@ -782,7 +782,7 @@ public function getType() /** * Sets type * - * @param string $type Type of payment instrument. Possible value: **card**, **bankAccount**. + * @param string $type The type of payment instrument. Possible values: **card**, **bankAccount**. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php deleted file mode 100644 index 21fb36c2f..000000000 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php +++ /dev/null @@ -1,638 +0,0 @@ - - */ -class PaymentInstrumentBankAccount implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'PaymentInstrument_bankAccount'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'formFactor' => 'string', - 'iban' => 'string', - 'type' => 'string', - 'accountNumber' => 'string', - 'sortCode' => 'string', - 'accountType' => 'string', - 'routingNumber' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'formFactor' => null, - 'iban' => null, - 'type' => null, - 'accountNumber' => null, - 'sortCode' => null, - 'accountType' => null, - 'routingNumber' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'formFactor' => true, - 'iban' => false, - 'type' => false, - 'accountNumber' => false, - 'sortCode' => false, - 'accountType' => false, - 'routingNumber' => 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 = [ - 'formFactor' => 'formFactor', - 'iban' => 'iban', - 'type' => 'type', - 'accountNumber' => 'accountNumber', - 'sortCode' => 'sortCode', - 'accountType' => 'accountType', - 'routingNumber' => 'routingNumber' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'formFactor' => 'setFormFactor', - 'iban' => 'setIban', - 'type' => 'setType', - 'accountNumber' => 'setAccountNumber', - 'sortCode' => 'setSortCode', - 'accountType' => 'setAccountType', - 'routingNumber' => 'setRoutingNumber' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'formFactor' => 'getFormFactor', - 'iban' => 'getIban', - 'type' => 'getType', - 'accountNumber' => 'getAccountNumber', - 'sortCode' => 'getSortCode', - 'accountType' => 'getAccountType', - 'routingNumber' => 'getRoutingNumber' - ]; - - /** - * 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('formFactor', $data ?? [], null); - $this->setIfExists('iban', $data ?? [], null); - $this->setIfExists('type', $data ?? [], null); - $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('sortCode', $data ?? [], null); - $this->setIfExists('accountType', $data ?? [], null); - $this->setIfExists('routingNumber', $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['iban'] === null) { - $invalidProperties[] = "'iban' can't be null"; - } - if ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } - - if ($this->container['accountNumber'] === null) { - $invalidProperties[] = "'accountNumber' can't be null"; - } - if ($this->container['sortCode'] === null) { - $invalidProperties[] = "'sortCode' can't be null"; - } - - if ($this->container['routingNumber'] === null) { - $invalidProperties[] = "'routingNumber' 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 formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - - /** - * Gets iban - * - * @return string - */ - public function getIban() - { - return $this->container['iban']; - } - - /** - * Sets iban - * - * @param string $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. - * - * @return self - */ - public function setIban($iban) - { - if (is_null($iban)) { - throw new \InvalidArgumentException('non-nullable iban cannot be null'); - } - $this->container['iban'] = $iban; - - return $this; - } - - /** - * Gets type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $type **usLocal** - * - * @return self - */ - public function setType($type) - { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets accountNumber - * - * @return string - */ - public function getAccountNumber() - { - return $this->container['accountNumber']; - } - - /** - * Sets accountNumber - * - * @param string $accountNumber The bank account number, without separators or whitespace. - * - * @return self - */ - public function setAccountNumber($accountNumber) - { - if (is_null($accountNumber)) { - throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); - } - $this->container['accountNumber'] = $accountNumber; - - return $this; - } - - /** - * Gets sortCode - * - * @return string - */ - public function getSortCode() - { - return $this->container['sortCode']; - } - - /** - * Sets sortCode - * - * @param string $sortCode The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. - * - * @return self - */ - public function setSortCode($sortCode) - { - if (is_null($sortCode)) { - throw new \InvalidArgumentException('non-nullable sortCode cannot be null'); - } - $this->container['sortCode'] = $sortCode; - - return $this; - } - - /** - * Gets accountType - * - * @return string|null - */ - public function getAccountType() - { - return $this->container['accountType']; - } - - /** - * Sets accountType - * - * @param string|null $accountType The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. - * - * @return self - */ - public function setAccountType($accountType) - { - if (is_null($accountType)) { - throw new \InvalidArgumentException('non-nullable accountType cannot be null'); - } - $this->container['accountType'] = $accountType; - - return $this; - } - - /** - * Gets routingNumber - * - * @return string - */ - public function getRoutingNumber() - { - return $this->container['routingNumber']; - } - - /** - * Sets routingNumber - * - * @param string $routingNumber The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. - * - * @return self - */ - public function setRoutingNumber($routingNumber) - { - if (is_null($routingNumber)) { - throw new \InvalidArgumentException('non-nullable routingNumber cannot be null'); - } - $this->container['routingNumber'] = $routingNumber; - - 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/BalancePlatform/PaymentInstrumentInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php index 661be4b7c..4343c2ae7 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php @@ -715,7 +715,7 @@ public function getType() /** * Sets type * - * @param string $type Type of payment instrument. Possible value: **card**, **bankAccount**. + * @param string $type The type of payment instrument. Possible values: **card**, **bankAccount**. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php index 36bf58710..4e8845fd6 100644 --- a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php +++ b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php @@ -326,6 +326,7 @@ public function getModelName() public const REASON_PENDING_APPROVAL = 'pendingApproval'; public const REASON_PENDING_EXECUTION = 'pendingExecution'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; + public const REASON_REFUSED_BY_CUSTOMER = 'refusedByCustomer'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; @@ -390,6 +391,7 @@ public function getReasonAllowableValues() self::REASON_PENDING_APPROVAL, self::REASON_PENDING_EXECUTION, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, + self::REASON_REFUSED_BY_CUSTOMER, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, diff --git a/src/Adyen/Model/BalancePlatform/TransactionRule.php b/src/Adyen/Model/BalancePlatform/TransactionRule.php index fb8e4cbe9..959f11a19 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRule.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRule.php @@ -646,7 +646,7 @@ public function getOutcomeType() /** * Sets outcomeType * - * @param string|null $outcomeType The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. Possible values: * **hardBlock**: the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, declines the Transaction. Default value: **hardBlock**. > **scoreBased** is not allowed when `requestType` is **bankTransfer**. + * @param string|null $outcomeType The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. Possible values: * **hardBlock**: the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, the transaction is declined. Default value: **hardBlock**. > **scoreBased** is not allowed when `requestType` is **bankTransfer**. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php index 9c235f5f8..498b26337 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php @@ -615,7 +615,7 @@ public function getOutcomeType() /** * Sets outcomeType * - * @param string|null $outcomeType The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. Possible values: * **hardBlock**: the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, declines the Transaction. Default value: **hardBlock**. > **scoreBased** is not allowed when `requestType` is **bankTransfer**. + * @param string|null $outcomeType The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. Possible values: * **hardBlock**: the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, the transaction is declined. Default value: **hardBlock**. > **scoreBased** is not allowed when `requestType` is **bankTransfer**. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/TransferRouteRequirements.php b/src/Adyen/Model/BalancePlatform/TransferRouteRequirements.php deleted file mode 100644 index db088c536..000000000 --- a/src/Adyen/Model/BalancePlatform/TransferRouteRequirements.php +++ /dev/null @@ -1,661 +0,0 @@ - - */ -class TransferRouteRequirements implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'TransferRoute_requirements'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'description' => 'string', - 'requiredAddressFields' => 'string[]', - 'type' => 'string', - 'max' => 'int', - 'min' => 'int', - 'bankAccountIdentificationTypes' => 'string[]', - 'issuingCountryCode' => 'string', - 'onlyForCrossBalancePlatform' => 'bool', - 'paymentInstrumentType' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'description' => null, - 'requiredAddressFields' => null, - 'type' => null, - 'max' => 'int64', - 'min' => 'int64', - 'bankAccountIdentificationTypes' => null, - 'issuingCountryCode' => null, - 'onlyForCrossBalancePlatform' => null, - 'paymentInstrumentType' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'description' => false, - 'requiredAddressFields' => false, - 'type' => false, - 'max' => false, - 'min' => false, - 'bankAccountIdentificationTypes' => false, - 'issuingCountryCode' => false, - 'onlyForCrossBalancePlatform' => false, - 'paymentInstrumentType' => 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 = [ - 'description' => 'description', - 'requiredAddressFields' => 'requiredAddressFields', - 'type' => 'type', - 'max' => 'max', - 'min' => 'min', - 'bankAccountIdentificationTypes' => 'bankAccountIdentificationTypes', - 'issuingCountryCode' => 'issuingCountryCode', - 'onlyForCrossBalancePlatform' => 'onlyForCrossBalancePlatform', - 'paymentInstrumentType' => 'paymentInstrumentType' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'description' => 'setDescription', - 'requiredAddressFields' => 'setRequiredAddressFields', - 'type' => 'setType', - 'max' => 'setMax', - 'min' => 'setMin', - 'bankAccountIdentificationTypes' => 'setBankAccountIdentificationTypes', - 'issuingCountryCode' => 'setIssuingCountryCode', - 'onlyForCrossBalancePlatform' => 'setOnlyForCrossBalancePlatform', - 'paymentInstrumentType' => 'setPaymentInstrumentType' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'description' => 'getDescription', - 'requiredAddressFields' => 'getRequiredAddressFields', - 'type' => 'getType', - 'max' => 'getMax', - 'min' => 'getMin', - 'bankAccountIdentificationTypes' => 'getBankAccountIdentificationTypes', - 'issuingCountryCode' => 'getIssuingCountryCode', - 'onlyForCrossBalancePlatform' => 'getOnlyForCrossBalancePlatform', - 'paymentInstrumentType' => 'getPaymentInstrumentType' - ]; - - /** - * 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('description', $data ?? [], null); - $this->setIfExists('requiredAddressFields', $data ?? [], null); - $this->setIfExists('type', $data ?? [], null); - $this->setIfExists('max', $data ?? [], null); - $this->setIfExists('min', $data ?? [], null); - $this->setIfExists('bankAccountIdentificationTypes', $data ?? [], null); - $this->setIfExists('issuingCountryCode', $data ?? [], null); - $this->setIfExists('onlyForCrossBalancePlatform', $data ?? [], null); - $this->setIfExists('paymentInstrumentType', $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 description - * - * @return string|null - */ - public function getDescription() - { - return $this->container['description']; - } - - /** - * Sets description - * - * @param string|null $description Specifies the requirements for the payment instrument that need to be included in the request for a particular route. - * - * @return self - */ - public function setDescription($description) - { - if (is_null($description)) { - throw new \InvalidArgumentException('non-nullable description cannot be null'); - } - $this->container['description'] = $description; - - return $this; - } - - /** - * Gets requiredAddressFields - * - * @return string[]|null - */ - public function getRequiredAddressFields() - { - return $this->container['requiredAddressFields']; - } - - /** - * Sets requiredAddressFields - * - * @param string[]|null $requiredAddressFields List of address fields. - * - * @return self - */ - public function setRequiredAddressFields($requiredAddressFields) - { - if (is_null($requiredAddressFields)) { - throw new \InvalidArgumentException('non-nullable requiredAddressFields cannot be null'); - } - $this->container['requiredAddressFields'] = $requiredAddressFields; - - return $this; - } - - /** - * Gets type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $type **paymentInstrumentRequirement** - * - * @return self - */ - public function setType($type) - { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets max - * - * @return int|null - */ - public function getMax() - { - return $this->container['max']; - } - - /** - * Sets max - * - * @param int|null $max Maximum amount. - * - * @return self - */ - public function setMax($max) - { - if (is_null($max)) { - throw new \InvalidArgumentException('non-nullable max cannot be null'); - } - $this->container['max'] = $max; - - return $this; - } - - /** - * Gets min - * - * @return int|null - */ - public function getMin() - { - return $this->container['min']; - } - - /** - * Sets min - * - * @param int|null $min Minimum amount. - * - * @return self - */ - public function setMin($min) - { - if (is_null($min)) { - throw new \InvalidArgumentException('non-nullable min cannot be null'); - } - $this->container['min'] = $min; - - return $this; - } - - /** - * Gets bankAccountIdentificationTypes - * - * @return string[]|null - */ - public function getBankAccountIdentificationTypes() - { - return $this->container['bankAccountIdentificationTypes']; - } - - /** - * Sets bankAccountIdentificationTypes - * - * @param string[]|null $bankAccountIdentificationTypes List of bank account identification types: eg.; [iban , numberAndBic] - * - * @return self - */ - public function setBankAccountIdentificationTypes($bankAccountIdentificationTypes) - { - if (is_null($bankAccountIdentificationTypes)) { - throw new \InvalidArgumentException('non-nullable bankAccountIdentificationTypes cannot be null'); - } - $this->container['bankAccountIdentificationTypes'] = $bankAccountIdentificationTypes; - - return $this; - } - - /** - * Gets issuingCountryCode - * - * @return string|null - */ - public function getIssuingCountryCode() - { - return $this->container['issuingCountryCode']; - } - - /** - * Sets issuingCountryCode - * - * @param string|null $issuingCountryCode The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the payment instrument is issued. For example, **NL** or **US**. - * - * @return self - */ - public function setIssuingCountryCode($issuingCountryCode) - { - if (is_null($issuingCountryCode)) { - throw new \InvalidArgumentException('non-nullable issuingCountryCode cannot be null'); - } - $this->container['issuingCountryCode'] = $issuingCountryCode; - - return $this; - } - - /** - * Gets onlyForCrossBalancePlatform - * - * @return bool|null - */ - public function getOnlyForCrossBalancePlatform() - { - return $this->container['onlyForCrossBalancePlatform']; - } - - /** - * Sets onlyForCrossBalancePlatform - * - * @param bool|null $onlyForCrossBalancePlatform Specifies if the requirement only applies to transfers to another balance platform. - * - * @return self - */ - public function setOnlyForCrossBalancePlatform($onlyForCrossBalancePlatform) - { - if (is_null($onlyForCrossBalancePlatform)) { - throw new \InvalidArgumentException('non-nullable onlyForCrossBalancePlatform cannot be null'); - } - $this->container['onlyForCrossBalancePlatform'] = $onlyForCrossBalancePlatform; - - return $this; - } - - /** - * Gets paymentInstrumentType - * - * @return string|null - */ - public function getPaymentInstrumentType() - { - return $this->container['paymentInstrumentType']; - } - - /** - * Sets paymentInstrumentType - * - * @param string|null $paymentInstrumentType The type of the payment instrument. For example, \"BankAccount\" or \"Card\". - * - * @return self - */ - public function setPaymentInstrumentType($paymentInstrumentType) - { - if (is_null($paymentInstrumentType)) { - throw new \InvalidArgumentException('non-nullable paymentInstrumentType cannot be null'); - } - $this->container['paymentInstrumentType'] = $paymentInstrumentType; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } -} diff --git a/src/Adyen/Model/BalancePlatform/TransferRouteRequirementsInner.php b/src/Adyen/Model/BalancePlatform/TransferRouteRequirementsInner.php index 2f4e825dc..85597d3e0 100644 --- a/src/Adyen/Model/BalancePlatform/TransferRouteRequirementsInner.php +++ b/src/Adyen/Model/BalancePlatform/TransferRouteRequirementsInner.php @@ -50,6 +50,7 @@ class TransferRouteRequirementsInner implements ModelInterface, ArrayAccess, \Js 'max' => 'int', 'min' => 'int', 'bankAccountIdentificationTypes' => 'string[]', + 'ibanPrefixes' => 'string[]', 'issuingCountryCode' => 'string', 'issuingCountryCodes' => 'string[]', 'onlyForCrossBalancePlatform' => 'bool', @@ -70,6 +71,7 @@ class TransferRouteRequirementsInner implements ModelInterface, ArrayAccess, \Js 'max' => 'int64', 'min' => 'int64', 'bankAccountIdentificationTypes' => null, + 'ibanPrefixes' => null, 'issuingCountryCode' => null, 'issuingCountryCodes' => null, 'onlyForCrossBalancePlatform' => null, @@ -88,6 +90,7 @@ class TransferRouteRequirementsInner implements ModelInterface, ArrayAccess, \Js 'max' => false, 'min' => false, 'bankAccountIdentificationTypes' => false, + 'ibanPrefixes' => false, 'issuingCountryCode' => false, 'issuingCountryCodes' => false, 'onlyForCrossBalancePlatform' => false, @@ -186,6 +189,7 @@ public function isNullableSetToNull(string $property): bool 'max' => 'max', 'min' => 'min', 'bankAccountIdentificationTypes' => 'bankAccountIdentificationTypes', + 'ibanPrefixes' => 'ibanPrefixes', 'issuingCountryCode' => 'issuingCountryCode', 'issuingCountryCodes' => 'issuingCountryCodes', 'onlyForCrossBalancePlatform' => 'onlyForCrossBalancePlatform', @@ -204,6 +208,7 @@ public function isNullableSetToNull(string $property): bool 'max' => 'setMax', 'min' => 'setMin', 'bankAccountIdentificationTypes' => 'setBankAccountIdentificationTypes', + 'ibanPrefixes' => 'setIbanPrefixes', 'issuingCountryCode' => 'setIssuingCountryCode', 'issuingCountryCodes' => 'setIssuingCountryCodes', 'onlyForCrossBalancePlatform' => 'setOnlyForCrossBalancePlatform', @@ -222,6 +227,7 @@ public function isNullableSetToNull(string $property): bool 'max' => 'getMax', 'min' => 'getMin', 'bankAccountIdentificationTypes' => 'getBankAccountIdentificationTypes', + 'ibanPrefixes' => 'getIbanPrefixes', 'issuingCountryCode' => 'getIssuingCountryCode', 'issuingCountryCodes' => 'getIssuingCountryCodes', 'onlyForCrossBalancePlatform' => 'getOnlyForCrossBalancePlatform', @@ -290,6 +296,7 @@ public function __construct(array $data = null) $this->setIfExists('max', $data ?? [], null); $this->setIfExists('min', $data ?? [], null); $this->setIfExists('bankAccountIdentificationTypes', $data ?? [], null); + $this->setIfExists('ibanPrefixes', $data ?? [], null); $this->setIfExists('issuingCountryCode', $data ?? [], null); $this->setIfExists('issuingCountryCodes', $data ?? [], null); $this->setIfExists('onlyForCrossBalancePlatform', $data ?? [], null); @@ -356,7 +363,7 @@ public function getDescription() /** * Sets description * - * @param string|null $description Specifies the requirements for the payment instrument that need to be included in the request for a particular route. + * @param string|null $description Specifies that you must provide a complete street address for International ACH (IAT) transactions. * * @return self */ @@ -404,7 +411,7 @@ public function getType() /** * Sets type * - * @param string $type **paymentInstrumentRequirement** + * @param string $type **usInternationalAchAddressRequirement** * * @return self */ @@ -487,6 +494,30 @@ public function setBankAccountIdentificationTypes($bankAccountIdentificationType return $this; } + /** + * Gets ibanPrefixes + * + * @return string[]|null + */ + public function getIbanPrefixes() + { + return $this->container['ibanPrefixes']; + } + + /** + * Sets ibanPrefixes + * + * @param string[]|null $ibanPrefixes Contains the list of allowed prefixes for international bank accounts. For example: NL, US, UK. + * + * @return self + */ + public function setIbanPrefixes($ibanPrefixes) + { + $this->container['ibanPrefixes'] = $ibanPrefixes; + + return $this; + } + /** * Gets issuingCountryCode * diff --git a/src/Adyen/Model/Transfers/TransferNotificationTransferTracking.php b/src/Adyen/Model/BalancePlatform/USInternationalAchAddressRequirement.php similarity index 79% rename from src/Adyen/Model/Transfers/TransferNotificationTransferTracking.php rename to src/Adyen/Model/BalancePlatform/USInternationalAchAddressRequirement.php index f4933f582..f2ded8acd 100644 --- a/src/Adyen/Model/Transfers/TransferNotificationTransferTracking.php +++ b/src/Adyen/Model/BalancePlatform/USInternationalAchAddressRequirement.php @@ -1,9 +1,9 @@ */ -class TransferNotificationTransferTracking implements ModelInterface, ArrayAccess, \JsonSerializable +class USInternationalAchAddressRequirement implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class TransferNotificationTransferTracking implements ModelInterface, ArrayAcces * * @var string */ - protected static $openAPIModelName = 'TransferNotificationTransferTracking'; + protected static $openAPIModelName = 'USInternationalAchAddressRequirement'; /** * Array of property to type mappings. Used for (de)serialization @@ -44,8 +44,8 @@ class TransferNotificationTransferTracking implements ModelInterface, ArrayAcces * @var string[] */ protected static $openAPITypes = [ - 'estimatedArrivalTime' => '\DateTime', - 'status' => 'string' + 'description' => 'string', + 'type' => 'string' ]; /** @@ -56,8 +56,8 @@ class TransferNotificationTransferTracking implements ModelInterface, ArrayAcces * @psalm-var array */ protected static $openAPIFormats = [ - 'estimatedArrivalTime' => 'date-time', - 'status' => null + 'description' => null, + 'type' => null ]; /** @@ -66,8 +66,8 @@ class TransferNotificationTransferTracking implements ModelInterface, ArrayAcces * @var boolean[] */ protected static $openAPINullables = [ - 'estimatedArrivalTime' => false, - 'status' => false + 'description' => false, + 'type' => false ]; /** @@ -156,8 +156,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'estimatedArrivalTime' => 'estimatedArrivalTime', - 'status' => 'status' + 'description' => 'description', + 'type' => 'type' ]; /** @@ -166,8 +166,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'estimatedArrivalTime' => 'setEstimatedArrivalTime', - 'status' => 'setStatus' + 'description' => 'setDescription', + 'type' => 'setType' ]; /** @@ -176,8 +176,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'estimatedArrivalTime' => 'getEstimatedArrivalTime', - 'status' => 'getStatus' + 'description' => 'getDescription', + 'type' => 'getType' ]; /** @@ -221,17 +221,17 @@ public function getModelName() return self::$openAPIModelName; } - public const STATUS_CREDITED = 'credited'; + public const TYPE_US_INTERNATIONAL_ACH_ADDRESS_REQUIREMENT = 'usInternationalAchAddressRequirement'; /** * Gets allowable values of the enum * * @return string[] */ - public function getStatusAllowableValues() + public function getTypeAllowableValues() { return [ - self::STATUS_CREDITED, + self::TYPE_US_INTERNATIONAL_ACH_ADDRESS_REQUIREMENT, ]; } /** @@ -249,8 +249,8 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('estimatedArrivalTime', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); } /** @@ -280,11 +280,14 @@ public function listInvalidProperties() { $invalidProperties = []; - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + 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 'status', must be one of '%s'", - $this->container['status'], + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], implode("', '", $allowedValues) ); } @@ -305,65 +308,59 @@ public function valid() /** - * Gets estimatedArrivalTime + * Gets description * - * @return \DateTime|null + * @return string|null */ - public function getEstimatedArrivalTime() + public function getDescription() { - return $this->container['estimatedArrivalTime']; + return $this->container['description']; } /** - * Sets estimatedArrivalTime + * Sets description * - * @param \DateTime|null $estimatedArrivalTime The estimated time the beneficiary should have access to the funds. + * @param string|null $description Specifies that you must provide a complete street address for International ACH (IAT) transactions. * * @return self */ - public function setEstimatedArrivalTime($estimatedArrivalTime) + public function setDescription($description) { - if (is_null($estimatedArrivalTime)) { - throw new \InvalidArgumentException('non-nullable estimatedArrivalTime cannot be null'); - } - $this->container['estimatedArrivalTime'] = $estimatedArrivalTime; + $this->container['description'] = $description; return $this; } /** - * Gets status + * Gets type * - * @return string|null + * @return string */ - public function getStatus() + public function getType() { - return $this->container['status']; + return $this->container['type']; } /** - * Sets status + * Sets type * - * @param string|null $status The tracking status of the transfer. + * @param string $type **usInternationalAchAddressRequirement** * * @return self */ - public function setStatus($status) + public function setType($type) { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($status, $allowedValues, true)) { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", - $status, + "Invalid value '%s' for 'type', must be one of '%s'", + $type, implode("', '", $allowedValues) ) ); } - $this->container['status'] = $status; + $this->container['type'] = $type; return $this; } diff --git a/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php b/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php index 4a2dfd11e..7a84f7cb3 100644 --- a/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php +++ b/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php @@ -782,7 +782,7 @@ public function getType() /** * Sets type * - * @param string $type Type of payment instrument. Possible value: **card**, **bankAccount**. + * @param string $type The type of payment instrument. Possible values: **card**, **bankAccount**. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.php index 84e78e5f3..b371b209b 100644 --- a/src/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.php +++ b/src/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.php @@ -326,6 +326,7 @@ public function getModelName() public const REASON_PENDING_APPROVAL = 'pendingApproval'; public const REASON_PENDING_EXECUTION = 'pendingExecution'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; + public const REASON_REFUSED_BY_CUSTOMER = 'refusedByCustomer'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; @@ -390,6 +391,7 @@ public function getReasonAllowableValues() self::REASON_PENDING_APPROVAL, self::REASON_PENDING_EXECUTION, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, + self::REASON_REFUSED_BY_CUSTOMER, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, diff --git a/src/Adyen/Model/Checkout/Card.php b/src/Adyen/Model/Checkout/Card.php deleted file mode 100644 index 593c4536c..000000000 --- a/src/Adyen/Model/Checkout/Card.php +++ /dev/null @@ -1,624 +0,0 @@ - - */ -class Card implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'Card'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'cvc' => 'string', - 'expiryMonth' => 'string', - 'expiryYear' => 'string', - 'holderName' => 'string', - 'issueNumber' => 'string', - 'number' => 'string', - 'startMonth' => 'string', - 'startYear' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'cvc' => null, - 'expiryMonth' => null, - 'expiryYear' => null, - 'holderName' => null, - 'issueNumber' => null, - 'number' => null, - 'startMonth' => null, - 'startYear' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'cvc' => false, - 'expiryMonth' => false, - 'expiryYear' => false, - 'holderName' => false, - 'issueNumber' => false, - 'number' => false, - 'startMonth' => false, - 'startYear' => 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 = [ - 'cvc' => 'cvc', - 'expiryMonth' => 'expiryMonth', - 'expiryYear' => 'expiryYear', - 'holderName' => 'holderName', - 'issueNumber' => 'issueNumber', - 'number' => 'number', - 'startMonth' => 'startMonth', - 'startYear' => 'startYear' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'cvc' => 'setCvc', - 'expiryMonth' => 'setExpiryMonth', - 'expiryYear' => 'setExpiryYear', - 'holderName' => 'setHolderName', - 'issueNumber' => 'setIssueNumber', - 'number' => 'setNumber', - 'startMonth' => 'setStartMonth', - 'startYear' => 'setStartYear' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'cvc' => 'getCvc', - 'expiryMonth' => 'getExpiryMonth', - 'expiryYear' => 'getExpiryYear', - 'holderName' => 'getHolderName', - 'issueNumber' => 'getIssueNumber', - 'number' => 'getNumber', - 'startMonth' => 'getStartMonth', - 'startYear' => 'getStartYear' - ]; - - /** - * 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('cvc', $data ?? [], null); - $this->setIfExists('expiryMonth', $data ?? [], null); - $this->setIfExists('expiryYear', $data ?? [], null); - $this->setIfExists('holderName', $data ?? [], null); - $this->setIfExists('issueNumber', $data ?? [], null); - $this->setIfExists('number', $data ?? [], null); - $this->setIfExists('startMonth', $data ?? [], null); - $this->setIfExists('startYear', $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 cvc - * - * @return string|null - */ - public function getCvc() - { - return $this->container['cvc']; - } - - /** - * Sets cvc - * - * @param string|null $cvc The [card verification code](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid) (1-20 characters). Depending on the card brand, it is known also as: * CVV2/CVC2 – length: 3 digits * CID – length: 4 digits > If you are using [Client-Side Encryption](https://docs.adyen.com/classic-integration/cse-integration-ecommerce), the CVC code is present in the encrypted data. You must never post the card details to the server. > This field must be always present in a [one-click payment request](https://docs.adyen.com/classic-integration/recurring-payments). > When this value is returned in a response, it is always empty because it is not stored. - * - * @return self - */ - public function setCvc($cvc) - { - $this->container['cvc'] = $cvc; - - return $this; - } - - /** - * Gets expiryMonth - * - * @return string|null - */ - public function getExpiryMonth() - { - return $this->container['expiryMonth']; - } - - /** - * Sets expiryMonth - * - * @param string|null $expiryMonth The card expiry month. Format: 2 digits, zero-padded for single digits. For example: * 03 = March * 11 = November - * - * @return self - */ - public function setExpiryMonth($expiryMonth) - { - $this->container['expiryMonth'] = $expiryMonth; - - return $this; - } - - /** - * Gets expiryYear - * - * @return string|null - */ - public function getExpiryYear() - { - return $this->container['expiryYear']; - } - - /** - * Sets expiryYear - * - * @param string|null $expiryYear The card expiry year. Format: 4 digits. For example: 2020 - * - * @return self - */ - public function setExpiryYear($expiryYear) - { - $this->container['expiryYear'] = $expiryYear; - - return $this; - } - - /** - * Gets holderName - * - * @return string|null - */ - public function getHolderName() - { - return $this->container['holderName']; - } - - /** - * Sets holderName - * - * @param string|null $holderName The name of the cardholder, as printed on the card. - * - * @return self - */ - public function setHolderName($holderName) - { - $this->container['holderName'] = $holderName; - - return $this; - } - - /** - * Gets issueNumber - * - * @return string|null - */ - public function getIssueNumber() - { - return $this->container['issueNumber']; - } - - /** - * Sets issueNumber - * - * @param string|null $issueNumber The issue number of the card (for some UK debit cards only). - * - * @return self - */ - public function setIssueNumber($issueNumber) - { - $this->container['issueNumber'] = $issueNumber; - - return $this; - } - - /** - * Gets number - * - * @return string|null - */ - public function getNumber() - { - return $this->container['number']; - } - - /** - * Sets number - * - * @param string|null $number The card number (4-19 characters). Do not use any separators. When this value is returned in a response, only the last 4 digits of the card number are returned. - * - * @return self - */ - public function setNumber($number) - { - $this->container['number'] = $number; - - return $this; - } - - /** - * Gets startMonth - * - * @return string|null - */ - public function getStartMonth() - { - return $this->container['startMonth']; - } - - /** - * Sets startMonth - * - * @param string|null $startMonth The month component of the start date (for some UK debit cards only). - * - * @return self - */ - public function setStartMonth($startMonth) - { - $this->container['startMonth'] = $startMonth; - - return $this; - } - - /** - * Gets startYear - * - * @return string|null - */ - public function getStartYear() - { - return $this->container['startYear']; - } - - /** - * Sets startYear - * - * @param string|null $startYear The year component of the start date (for some UK debit cards only). - * - * @return self - */ - public function setStartYear($startYear) - { - $this->container['startYear'] = $startYear; - - 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/CardDetailsRequest.php b/src/Adyen/Model/Checkout/CardDetailsRequest.php index a1327d010..862cc4421 100644 --- a/src/Adyen/Model/Checkout/CardDetailsRequest.php +++ b/src/Adyen/Model/Checkout/CardDetailsRequest.php @@ -323,7 +323,7 @@ public function getCardNumber() /** * Sets cardNumber * - * @param string $cardNumber A minimum of the first 8 digits of the card number and a maximum of the full card number. 11 digits gives the best result. You must be [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide) to collect raw card data. + * @param string $cardNumber A minimum of the first eight digits of the card number. The full card number gives the best result. You must be [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide) to collect raw card data. * * @return self */ diff --git a/src/Adyen/Model/Checkout/BankAccount.php b/src/Adyen/Model/Checkout/CheckoutBankAccount.php similarity index 86% rename from src/Adyen/Model/Checkout/BankAccount.php rename to src/Adyen/Model/Checkout/CheckoutBankAccount.php index 5e357358a..13b415fcf 100644 --- a/src/Adyen/Model/Checkout/BankAccount.php +++ b/src/Adyen/Model/Checkout/CheckoutBankAccount.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * BankAccount Class Doc Comment + * CheckoutBankAccount Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable +class CheckoutBankAccount implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable * * @var string */ - protected static $openAPIModelName = 'BankAccount'; + protected static $openAPIModelName = 'CheckoutBankAccount'; /** * Array of property to type mappings. Used for (de)serialization @@ -44,6 +44,7 @@ class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'accountType' => 'string', 'bankAccountNumber' => 'string', 'bankCity' => 'string', 'bankLocationId' => 'string', @@ -63,6 +64,7 @@ class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'accountType' => null, 'bankAccountNumber' => null, 'bankCity' => null, 'bankLocationId' => null, @@ -80,6 +82,7 @@ class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ + 'accountType' => false, 'bankAccountNumber' => false, 'bankCity' => false, 'bankLocationId' => false, @@ -177,6 +180,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'accountType' => 'accountType', 'bankAccountNumber' => 'bankAccountNumber', 'bankCity' => 'bankCity', 'bankLocationId' => 'bankLocationId', @@ -194,6 +198,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'accountType' => 'setAccountType', 'bankAccountNumber' => 'setBankAccountNumber', 'bankCity' => 'setBankCity', 'bankLocationId' => 'setBankLocationId', @@ -211,6 +216,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'accountType' => 'getAccountType', 'bankAccountNumber' => 'getBankAccountNumber', 'bankCity' => 'getBankCity', 'bankLocationId' => 'getBankLocationId', @@ -263,7 +269,31 @@ public function getModelName() return self::$openAPIModelName; } + public const ACCOUNT_TYPE_BALANCE = 'balance'; + public const ACCOUNT_TYPE_CHECKING = 'checking'; + public const ACCOUNT_TYPE_DEPOSIT = 'deposit'; + public const ACCOUNT_TYPE_GENERAL = 'general'; + public const ACCOUNT_TYPE_OTHER = 'other'; + public const ACCOUNT_TYPE_PAYMENT = 'payment'; + public const ACCOUNT_TYPE_SAVINGS = 'savings'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAccountTypeAllowableValues() + { + return [ + self::ACCOUNT_TYPE_BALANCE, + self::ACCOUNT_TYPE_CHECKING, + self::ACCOUNT_TYPE_DEPOSIT, + self::ACCOUNT_TYPE_GENERAL, + self::ACCOUNT_TYPE_OTHER, + self::ACCOUNT_TYPE_PAYMENT, + self::ACCOUNT_TYPE_SAVINGS, + ]; + } /** * Associative array for storing property values * @@ -279,6 +309,7 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('accountType', $data ?? [], null); $this->setIfExists('bankAccountNumber', $data ?? [], null); $this->setIfExists('bankCity', $data ?? [], null); $this->setIfExists('bankLocationId', $data ?? [], null); @@ -317,6 +348,15 @@ public function listInvalidProperties() { $invalidProperties = []; + $allowedValues = $this->getAccountTypeAllowableValues(); + if (!is_null($this->container['accountType']) && !in_array($this->container['accountType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'accountType', must be one of '%s'", + $this->container['accountType'], + implode("', '", $allowedValues) + ); + } + return $invalidProperties; } @@ -332,6 +372,40 @@ public function valid() } + /** + * Gets accountType + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['accountType']; + } + + /** + * Sets accountType + * + * @param string|null $accountType The type of the bank account. + * + * @return self + */ + public function setAccountType($accountType) + { + $allowedValues = $this->getAccountTypeAllowableValues(); + if (!in_array($accountType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'accountType', must be one of '%s'", + $accountType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['accountType'] = $accountType; + + return $this; + } + /** * Gets bankAccountNumber * diff --git a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php index c5efe3d95..50e4731f4 100644 --- a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php +++ b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php @@ -104,8 +104,9 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'payerSelected' => 'string', 'shopperAccountIdentifier' => 'string', 'virtualPaymentAddress' => 'string', - 'samsungPayToken' => 'string', + 'deviceFingerprint' => 'string', 'iban' => 'string', + 'samsungPayToken' => 'string', 'billingSequenceNumber' => 'string', 'appId' => 'string', 'visaCheckoutCallId' => 'string', @@ -180,8 +181,9 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'payerSelected' => null, 'shopperAccountIdentifier' => null, 'virtualPaymentAddress' => null, - 'samsungPayToken' => null, + 'deviceFingerprint' => null, 'iban' => null, + 'samsungPayToken' => null, 'billingSequenceNumber' => null, 'appId' => null, 'visaCheckoutCallId' => null, @@ -254,8 +256,9 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'payerSelected' => false, 'shopperAccountIdentifier' => false, 'virtualPaymentAddress' => false, - 'samsungPayToken' => false, + 'deviceFingerprint' => false, 'iban' => false, + 'samsungPayToken' => false, 'billingSequenceNumber' => false, 'appId' => false, 'visaCheckoutCallId' => false, @@ -408,8 +411,9 @@ public function isNullableSetToNull(string $property): bool 'payerSelected' => 'payerSelected', 'shopperAccountIdentifier' => 'shopperAccountIdentifier', 'virtualPaymentAddress' => 'virtualPaymentAddress', - 'samsungPayToken' => 'samsungPayToken', + 'deviceFingerprint' => 'deviceFingerprint', 'iban' => 'iban', + 'samsungPayToken' => 'samsungPayToken', 'billingSequenceNumber' => 'billingSequenceNumber', 'appId' => 'appId', 'visaCheckoutCallId' => 'visaCheckoutCallId', @@ -482,8 +486,9 @@ public function isNullableSetToNull(string $property): bool 'payerSelected' => 'setPayerSelected', 'shopperAccountIdentifier' => 'setShopperAccountIdentifier', 'virtualPaymentAddress' => 'setVirtualPaymentAddress', - 'samsungPayToken' => 'setSamsungPayToken', + 'deviceFingerprint' => 'setDeviceFingerprint', 'iban' => 'setIban', + 'samsungPayToken' => 'setSamsungPayToken', 'billingSequenceNumber' => 'setBillingSequenceNumber', 'appId' => 'setAppId', 'visaCheckoutCallId' => 'setVisaCheckoutCallId', @@ -556,8 +561,9 @@ public function isNullableSetToNull(string $property): bool 'payerSelected' => 'getPayerSelected', 'shopperAccountIdentifier' => 'getShopperAccountIdentifier', 'virtualPaymentAddress' => 'getVirtualPaymentAddress', - 'samsungPayToken' => 'getSamsungPayToken', + 'deviceFingerprint' => 'getDeviceFingerprint', 'iban' => 'getIban', + 'samsungPayToken' => 'getSamsungPayToken', 'billingSequenceNumber' => 'getBillingSequenceNumber', 'appId' => 'getAppId', 'visaCheckoutCallId' => 'getVisaCheckoutCallId', @@ -680,8 +686,9 @@ public function __construct(array $data = null) $this->setIfExists('payerSelected', $data ?? [], null); $this->setIfExists('shopperAccountIdentifier', $data ?? [], null); $this->setIfExists('virtualPaymentAddress', $data ?? [], null); - $this->setIfExists('samsungPayToken', $data ?? [], null); + $this->setIfExists('deviceFingerprint', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('samsungPayToken', $data ?? [], null); $this->setIfExists('billingSequenceNumber', $data ?? [], null); $this->setIfExists('appId', $data ?? [], null); $this->setIfExists('visaCheckoutCallId', $data ?? [], null); @@ -731,7 +738,6 @@ public function listInvalidProperties() if ($this->container['issuer'] === null) { $invalidProperties[] = "'issuer' can't be null"; } - if ($this->container['firstName'] === null) { $invalidProperties[] = "'firstName' can't be null"; } @@ -750,12 +756,12 @@ public function listInvalidProperties() if ($this->container['masterpassTransactionId'] === null) { $invalidProperties[] = "'masterpassTransactionId' can't be null"; } - if ($this->container['samsungPayToken'] === null) { - $invalidProperties[] = "'samsungPayToken' can't be null"; - } if ($this->container['iban'] === null) { $invalidProperties[] = "'iban' can't be null"; } + if ($this->container['samsungPayToken'] === null) { + $invalidProperties[] = "'samsungPayToken' can't be null"; + } if ($this->container['billingSequenceNumber'] === null) { $invalidProperties[] = "'billingSequenceNumber' can't be null"; } @@ -2198,25 +2204,25 @@ public function setVirtualPaymentAddress($virtualPaymentAddress) } /** - * Gets samsungPayToken + * Gets deviceFingerprint * - * @return string + * @return string|null */ - public function getSamsungPayToken() + public function getDeviceFingerprint() { - return $this->container['samsungPayToken']; + return $this->container['deviceFingerprint']; } /** - * Sets samsungPayToken + * Sets deviceFingerprint * - * @param string $samsungPayToken The payload you received from the Samsung Pay SDK response. + * @param string|null $deviceFingerprint A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). * * @return self */ - public function setSamsungPayToken($samsungPayToken) + public function setDeviceFingerprint($deviceFingerprint) { - $this->container['samsungPayToken'] = $samsungPayToken; + $this->container['deviceFingerprint'] = $deviceFingerprint; return $this; } @@ -2245,6 +2251,30 @@ public function setIban($iban) return $this; } + /** + * Gets samsungPayToken + * + * @return string + */ + public function getSamsungPayToken() + { + return $this->container['samsungPayToken']; + } + + /** + * Sets samsungPayToken + * + * @param string $samsungPayToken The payload you received from the Samsung Pay SDK response. + * + * @return self + */ + public function setSamsungPayToken($samsungPayToken) + { + $this->container['samsungPayToken'] = $samsungPayToken; + + return $this; + } + /** * Gets billingSequenceNumber * diff --git a/src/Adyen/Model/TransferWebhooks/TransferNotificationTransferTracking.php b/src/Adyen/Model/Checkout/EBankingFinlandDetails.php similarity index 77% rename from src/Adyen/Model/TransferWebhooks/TransferNotificationTransferTracking.php rename to src/Adyen/Model/Checkout/EBankingFinlandDetails.php index 312f626f6..10b70226b 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferNotificationTransferTracking.php +++ b/src/Adyen/Model/Checkout/EBankingFinlandDetails.php @@ -1,9 +1,9 @@ */ -class TransferNotificationTransferTracking implements ModelInterface, ArrayAccess, \JsonSerializable +class EBankingFinlandDetails implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class TransferNotificationTransferTracking implements ModelInterface, ArrayAcces * * @var string */ - protected static $openAPIModelName = 'TransferNotificationTransferTracking'; + protected static $openAPIModelName = 'EBankingFinlandDetails'; /** * Array of property to type mappings. Used for (de)serialization @@ -44,8 +44,9 @@ class TransferNotificationTransferTracking implements ModelInterface, ArrayAcces * @var string[] */ protected static $openAPITypes = [ - 'estimatedArrivalTime' => '\DateTime', - 'status' => 'string' + 'checkoutAttemptId' => 'string', + 'issuer' => 'string', + 'type' => 'string' ]; /** @@ -56,8 +57,9 @@ class TransferNotificationTransferTracking implements ModelInterface, ArrayAcces * @psalm-var array */ protected static $openAPIFormats = [ - 'estimatedArrivalTime' => 'date-time', - 'status' => null + 'checkoutAttemptId' => null, + 'issuer' => null, + 'type' => null ]; /** @@ -66,8 +68,9 @@ class TransferNotificationTransferTracking implements ModelInterface, ArrayAcces * @var boolean[] */ protected static $openAPINullables = [ - 'estimatedArrivalTime' => false, - 'status' => false + 'checkoutAttemptId' => false, + 'issuer' => false, + 'type' => false ]; /** @@ -156,8 +159,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'estimatedArrivalTime' => 'estimatedArrivalTime', - 'status' => 'status' + 'checkoutAttemptId' => 'checkoutAttemptId', + 'issuer' => 'issuer', + 'type' => 'type' ]; /** @@ -166,8 +170,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'estimatedArrivalTime' => 'setEstimatedArrivalTime', - 'status' => 'setStatus' + 'checkoutAttemptId' => 'setCheckoutAttemptId', + 'issuer' => 'setIssuer', + 'type' => 'setType' ]; /** @@ -176,8 +181,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'estimatedArrivalTime' => 'getEstimatedArrivalTime', - 'status' => 'getStatus' + 'checkoutAttemptId' => 'getCheckoutAttemptId', + 'issuer' => 'getIssuer', + 'type' => 'getType' ]; /** @@ -221,17 +227,17 @@ public function getModelName() return self::$openAPIModelName; } - public const STATUS_CREDITED = 'credited'; + public const TYPE_EBANKING_FI = 'ebanking_FI'; /** * Gets allowable values of the enum * * @return string[] */ - public function getStatusAllowableValues() + public function getTypeAllowableValues() { return [ - self::STATUS_CREDITED, + self::TYPE_EBANKING_FI, ]; } /** @@ -249,8 +255,9 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('estimatedArrivalTime', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('checkoutAttemptId', $data ?? [], null); + $this->setIfExists('issuer', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); } /** @@ -280,11 +287,14 @@ public function listInvalidProperties() { $invalidProperties = []; - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + 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 'status', must be one of '%s'", - $this->container['status'], + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], implode("', '", $allowedValues) ); } @@ -305,65 +315,83 @@ public function valid() /** - * Gets estimatedArrivalTime + * Gets checkoutAttemptId * - * @return \DateTime|null + * @return string|null */ - public function getEstimatedArrivalTime() + public function getCheckoutAttemptId() { - return $this->container['estimatedArrivalTime']; + return $this->container['checkoutAttemptId']; } /** - * Sets estimatedArrivalTime + * Sets checkoutAttemptId * - * @param \DateTime|null $estimatedArrivalTime The estimated time the beneficiary should have access to the funds. + * @param string|null $checkoutAttemptId The checkout attempt identifier. * * @return self */ - public function setEstimatedArrivalTime($estimatedArrivalTime) + public function setCheckoutAttemptId($checkoutAttemptId) { - if (is_null($estimatedArrivalTime)) { - throw new \InvalidArgumentException('non-nullable estimatedArrivalTime cannot be null'); - } - $this->container['estimatedArrivalTime'] = $estimatedArrivalTime; + $this->container['checkoutAttemptId'] = $checkoutAttemptId; return $this; } /** - * Gets status + * Gets issuer * * @return string|null */ - public function getStatus() + public function getIssuer() { - return $this->container['status']; + return $this->container['issuer']; } /** - * Sets status + * Sets issuer * - * @param string|null $status The tracking status of the transfer. + * @param string|null $issuer The Ebanking Finland issuer value of the shopper's selected bank. * * @return self */ - public function setStatus($status) + public function setIssuer($issuer) { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($status, $allowedValues, true)) { + $this->container['issuer'] = $issuer; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **ebanking_FI** + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", - $status, + "Invalid value '%s' for 'type', must be one of '%s'", + $type, implode("', '", $allowedValues) ) ); } - $this->container['status'] = $status; + $this->container['type'] = $type; return $this; } diff --git a/src/Adyen/Model/Checkout/FundRecipient.php b/src/Adyen/Model/Checkout/FundRecipient.php index 5770a299f..5a9ca982e 100644 --- a/src/Adyen/Model/Checkout/FundRecipient.php +++ b/src/Adyen/Model/Checkout/FundRecipient.php @@ -395,7 +395,7 @@ public function getIBAN() /** * Sets iBAN * - * @param string|null $iBAN Fund Recipient Iban for C2C payments + * @param string|null $iBAN The IBAN of the bank account where the funds are being transferred to. * * @return self */ @@ -611,7 +611,7 @@ public function getWalletIdentifier() /** * Sets walletIdentifier * - * @param string|null $walletIdentifier Indicates where the money is going. + * @param string|null $walletIdentifier The unique identifier for the wallet the funds are being transferred to. You can use the shopper reference or any other identifier. * * @return self */ @@ -635,7 +635,7 @@ public function getWalletOwnerTaxId() /** * Sets walletOwnerTaxId * - * @param string|null $walletOwnerTaxId Indicates the tax identifier of the fund recipient + * @param string|null $walletOwnerTaxId The tax identifier of the person receiving the funds. * * @return self */ @@ -659,7 +659,7 @@ public function getWalletPurpose() /** * Sets walletPurpose * - * @param string|null $walletPurpose The purpose of a digital wallet transaction + * @param string|null $walletPurpose The purpose of a digital wallet transaction. * * @return self */ diff --git a/src/Adyen/Model/Checkout/Mandate.php b/src/Adyen/Model/Checkout/Mandate.php index 5d840846c..a775ce98a 100644 --- a/src/Adyen/Model/Checkout/Mandate.php +++ b/src/Adyen/Model/Checkout/Mandate.php @@ -601,7 +601,7 @@ public function getFrequency() /** * Sets frequency * - * @param string $frequency The frequency with which a shopper should be charged. Possible values: **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. + * @param string $frequency The frequency with which a shopper should be charged. Possible values: **adhoc**, **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/UKLocalAccountIdentification.php b/src/Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.php similarity index 75% rename from src/Adyen/Model/ConfigurationWebhooks/UKLocalAccountIdentification.php rename to src/Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.php index 278f7077c..98637c162 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/UKLocalAccountIdentification.php +++ b/src/Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.php @@ -1,9 +1,9 @@ */ -class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +class PayByBankAISDirectDebitDetails implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json * * @var string */ - protected static $openAPIModelName = 'UKLocalAccountIdentification'; + protected static $openAPIModelName = 'PayByBankAISDirectDebitDetails'; /** * Array of property to type mappings. Used for (de)serialization @@ -44,9 +44,9 @@ class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json * @var string[] */ protected static $openAPITypes = [ - 'accountNumber' => 'string', - 'formFactor' => 'string', - 'sortCode' => 'string', + 'checkoutAttemptId' => 'string', + 'recurringDetailReference' => 'string', + 'storedPaymentMethodId' => 'string', 'type' => 'string' ]; @@ -58,9 +58,9 @@ class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json * @psalm-var array */ protected static $openAPIFormats = [ - 'accountNumber' => null, - 'formFactor' => null, - 'sortCode' => null, + 'checkoutAttemptId' => null, + 'recurringDetailReference' => null, + 'storedPaymentMethodId' => null, 'type' => null ]; @@ -70,9 +70,9 @@ class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json * @var boolean[] */ protected static $openAPINullables = [ - 'accountNumber' => false, - 'formFactor' => true, - 'sortCode' => false, + 'checkoutAttemptId' => false, + 'recurringDetailReference' => false, + 'storedPaymentMethodId' => false, 'type' => false ]; @@ -162,9 +162,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'accountNumber' => 'accountNumber', - 'formFactor' => 'formFactor', - 'sortCode' => 'sortCode', + 'checkoutAttemptId' => 'checkoutAttemptId', + 'recurringDetailReference' => 'recurringDetailReference', + 'storedPaymentMethodId' => 'storedPaymentMethodId', 'type' => 'type' ]; @@ -174,9 +174,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'accountNumber' => 'setAccountNumber', - 'formFactor' => 'setFormFactor', - 'sortCode' => 'setSortCode', + 'checkoutAttemptId' => 'setCheckoutAttemptId', + 'recurringDetailReference' => 'setRecurringDetailReference', + 'storedPaymentMethodId' => 'setStoredPaymentMethodId', 'type' => 'setType' ]; @@ -186,9 +186,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'accountNumber' => 'getAccountNumber', - 'formFactor' => 'getFormFactor', - 'sortCode' => 'getSortCode', + 'checkoutAttemptId' => 'getCheckoutAttemptId', + 'recurringDetailReference' => 'getRecurringDetailReference', + 'storedPaymentMethodId' => 'getStoredPaymentMethodId', 'type' => 'getType' ]; @@ -233,7 +233,7 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_UK_LOCAL = 'ukLocal'; + public const TYPE_PAYBYBANK_AIS_DD = 'paybybank_AIS_DD'; /** * Gets allowable values of the enum @@ -243,7 +243,7 @@ public function getModelName() public function getTypeAllowableValues() { return [ - self::TYPE_UK_LOCAL, + self::TYPE_PAYBYBANK_AIS_DD, ]; } /** @@ -261,9 +261,9 @@ public function getTypeAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); - $this->setIfExists('sortCode', $data ?? [], null); + $this->setIfExists('checkoutAttemptId', $data ?? [], null); + $this->setIfExists('recurringDetailReference', $data ?? [], null); + $this->setIfExists('storedPaymentMethodId', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -294,12 +294,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['accountNumber'] === null) { - $invalidProperties[] = "'accountNumber' can't be null"; - } - if ($this->container['sortCode'] === null) { - $invalidProperties[] = "'sortCode' can't be null"; - } if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } @@ -328,89 +322,75 @@ public function valid() /** - * Gets accountNumber + * Gets checkoutAttemptId * - * @return string + * @return string|null */ - public function getAccountNumber() + public function getCheckoutAttemptId() { - return $this->container['accountNumber']; + return $this->container['checkoutAttemptId']; } /** - * Sets accountNumber + * Sets checkoutAttemptId * - * @param string $accountNumber The 8-digit bank account number, without separators or whitespace. + * @param string|null $checkoutAttemptId The checkout attempt identifier. * * @return self */ - public function setAccountNumber($accountNumber) + public function setCheckoutAttemptId($checkoutAttemptId) { - if (is_null($accountNumber)) { - throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); - } - $this->container['accountNumber'] = $accountNumber; + $this->container['checkoutAttemptId'] = $checkoutAttemptId; return $this; } /** - * Gets formFactor + * Gets recurringDetailReference * * @return string|null + * @deprecated */ - public function getFormFactor() + public function getRecurringDetailReference() { - return $this->container['formFactor']; + return $this->container['recurringDetailReference']; } /** - * Sets formFactor + * Sets recurringDetailReference * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. + * @param string|null $recurringDetailReference This is the `recurringDetailReference` returned in the response when you created the token. * * @return self + * @deprecated */ - public function setFormFactor($formFactor) + public function setRecurringDetailReference($recurringDetailReference) { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; + $this->container['recurringDetailReference'] = $recurringDetailReference; return $this; } /** - * Gets sortCode + * Gets storedPaymentMethodId * - * @return string + * @return string|null */ - public function getSortCode() + public function getStoredPaymentMethodId() { - return $this->container['sortCode']; + return $this->container['storedPaymentMethodId']; } /** - * Sets sortCode + * Sets storedPaymentMethodId * - * @param string $sortCode The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. + * @param string|null $storedPaymentMethodId This is the `recurringDetailReference` returned in the response when you created the token. * * @return self */ - public function setSortCode($sortCode) + public function setStoredPaymentMethodId($storedPaymentMethodId) { - if (is_null($sortCode)) { - throw new \InvalidArgumentException('non-nullable sortCode cannot be null'); - } - $this->container['sortCode'] = $sortCode; + $this->container['storedPaymentMethodId'] = $storedPaymentMethodId; return $this; } @@ -428,15 +408,12 @@ public function getType() /** * Sets type * - * @param string $type **ukLocal** + * @param string $type **paybybank_** * * @return self */ public function setType($type) { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( diff --git a/src/Adyen/Model/Checkout/PaymentDetails.php b/src/Adyen/Model/Checkout/PaymentDetails.php index 553c49149..4e6ad821a 100644 --- a/src/Adyen/Model/Checkout/PaymentDetails.php +++ b/src/Adyen/Model/Checkout/PaymentDetails.php @@ -251,7 +251,6 @@ public function getModelName() public const TYPE_UPI_QR = 'upi_qr'; public const TYPE_PAYTM = 'paytm'; public const TYPE_MOLPAY_EBANKING_VN = 'molpay_ebanking_VN'; - public const TYPE_EBANKING_FI = 'ebanking_FI'; public const TYPE_MOLPAY_EBANKING_MY = 'molpay_ebanking_MY'; public const TYPE_MOLPAY_EBANKING_DIRECT_MY = 'molpay_ebanking_direct_MY'; public const TYPE_SWISH = 'swish'; @@ -351,7 +350,6 @@ public function getTypeAllowableValues() self::TYPE_UPI_QR, self::TYPE_PAYTM, self::TYPE_MOLPAY_EBANKING_VN, - self::TYPE_EBANKING_FI, self::TYPE_MOLPAY_EBANKING_MY, self::TYPE_MOLPAY_EBANKING_DIRECT_MY, self::TYPE_SWISH, diff --git a/src/Adyen/Model/Checkout/PaymentMethodsRequest.php b/src/Adyen/Model/Checkout/PaymentMethodsRequest.php index dfe17a6fb..0089c1ad8 100644 --- a/src/Adyen/Model/Checkout/PaymentMethodsRequest.php +++ b/src/Adyen/Model/Checkout/PaymentMethodsRequest.php @@ -52,6 +52,7 @@ class PaymentMethodsRequest implements ModelInterface, ArrayAccess, \JsonSeriali 'countryCode' => 'string', 'merchantAccount' => 'string', 'order' => '\Adyen\Model\Checkout\EncryptedOrderData', + 'shopperConversionId' => 'string', 'shopperLocale' => 'string', 'shopperReference' => 'string', 'splitCardFundingSources' => 'bool', @@ -75,6 +76,7 @@ class PaymentMethodsRequest implements ModelInterface, ArrayAccess, \JsonSeriali 'countryCode' => null, 'merchantAccount' => null, 'order' => null, + 'shopperConversionId' => null, 'shopperLocale' => null, 'shopperReference' => null, 'splitCardFundingSources' => null, @@ -96,6 +98,7 @@ class PaymentMethodsRequest implements ModelInterface, ArrayAccess, \JsonSeriali 'countryCode' => false, 'merchantAccount' => false, 'order' => false, + 'shopperConversionId' => false, 'shopperLocale' => false, 'shopperReference' => false, 'splitCardFundingSources' => false, @@ -197,6 +200,7 @@ public function isNullableSetToNull(string $property): bool 'countryCode' => 'countryCode', 'merchantAccount' => 'merchantAccount', 'order' => 'order', + 'shopperConversionId' => 'shopperConversionId', 'shopperLocale' => 'shopperLocale', 'shopperReference' => 'shopperReference', 'splitCardFundingSources' => 'splitCardFundingSources', @@ -218,6 +222,7 @@ public function isNullableSetToNull(string $property): bool 'countryCode' => 'setCountryCode', 'merchantAccount' => 'setMerchantAccount', 'order' => 'setOrder', + 'shopperConversionId' => 'setShopperConversionId', 'shopperLocale' => 'setShopperLocale', 'shopperReference' => 'setShopperReference', 'splitCardFundingSources' => 'setSplitCardFundingSources', @@ -239,6 +244,7 @@ public function isNullableSetToNull(string $property): bool 'countryCode' => 'getCountryCode', 'merchantAccount' => 'getMerchantAccount', 'order' => 'getOrder', + 'shopperConversionId' => 'getShopperConversionId', 'shopperLocale' => 'getShopperLocale', 'shopperReference' => 'getShopperReference', 'splitCardFundingSources' => 'getSplitCardFundingSources', @@ -343,6 +349,7 @@ public function __construct(array $data = null) $this->setIfExists('countryCode', $data ?? [], null); $this->setIfExists('merchantAccount', $data ?? [], null); $this->setIfExists('order', $data ?? [], null); + $this->setIfExists('shopperConversionId', $data ?? [], null); $this->setIfExists('shopperLocale', $data ?? [], null); $this->setIfExists('shopperReference', $data ?? [], null); $this->setIfExists('splitCardFundingSources', $data ?? [], null); @@ -615,6 +622,30 @@ public function setOrder($order) return $this; } + /** + * Gets shopperConversionId + * + * @return string|null + */ + public function getShopperConversionId() + { + return $this->container['shopperConversionId']; + } + + /** + * Sets shopperConversionId + * + * @param string|null $shopperConversionId A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates. + * + * @return self + */ + public function setShopperConversionId($shopperConversionId) + { + $this->container['shopperConversionId'] = $shopperConversionId; + + return $this; + } + /** * Gets shopperLocale * diff --git a/src/Adyen/Model/Checkout/PaymentRequest.php b/src/Adyen/Model/Checkout/PaymentRequest.php index aab20b5c0..921cb0a8a 100644 --- a/src/Adyen/Model/Checkout/PaymentRequest.php +++ b/src/Adyen/Model/Checkout/PaymentRequest.php @@ -50,6 +50,7 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'amount' => '\Adyen\Model\Checkout\Amount', 'applicationInfo' => '\Adyen\Model\Checkout\ApplicationInfo', 'authenticationData' => '\Adyen\Model\Checkout\AuthenticationData', + 'bankAccount' => '\Adyen\Model\Checkout\CheckoutBankAccount', 'billingAddress' => '\Adyen\Model\Checkout\BillingAddress', 'browserInfo' => '\Adyen\Model\Checkout\BrowserInfo', 'captureDelayHours' => 'int', @@ -96,6 +97,7 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'returnUrl' => 'string', 'riskData' => '\Adyen\Model\Checkout\RiskData', 'sessionValidity' => 'string', + 'shopperConversionId' => 'string', 'shopperEmail' => 'string', 'shopperIP' => 'string', 'shopperInteraction' => 'string', @@ -128,6 +130,7 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'amount' => null, 'applicationInfo' => null, 'authenticationData' => null, + 'bankAccount' => null, 'billingAddress' => null, 'browserInfo' => null, 'captureDelayHours' => 'int32', @@ -174,6 +177,7 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'returnUrl' => null, 'riskData' => null, 'sessionValidity' => null, + 'shopperConversionId' => null, 'shopperEmail' => null, 'shopperIP' => null, 'shopperInteraction' => null, @@ -204,6 +208,7 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'amount' => false, 'applicationInfo' => false, 'authenticationData' => false, + 'bankAccount' => false, 'billingAddress' => false, 'browserInfo' => false, 'captureDelayHours' => true, @@ -250,6 +255,7 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'returnUrl' => false, 'riskData' => false, 'sessionValidity' => false, + 'shopperConversionId' => false, 'shopperEmail' => false, 'shopperIP' => false, 'shopperInteraction' => false, @@ -360,6 +366,7 @@ public function isNullableSetToNull(string $property): bool 'amount' => 'amount', 'applicationInfo' => 'applicationInfo', 'authenticationData' => 'authenticationData', + 'bankAccount' => 'bankAccount', 'billingAddress' => 'billingAddress', 'browserInfo' => 'browserInfo', 'captureDelayHours' => 'captureDelayHours', @@ -406,6 +413,7 @@ public function isNullableSetToNull(string $property): bool 'returnUrl' => 'returnUrl', 'riskData' => 'riskData', 'sessionValidity' => 'sessionValidity', + 'shopperConversionId' => 'shopperConversionId', 'shopperEmail' => 'shopperEmail', 'shopperIP' => 'shopperIP', 'shopperInteraction' => 'shopperInteraction', @@ -436,6 +444,7 @@ public function isNullableSetToNull(string $property): bool 'amount' => 'setAmount', 'applicationInfo' => 'setApplicationInfo', 'authenticationData' => 'setAuthenticationData', + 'bankAccount' => 'setBankAccount', 'billingAddress' => 'setBillingAddress', 'browserInfo' => 'setBrowserInfo', 'captureDelayHours' => 'setCaptureDelayHours', @@ -482,6 +491,7 @@ public function isNullableSetToNull(string $property): bool 'returnUrl' => 'setReturnUrl', 'riskData' => 'setRiskData', 'sessionValidity' => 'setSessionValidity', + 'shopperConversionId' => 'setShopperConversionId', 'shopperEmail' => 'setShopperEmail', 'shopperIP' => 'setShopperIP', 'shopperInteraction' => 'setShopperInteraction', @@ -512,6 +522,7 @@ public function isNullableSetToNull(string $property): bool 'amount' => 'getAmount', 'applicationInfo' => 'getApplicationInfo', 'authenticationData' => 'getAuthenticationData', + 'bankAccount' => 'getBankAccount', 'billingAddress' => 'getBillingAddress', 'browserInfo' => 'getBrowserInfo', 'captureDelayHours' => 'getCaptureDelayHours', @@ -558,6 +569,7 @@ public function isNullableSetToNull(string $property): bool 'returnUrl' => 'getReturnUrl', 'riskData' => 'getRiskData', 'sessionValidity' => 'getSessionValidity', + 'shopperConversionId' => 'getShopperConversionId', 'shopperEmail' => 'getShopperEmail', 'shopperIP' => 'getShopperIP', 'shopperInteraction' => 'getShopperInteraction', @@ -719,6 +731,7 @@ public function __construct(array $data = null) $this->setIfExists('amount', $data ?? [], null); $this->setIfExists('applicationInfo', $data ?? [], null); $this->setIfExists('authenticationData', $data ?? [], null); + $this->setIfExists('bankAccount', $data ?? [], null); $this->setIfExists('billingAddress', $data ?? [], null); $this->setIfExists('browserInfo', $data ?? [], null); $this->setIfExists('captureDelayHours', $data ?? [], null); @@ -765,6 +778,7 @@ public function __construct(array $data = null) $this->setIfExists('returnUrl', $data ?? [], null); $this->setIfExists('riskData', $data ?? [], null); $this->setIfExists('sessionValidity', $data ?? [], null); + $this->setIfExists('shopperConversionId', $data ?? [], null); $this->setIfExists('shopperEmail', $data ?? [], null); $this->setIfExists('shopperIP', $data ?? [], null); $this->setIfExists('shopperInteraction', $data ?? [], null); @@ -1029,6 +1043,30 @@ public function setAuthenticationData($authenticationData) return $this; } + /** + * Gets bankAccount + * + * @return \Adyen\Model\Checkout\CheckoutBankAccount|null + */ + public function getBankAccount() + { + return $this->container['bankAccount']; + } + + /** + * Sets bankAccount + * + * @param \Adyen\Model\Checkout\CheckoutBankAccount|null $bankAccount bankAccount + * + * @return self + */ + public function setBankAccount($bankAccount) + { + $this->container['bankAccount'] = $bankAccount; + + return $this; + } + /** * Gets billingAddress * @@ -2177,6 +2215,30 @@ public function setSessionValidity($sessionValidity) return $this; } + /** + * Gets shopperConversionId + * + * @return string|null + */ + public function getShopperConversionId() + { + return $this->container['shopperConversionId']; + } + + /** + * Sets shopperConversionId + * + * @param string|null $shopperConversionId A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates. + * + * @return self + */ + public function setShopperConversionId($shopperConversionId) + { + $this->container['shopperConversionId'] = $shopperConversionId; + + return $this; + } + /** * Gets shopperEmail * diff --git a/src/Adyen/Model/Checkout/PaymentSetupRequest.php b/src/Adyen/Model/Checkout/PaymentSetupRequest.php deleted file mode 100644 index bba2b04c9..000000000 --- a/src/Adyen/Model/Checkout/PaymentSetupRequest.php +++ /dev/null @@ -1,2267 +0,0 @@ - - */ -class PaymentSetupRequest implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'PaymentSetupRequest'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'additionalAmount' => '\Adyen\Model\Checkout\Amount', - 'additionalData' => 'array', - 'allowedPaymentMethods' => 'string[]', - 'amount' => '\Adyen\Model\Checkout\Amount', - 'applicationInfo' => '\Adyen\Model\Checkout\ApplicationInfo', - 'billingAddress' => '\Adyen\Model\Checkout\Address', - 'blockedPaymentMethods' => 'string[]', - 'captureDelayHours' => 'int', - 'channel' => 'string', - 'checkoutAttemptId' => 'string', - 'company' => '\Adyen\Model\Checkout\Company', - 'configuration' => '\Adyen\Model\Checkout\Configuration', - 'conversionId' => 'string', - 'countryCode' => 'string', - 'dateOfBirth' => '\DateTime', - 'dccQuote' => '\Adyen\Model\Checkout\ForexQuote', - 'deliveryAddress' => '\Adyen\Model\Checkout\Address', - 'deliveryDate' => '\DateTime', - 'enableOneClick' => 'bool', - 'enablePayOut' => 'bool', - 'enableRecurring' => 'bool', - 'entityType' => 'string', - 'fraudOffset' => 'int', - 'installments' => '\Adyen\Model\Checkout\Installments', - 'lineItems' => '\Adyen\Model\Checkout\LineItem[]', - 'localizedShopperStatement' => 'array', - 'mandate' => '\Adyen\Model\Checkout\Mandate', - 'mcc' => 'string', - 'merchantAccount' => 'string', - 'merchantOrderReference' => 'string', - 'metadata' => 'array', - 'orderReference' => 'string', - 'origin' => 'string', - 'platformChargebackLogic' => '\Adyen\Model\Checkout\PlatformChargebackLogic', - 'recurringExpiry' => 'string', - 'recurringFrequency' => 'string', - 'reference' => 'string', - 'returnUrl' => 'string', - 'riskData' => '\Adyen\Model\Checkout\RiskData', - 'sdkVersion' => 'string', - 'secureRemoteCommerceCheckoutData' => '\Adyen\Model\Checkout\SecureRemoteCommerceCheckoutData', - 'sessionValidity' => 'string', - 'shopperEmail' => 'string', - 'shopperIP' => 'string', - 'shopperInteraction' => 'string', - 'shopperLocale' => 'string', - 'shopperName' => '\Adyen\Model\Checkout\Name', - 'shopperReference' => 'string', - 'shopperStatement' => 'string', - 'socialSecurityNumber' => 'string', - 'splits' => '\Adyen\Model\Checkout\Split[]', - 'store' => 'string', - 'storePaymentMethod' => 'bool', - 'telephoneNumber' => 'string', - 'threeDSAuthenticationOnly' => 'bool', - 'token' => 'string', - 'trustedShopper' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'additionalAmount' => null, - 'additionalData' => null, - 'allowedPaymentMethods' => null, - 'amount' => null, - 'applicationInfo' => null, - 'billingAddress' => null, - 'blockedPaymentMethods' => null, - 'captureDelayHours' => 'int32', - 'channel' => null, - 'checkoutAttemptId' => null, - 'company' => null, - 'configuration' => null, - 'conversionId' => null, - 'countryCode' => null, - 'dateOfBirth' => 'date', - 'dccQuote' => null, - 'deliveryAddress' => null, - 'deliveryDate' => 'date-time', - 'enableOneClick' => null, - 'enablePayOut' => null, - 'enableRecurring' => null, - 'entityType' => null, - 'fraudOffset' => 'int32', - 'installments' => null, - 'lineItems' => null, - 'localizedShopperStatement' => null, - 'mandate' => null, - 'mcc' => null, - 'merchantAccount' => null, - 'merchantOrderReference' => null, - 'metadata' => null, - 'orderReference' => null, - 'origin' => null, - 'platformChargebackLogic' => null, - 'recurringExpiry' => null, - 'recurringFrequency' => null, - 'reference' => null, - 'returnUrl' => null, - 'riskData' => null, - 'sdkVersion' => null, - 'secureRemoteCommerceCheckoutData' => null, - 'sessionValidity' => null, - 'shopperEmail' => null, - 'shopperIP' => null, - 'shopperInteraction' => null, - 'shopperLocale' => null, - 'shopperName' => null, - 'shopperReference' => null, - 'shopperStatement' => null, - 'socialSecurityNumber' => null, - 'splits' => null, - 'store' => null, - 'storePaymentMethod' => null, - 'telephoneNumber' => null, - 'threeDSAuthenticationOnly' => null, - 'token' => null, - 'trustedShopper' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'additionalAmount' => false, - 'additionalData' => false, - 'allowedPaymentMethods' => false, - 'amount' => false, - 'applicationInfo' => false, - 'billingAddress' => false, - 'blockedPaymentMethods' => false, - 'captureDelayHours' => true, - 'channel' => false, - 'checkoutAttemptId' => false, - 'company' => false, - 'configuration' => false, - 'conversionId' => false, - 'countryCode' => false, - 'dateOfBirth' => false, - 'dccQuote' => false, - 'deliveryAddress' => false, - 'deliveryDate' => false, - 'enableOneClick' => false, - 'enablePayOut' => false, - 'enableRecurring' => false, - 'entityType' => false, - 'fraudOffset' => true, - 'installments' => false, - 'lineItems' => false, - 'localizedShopperStatement' => false, - 'mandate' => false, - 'mcc' => false, - 'merchantAccount' => false, - 'merchantOrderReference' => false, - 'metadata' => false, - 'orderReference' => false, - 'origin' => false, - 'platformChargebackLogic' => false, - 'recurringExpiry' => false, - 'recurringFrequency' => false, - 'reference' => false, - 'returnUrl' => false, - 'riskData' => false, - 'sdkVersion' => false, - 'secureRemoteCommerceCheckoutData' => false, - 'sessionValidity' => false, - 'shopperEmail' => false, - 'shopperIP' => false, - 'shopperInteraction' => false, - 'shopperLocale' => false, - 'shopperName' => false, - 'shopperReference' => false, - 'shopperStatement' => false, - 'socialSecurityNumber' => false, - 'splits' => false, - 'store' => false, - 'storePaymentMethod' => false, - 'telephoneNumber' => false, - 'threeDSAuthenticationOnly' => false, - 'token' => false, - 'trustedShopper' => 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 = [ - 'additionalAmount' => 'additionalAmount', - 'additionalData' => 'additionalData', - 'allowedPaymentMethods' => 'allowedPaymentMethods', - 'amount' => 'amount', - 'applicationInfo' => 'applicationInfo', - 'billingAddress' => 'billingAddress', - 'blockedPaymentMethods' => 'blockedPaymentMethods', - 'captureDelayHours' => 'captureDelayHours', - 'channel' => 'channel', - 'checkoutAttemptId' => 'checkoutAttemptId', - 'company' => 'company', - 'configuration' => 'configuration', - 'conversionId' => 'conversionId', - 'countryCode' => 'countryCode', - 'dateOfBirth' => 'dateOfBirth', - 'dccQuote' => 'dccQuote', - 'deliveryAddress' => 'deliveryAddress', - 'deliveryDate' => 'deliveryDate', - 'enableOneClick' => 'enableOneClick', - 'enablePayOut' => 'enablePayOut', - 'enableRecurring' => 'enableRecurring', - 'entityType' => 'entityType', - 'fraudOffset' => 'fraudOffset', - 'installments' => 'installments', - 'lineItems' => 'lineItems', - 'localizedShopperStatement' => 'localizedShopperStatement', - 'mandate' => 'mandate', - 'mcc' => 'mcc', - 'merchantAccount' => 'merchantAccount', - 'merchantOrderReference' => 'merchantOrderReference', - 'metadata' => 'metadata', - 'orderReference' => 'orderReference', - 'origin' => 'origin', - 'platformChargebackLogic' => 'platformChargebackLogic', - 'recurringExpiry' => 'recurringExpiry', - 'recurringFrequency' => 'recurringFrequency', - 'reference' => 'reference', - 'returnUrl' => 'returnUrl', - 'riskData' => 'riskData', - 'sdkVersion' => 'sdkVersion', - 'secureRemoteCommerceCheckoutData' => 'secureRemoteCommerceCheckoutData', - 'sessionValidity' => 'sessionValidity', - 'shopperEmail' => 'shopperEmail', - 'shopperIP' => 'shopperIP', - 'shopperInteraction' => 'shopperInteraction', - 'shopperLocale' => 'shopperLocale', - 'shopperName' => 'shopperName', - 'shopperReference' => 'shopperReference', - 'shopperStatement' => 'shopperStatement', - 'socialSecurityNumber' => 'socialSecurityNumber', - 'splits' => 'splits', - 'store' => 'store', - 'storePaymentMethod' => 'storePaymentMethod', - 'telephoneNumber' => 'telephoneNumber', - 'threeDSAuthenticationOnly' => 'threeDSAuthenticationOnly', - 'token' => 'token', - 'trustedShopper' => 'trustedShopper' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'additionalAmount' => 'setAdditionalAmount', - 'additionalData' => 'setAdditionalData', - 'allowedPaymentMethods' => 'setAllowedPaymentMethods', - 'amount' => 'setAmount', - 'applicationInfo' => 'setApplicationInfo', - 'billingAddress' => 'setBillingAddress', - 'blockedPaymentMethods' => 'setBlockedPaymentMethods', - 'captureDelayHours' => 'setCaptureDelayHours', - 'channel' => 'setChannel', - 'checkoutAttemptId' => 'setCheckoutAttemptId', - 'company' => 'setCompany', - 'configuration' => 'setConfiguration', - 'conversionId' => 'setConversionId', - 'countryCode' => 'setCountryCode', - 'dateOfBirth' => 'setDateOfBirth', - 'dccQuote' => 'setDccQuote', - 'deliveryAddress' => 'setDeliveryAddress', - 'deliveryDate' => 'setDeliveryDate', - 'enableOneClick' => 'setEnableOneClick', - 'enablePayOut' => 'setEnablePayOut', - 'enableRecurring' => 'setEnableRecurring', - 'entityType' => 'setEntityType', - 'fraudOffset' => 'setFraudOffset', - 'installments' => 'setInstallments', - 'lineItems' => 'setLineItems', - 'localizedShopperStatement' => 'setLocalizedShopperStatement', - 'mandate' => 'setMandate', - 'mcc' => 'setMcc', - 'merchantAccount' => 'setMerchantAccount', - 'merchantOrderReference' => 'setMerchantOrderReference', - 'metadata' => 'setMetadata', - 'orderReference' => 'setOrderReference', - 'origin' => 'setOrigin', - 'platformChargebackLogic' => 'setPlatformChargebackLogic', - 'recurringExpiry' => 'setRecurringExpiry', - 'recurringFrequency' => 'setRecurringFrequency', - 'reference' => 'setReference', - 'returnUrl' => 'setReturnUrl', - 'riskData' => 'setRiskData', - 'sdkVersion' => 'setSdkVersion', - 'secureRemoteCommerceCheckoutData' => 'setSecureRemoteCommerceCheckoutData', - 'sessionValidity' => 'setSessionValidity', - 'shopperEmail' => 'setShopperEmail', - 'shopperIP' => 'setShopperIP', - 'shopperInteraction' => 'setShopperInteraction', - 'shopperLocale' => 'setShopperLocale', - 'shopperName' => 'setShopperName', - 'shopperReference' => 'setShopperReference', - 'shopperStatement' => 'setShopperStatement', - 'socialSecurityNumber' => 'setSocialSecurityNumber', - 'splits' => 'setSplits', - 'store' => 'setStore', - 'storePaymentMethod' => 'setStorePaymentMethod', - 'telephoneNumber' => 'setTelephoneNumber', - 'threeDSAuthenticationOnly' => 'setThreeDSAuthenticationOnly', - 'token' => 'setToken', - 'trustedShopper' => 'setTrustedShopper' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'additionalAmount' => 'getAdditionalAmount', - 'additionalData' => 'getAdditionalData', - 'allowedPaymentMethods' => 'getAllowedPaymentMethods', - 'amount' => 'getAmount', - 'applicationInfo' => 'getApplicationInfo', - 'billingAddress' => 'getBillingAddress', - 'blockedPaymentMethods' => 'getBlockedPaymentMethods', - 'captureDelayHours' => 'getCaptureDelayHours', - 'channel' => 'getChannel', - 'checkoutAttemptId' => 'getCheckoutAttemptId', - 'company' => 'getCompany', - 'configuration' => 'getConfiguration', - 'conversionId' => 'getConversionId', - 'countryCode' => 'getCountryCode', - 'dateOfBirth' => 'getDateOfBirth', - 'dccQuote' => 'getDccQuote', - 'deliveryAddress' => 'getDeliveryAddress', - 'deliveryDate' => 'getDeliveryDate', - 'enableOneClick' => 'getEnableOneClick', - 'enablePayOut' => 'getEnablePayOut', - 'enableRecurring' => 'getEnableRecurring', - 'entityType' => 'getEntityType', - 'fraudOffset' => 'getFraudOffset', - 'installments' => 'getInstallments', - 'lineItems' => 'getLineItems', - 'localizedShopperStatement' => 'getLocalizedShopperStatement', - 'mandate' => 'getMandate', - 'mcc' => 'getMcc', - 'merchantAccount' => 'getMerchantAccount', - 'merchantOrderReference' => 'getMerchantOrderReference', - 'metadata' => 'getMetadata', - 'orderReference' => 'getOrderReference', - 'origin' => 'getOrigin', - 'platformChargebackLogic' => 'getPlatformChargebackLogic', - 'recurringExpiry' => 'getRecurringExpiry', - 'recurringFrequency' => 'getRecurringFrequency', - 'reference' => 'getReference', - 'returnUrl' => 'getReturnUrl', - 'riskData' => 'getRiskData', - 'sdkVersion' => 'getSdkVersion', - 'secureRemoteCommerceCheckoutData' => 'getSecureRemoteCommerceCheckoutData', - 'sessionValidity' => 'getSessionValidity', - 'shopperEmail' => 'getShopperEmail', - 'shopperIP' => 'getShopperIP', - 'shopperInteraction' => 'getShopperInteraction', - 'shopperLocale' => 'getShopperLocale', - 'shopperName' => 'getShopperName', - 'shopperReference' => 'getShopperReference', - 'shopperStatement' => 'getShopperStatement', - 'socialSecurityNumber' => 'getSocialSecurityNumber', - 'splits' => 'getSplits', - 'store' => 'getStore', - 'storePaymentMethod' => 'getStorePaymentMethod', - 'telephoneNumber' => 'getTelephoneNumber', - 'threeDSAuthenticationOnly' => 'getThreeDSAuthenticationOnly', - 'token' => 'getToken', - 'trustedShopper' => 'getTrustedShopper' - ]; - - /** - * 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 CHANNEL_I_OS = 'iOS'; - public const CHANNEL_ANDROID = 'Android'; - public const CHANNEL_WEB = 'Web'; - public const ENTITY_TYPE_NATURAL_PERSON = 'NaturalPerson'; - public const ENTITY_TYPE_COMPANY_NAME = 'CompanyName'; - public const SHOPPER_INTERACTION_ECOMMERCE = 'Ecommerce'; - public const SHOPPER_INTERACTION_CONT_AUTH = 'ContAuth'; - public const SHOPPER_INTERACTION_MOTO = 'Moto'; - public const SHOPPER_INTERACTION_POS = 'POS'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getChannelAllowableValues() - { - return [ - self::CHANNEL_I_OS, - self::CHANNEL_ANDROID, - self::CHANNEL_WEB, - ]; - } - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getEntityTypeAllowableValues() - { - return [ - self::ENTITY_TYPE_NATURAL_PERSON, - self::ENTITY_TYPE_COMPANY_NAME, - ]; - } - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getShopperInteractionAllowableValues() - { - return [ - self::SHOPPER_INTERACTION_ECOMMERCE, - self::SHOPPER_INTERACTION_CONT_AUTH, - self::SHOPPER_INTERACTION_MOTO, - self::SHOPPER_INTERACTION_POS, - ]; - } - /** - * 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('additionalAmount', $data ?? [], null); - $this->setIfExists('additionalData', $data ?? [], null); - $this->setIfExists('allowedPaymentMethods', $data ?? [], null); - $this->setIfExists('amount', $data ?? [], null); - $this->setIfExists('applicationInfo', $data ?? [], null); - $this->setIfExists('billingAddress', $data ?? [], null); - $this->setIfExists('blockedPaymentMethods', $data ?? [], null); - $this->setIfExists('captureDelayHours', $data ?? [], null); - $this->setIfExists('channel', $data ?? [], null); - $this->setIfExists('checkoutAttemptId', $data ?? [], null); - $this->setIfExists('company', $data ?? [], null); - $this->setIfExists('configuration', $data ?? [], null); - $this->setIfExists('conversionId', $data ?? [], null); - $this->setIfExists('countryCode', $data ?? [], null); - $this->setIfExists('dateOfBirth', $data ?? [], null); - $this->setIfExists('dccQuote', $data ?? [], null); - $this->setIfExists('deliveryAddress', $data ?? [], null); - $this->setIfExists('deliveryDate', $data ?? [], null); - $this->setIfExists('enableOneClick', $data ?? [], null); - $this->setIfExists('enablePayOut', $data ?? [], null); - $this->setIfExists('enableRecurring', $data ?? [], null); - $this->setIfExists('entityType', $data ?? [], null); - $this->setIfExists('fraudOffset', $data ?? [], null); - $this->setIfExists('installments', $data ?? [], null); - $this->setIfExists('lineItems', $data ?? [], null); - $this->setIfExists('localizedShopperStatement', $data ?? [], null); - $this->setIfExists('mandate', $data ?? [], null); - $this->setIfExists('mcc', $data ?? [], null); - $this->setIfExists('merchantAccount', $data ?? [], null); - $this->setIfExists('merchantOrderReference', $data ?? [], null); - $this->setIfExists('metadata', $data ?? [], null); - $this->setIfExists('orderReference', $data ?? [], null); - $this->setIfExists('origin', $data ?? [], null); - $this->setIfExists('platformChargebackLogic', $data ?? [], null); - $this->setIfExists('recurringExpiry', $data ?? [], null); - $this->setIfExists('recurringFrequency', $data ?? [], null); - $this->setIfExists('reference', $data ?? [], null); - $this->setIfExists('returnUrl', $data ?? [], null); - $this->setIfExists('riskData', $data ?? [], null); - $this->setIfExists('sdkVersion', $data ?? [], null); - $this->setIfExists('secureRemoteCommerceCheckoutData', $data ?? [], null); - $this->setIfExists('sessionValidity', $data ?? [], null); - $this->setIfExists('shopperEmail', $data ?? [], null); - $this->setIfExists('shopperIP', $data ?? [], null); - $this->setIfExists('shopperInteraction', $data ?? [], null); - $this->setIfExists('shopperLocale', $data ?? [], null); - $this->setIfExists('shopperName', $data ?? [], null); - $this->setIfExists('shopperReference', $data ?? [], null); - $this->setIfExists('shopperStatement', $data ?? [], null); - $this->setIfExists('socialSecurityNumber', $data ?? [], null); - $this->setIfExists('splits', $data ?? [], null); - $this->setIfExists('store', $data ?? [], null); - $this->setIfExists('storePaymentMethod', $data ?? [], null); - $this->setIfExists('telephoneNumber', $data ?? [], null); - $this->setIfExists('threeDSAuthenticationOnly', $data ?? [], null); - $this->setIfExists('token', $data ?? [], null); - $this->setIfExists('trustedShopper', $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['amount'] === null) { - $invalidProperties[] = "'amount' can't be null"; - } - $allowedValues = $this->getChannelAllowableValues(); - if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'channel', must be one of '%s'", - $this->container['channel'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['countryCode'] === null) { - $invalidProperties[] = "'countryCode' can't be null"; - } - $allowedValues = $this->getEntityTypeAllowableValues(); - if (!is_null($this->container['entityType']) && !in_array($this->container['entityType'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'entityType', must be one of '%s'", - $this->container['entityType'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['merchantAccount'] === null) { - $invalidProperties[] = "'merchantAccount' can't be null"; - } - if ($this->container['reference'] === null) { - $invalidProperties[] = "'reference' can't be null"; - } - if ($this->container['returnUrl'] === null) { - $invalidProperties[] = "'returnUrl' can't be null"; - } - $allowedValues = $this->getShopperInteractionAllowableValues(); - if (!is_null($this->container['shopperInteraction']) && !in_array($this->container['shopperInteraction'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'shopperInteraction', must be one of '%s'", - $this->container['shopperInteraction'], - 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 additionalAmount - * - * @return \Adyen\Model\Checkout\Amount|null - */ - public function getAdditionalAmount() - { - return $this->container['additionalAmount']; - } - - /** - * Sets additionalAmount - * - * @param \Adyen\Model\Checkout\Amount|null $additionalAmount additionalAmount - * - * @return self - */ - public function setAdditionalAmount($additionalAmount) - { - $this->container['additionalAmount'] = $additionalAmount; - - return $this; - } - - /** - * Gets additionalData - * - * @return array|null - */ - public function getAdditionalData() - { - return $this->container['additionalData']; - } - - /** - * Sets additionalData - * - * @param array|null $additionalData This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - * - * @return self - */ - public function setAdditionalData($additionalData) - { - $this->container['additionalData'] = $additionalData; - - return $this; - } - - /** - * Gets allowedPaymentMethods - * - * @return string[]|null - */ - public function getAllowedPaymentMethods() - { - return $this->container['allowedPaymentMethods']; - } - - /** - * Sets allowedPaymentMethods - * - * @param string[]|null $allowedPaymentMethods List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` - * - * @return self - */ - public function setAllowedPaymentMethods($allowedPaymentMethods) - { - $this->container['allowedPaymentMethods'] = $allowedPaymentMethods; - - return $this; - } - - /** - * Gets amount - * - * @return \Adyen\Model\Checkout\Amount - */ - public function getAmount() - { - return $this->container['amount']; - } - - /** - * Sets amount - * - * @param \Adyen\Model\Checkout\Amount $amount amount - * - * @return self - */ - public function setAmount($amount) - { - $this->container['amount'] = $amount; - - return $this; - } - - /** - * Gets applicationInfo - * - * @return \Adyen\Model\Checkout\ApplicationInfo|null - */ - public function getApplicationInfo() - { - return $this->container['applicationInfo']; - } - - /** - * Sets applicationInfo - * - * @param \Adyen\Model\Checkout\ApplicationInfo|null $applicationInfo applicationInfo - * - * @return self - */ - public function setApplicationInfo($applicationInfo) - { - $this->container['applicationInfo'] = $applicationInfo; - - return $this; - } - - /** - * Gets billingAddress - * - * @return \Adyen\Model\Checkout\Address|null - */ - public function getBillingAddress() - { - return $this->container['billingAddress']; - } - - /** - * Sets billingAddress - * - * @param \Adyen\Model\Checkout\Address|null $billingAddress billingAddress - * - * @return self - */ - public function setBillingAddress($billingAddress) - { - $this->container['billingAddress'] = $billingAddress; - - return $this; - } - - /** - * Gets blockedPaymentMethods - * - * @return string[]|null - */ - public function getBlockedPaymentMethods() - { - return $this->container['blockedPaymentMethods']; - } - - /** - * Sets blockedPaymentMethods - * - * @param string[]|null $blockedPaymentMethods List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` - * - * @return self - */ - public function setBlockedPaymentMethods($blockedPaymentMethods) - { - $this->container['blockedPaymentMethods'] = $blockedPaymentMethods; - - return $this; - } - - /** - * Gets captureDelayHours - * - * @return int|null - */ - public function getCaptureDelayHours() - { - return $this->container['captureDelayHours']; - } - - /** - * Sets captureDelayHours - * - * @param int|null $captureDelayHours The delay between the authorisation and scheduled auto-capture, specified in hours. - * - * @return self - */ - public function setCaptureDelayHours($captureDelayHours) - { - $this->container['captureDelayHours'] = $captureDelayHours; - - return $this; - } - - /** - * Gets channel - * - * @return string|null - */ - public function getChannel() - { - return $this->container['channel']; - } - - /** - * Sets channel - * - * @param string|null $channel The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web - * - * @return self - */ - public function setChannel($channel) - { - $allowedValues = $this->getChannelAllowableValues(); - if (!in_array($channel, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'channel', must be one of '%s'", - $channel, - implode("', '", $allowedValues) - ) - ); - } - $this->container['channel'] = $channel; - - return $this; - } - - /** - * Gets checkoutAttemptId - * - * @return string|null - */ - public function getCheckoutAttemptId() - { - return $this->container['checkoutAttemptId']; - } - - /** - * Sets checkoutAttemptId - * - * @param string|null $checkoutAttemptId Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - * - * @return self - */ - public function setCheckoutAttemptId($checkoutAttemptId) - { - $this->container['checkoutAttemptId'] = $checkoutAttemptId; - - return $this; - } - - /** - * Gets company - * - * @return \Adyen\Model\Checkout\Company|null - */ - public function getCompany() - { - return $this->container['company']; - } - - /** - * Sets company - * - * @param \Adyen\Model\Checkout\Company|null $company company - * - * @return self - */ - public function setCompany($company) - { - $this->container['company'] = $company; - - return $this; - } - - /** - * Gets configuration - * - * @return \Adyen\Model\Checkout\Configuration|null - */ - public function getConfiguration() - { - return $this->container['configuration']; - } - - /** - * Sets configuration - * - * @param \Adyen\Model\Checkout\Configuration|null $configuration configuration - * - * @return self - */ - public function setConfiguration($configuration) - { - $this->container['configuration'] = $configuration; - - return $this; - } - - /** - * Gets conversionId - * - * @return string|null - * @deprecated - */ - public function getConversionId() - { - return $this->container['conversionId']; - } - - /** - * Sets conversionId - * - * @param string|null $conversionId Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - * - * @return self - * @deprecated - */ - public function setConversionId($conversionId) - { - $this->container['conversionId'] = $conversionId; - - return $this; - } - - /** - * Gets countryCode - * - * @return string - */ - public function getCountryCode() - { - return $this->container['countryCode']; - } - - /** - * Sets countryCode - * - * @param string $countryCode The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE - * - * @return self - */ - public function setCountryCode($countryCode) - { - $this->container['countryCode'] = $countryCode; - - return $this; - } - - /** - * Gets dateOfBirth - * - * @return \DateTime|null - */ - public function getDateOfBirth() - { - return $this->container['dateOfBirth']; - } - - /** - * Sets dateOfBirth - * - * @param \DateTime|null $dateOfBirth The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - * - * @return self - */ - public function setDateOfBirth($dateOfBirth) - { - $this->container['dateOfBirth'] = $dateOfBirth; - - return $this; - } - - /** - * Gets dccQuote - * - * @return \Adyen\Model\Checkout\ForexQuote|null - */ - public function getDccQuote() - { - return $this->container['dccQuote']; - } - - /** - * Sets dccQuote - * - * @param \Adyen\Model\Checkout\ForexQuote|null $dccQuote dccQuote - * - * @return self - */ - public function setDccQuote($dccQuote) - { - $this->container['dccQuote'] = $dccQuote; - - return $this; - } - - /** - * Gets deliveryAddress - * - * @return \Adyen\Model\Checkout\Address|null - */ - public function getDeliveryAddress() - { - return $this->container['deliveryAddress']; - } - - /** - * Sets deliveryAddress - * - * @param \Adyen\Model\Checkout\Address|null $deliveryAddress deliveryAddress - * - * @return self - */ - public function setDeliveryAddress($deliveryAddress) - { - $this->container['deliveryAddress'] = $deliveryAddress; - - return $this; - } - - /** - * Gets deliveryDate - * - * @return \DateTime|null - */ - public function getDeliveryDate() - { - return $this->container['deliveryDate']; - } - - /** - * Sets deliveryDate - * - * @param \DateTime|null $deliveryDate The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - * - * @return self - */ - public function setDeliveryDate($deliveryDate) - { - $this->container['deliveryDate'] = $deliveryDate; - - return $this; - } - - /** - * Gets enableOneClick - * - * @return bool|null - */ - public function getEnableOneClick() - { - return $this->container['enableOneClick']; - } - - /** - * Sets enableOneClick - * - * @param bool|null $enableOneClick When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. - * - * @return self - */ - public function setEnableOneClick($enableOneClick) - { - $this->container['enableOneClick'] = $enableOneClick; - - return $this; - } - - /** - * Gets enablePayOut - * - * @return bool|null - */ - public function getEnablePayOut() - { - return $this->container['enablePayOut']; - } - - /** - * Sets enablePayOut - * - * @param bool|null $enablePayOut When true and `shopperReference` is provided, the payment details will be tokenized for payouts. - * - * @return self - */ - public function setEnablePayOut($enablePayOut) - { - $this->container['enablePayOut'] = $enablePayOut; - - return $this; - } - - /** - * Gets enableRecurring - * - * @return bool|null - */ - public function getEnableRecurring() - { - return $this->container['enableRecurring']; - } - - /** - * Sets enableRecurring - * - * @param bool|null $enableRecurring When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. - * - * @return self - */ - public function setEnableRecurring($enableRecurring) - { - $this->container['enableRecurring'] = $enableRecurring; - - return $this; - } - - /** - * Gets entityType - * - * @return string|null - */ - public function getEntityType() - { - return $this->container['entityType']; - } - - /** - * Sets entityType - * - * @param string|null $entityType The type of the entity the payment is processed for. - * - * @return self - */ - public function setEntityType($entityType) - { - $allowedValues = $this->getEntityTypeAllowableValues(); - if (!in_array($entityType, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'entityType', must be one of '%s'", - $entityType, - implode("', '", $allowedValues) - ) - ); - } - $this->container['entityType'] = $entityType; - - return $this; - } - - /** - * Gets fraudOffset - * - * @return int|null - */ - public function getFraudOffset() - { - return $this->container['fraudOffset']; - } - - /** - * Sets fraudOffset - * - * @param int|null $fraudOffset An integer value that is added to the normal fraud score. The value can be either positive or negative. - * - * @return self - */ - public function setFraudOffset($fraudOffset) - { - $this->container['fraudOffset'] = $fraudOffset; - - return $this; - } - - /** - * Gets installments - * - * @return \Adyen\Model\Checkout\Installments|null - */ - public function getInstallments() - { - return $this->container['installments']; - } - - /** - * Sets installments - * - * @param \Adyen\Model\Checkout\Installments|null $installments installments - * - * @return self - */ - public function setInstallments($installments) - { - $this->container['installments'] = $installments; - - return $this; - } - - /** - * Gets lineItems - * - * @return \Adyen\Model\Checkout\LineItem[]|null - */ - public function getLineItems() - { - return $this->container['lineItems']; - } - - /** - * Sets lineItems - * - * @param \Adyen\Model\Checkout\LineItem[]|null $lineItems Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - * - * @return self - */ - public function setLineItems($lineItems) - { - $this->container['lineItems'] = $lineItems; - - return $this; - } - - /** - * Gets localizedShopperStatement - * - * @return array|null - */ - public function getLocalizedShopperStatement() - { - return $this->container['localizedShopperStatement']; - } - - /** - * Sets localizedShopperStatement - * - * @param array|null $localizedShopperStatement The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. - * - * @return self - */ - public function setLocalizedShopperStatement($localizedShopperStatement) - { - $this->container['localizedShopperStatement'] = $localizedShopperStatement; - - return $this; - } - - /** - * Gets mandate - * - * @return \Adyen\Model\Checkout\Mandate|null - */ - public function getMandate() - { - return $this->container['mandate']; - } - - /** - * Sets mandate - * - * @param \Adyen\Model\Checkout\Mandate|null $mandate mandate - * - * @return self - */ - public function setMandate($mandate) - { - $this->container['mandate'] = $mandate; - - return $this; - } - - /** - * Gets mcc - * - * @return string|null - */ - public function getMcc() - { - return $this->container['mcc']; - } - - /** - * Sets mcc - * - * @param string|null $mcc The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - * - * @return self - */ - public function setMcc($mcc) - { - $this->container['mcc'] = $mcc; - - return $this; - } - - /** - * Gets merchantAccount - * - * @return string - */ - public function getMerchantAccount() - { - return $this->container['merchantAccount']; - } - - /** - * Sets merchantAccount - * - * @param string $merchantAccount The merchant account identifier, with which you want to process the transaction. - * - * @return self - */ - public function setMerchantAccount($merchantAccount) - { - $this->container['merchantAccount'] = $merchantAccount; - - return $this; - } - - /** - * Gets merchantOrderReference - * - * @return string|null - */ - public function getMerchantOrderReference() - { - return $this->container['merchantOrderReference']; - } - - /** - * Sets merchantOrderReference - * - * @param string|null $merchantOrderReference This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - * - * @return self - */ - public function setMerchantOrderReference($merchantOrderReference) - { - $this->container['merchantOrderReference'] = $merchantOrderReference; - - return $this; - } - - /** - * Gets metadata - * - * @return array|null - */ - public function getMetadata() - { - return $this->container['metadata']; - } - - /** - * Sets metadata - * - * @param array|null $metadata Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. - * - * @return self - */ - public function setMetadata($metadata) - { - $this->container['metadata'] = $metadata; - - return $this; - } - - /** - * Gets orderReference - * - * @return string|null - */ - public function getOrderReference() - { - return $this->container['orderReference']; - } - - /** - * Sets orderReference - * - * @param string|null $orderReference When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. - * - * @return self - */ - public function setOrderReference($orderReference) - { - $this->container['orderReference'] = $orderReference; - - return $this; - } - - /** - * Gets origin - * - * @return string|null - */ - public function getOrigin() - { - return $this->container['origin']; - } - - /** - * Sets origin - * - * @param string|null $origin Required for the Web integration. Set this parameter to the origin URL of the page that you are loading the SDK from. - * - * @return self - */ - public function setOrigin($origin) - { - $this->container['origin'] = $origin; - - return $this; - } - - /** - * Gets platformChargebackLogic - * - * @return \Adyen\Model\Checkout\PlatformChargebackLogic|null - */ - public function getPlatformChargebackLogic() - { - return $this->container['platformChargebackLogic']; - } - - /** - * Sets platformChargebackLogic - * - * @param \Adyen\Model\Checkout\PlatformChargebackLogic|null $platformChargebackLogic platformChargebackLogic - * - * @return self - */ - public function setPlatformChargebackLogic($platformChargebackLogic) - { - $this->container['platformChargebackLogic'] = $platformChargebackLogic; - - return $this; - } - - /** - * Gets recurringExpiry - * - * @return string|null - */ - public function getRecurringExpiry() - { - return $this->container['recurringExpiry']; - } - - /** - * Sets recurringExpiry - * - * @param string|null $recurringExpiry Date after which no further authorisations shall be performed. Only for 3D Secure 2. - * - * @return self - */ - public function setRecurringExpiry($recurringExpiry) - { - $this->container['recurringExpiry'] = $recurringExpiry; - - return $this; - } - - /** - * Gets recurringFrequency - * - * @return string|null - */ - public function getRecurringFrequency() - { - return $this->container['recurringFrequency']; - } - - /** - * Sets recurringFrequency - * - * @param string|null $recurringFrequency Minimum number of days between authorisations. Only for 3D Secure 2. - * - * @return self - */ - public function setRecurringFrequency($recurringFrequency) - { - $this->container['recurringFrequency'] = $recurringFrequency; - - return $this; - } - - /** - * Gets reference - * - * @return string - */ - public function getReference() - { - return $this->container['reference']; - } - - /** - * Sets reference - * - * @param string $reference The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - * - * @return self - */ - public function setReference($reference) - { - $this->container['reference'] = $reference; - - return $this; - } - - /** - * Gets returnUrl - * - * @return string - */ - public function getReturnUrl() - { - return $this->container['returnUrl']; - } - - /** - * Sets returnUrl - * - * @param string $returnUrl The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. - * - * @return self - */ - public function setReturnUrl($returnUrl) - { - $this->container['returnUrl'] = $returnUrl; - - return $this; - } - - /** - * Gets riskData - * - * @return \Adyen\Model\Checkout\RiskData|null - */ - public function getRiskData() - { - return $this->container['riskData']; - } - - /** - * Sets riskData - * - * @param \Adyen\Model\Checkout\RiskData|null $riskData riskData - * - * @return self - */ - public function setRiskData($riskData) - { - $this->container['riskData'] = $riskData; - - return $this; - } - - /** - * Gets sdkVersion - * - * @return string|null - */ - public function getSdkVersion() - { - return $this->container['sdkVersion']; - } - - /** - * Sets sdkVersion - * - * @param string|null $sdkVersion The version of the SDK you are using (for Web SDK integrations only). - * - * @return self - */ - public function setSdkVersion($sdkVersion) - { - $this->container['sdkVersion'] = $sdkVersion; - - return $this; - } - - /** - * Gets secureRemoteCommerceCheckoutData - * - * @return \Adyen\Model\Checkout\SecureRemoteCommerceCheckoutData|null - */ - public function getSecureRemoteCommerceCheckoutData() - { - return $this->container['secureRemoteCommerceCheckoutData']; - } - - /** - * Sets secureRemoteCommerceCheckoutData - * - * @param \Adyen\Model\Checkout\SecureRemoteCommerceCheckoutData|null $secureRemoteCommerceCheckoutData secureRemoteCommerceCheckoutData - * - * @return self - */ - public function setSecureRemoteCommerceCheckoutData($secureRemoteCommerceCheckoutData) - { - $this->container['secureRemoteCommerceCheckoutData'] = $secureRemoteCommerceCheckoutData; - - return $this; - } - - /** - * Gets sessionValidity - * - * @return string|null - */ - public function getSessionValidity() - { - return $this->container['sessionValidity']; - } - - /** - * Sets sessionValidity - * - * @param string|null $sessionValidity The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 - * - * @return self - */ - public function setSessionValidity($sessionValidity) - { - $this->container['sessionValidity'] = $sessionValidity; - - return $this; - } - - /** - * Gets shopperEmail - * - * @return string|null - */ - public function getShopperEmail() - { - return $this->container['shopperEmail']; - } - - /** - * Sets shopperEmail - * - * @param string|null $shopperEmail The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. - * - * @return self - */ - public function setShopperEmail($shopperEmail) - { - $this->container['shopperEmail'] = $shopperEmail; - - return $this; - } - - /** - * Gets shopperIP - * - * @return string|null - */ - public function getShopperIP() - { - return $this->container['shopperIP']; - } - - /** - * Sets shopperIP - * - * @param string|null $shopperIP The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - * - * @return self - */ - public function setShopperIP($shopperIP) - { - $this->container['shopperIP'] = $shopperIP; - - return $this; - } - - /** - * Gets shopperInteraction - * - * @return string|null - */ - public function getShopperInteraction() - { - return $this->container['shopperInteraction']; - } - - /** - * Sets shopperInteraction - * - * @param string|null $shopperInteraction Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - * - * @return self - */ - public function setShopperInteraction($shopperInteraction) - { - $allowedValues = $this->getShopperInteractionAllowableValues(); - if (!in_array($shopperInteraction, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'shopperInteraction', must be one of '%s'", - $shopperInteraction, - implode("', '", $allowedValues) - ) - ); - } - $this->container['shopperInteraction'] = $shopperInteraction; - - return $this; - } - - /** - * Gets shopperLocale - * - * @return string|null - */ - public function getShopperLocale() - { - return $this->container['shopperLocale']; - } - - /** - * Sets shopperLocale - * - * @param string|null $shopperLocale The combination of a language code and a country code to specify the language to be used in the payment. - * - * @return self - */ - public function setShopperLocale($shopperLocale) - { - $this->container['shopperLocale'] = $shopperLocale; - - return $this; - } - - /** - * Gets shopperName - * - * @return \Adyen\Model\Checkout\Name|null - */ - public function getShopperName() - { - return $this->container['shopperName']; - } - - /** - * Sets shopperName - * - * @param \Adyen\Model\Checkout\Name|null $shopperName shopperName - * - * @return self - */ - public function setShopperName($shopperName) - { - $this->container['shopperName'] = $shopperName; - - return $this; - } - - /** - * Gets shopperReference - * - * @return string|null - */ - public function getShopperReference() - { - return $this->container['shopperReference']; - } - - /** - * Sets shopperReference - * - * @param string|null $shopperReference Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - * - * @return self - */ - public function setShopperReference($shopperReference) - { - $this->container['shopperReference'] = $shopperReference; - - return $this; - } - - /** - * Gets shopperStatement - * - * @return string|null - */ - public function getShopperStatement() - { - return $this->container['shopperStatement']; - } - - /** - * Sets shopperStatement - * - * @param string|null $shopperStatement The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - * - * @return self - */ - public function setShopperStatement($shopperStatement) - { - $this->container['shopperStatement'] = $shopperStatement; - - return $this; - } - - /** - * Gets socialSecurityNumber - * - * @return string|null - */ - public function getSocialSecurityNumber() - { - return $this->container['socialSecurityNumber']; - } - - /** - * Sets socialSecurityNumber - * - * @param string|null $socialSecurityNumber The shopper's social security number. - * - * @return self - */ - public function setSocialSecurityNumber($socialSecurityNumber) - { - $this->container['socialSecurityNumber'] = $socialSecurityNumber; - - return $this; - } - - /** - * Gets splits - * - * @return \Adyen\Model\Checkout\Split[]|null - */ - public function getSplits() - { - return $this->container['splits']; - } - - /** - * Sets splits - * - * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the payment should be split when using either Adyen for Platforms for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms]((https://docs.adyen.com/platforms/split-payments), or standalone [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). - * - * @return self - */ - public function setSplits($splits) - { - $this->container['splits'] = $splits; - - return $this; - } - - /** - * Gets store - * - * @return string|null - */ - public function getStore() - { - return $this->container['store']; - } - - /** - * Sets store - * - * @param string|null $store Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. - * - * @return self - */ - public function setStore($store) - { - $this->container['store'] = $store; - - return $this; - } - - /** - * Gets storePaymentMethod - * - * @return bool|null - */ - public function getStorePaymentMethod() - { - return $this->container['storePaymentMethod']; - } - - /** - * Sets storePaymentMethod - * - * @param bool|null $storePaymentMethod When true and `shopperReference` is provided, the payment details will be stored. - * - * @return self - */ - public function setStorePaymentMethod($storePaymentMethod) - { - $this->container['storePaymentMethod'] = $storePaymentMethod; - - return $this; - } - - /** - * Gets telephoneNumber - * - * @return string|null - */ - public function getTelephoneNumber() - { - return $this->container['telephoneNumber']; - } - - /** - * Sets telephoneNumber - * - * @param string|null $telephoneNumber The shopper's telephone number. - * - * @return self - */ - public function setTelephoneNumber($telephoneNumber) - { - $this->container['telephoneNumber'] = $telephoneNumber; - - return $this; - } - - /** - * Gets threeDSAuthenticationOnly - * - * @return bool|null - * @deprecated - */ - public function getThreeDSAuthenticationOnly() - { - return $this->container['threeDSAuthenticationOnly']; - } - - /** - * Sets threeDSAuthenticationOnly - * - * @param bool|null $threeDSAuthenticationOnly If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - * - * @return self - * @deprecated - */ - public function setThreeDSAuthenticationOnly($threeDSAuthenticationOnly) - { - $this->container['threeDSAuthenticationOnly'] = $threeDSAuthenticationOnly; - - return $this; - } - - /** - * Gets token - * - * @return string|null - */ - public function getToken() - { - return $this->container['token']; - } - - /** - * Sets token - * - * @param string|null $token The token obtained when initializing the SDK. > This parameter is required for iOS and Android; not required for Web. - * - * @return self - */ - public function setToken($token) - { - $this->container['token'] = $token; - - return $this; - } - - /** - * Gets trustedShopper - * - * @return bool|null - */ - public function getTrustedShopper() - { - return $this->container['trustedShopper']; - } - - /** - * Sets trustedShopper - * - * @param bool|null $trustedShopper Set to true if the payment should be routed to a trusted MID. - * - * @return self - */ - public function setTrustedShopper($trustedShopper) - { - $this->container['trustedShopper'] = $trustedShopper; - - 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/PaymentSetupResponse.php b/src/Adyen/Model/Checkout/PaymentSetupResponse.php deleted file mode 100644 index 45b635f86..000000000 --- a/src/Adyen/Model/Checkout/PaymentSetupResponse.php +++ /dev/null @@ -1,440 +0,0 @@ - - */ -class PaymentSetupResponse implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'PaymentSetupResponse'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'paymentSession' => 'string', - 'recurringDetails' => '\Adyen\Model\Checkout\RecurringDetail[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'paymentSession' => null, - 'recurringDetails' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'paymentSession' => false, - 'recurringDetails' => 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 = [ - 'paymentSession' => 'paymentSession', - 'recurringDetails' => 'recurringDetails' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'paymentSession' => 'setPaymentSession', - 'recurringDetails' => 'setRecurringDetails' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'paymentSession' => 'getPaymentSession', - 'recurringDetails' => 'getRecurringDetails' - ]; - - /** - * 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('paymentSession', $data ?? [], null); - $this->setIfExists('recurringDetails', $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 paymentSession - * - * @return string|null - */ - public function getPaymentSession() - { - return $this->container['paymentSession']; - } - - /** - * Sets paymentSession - * - * @param string|null $paymentSession The encoded payment session that you need to pass to the SDK. - * - * @return self - */ - public function setPaymentSession($paymentSession) - { - $this->container['paymentSession'] = $paymentSession; - - return $this; - } - - /** - * Gets recurringDetails - * - * @return \Adyen\Model\Checkout\RecurringDetail[]|null - * @deprecated - */ - public function getRecurringDetails() - { - return $this->container['recurringDetails']; - } - - /** - * Sets recurringDetails - * - * @param \Adyen\Model\Checkout\RecurringDetail[]|null $recurringDetails The detailed list of stored payment details required to generate payment forms. Will be empty if oneClick is set to false in the request. - * - * @return self - * @deprecated - */ - public function setRecurringDetails($recurringDetails) - { - $this->container['recurringDetails'] = $recurringDetails; - - 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/PaymentVerificationResponse.php b/src/Adyen/Model/Checkout/PaymentVerificationResponse.php deleted file mode 100644 index fd4ee8adb..000000000 --- a/src/Adyen/Model/Checkout/PaymentVerificationResponse.php +++ /dev/null @@ -1,749 +0,0 @@ - - */ -class PaymentVerificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'PaymentVerificationResponse'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'additionalData' => 'array', - 'fraudResult' => '\Adyen\Model\Checkout\FraudResult', - 'merchantReference' => 'string', - 'order' => '\Adyen\Model\Checkout\CheckoutOrderResponse', - 'pspReference' => 'string', - 'refusalReason' => 'string', - 'refusalReasonCode' => 'string', - 'resultCode' => 'string', - 'serviceError' => '\Adyen\Model\Checkout\ServiceErrorDetails', - 'shopperLocale' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'additionalData' => null, - 'fraudResult' => null, - 'merchantReference' => null, - 'order' => null, - 'pspReference' => null, - 'refusalReason' => null, - 'refusalReasonCode' => null, - 'resultCode' => null, - 'serviceError' => null, - 'shopperLocale' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'additionalData' => false, - 'fraudResult' => false, - 'merchantReference' => false, - 'order' => false, - 'pspReference' => false, - 'refusalReason' => false, - 'refusalReasonCode' => false, - 'resultCode' => false, - 'serviceError' => false, - 'shopperLocale' => 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 = [ - 'additionalData' => 'additionalData', - 'fraudResult' => 'fraudResult', - 'merchantReference' => 'merchantReference', - 'order' => 'order', - 'pspReference' => 'pspReference', - 'refusalReason' => 'refusalReason', - 'refusalReasonCode' => 'refusalReasonCode', - 'resultCode' => 'resultCode', - 'serviceError' => 'serviceError', - 'shopperLocale' => 'shopperLocale' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'additionalData' => 'setAdditionalData', - 'fraudResult' => 'setFraudResult', - 'merchantReference' => 'setMerchantReference', - 'order' => 'setOrder', - 'pspReference' => 'setPspReference', - 'refusalReason' => 'setRefusalReason', - 'refusalReasonCode' => 'setRefusalReasonCode', - 'resultCode' => 'setResultCode', - 'serviceError' => 'setServiceError', - 'shopperLocale' => 'setShopperLocale' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'additionalData' => 'getAdditionalData', - 'fraudResult' => 'getFraudResult', - 'merchantReference' => 'getMerchantReference', - 'order' => 'getOrder', - 'pspReference' => 'getPspReference', - 'refusalReason' => 'getRefusalReason', - 'refusalReasonCode' => 'getRefusalReasonCode', - 'resultCode' => 'getResultCode', - 'serviceError' => 'getServiceError', - 'shopperLocale' => 'getShopperLocale' - ]; - - /** - * 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 RESULT_CODE_AUTHENTICATION_FINISHED = 'AuthenticationFinished'; - public const RESULT_CODE_AUTHENTICATION_NOT_REQUIRED = 'AuthenticationNotRequired'; - public const RESULT_CODE_AUTHORISED = 'Authorised'; - public const RESULT_CODE_CANCELLED = 'Cancelled'; - public const RESULT_CODE_CHALLENGE_SHOPPER = 'ChallengeShopper'; - public const RESULT_CODE_ERROR = 'Error'; - public const RESULT_CODE_IDENTIFY_SHOPPER = 'IdentifyShopper'; - public const RESULT_CODE_PARTIALLY_AUTHORISED = 'PartiallyAuthorised'; - public const RESULT_CODE_PENDING = 'Pending'; - public const RESULT_CODE_PRESENT_TO_SHOPPER = 'PresentToShopper'; - public const RESULT_CODE_RECEIVED = 'Received'; - public const RESULT_CODE_REDIRECT_SHOPPER = 'RedirectShopper'; - public const RESULT_CODE_REFUSED = 'Refused'; - public const RESULT_CODE_SUCCESS = 'Success'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getResultCodeAllowableValues() - { - return [ - self::RESULT_CODE_AUTHENTICATION_FINISHED, - self::RESULT_CODE_AUTHENTICATION_NOT_REQUIRED, - self::RESULT_CODE_AUTHORISED, - self::RESULT_CODE_CANCELLED, - self::RESULT_CODE_CHALLENGE_SHOPPER, - self::RESULT_CODE_ERROR, - self::RESULT_CODE_IDENTIFY_SHOPPER, - self::RESULT_CODE_PARTIALLY_AUTHORISED, - self::RESULT_CODE_PENDING, - self::RESULT_CODE_PRESENT_TO_SHOPPER, - self::RESULT_CODE_RECEIVED, - self::RESULT_CODE_REDIRECT_SHOPPER, - self::RESULT_CODE_REFUSED, - self::RESULT_CODE_SUCCESS, - ]; - } - /** - * 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('additionalData', $data ?? [], null); - $this->setIfExists('fraudResult', $data ?? [], null); - $this->setIfExists('merchantReference', $data ?? [], null); - $this->setIfExists('order', $data ?? [], null); - $this->setIfExists('pspReference', $data ?? [], null); - $this->setIfExists('refusalReason', $data ?? [], null); - $this->setIfExists('refusalReasonCode', $data ?? [], null); - $this->setIfExists('resultCode', $data ?? [], null); - $this->setIfExists('serviceError', $data ?? [], null); - $this->setIfExists('shopperLocale', $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['merchantReference'] === null) { - $invalidProperties[] = "'merchantReference' can't be null"; - } - $allowedValues = $this->getResultCodeAllowableValues(); - if (!is_null($this->container['resultCode']) && !in_array($this->container['resultCode'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'resultCode', must be one of '%s'", - $this->container['resultCode'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['shopperLocale'] === null) { - $invalidProperties[] = "'shopperLocale' 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 additionalData - * - * @return array|null - */ - public function getAdditionalData() - { - return $this->container['additionalData']; - } - - /** - * Sets additionalData - * - * @param array|null $additionalData Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. - * - * @return self - */ - public function setAdditionalData($additionalData) - { - $this->container['additionalData'] = $additionalData; - - return $this; - } - - /** - * Gets fraudResult - * - * @return \Adyen\Model\Checkout\FraudResult|null - */ - public function getFraudResult() - { - return $this->container['fraudResult']; - } - - /** - * Sets fraudResult - * - * @param \Adyen\Model\Checkout\FraudResult|null $fraudResult fraudResult - * - * @return self - */ - public function setFraudResult($fraudResult) - { - $this->container['fraudResult'] = $fraudResult; - - return $this; - } - - /** - * Gets merchantReference - * - * @return string - */ - public function getMerchantReference() - { - return $this->container['merchantReference']; - } - - /** - * Sets merchantReference - * - * @param string $merchantReference A unique value that you provided in the initial `/paymentSession` request as a `reference` field. - * - * @return self - */ - public function setMerchantReference($merchantReference) - { - $this->container['merchantReference'] = $merchantReference; - - return $this; - } - - /** - * Gets order - * - * @return \Adyen\Model\Checkout\CheckoutOrderResponse|null - */ - public function getOrder() - { - return $this->container['order']; - } - - /** - * Sets order - * - * @param \Adyen\Model\Checkout\CheckoutOrderResponse|null $order order - * - * @return self - */ - public function setOrder($order) - { - $this->container['order'] = $order; - - return $this; - } - - /** - * Gets pspReference - * - * @return string|null - */ - public function getPspReference() - { - return $this->container['pspReference']; - } - - /** - * Sets pspReference - * - * @param string|null $pspReference Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. - * - * @return self - */ - public function setPspReference($pspReference) - { - $this->container['pspReference'] = $pspReference; - - return $this; - } - - /** - * Gets refusalReason - * - * @return string|null - */ - public function getRefusalReason() - { - return $this->container['refusalReason']; - } - - /** - * Sets refusalReason - * - * @param string|null $refusalReason If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - * - * @return self - */ - public function setRefusalReason($refusalReason) - { - $this->container['refusalReason'] = $refusalReason; - - return $this; - } - - /** - * Gets refusalReasonCode - * - * @return string|null - */ - public function getRefusalReasonCode() - { - return $this->container['refusalReasonCode']; - } - - /** - * Sets refusalReasonCode - * - * @param string|null $refusalReasonCode Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - * - * @return self - */ - public function setRefusalReasonCode($refusalReasonCode) - { - $this->container['refusalReasonCode'] = $refusalReasonCode; - - return $this; - } - - /** - * Gets resultCode - * - * @return string|null - */ - public function getResultCode() - { - return $this->container['resultCode']; - } - - /** - * Sets resultCode - * - * @param string|null $resultCode The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. - * - * @return self - */ - public function setResultCode($resultCode) - { - $allowedValues = $this->getResultCodeAllowableValues(); - if (!in_array($resultCode, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'resultCode', must be one of '%s'", - $resultCode, - implode("', '", $allowedValues) - ) - ); - } - $this->container['resultCode'] = $resultCode; - - return $this; - } - - /** - * Gets serviceError - * - * @return \Adyen\Model\Checkout\ServiceErrorDetails|null - */ - public function getServiceError() - { - return $this->container['serviceError']; - } - - /** - * Sets serviceError - * - * @param \Adyen\Model\Checkout\ServiceErrorDetails|null $serviceError serviceError - * - * @return self - */ - public function setServiceError($serviceError) - { - $this->container['serviceError'] = $serviceError; - - return $this; - } - - /** - * Gets shopperLocale - * - * @return string - */ - public function getShopperLocale() - { - return $this->container['shopperLocale']; - } - - /** - * Sets shopperLocale - * - * @param string $shopperLocale The shopperLocale value provided in the payment request. - * - * @return self - */ - public function setShopperLocale($shopperLocale) - { - $this->container['shopperLocale'] = $shopperLocale; - - 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/ResponseAdditionalDataCard.php b/src/Adyen/Model/Checkout/ResponseAdditionalDataCard.php index b8d97aaed..579242606 100644 --- a/src/Adyen/Model/Checkout/ResponseAdditionalDataCard.php +++ b/src/Adyen/Model/Checkout/ResponseAdditionalDataCard.php @@ -50,6 +50,7 @@ class ResponseAdditionalDataCard implements ModelInterface, ArrayAccess, \JsonSe 'cardIssuingCountry' => 'string', 'cardIssuingCurrency' => 'string', 'cardPaymentMethod' => 'string', + 'cardProductId' => 'string', 'cardSummary' => 'string', 'issuerBin' => 'string' ]; @@ -68,6 +69,7 @@ class ResponseAdditionalDataCard implements ModelInterface, ArrayAccess, \JsonSe 'cardIssuingCountry' => null, 'cardIssuingCurrency' => null, 'cardPaymentMethod' => null, + 'cardProductId' => null, 'cardSummary' => null, 'issuerBin' => null ]; @@ -84,6 +86,7 @@ class ResponseAdditionalDataCard implements ModelInterface, ArrayAccess, \JsonSe 'cardIssuingCountry' => false, 'cardIssuingCurrency' => false, 'cardPaymentMethod' => false, + 'cardProductId' => false, 'cardSummary' => false, 'issuerBin' => false ]; @@ -180,6 +183,7 @@ public function isNullableSetToNull(string $property): bool 'cardIssuingCountry' => 'cardIssuingCountry', 'cardIssuingCurrency' => 'cardIssuingCurrency', 'cardPaymentMethod' => 'cardPaymentMethod', + 'cardProductId' => 'cardProductId', 'cardSummary' => 'cardSummary', 'issuerBin' => 'issuerBin' ]; @@ -196,6 +200,7 @@ public function isNullableSetToNull(string $property): bool 'cardIssuingCountry' => 'setCardIssuingCountry', 'cardIssuingCurrency' => 'setCardIssuingCurrency', 'cardPaymentMethod' => 'setCardPaymentMethod', + 'cardProductId' => 'setCardProductId', 'cardSummary' => 'setCardSummary', 'issuerBin' => 'setIssuerBin' ]; @@ -212,6 +217,7 @@ public function isNullableSetToNull(string $property): bool 'cardIssuingCountry' => 'getCardIssuingCountry', 'cardIssuingCurrency' => 'getCardIssuingCurrency', 'cardPaymentMethod' => 'getCardPaymentMethod', + 'cardProductId' => 'getCardProductId', 'cardSummary' => 'getCardSummary', 'issuerBin' => 'getIssuerBin' ]; @@ -257,7 +263,39 @@ public function getModelName() return self::$openAPIModelName; } + public const CARD_PRODUCT_ID_A = 'A'; + public const CARD_PRODUCT_ID_B = 'B'; + public const CARD_PRODUCT_ID_C = 'C'; + public const CARD_PRODUCT_ID_D = 'D'; + public const CARD_PRODUCT_ID_F = 'F'; + public const CARD_PRODUCT_ID_MCC = 'MCC'; + public const CARD_PRODUCT_ID_MCE = 'MCE'; + public const CARD_PRODUCT_ID_MCF = 'MCF'; + public const CARD_PRODUCT_ID_MCG = 'MCG'; + public const CARD_PRODUCT_ID_MCH = 'MCH'; + public const CARD_PRODUCT_ID_MCI = 'MCI'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCardProductIdAllowableValues() + { + return [ + self::CARD_PRODUCT_ID_A, + self::CARD_PRODUCT_ID_B, + self::CARD_PRODUCT_ID_C, + self::CARD_PRODUCT_ID_D, + self::CARD_PRODUCT_ID_F, + self::CARD_PRODUCT_ID_MCC, + self::CARD_PRODUCT_ID_MCE, + self::CARD_PRODUCT_ID_MCF, + self::CARD_PRODUCT_ID_MCG, + self::CARD_PRODUCT_ID_MCH, + self::CARD_PRODUCT_ID_MCI, + ]; + } /** * Associative array for storing property values * @@ -279,6 +317,7 @@ public function __construct(array $data = null) $this->setIfExists('cardIssuingCountry', $data ?? [], null); $this->setIfExists('cardIssuingCurrency', $data ?? [], null); $this->setIfExists('cardPaymentMethod', $data ?? [], null); + $this->setIfExists('cardProductId', $data ?? [], null); $this->setIfExists('cardSummary', $data ?? [], null); $this->setIfExists('issuerBin', $data ?? [], null); } @@ -310,6 +349,15 @@ public function listInvalidProperties() { $invalidProperties = []; + $allowedValues = $this->getCardProductIdAllowableValues(); + if (!is_null($this->container['cardProductId']) && !in_array($this->container['cardProductId'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'cardProductId', must be one of '%s'", + $this->container['cardProductId'], + implode("', '", $allowedValues) + ); + } + return $invalidProperties; } @@ -469,6 +517,40 @@ public function setCardPaymentMethod($cardPaymentMethod) return $this; } + /** + * Gets cardProductId + * + * @return string|null + */ + public function getCardProductId() + { + return $this->container['cardProductId']; + } + + /** + * Sets cardProductId + * + * @param string|null $cardProductId The Card Product ID represents the type of card following card scheme product definitions and can be returned for Adyen Acquiring service level payments. Possible values Visa: * **A** - Visa Traditional * **B** - Visa Traditional Rewards * **C** - Visa Signature * **D** - Visa Signature Preferred * **F** - Visa Classic Possible values Mastercard: * **MCC** - Mastercard Card * **MCE** - Mastercard Electronic Card * **MCF** - Mastercard Corporate Fleet Card * **MCG** - Gold Mastercard Card * **MCH** - Mastercard Premium Charge * **MCI** - Mastercard Select Debit + * + * @return self + */ + public function setCardProductId($cardProductId) + { + $allowedValues = $this->getCardProductIdAllowableValues(); + if (!in_array($cardProductId, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'cardProductId', must be one of '%s'", + $cardProductId, + implode("', '", $allowedValues) + ) + ); + } + $this->container['cardProductId'] = $cardProductId; + + return $this; + } + /** * Gets cardSummary * diff --git a/src/Adyen/Model/Checkout/ShopperInput.php b/src/Adyen/Model/Checkout/RivertyDetails.php similarity index 63% rename from src/Adyen/Model/Checkout/ShopperInput.php rename to src/Adyen/Model/Checkout/RivertyDetails.php index 461aeba82..c787b5dd7 100644 --- a/src/Adyen/Model/Checkout/ShopperInput.php +++ b/src/Adyen/Model/Checkout/RivertyDetails.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * ShopperInput Class Doc Comment + * RivertyDetails Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class ShopperInput implements ModelInterface, ArrayAccess, \JsonSerializable +class RivertyDetails implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class ShopperInput implements ModelInterface, ArrayAccess, \JsonSerializable * * @var string */ - protected static $openAPIModelName = 'ShopperInput'; + protected static $openAPIModelName = 'RivertyDetails'; /** * Array of property to type mappings. Used for (de)serialization @@ -45,8 +45,14 @@ class ShopperInput implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'billingAddress' => 'string', + 'checkoutAttemptId' => 'string', 'deliveryAddress' => 'string', - 'personalDetails' => 'string' + 'deviceFingerprint' => 'string', + 'iban' => 'string', + 'personalDetails' => 'string', + 'recurringDetailReference' => 'string', + 'storedPaymentMethodId' => 'string', + 'type' => 'string' ]; /** @@ -58,8 +64,14 @@ class ShopperInput implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'billingAddress' => null, + 'checkoutAttemptId' => null, 'deliveryAddress' => null, - 'personalDetails' => null + 'deviceFingerprint' => null, + 'iban' => null, + 'personalDetails' => null, + 'recurringDetailReference' => null, + 'storedPaymentMethodId' => null, + 'type' => null ]; /** @@ -69,8 +81,14 @@ class ShopperInput implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'billingAddress' => false, + 'checkoutAttemptId' => false, 'deliveryAddress' => false, - 'personalDetails' => false + 'deviceFingerprint' => false, + 'iban' => false, + 'personalDetails' => false, + 'recurringDetailReference' => false, + 'storedPaymentMethodId' => false, + 'type' => false ]; /** @@ -160,8 +178,14 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'billingAddress' => 'billingAddress', + 'checkoutAttemptId' => 'checkoutAttemptId', 'deliveryAddress' => 'deliveryAddress', - 'personalDetails' => 'personalDetails' + 'deviceFingerprint' => 'deviceFingerprint', + 'iban' => 'iban', + 'personalDetails' => 'personalDetails', + 'recurringDetailReference' => 'recurringDetailReference', + 'storedPaymentMethodId' => 'storedPaymentMethodId', + 'type' => 'type' ]; /** @@ -171,8 +195,14 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'billingAddress' => 'setBillingAddress', + 'checkoutAttemptId' => 'setCheckoutAttemptId', 'deliveryAddress' => 'setDeliveryAddress', - 'personalDetails' => 'setPersonalDetails' + 'deviceFingerprint' => 'setDeviceFingerprint', + 'iban' => 'setIban', + 'personalDetails' => 'setPersonalDetails', + 'recurringDetailReference' => 'setRecurringDetailReference', + 'storedPaymentMethodId' => 'setStoredPaymentMethodId', + 'type' => 'setType' ]; /** @@ -182,8 +212,14 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'billingAddress' => 'getBillingAddress', + 'checkoutAttemptId' => 'getCheckoutAttemptId', 'deliveryAddress' => 'getDeliveryAddress', - 'personalDetails' => 'getPersonalDetails' + 'deviceFingerprint' => 'getDeviceFingerprint', + 'iban' => 'getIban', + 'personalDetails' => 'getPersonalDetails', + 'recurringDetailReference' => 'getRecurringDetailReference', + 'storedPaymentMethodId' => 'getStoredPaymentMethodId', + 'type' => 'getType' ]; /** @@ -227,53 +263,21 @@ public function getModelName() return self::$openAPIModelName; } - public const BILLING_ADDRESS_EDITABLE = 'editable'; - public const BILLING_ADDRESS_HIDDEN = 'hidden'; - public const BILLING_ADDRESS_READ_ONLY = 'readOnly'; - public const DELIVERY_ADDRESS_EDITABLE = 'editable'; - public const DELIVERY_ADDRESS_HIDDEN = 'hidden'; - public const DELIVERY_ADDRESS_READ_ONLY = 'readOnly'; - public const PERSONAL_DETAILS_EDITABLE = 'editable'; - public const PERSONAL_DETAILS_HIDDEN = 'hidden'; - public const PERSONAL_DETAILS_READ_ONLY = 'readOnly'; + public const TYPE_RIVERTY = 'riverty'; + public const TYPE_RIVERTY_ACCOUNT = 'riverty_account'; + public const TYPE_SEPADIRECTDEBIT_RIVERTY = 'sepadirectdebit_riverty'; /** * Gets allowable values of the enum * * @return string[] */ - public function getBillingAddressAllowableValues() + public function getTypeAllowableValues() { return [ - self::BILLING_ADDRESS_EDITABLE, - self::BILLING_ADDRESS_HIDDEN, - self::BILLING_ADDRESS_READ_ONLY, - ]; - } - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getDeliveryAddressAllowableValues() - { - return [ - self::DELIVERY_ADDRESS_EDITABLE, - self::DELIVERY_ADDRESS_HIDDEN, - self::DELIVERY_ADDRESS_READ_ONLY, - ]; - } - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getPersonalDetailsAllowableValues() - { - return [ - self::PERSONAL_DETAILS_EDITABLE, - self::PERSONAL_DETAILS_HIDDEN, - self::PERSONAL_DETAILS_READ_ONLY, + self::TYPE_RIVERTY, + self::TYPE_RIVERTY_ACCOUNT, + self::TYPE_SEPADIRECTDEBIT_RIVERTY, ]; } /** @@ -292,8 +296,14 @@ public function getPersonalDetailsAllowableValues() public function __construct(array $data = null) { $this->setIfExists('billingAddress', $data ?? [], null); + $this->setIfExists('checkoutAttemptId', $data ?? [], null); $this->setIfExists('deliveryAddress', $data ?? [], null); + $this->setIfExists('deviceFingerprint', $data ?? [], null); + $this->setIfExists('iban', $data ?? [], null); $this->setIfExists('personalDetails', $data ?? [], null); + $this->setIfExists('recurringDetailReference', $data ?? [], null); + $this->setIfExists('storedPaymentMethodId', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); } /** @@ -323,29 +333,14 @@ public function listInvalidProperties() { $invalidProperties = []; - $allowedValues = $this->getBillingAddressAllowableValues(); - if (!is_null($this->container['billingAddress']) && !in_array($this->container['billingAddress'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'billingAddress', must be one of '%s'", - $this->container['billingAddress'], - implode("', '", $allowedValues) - ); + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; } - - $allowedValues = $this->getDeliveryAddressAllowableValues(); - if (!is_null($this->container['deliveryAddress']) && !in_array($this->container['deliveryAddress'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'deliveryAddress', must be one of '%s'", - $this->container['deliveryAddress'], - implode("', '", $allowedValues) - ); - } - - $allowedValues = $this->getPersonalDetailsAllowableValues(); - if (!is_null($this->container['personalDetails']) && !in_array($this->container['personalDetails'], $allowedValues, true)) { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'personalDetails', must be one of '%s'", - $this->container['personalDetails'], + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], implode("', '", $allowedValues) ); } @@ -378,27 +373,41 @@ public function getBillingAddress() /** * Sets billingAddress * - * @param string|null $billingAddress Specifies visibility of billing address fields. Permitted values: * editable * hidden * readOnly + * @param string|null $billingAddress The address where to send the invoice. * * @return self */ public function setBillingAddress($billingAddress) { - $allowedValues = $this->getBillingAddressAllowableValues(); - if (!in_array($billingAddress, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'billingAddress', must be one of '%s'", - $billingAddress, - implode("', '", $allowedValues) - ) - ); - } $this->container['billingAddress'] = $billingAddress; 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 deliveryAddress * @@ -412,27 +421,65 @@ public function getDeliveryAddress() /** * Sets deliveryAddress * - * @param string|null $deliveryAddress Specifies visibility of delivery address fields. Permitted values: * editable * hidden * readOnly + * @param string|null $deliveryAddress The address where the goods should be delivered. * * @return self */ public function setDeliveryAddress($deliveryAddress) { - $allowedValues = $this->getDeliveryAddressAllowableValues(); - if (!in_array($deliveryAddress, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'deliveryAddress', must be one of '%s'", - $deliveryAddress, - implode("', '", $allowedValues) - ) - ); - } $this->container['deliveryAddress'] = $deliveryAddress; return $this; } + /** + * Gets deviceFingerprint + * + * @return string|null + */ + public function getDeviceFingerprint() + { + return $this->container['deviceFingerprint']; + } + + /** + * Sets deviceFingerprint + * + * @param string|null $deviceFingerprint A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + * + * @return self + */ + public function setDeviceFingerprint($deviceFingerprint) + { + $this->container['deviceFingerprint'] = $deviceFingerprint; + + return $this; + } + + /** + * Gets iban + * + * @return string|null + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string|null $iban The iban number of the customer + * + * @return self + */ + public function setIban($iban) + { + $this->container['iban'] = $iban; + + return $this; + } + /** * Gets personalDetails * @@ -446,23 +493,97 @@ public function getPersonalDetails() /** * Sets personalDetails * - * @param string|null $personalDetails Specifies visibility of personal details. Permitted values: * editable * hidden * readOnly + * @param string|null $personalDetails Shopper name, date of birth, phone number, and email address. * * @return self */ public function setPersonalDetails($personalDetails) { - $allowedValues = $this->getPersonalDetailsAllowableValues(); - if (!in_array($personalDetails, $allowedValues, true)) { + $this->container['personalDetails'] = $personalDetails; + + return $this; + } + + /** + * Gets recurringDetailReference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurringDetailReference']; + } + + /** + * Sets recurringDetailReference + * + * @param string|null $recurringDetailReference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurringDetailReference) + { + $this->container['recurringDetailReference'] = $recurringDetailReference; + + return $this; + } + + /** + * Gets storedPaymentMethodId + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['storedPaymentMethodId']; + } + + /** + * Sets storedPaymentMethodId + * + * @param string|null $storedPaymentMethodId This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($storedPaymentMethodId) + { + $this->container['storedPaymentMethodId'] = $storedPaymentMethodId; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **riverty** + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'personalDetails', must be one of '%s'", - $personalDetails, + "Invalid value '%s' for 'type', must be one of '%s'", + $type, implode("', '", $allowedValues) ) ); } - $this->container['personalDetails'] = $personalDetails; + $this->container['type'] = $type; return $this; } diff --git a/src/Adyen/Model/Checkout/StoredDetails.php b/src/Adyen/Model/Checkout/StoredDetails.php deleted file mode 100644 index 5afe70daa..000000000 --- a/src/Adyen/Model/Checkout/StoredDetails.php +++ /dev/null @@ -1,469 +0,0 @@ - - */ -class StoredDetails implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'StoredDetails'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'bank' => '\Adyen\Model\Checkout\BankAccount', - 'card' => '\Adyen\Model\Checkout\Card', - 'emailAddress' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'bank' => null, - 'card' => null, - 'emailAddress' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'bank' => false, - 'card' => false, - 'emailAddress' => 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', - 'card' => 'card', - 'emailAddress' => 'emailAddress' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'bank' => 'setBank', - 'card' => 'setCard', - 'emailAddress' => 'setEmailAddress' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'bank' => 'getBank', - 'card' => 'getCard', - 'emailAddress' => 'getEmailAddress' - ]; - - /** - * 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('bank', $data ?? [], null); - $this->setIfExists('card', $data ?? [], null); - $this->setIfExists('emailAddress', $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 bank - * - * @return \Adyen\Model\Checkout\BankAccount|null - */ - public function getBank() - { - return $this->container['bank']; - } - - /** - * Sets bank - * - * @param \Adyen\Model\Checkout\BankAccount|null $bank bank - * - * @return self - */ - public function setBank($bank) - { - $this->container['bank'] = $bank; - - return $this; - } - - /** - * Gets card - * - * @return \Adyen\Model\Checkout\Card|null - */ - public function getCard() - { - return $this->container['card']; - } - - /** - * Sets card - * - * @param \Adyen\Model\Checkout\Card|null $card card - * - * @return self - */ - public function setCard($card) - { - $this->container['card'] = $card; - - return $this; - } - - /** - * Gets emailAddress - * - * @return string|null - */ - public function getEmailAddress() - { - return $this->container['emailAddress']; - } - - /** - * Sets emailAddress - * - * @param string|null $emailAddress The email associated with stored payment details. - * - * @return self - */ - public function setEmailAddress($emailAddress) - { - $this->container['emailAddress'] = $emailAddress; - - 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/StoredPaymentMethodDetails.php b/src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php index bd930be5d..39abd6494 100644 --- a/src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php +++ b/src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php @@ -238,7 +238,6 @@ public function getModelName() public const TYPE_BCMC_MOBILE_APP = 'bcmc_mobile_app'; public const TYPE_MOMO_WALLET = 'momo_wallet'; public const TYPE_MOMO_WALLET_APP = 'momo_wallet_app'; - public const TYPE_TWINT = 'twint'; public const TYPE_PAYMAYA_WALLET = 'paymaya_wallet'; public const TYPE_GRABPAY_SG = 'grabpay_SG'; public const TYPE_GRABPAY_MY = 'grabpay_MY'; @@ -265,7 +264,6 @@ public function getTypeAllowableValues() self::TYPE_BCMC_MOBILE_APP, self::TYPE_MOMO_WALLET, self::TYPE_MOMO_WALLET_APP, - self::TYPE_TWINT, self::TYPE_PAYMAYA_WALLET, self::TYPE_GRABPAY_SG, self::TYPE_GRABPAY_MY, diff --git a/src/Adyen/Model/Checkout/ThreeDSRequestData.php b/src/Adyen/Model/Checkout/ThreeDSRequestData.php index 087c5ce5f..eee0d257b 100644 --- a/src/Adyen/Model/Checkout/ThreeDSRequestData.php +++ b/src/Adyen/Model/Checkout/ThreeDSRequestData.php @@ -241,6 +241,7 @@ public function getModelName() public const DATA_ONLY_FALSE = 'false'; public const DATA_ONLY_TRUE = 'true'; public const NATIVE_THREE_DS_PREFERRED = 'preferred'; + public const NATIVE_THREE_DS_DISABLED = 'disabled'; public const THREE_DS_VERSION__1_0 = '2.1.0'; public const THREE_DS_VERSION__2_0 = '2.2.0'; @@ -280,6 +281,7 @@ public function getNativeThreeDSAllowableValues() { return [ self::NATIVE_THREE_DS_PREFERRED, + self::NATIVE_THREE_DS_DISABLED, ]; } /** @@ -474,7 +476,7 @@ public function getNativeThreeDS() /** * Sets nativeThreeDS * - * @param string|null $nativeThreeDS Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be used when available. Possible values: * **preferred**: Use native 3D Secure authentication when available. + * @param string|null $nativeThreeDS Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be used when available. Possible values: * **preferred**: Use native 3D Secure authentication when available. * **disabled**: Only use the redirect 3D Secure authentication flow. * * @return self */ diff --git a/src/Adyen/Model/Checkout/SecureRemoteCommerceCheckoutData.php b/src/Adyen/Model/Checkout/TwintDetails.php similarity index 67% rename from src/Adyen/Model/Checkout/SecureRemoteCommerceCheckoutData.php rename to src/Adyen/Model/Checkout/TwintDetails.php index fafc63a8b..9617fb730 100644 --- a/src/Adyen/Model/Checkout/SecureRemoteCommerceCheckoutData.php +++ b/src/Adyen/Model/Checkout/TwintDetails.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * SecureRemoteCommerceCheckoutData Class Doc Comment + * TwintDetails Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class SecureRemoteCommerceCheckoutData implements ModelInterface, ArrayAccess, \JsonSerializable +class TwintDetails implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class SecureRemoteCommerceCheckoutData implements ModelInterface, ArrayAccess, \ * * @var string */ - protected static $openAPIModelName = 'SecureRemoteCommerceCheckoutData'; + protected static $openAPIModelName = 'TwintDetails'; /** * Array of property to type mappings. Used for (de)serialization @@ -44,12 +44,11 @@ class SecureRemoteCommerceCheckoutData implements ModelInterface, ArrayAccess, \ * @var string[] */ protected static $openAPITypes = [ - 'checkoutPayload' => 'string', - 'correlationId' => 'string', - 'cvc' => 'string', - 'digitalCardId' => 'string', - 'scheme' => 'string', - 'tokenReference' => 'string' + 'checkoutAttemptId' => 'string', + 'recurringDetailReference' => 'string', + 'storedPaymentMethodId' => 'string', + 'subtype' => 'string', + 'type' => 'string' ]; /** @@ -60,12 +59,11 @@ class SecureRemoteCommerceCheckoutData implements ModelInterface, ArrayAccess, \ * @psalm-var array */ protected static $openAPIFormats = [ - 'checkoutPayload' => null, - 'correlationId' => null, - 'cvc' => null, - 'digitalCardId' => null, - 'scheme' => null, - 'tokenReference' => null + 'checkoutAttemptId' => null, + 'recurringDetailReference' => null, + 'storedPaymentMethodId' => null, + 'subtype' => null, + 'type' => null ]; /** @@ -74,12 +72,11 @@ class SecureRemoteCommerceCheckoutData implements ModelInterface, ArrayAccess, \ * @var boolean[] */ protected static $openAPINullables = [ - 'checkoutPayload' => false, - 'correlationId' => false, - 'cvc' => false, - 'digitalCardId' => false, - 'scheme' => false, - 'tokenReference' => false + 'checkoutAttemptId' => false, + 'recurringDetailReference' => false, + 'storedPaymentMethodId' => false, + 'subtype' => false, + 'type' => false ]; /** @@ -168,12 +165,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'checkoutPayload' => 'checkoutPayload', - 'correlationId' => 'correlationId', - 'cvc' => 'cvc', - 'digitalCardId' => 'digitalCardId', - 'scheme' => 'scheme', - 'tokenReference' => 'tokenReference' + 'checkoutAttemptId' => 'checkoutAttemptId', + 'recurringDetailReference' => 'recurringDetailReference', + 'storedPaymentMethodId' => 'storedPaymentMethodId', + 'subtype' => 'subtype', + 'type' => 'type' ]; /** @@ -182,12 +178,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'checkoutPayload' => 'setCheckoutPayload', - 'correlationId' => 'setCorrelationId', - 'cvc' => 'setCvc', - 'digitalCardId' => 'setDigitalCardId', - 'scheme' => 'setScheme', - 'tokenReference' => 'setTokenReference' + 'checkoutAttemptId' => 'setCheckoutAttemptId', + 'recurringDetailReference' => 'setRecurringDetailReference', + 'storedPaymentMethodId' => 'setStoredPaymentMethodId', + 'subtype' => 'setSubtype', + 'type' => 'setType' ]; /** @@ -196,12 +191,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'checkoutPayload' => 'getCheckoutPayload', - 'correlationId' => 'getCorrelationId', - 'cvc' => 'getCvc', - 'digitalCardId' => 'getDigitalCardId', - 'scheme' => 'getScheme', - 'tokenReference' => 'getTokenReference' + 'checkoutAttemptId' => 'getCheckoutAttemptId', + 'recurringDetailReference' => 'getRecurringDetailReference', + 'storedPaymentMethodId' => 'getStoredPaymentMethodId', + 'subtype' => 'getSubtype', + 'type' => 'getType' ]; /** @@ -245,19 +239,17 @@ public function getModelName() return self::$openAPIModelName; } - public const SCHEME_MC = 'mc'; - public const SCHEME_VISA = 'visa'; + public const TYPE_TWINT = 'twint'; /** * Gets allowable values of the enum * * @return string[] */ - public function getSchemeAllowableValues() + public function getTypeAllowableValues() { return [ - self::SCHEME_MC, - self::SCHEME_VISA, + self::TYPE_TWINT, ]; } /** @@ -275,12 +267,11 @@ public function getSchemeAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('checkoutPayload', $data ?? [], null); - $this->setIfExists('correlationId', $data ?? [], null); - $this->setIfExists('cvc', $data ?? [], null); - $this->setIfExists('digitalCardId', $data ?? [], null); - $this->setIfExists('scheme', $data ?? [], null); - $this->setIfExists('tokenReference', $data ?? [], null); + $this->setIfExists('checkoutAttemptId', $data ?? [], null); + $this->setIfExists('recurringDetailReference', $data ?? [], null); + $this->setIfExists('storedPaymentMethodId', $data ?? [], null); + $this->setIfExists('subtype', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); } /** @@ -310,11 +301,11 @@ public function listInvalidProperties() { $invalidProperties = []; - $allowedValues = $this->getSchemeAllowableValues(); - if (!is_null($this->container['scheme']) && !in_array($this->container['scheme'], $allowedValues, true)) { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'scheme', must be one of '%s'", - $this->container['scheme'], + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], implode("', '", $allowedValues) ); } @@ -335,155 +326,133 @@ public function valid() /** - * Gets checkoutPayload + * Gets checkoutAttemptId * * @return string|null */ - public function getCheckoutPayload() + public function getCheckoutAttemptId() { - return $this->container['checkoutPayload']; + return $this->container['checkoutAttemptId']; } /** - * Sets checkoutPayload + * Sets checkoutAttemptId * - * @param string|null $checkoutPayload The Secure Remote Commerce checkout payload to process the payment with. + * @param string|null $checkoutAttemptId The checkout attempt identifier. * * @return self */ - public function setCheckoutPayload($checkoutPayload) + public function setCheckoutAttemptId($checkoutAttemptId) { - $this->container['checkoutPayload'] = $checkoutPayload; + $this->container['checkoutAttemptId'] = $checkoutAttemptId; return $this; } /** - * Gets correlationId + * Gets recurringDetailReference * * @return string|null + * @deprecated */ - public function getCorrelationId() + public function getRecurringDetailReference() { - return $this->container['correlationId']; + return $this->container['recurringDetailReference']; } /** - * Sets correlationId + * Sets recurringDetailReference * - * @param string|null $correlationId This is the unique identifier generated by SRC system to track and link SRC messages. Available within the present checkout session (e.g. received in an earlier API response during the present session). + * @param string|null $recurringDetailReference This is the `recurringDetailReference` returned in the response when you created the token. * * @return self + * @deprecated */ - public function setCorrelationId($correlationId) + public function setRecurringDetailReference($recurringDetailReference) { - $this->container['correlationId'] = $correlationId; + $this->container['recurringDetailReference'] = $recurringDetailReference; return $this; } /** - * Gets cvc + * Gets storedPaymentMethodId * * @return string|null */ - public function getCvc() + public function getStoredPaymentMethodId() { - return $this->container['cvc']; + return $this->container['storedPaymentMethodId']; } /** - * Sets cvc + * Sets storedPaymentMethodId * - * @param string|null $cvc The [card verification code](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#card-security-code-cvc-cvv-cid). + * @param string|null $storedPaymentMethodId This is the `recurringDetailReference` returned in the response when you created the token. * * @return self */ - public function setCvc($cvc) + public function setStoredPaymentMethodId($storedPaymentMethodId) { - $this->container['cvc'] = $cvc; + $this->container['storedPaymentMethodId'] = $storedPaymentMethodId; return $this; } /** - * Gets digitalCardId + * Gets subtype * * @return string|null */ - public function getDigitalCardId() + public function getSubtype() { - return $this->container['digitalCardId']; + return $this->container['subtype']; } /** - * Sets digitalCardId + * Sets subtype * - * @param string|null $digitalCardId A unique identifier that represents the token associated with a card enrolled. Required for scheme 'mc'. + * @param string|null $subtype The type of flow to initiate. * * @return self */ - public function setDigitalCardId($digitalCardId) + public function setSubtype($subtype) { - $this->container['digitalCardId'] = $digitalCardId; + $this->container['subtype'] = $subtype; return $this; } /** - * Gets scheme + * Gets type * * @return string|null */ - public function getScheme() + public function getType() { - return $this->container['scheme']; + return $this->container['type']; } /** - * Sets scheme + * Sets type * - * @param string|null $scheme The Secure Remote Commerce scheme. + * @param string|null $type The payment method type. * * @return self */ - public function setScheme($scheme) + public function setType($type) { - $allowedValues = $this->getSchemeAllowableValues(); - if (!in_array($scheme, $allowedValues, true)) { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'scheme', must be one of '%s'", - $scheme, + "Invalid value '%s' for 'type', must be one of '%s'", + $type, implode("', '", $allowedValues) ) ); } - $this->container['scheme'] = $scheme; - - return $this; - } - - /** - * Gets tokenReference - * - * @return string|null - */ - public function getTokenReference() - { - return $this->container['tokenReference']; - } - - /** - * Sets tokenReference - * - * @param string|null $tokenReference A unique identifier that represents the token associated with a card enrolled. Required for scheme 'visa'. - * - * @return self - */ - public function setTokenReference($tokenReference) - { - $this->container['tokenReference'] = $tokenReference; + $this->container['type'] = $type; return $this; } diff --git a/src/Adyen/Model/ConfigurationWebhooks/Contact.php b/src/Adyen/Model/ConfigurationWebhooks/Contact.php deleted file mode 100644 index e83c5ad97..000000000 --- a/src/Adyen/Model/ConfigurationWebhooks/Contact.php +++ /dev/null @@ -1,614 +0,0 @@ - - */ -class Contact implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'Contact'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'address' => '\Adyen\Model\ConfigurationWebhooks\Address', - 'email' => 'string', - 'fullPhoneNumber' => 'string', - 'name' => '\Adyen\Model\ConfigurationWebhooks\Name', - 'personalData' => '\Adyen\Model\ConfigurationWebhooks\PersonalData', - 'phoneNumber' => '\Adyen\Model\ConfigurationWebhooks\PhoneNumber', - 'webAddress' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'address' => null, - 'email' => null, - 'fullPhoneNumber' => null, - 'name' => null, - 'personalData' => null, - 'phoneNumber' => null, - 'webAddress' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'address' => false, - 'email' => false, - 'fullPhoneNumber' => false, - 'name' => false, - 'personalData' => false, - 'phoneNumber' => false, - 'webAddress' => 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 = [ - 'address' => 'address', - 'email' => 'email', - 'fullPhoneNumber' => 'fullPhoneNumber', - 'name' => 'name', - 'personalData' => 'personalData', - 'phoneNumber' => 'phoneNumber', - 'webAddress' => 'webAddress' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'address' => 'setAddress', - 'email' => 'setEmail', - 'fullPhoneNumber' => 'setFullPhoneNumber', - 'name' => 'setName', - 'personalData' => 'setPersonalData', - 'phoneNumber' => 'setPhoneNumber', - 'webAddress' => 'setWebAddress' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'address' => 'getAddress', - 'email' => 'getEmail', - 'fullPhoneNumber' => 'getFullPhoneNumber', - 'name' => 'getName', - 'personalData' => 'getPersonalData', - 'phoneNumber' => 'getPhoneNumber', - 'webAddress' => 'getWebAddress' - ]; - - /** - * 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('address', $data ?? [], null); - $this->setIfExists('email', $data ?? [], null); - $this->setIfExists('fullPhoneNumber', $data ?? [], null); - $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('personalData', $data ?? [], null); - $this->setIfExists('phoneNumber', $data ?? [], null); - $this->setIfExists('webAddress', $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 address - * - * @return \Adyen\Model\ConfigurationWebhooks\Address|null - */ - public function getAddress() - { - return $this->container['address']; - } - - /** - * Sets address - * - * @param \Adyen\Model\ConfigurationWebhooks\Address|null $address address - * - * @return self - */ - public function setAddress($address) - { - if (is_null($address)) { - throw new \InvalidArgumentException('non-nullable address cannot be null'); - } - $this->container['address'] = $address; - - return $this; - } - - /** - * Gets email - * - * @return string|null - */ - public function getEmail() - { - return $this->container['email']; - } - - /** - * Sets email - * - * @param string|null $email The e-mail address of the contact. - * - * @return self - */ - public function setEmail($email) - { - if (is_null($email)) { - throw new \InvalidArgumentException('non-nullable email cannot be null'); - } - $this->container['email'] = $email; - - return $this; - } - - /** - * Gets fullPhoneNumber - * - * @return string|null - */ - public function getFullPhoneNumber() - { - return $this->container['fullPhoneNumber']; - } - - /** - * Sets fullPhoneNumber - * - * @param string|null $fullPhoneNumber The phone number of the contact provided as a single string. It will be handled as a landline phone. **Examples:** \"0031 6 11 22 33 44\", \"+316/1122-3344\", \"(0031) 611223344\" - * - * @return self - */ - public function setFullPhoneNumber($fullPhoneNumber) - { - if (is_null($fullPhoneNumber)) { - throw new \InvalidArgumentException('non-nullable fullPhoneNumber cannot be null'); - } - $this->container['fullPhoneNumber'] = $fullPhoneNumber; - - return $this; - } - - /** - * Gets name - * - * @return \Adyen\Model\ConfigurationWebhooks\Name|null - */ - public function getName() - { - return $this->container['name']; - } - - /** - * Sets name - * - * @param \Adyen\Model\ConfigurationWebhooks\Name|null $name name - * - * @return self - */ - public function setName($name) - { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); - } - $this->container['name'] = $name; - - return $this; - } - - /** - * Gets personalData - * - * @return \Adyen\Model\ConfigurationWebhooks\PersonalData|null - */ - public function getPersonalData() - { - return $this->container['personalData']; - } - - /** - * Sets personalData - * - * @param \Adyen\Model\ConfigurationWebhooks\PersonalData|null $personalData personalData - * - * @return self - */ - public function setPersonalData($personalData) - { - if (is_null($personalData)) { - throw new \InvalidArgumentException('non-nullable personalData cannot be null'); - } - $this->container['personalData'] = $personalData; - - return $this; - } - - /** - * Gets phoneNumber - * - * @return \Adyen\Model\ConfigurationWebhooks\PhoneNumber|null - */ - public function getPhoneNumber() - { - return $this->container['phoneNumber']; - } - - /** - * Sets phoneNumber - * - * @param \Adyen\Model\ConfigurationWebhooks\PhoneNumber|null $phoneNumber phoneNumber - * - * @return self - */ - public function setPhoneNumber($phoneNumber) - { - if (is_null($phoneNumber)) { - throw new \InvalidArgumentException('non-nullable phoneNumber cannot be null'); - } - $this->container['phoneNumber'] = $phoneNumber; - - return $this; - } - - /** - * Gets webAddress - * - * @return string|null - */ - public function getWebAddress() - { - return $this->container['webAddress']; - } - - /** - * Sets webAddress - * - * @param string|null $webAddress The URL of the website of the contact. - * - * @return self - */ - public function setWebAddress($webAddress) - { - if (is_null($webAddress)) { - throw new \InvalidArgumentException('non-nullable webAddress cannot be null'); - } - $this->container['webAddress'] = $webAddress; - - 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/ConfigurationWebhooks/PaymentInstrument.php b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrument.php index 5d4dd6bd8..84553fe2e 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrument.php +++ b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrument.php @@ -782,7 +782,7 @@ public function getType() /** * Sets type * - * @param string $type Type of payment instrument. Possible value: **card**, **bankAccount**. + * @param string $type The type of payment instrument. Possible values: **card**, **bankAccount**. * * @return self */ diff --git a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentBankAccount.php b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentBankAccount.php deleted file mode 100644 index bbe12b3b9..000000000 --- a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentBankAccount.php +++ /dev/null @@ -1,638 +0,0 @@ - - */ -class PaymentInstrumentBankAccount implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'PaymentInstrument_bankAccount'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'formFactor' => 'string', - 'iban' => 'string', - 'type' => 'string', - 'accountNumber' => 'string', - 'sortCode' => 'string', - 'accountType' => 'string', - 'routingNumber' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'formFactor' => null, - 'iban' => null, - 'type' => null, - 'accountNumber' => null, - 'sortCode' => null, - 'accountType' => null, - 'routingNumber' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'formFactor' => true, - 'iban' => false, - 'type' => false, - 'accountNumber' => false, - 'sortCode' => false, - 'accountType' => false, - 'routingNumber' => 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 = [ - 'formFactor' => 'formFactor', - 'iban' => 'iban', - 'type' => 'type', - 'accountNumber' => 'accountNumber', - 'sortCode' => 'sortCode', - 'accountType' => 'accountType', - 'routingNumber' => 'routingNumber' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'formFactor' => 'setFormFactor', - 'iban' => 'setIban', - 'type' => 'setType', - 'accountNumber' => 'setAccountNumber', - 'sortCode' => 'setSortCode', - 'accountType' => 'setAccountType', - 'routingNumber' => 'setRoutingNumber' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'formFactor' => 'getFormFactor', - 'iban' => 'getIban', - 'type' => 'getType', - 'accountNumber' => 'getAccountNumber', - 'sortCode' => 'getSortCode', - 'accountType' => 'getAccountType', - 'routingNumber' => 'getRoutingNumber' - ]; - - /** - * 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('formFactor', $data ?? [], null); - $this->setIfExists('iban', $data ?? [], null); - $this->setIfExists('type', $data ?? [], null); - $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('sortCode', $data ?? [], null); - $this->setIfExists('accountType', $data ?? [], null); - $this->setIfExists('routingNumber', $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['iban'] === null) { - $invalidProperties[] = "'iban' can't be null"; - } - if ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } - - if ($this->container['accountNumber'] === null) { - $invalidProperties[] = "'accountNumber' can't be null"; - } - if ($this->container['sortCode'] === null) { - $invalidProperties[] = "'sortCode' can't be null"; - } - - if ($this->container['routingNumber'] === null) { - $invalidProperties[] = "'routingNumber' 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 formFactor - * - * @return string|null - */ - public function getFormFactor() - { - return $this->container['formFactor']; - } - - /** - * Sets formFactor - * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. - * - * @return self - */ - public function setFormFactor($formFactor) - { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; - - return $this; - } - - /** - * Gets iban - * - * @return string - */ - public function getIban() - { - return $this->container['iban']; - } - - /** - * Sets iban - * - * @param string $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. - * - * @return self - */ - public function setIban($iban) - { - if (is_null($iban)) { - throw new \InvalidArgumentException('non-nullable iban cannot be null'); - } - $this->container['iban'] = $iban; - - return $this; - } - - /** - * Gets type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $type **usLocal** - * - * @return self - */ - public function setType($type) - { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets accountNumber - * - * @return string - */ - public function getAccountNumber() - { - return $this->container['accountNumber']; - } - - /** - * Sets accountNumber - * - * @param string $accountNumber The bank account number, without separators or whitespace. - * - * @return self - */ - public function setAccountNumber($accountNumber) - { - if (is_null($accountNumber)) { - throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); - } - $this->container['accountNumber'] = $accountNumber; - - return $this; - } - - /** - * Gets sortCode - * - * @return string - */ - public function getSortCode() - { - return $this->container['sortCode']; - } - - /** - * Sets sortCode - * - * @param string $sortCode The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. - * - * @return self - */ - public function setSortCode($sortCode) - { - if (is_null($sortCode)) { - throw new \InvalidArgumentException('non-nullable sortCode cannot be null'); - } - $this->container['sortCode'] = $sortCode; - - return $this; - } - - /** - * Gets accountType - * - * @return string|null - */ - public function getAccountType() - { - return $this->container['accountType']; - } - - /** - * Sets accountType - * - * @param string|null $accountType The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. - * - * @return self - */ - public function setAccountType($accountType) - { - if (is_null($accountType)) { - throw new \InvalidArgumentException('non-nullable accountType cannot be null'); - } - $this->container['accountType'] = $accountType; - - return $this; - } - - /** - * Gets routingNumber - * - * @return string - */ - public function getRoutingNumber() - { - return $this->container['routingNumber']; - } - - /** - * Sets routingNumber - * - * @param string $routingNumber The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. - * - * @return self - */ - public function setRoutingNumber($routingNumber) - { - if (is_null($routingNumber)) { - throw new \InvalidArgumentException('non-nullable routingNumber cannot be null'); - } - $this->container['routingNumber'] = $routingNumber; - - 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/ConfigurationWebhooks/PaymentInstrumentReference.php b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentReference.php deleted file mode 100644 index 42fdde78b..000000000 --- a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentReference.php +++ /dev/null @@ -1,413 +0,0 @@ - - */ -class PaymentInstrumentReference implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'PaymentInstrumentReference'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'id' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'id' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'id' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'id' => 'id' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->setIfExists('id', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['id'] === null) { - $invalidProperties[] = "'id' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets id - * - * @return string - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param string $id The unique identifier of the payment instrument. - * - * @return self - */ - public function setId($id) - { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); - } - $this->container['id'] = $id; - - return $this; - } - /** - * 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/ConfigurationWebhooks/PersonalData.php b/src/Adyen/Model/ConfigurationWebhooks/PersonalData.php deleted file mode 100644 index e6a8ac037..000000000 --- a/src/Adyen/Model/ConfigurationWebhooks/PersonalData.php +++ /dev/null @@ -1,478 +0,0 @@ - - */ -class PersonalData implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'PersonalData'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'dateOfBirth' => 'string', - 'idNumber' => 'string', - 'nationality' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'dateOfBirth' => null, - 'idNumber' => null, - 'nationality' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'dateOfBirth' => false, - 'idNumber' => false, - 'nationality' => 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 = [ - 'dateOfBirth' => 'dateOfBirth', - 'idNumber' => 'idNumber', - 'nationality' => 'nationality' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'dateOfBirth' => 'setDateOfBirth', - 'idNumber' => 'setIdNumber', - 'nationality' => 'setNationality' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'dateOfBirth' => 'getDateOfBirth', - 'idNumber' => 'getIdNumber', - 'nationality' => 'getNationality' - ]; - - /** - * 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('dateOfBirth', $data ?? [], null); - $this->setIfExists('idNumber', $data ?? [], null); - $this->setIfExists('nationality', $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 dateOfBirth - * - * @return string|null - */ - public function getDateOfBirth() - { - return $this->container['dateOfBirth']; - } - - /** - * Sets dateOfBirth - * - * @param string|null $dateOfBirth The date of birth of the person. The date should be in ISO-8601 format yyyy-mm-dd (e.g. 2000-01-31). - * - * @return self - */ - public function setDateOfBirth($dateOfBirth) - { - if (is_null($dateOfBirth)) { - throw new \InvalidArgumentException('non-nullable dateOfBirth cannot be null'); - } - $this->container['dateOfBirth'] = $dateOfBirth; - - return $this; - } - - /** - * Gets idNumber - * - * @return string|null - */ - public function getIdNumber() - { - return $this->container['idNumber']; - } - - /** - * Sets idNumber - * - * @param string|null $idNumber An ID number of the person. - * - * @return self - */ - public function setIdNumber($idNumber) - { - if (is_null($idNumber)) { - throw new \InvalidArgumentException('non-nullable idNumber cannot be null'); - } - $this->container['idNumber'] = $idNumber; - - return $this; - } - - /** - * Gets nationality - * - * @return string|null - */ - public function getNationality() - { - return $this->container['nationality']; - } - - /** - * Sets nationality - * - * @param string|null $nationality The nationality of the person represented by a two-character country code. >The permitted country codes are defined in ISO-3166-1 alpha-2 (e.g. 'NL'). - * - * @return self - */ - public function setNationality($nationality) - { - if (is_null($nationality)) { - throw new \InvalidArgumentException('non-nullable nationality cannot be null'); - } - $this->container['nationality'] = $nationality; - - 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/ConfigurationWebhooks/SweepConfigurationV2.php b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.php index f8ed5cacc..1808d9162 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.php +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.php @@ -326,6 +326,7 @@ public function getModelName() public const REASON_PENDING_APPROVAL = 'pendingApproval'; public const REASON_PENDING_EXECUTION = 'pendingExecution'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; + public const REASON_REFUSED_BY_CUSTOMER = 'refusedByCustomer'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; @@ -390,6 +391,7 @@ public function getReasonAllowableValues() self::REASON_PENDING_APPROVAL, self::REASON_PENDING_EXECUTION, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, + self::REASON_REFUSED_BY_CUSTOMER, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, diff --git a/src/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.php b/src/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.php index e8b62d043..bbc1c41a9 100644 --- a/src/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.php +++ b/src/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.php @@ -248,6 +248,7 @@ public function getModelName() public const TYPE_ADYEN_ACCOUNT = 'adyenAccount'; public const TYPE_ADYEN_CAPITAL = 'adyenCapital'; public const TYPE_ADYEN_CARD = 'adyenCard'; + public const TYPE_ADYEN_CHARGE_CARD = 'adyenChargeCard'; public const TYPE_ADYEN_FOR_PLATFORMS_ADVANCED = 'adyenForPlatformsAdvanced'; public const TYPE_ADYEN_FOR_PLATFORMS_MANAGE = 'adyenForPlatformsManage'; public const TYPE_ADYEN_FRANCHISEE = 'adyenFranchisee'; @@ -265,6 +266,7 @@ public function getTypeAllowableValues() self::TYPE_ADYEN_ACCOUNT, self::TYPE_ADYEN_CAPITAL, self::TYPE_ADYEN_CARD, + self::TYPE_ADYEN_CHARGE_CARD, self::TYPE_ADYEN_FOR_PLATFORMS_ADVANCED, self::TYPE_ADYEN_FOR_PLATFORMS_MANAGE, self::TYPE_ADYEN_FRANCHISEE, @@ -479,7 +481,7 @@ public function getType() /** * Sets type * - * @param string|null $type The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** + * @param string|null $type The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/BankAccount.php b/src/Adyen/Model/LegalEntityManagement/BankAccount.php deleted file mode 100644 index 2aaad6357..000000000 --- a/src/Adyen/Model/LegalEntityManagement/BankAccount.php +++ /dev/null @@ -1,864 +0,0 @@ - - */ -class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'BankAccount'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'accountNumber' => 'string', - 'bsbCode' => 'string', - 'type' => 'string', - 'accountType' => 'string', - 'institutionNumber' => 'string', - 'transitNumber' => 'string', - 'bankCode' => 'string', - 'clearingCode' => 'string', - 'iban' => 'string', - 'additionalBankIdentification' => '\Adyen\Model\LegalEntityManagement\AdditionalBankIdentification', - 'bic' => 'string', - 'clearingNumber' => 'string', - 'sortCode' => 'string', - 'routingNumber' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'accountNumber' => null, - 'bsbCode' => null, - 'type' => null, - 'accountType' => null, - 'institutionNumber' => null, - 'transitNumber' => null, - 'bankCode' => null, - 'clearingCode' => null, - 'iban' => null, - 'additionalBankIdentification' => null, - 'bic' => null, - 'clearingNumber' => null, - 'sortCode' => null, - 'routingNumber' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'accountNumber' => false, - 'bsbCode' => false, - 'type' => false, - 'accountType' => false, - 'institutionNumber' => false, - 'transitNumber' => false, - 'bankCode' => false, - 'clearingCode' => false, - 'iban' => false, - 'additionalBankIdentification' => false, - 'bic' => false, - 'clearingNumber' => false, - 'sortCode' => false, - 'routingNumber' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'accountNumber' => 'accountNumber', - 'bsbCode' => 'bsbCode', - 'type' => 'type', - 'accountType' => 'accountType', - 'institutionNumber' => 'institutionNumber', - 'transitNumber' => 'transitNumber', - 'bankCode' => 'bankCode', - 'clearingCode' => 'clearingCode', - 'iban' => 'iban', - 'additionalBankIdentification' => 'additionalBankIdentification', - 'bic' => 'bic', - 'clearingNumber' => 'clearingNumber', - 'sortCode' => 'sortCode', - 'routingNumber' => 'routingNumber' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'accountNumber' => 'setAccountNumber', - 'bsbCode' => 'setBsbCode', - 'type' => 'setType', - 'accountType' => 'setAccountType', - 'institutionNumber' => 'setInstitutionNumber', - 'transitNumber' => 'setTransitNumber', - 'bankCode' => 'setBankCode', - 'clearingCode' => 'setClearingCode', - 'iban' => 'setIban', - 'additionalBankIdentification' => 'setAdditionalBankIdentification', - 'bic' => 'setBic', - 'clearingNumber' => 'setClearingNumber', - 'sortCode' => 'setSortCode', - 'routingNumber' => 'setRoutingNumber' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'accountNumber' => 'getAccountNumber', - 'bsbCode' => 'getBsbCode', - 'type' => 'getType', - 'accountType' => 'getAccountType', - 'institutionNumber' => 'getInstitutionNumber', - 'transitNumber' => 'getTransitNumber', - 'bankCode' => 'getBankCode', - 'clearingCode' => 'getClearingCode', - 'iban' => 'getIban', - 'additionalBankIdentification' => 'getAdditionalBankIdentification', - 'bic' => 'getBic', - 'clearingNumber' => 'getClearingNumber', - 'sortCode' => 'getSortCode', - 'routingNumber' => 'getRoutingNumber' - ]; - - /** - * 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('accountNumber', $data ?? [], null); - $this->setIfExists('bsbCode', $data ?? [], null); - $this->setIfExists('type', $data ?? [], 'usLocal'); - $this->setIfExists('accountType', $data ?? [], 'checking'); - $this->setIfExists('institutionNumber', $data ?? [], null); - $this->setIfExists('transitNumber', $data ?? [], null); - $this->setIfExists('bankCode', $data ?? [], null); - $this->setIfExists('clearingCode', $data ?? [], null); - $this->setIfExists('iban', $data ?? [], null); - $this->setIfExists('additionalBankIdentification', $data ?? [], null); - $this->setIfExists('bic', $data ?? [], null); - $this->setIfExists('clearingNumber', $data ?? [], null); - $this->setIfExists('sortCode', $data ?? [], null); - $this->setIfExists('routingNumber', $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['accountNumber'] === null) { - $invalidProperties[] = "'accountNumber' can't be null"; - } - if ($this->container['bsbCode'] === null) { - $invalidProperties[] = "'bsbCode' can't be null"; - } - if ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } - - - if ($this->container['institutionNumber'] === null) { - $invalidProperties[] = "'institutionNumber' can't be null"; - } - if ($this->container['transitNumber'] === null) { - $invalidProperties[] = "'transitNumber' can't be null"; - } - if ($this->container['bankCode'] === null) { - $invalidProperties[] = "'bankCode' can't be null"; - } - if ($this->container['clearingCode'] === null) { - $invalidProperties[] = "'clearingCode' can't be null"; - } - if ($this->container['iban'] === null) { - $invalidProperties[] = "'iban' can't be null"; - } - if ($this->container['bic'] === null) { - $invalidProperties[] = "'bic' can't be null"; - } - if ($this->container['clearingNumber'] === null) { - $invalidProperties[] = "'clearingNumber' can't be null"; - } - if ($this->container['sortCode'] === null) { - $invalidProperties[] = "'sortCode' can't be null"; - } - if ($this->container['routingNumber'] === null) { - $invalidProperties[] = "'routingNumber' 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 accountNumber - * - * @return string - */ - public function getAccountNumber() - { - return $this->container['accountNumber']; - } - - /** - * Sets accountNumber - * - * @param string $accountNumber The bank account number, without separators or whitespace. - * - * @return self - */ - public function setAccountNumber($accountNumber) - { - if (is_null($accountNumber)) { - throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); - } - $this->container['accountNumber'] = $accountNumber; - - return $this; - } - - /** - * Gets bsbCode - * - * @return string - */ - public function getBsbCode() - { - return $this->container['bsbCode']; - } - - /** - * Sets bsbCode - * - * @param string $bsbCode The 6-digit [Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or whitespace. - * - * @return self - */ - public function setBsbCode($bsbCode) - { - if (is_null($bsbCode)) { - throw new \InvalidArgumentException('non-nullable bsbCode cannot be null'); - } - $this->container['bsbCode'] = $bsbCode; - - return $this; - } - - /** - * Gets type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $type **usLocal** - * - * @return self - */ - public function setType($type) - { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets accountType - * - * @return string|null - */ - public function getAccountType() - { - return $this->container['accountType']; - } - - /** - * Sets accountType - * - * @param string|null $accountType The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. - * - * @return self - */ - public function setAccountType($accountType) - { - if (is_null($accountType)) { - throw new \InvalidArgumentException('non-nullable accountType cannot be null'); - } - $this->container['accountType'] = $accountType; - - return $this; - } - - /** - * Gets institutionNumber - * - * @return string - */ - public function getInstitutionNumber() - { - return $this->container['institutionNumber']; - } - - /** - * Sets institutionNumber - * - * @param string $institutionNumber The 3-digit institution number, without separators or whitespace. - * - * @return self - */ - public function setInstitutionNumber($institutionNumber) - { - if (is_null($institutionNumber)) { - throw new \InvalidArgumentException('non-nullable institutionNumber cannot be null'); - } - $this->container['institutionNumber'] = $institutionNumber; - - return $this; - } - - /** - * Gets transitNumber - * - * @return string - */ - public function getTransitNumber() - { - return $this->container['transitNumber']; - } - - /** - * Sets transitNumber - * - * @param string $transitNumber The 5-digit transit number, without separators or whitespace. - * - * @return self - */ - public function setTransitNumber($transitNumber) - { - if (is_null($transitNumber)) { - throw new \InvalidArgumentException('non-nullable transitNumber cannot be null'); - } - $this->container['transitNumber'] = $transitNumber; - - return $this; - } - - /** - * Gets bankCode - * - * @return string - */ - public function getBankCode() - { - return $this->container['bankCode']; - } - - /** - * Sets bankCode - * - * @param string $bankCode The 4-digit bank code (Registreringsnummer) (without separators or whitespace). - * - * @return self - */ - public function setBankCode($bankCode) - { - if (is_null($bankCode)) { - throw new \InvalidArgumentException('non-nullable bankCode cannot be null'); - } - $this->container['bankCode'] = $bankCode; - - return $this; - } - - /** - * Gets clearingCode - * - * @return string - */ - public function getClearingCode() - { - return $this->container['clearingCode']; - } - - /** - * Sets clearingCode - * - * @param string $clearingCode The 3-digit clearing code, without separators or whitespace. - * - * @return self - */ - public function setClearingCode($clearingCode) - { - if (is_null($clearingCode)) { - throw new \InvalidArgumentException('non-nullable clearingCode cannot be null'); - } - $this->container['clearingCode'] = $clearingCode; - - return $this; - } - - /** - * Gets iban - * - * @return string - */ - public function getIban() - { - return $this->container['iban']; - } - - /** - * Sets iban - * - * @param string $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. - * - * @return self - */ - public function setIban($iban) - { - if (is_null($iban)) { - throw new \InvalidArgumentException('non-nullable iban cannot be null'); - } - $this->container['iban'] = $iban; - - return $this; - } - - /** - * Gets additionalBankIdentification - * - * @return \Adyen\Model\LegalEntityManagement\AdditionalBankIdentification|null - */ - public function getAdditionalBankIdentification() - { - return $this->container['additionalBankIdentification']; - } - - /** - * Sets additionalBankIdentification - * - * @param \Adyen\Model\LegalEntityManagement\AdditionalBankIdentification|null $additionalBankIdentification additionalBankIdentification - * - * @return self - */ - public function setAdditionalBankIdentification($additionalBankIdentification) - { - if (is_null($additionalBankIdentification)) { - throw new \InvalidArgumentException('non-nullable additionalBankIdentification cannot be null'); - } - $this->container['additionalBankIdentification'] = $additionalBankIdentification; - - return $this; - } - - /** - * Gets bic - * - * @return string - */ - public function getBic() - { - return $this->container['bic']; - } - - /** - * Sets bic - * - * @param string $bic The bank's 8- or 11-character BIC or SWIFT code. - * - * @return self - */ - public function setBic($bic) - { - if (is_null($bic)) { - throw new \InvalidArgumentException('non-nullable bic cannot be null'); - } - $this->container['bic'] = $bic; - - return $this; - } - - /** - * Gets clearingNumber - * - * @return string - */ - public function getClearingNumber() - { - return $this->container['clearingNumber']; - } - - /** - * Sets clearingNumber - * - * @param string $clearingNumber The 4- to 5-digit clearing number ([Clearingnummer](https://sv.wikipedia.org/wiki/Clearingnummer)), without separators or whitespace. - * - * @return self - */ - public function setClearingNumber($clearingNumber) - { - if (is_null($clearingNumber)) { - throw new \InvalidArgumentException('non-nullable clearingNumber cannot be null'); - } - $this->container['clearingNumber'] = $clearingNumber; - - return $this; - } - - /** - * Gets sortCode - * - * @return string - */ - public function getSortCode() - { - return $this->container['sortCode']; - } - - /** - * Sets sortCode - * - * @param string $sortCode The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. - * - * @return self - */ - public function setSortCode($sortCode) - { - if (is_null($sortCode)) { - throw new \InvalidArgumentException('non-nullable sortCode cannot be null'); - } - $this->container['sortCode'] = $sortCode; - - return $this; - } - - /** - * Gets routingNumber - * - * @return string - */ - public function getRoutingNumber() - { - return $this->container['routingNumber']; - } - - /** - * Sets routingNumber - * - * @param string $routingNumber The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. - * - * @return self - */ - public function setRoutingNumber($routingNumber) - { - if (is_null($routingNumber)) { - throw new \InvalidArgumentException('non-nullable routingNumber cannot be null'); - } - $this->container['routingNumber'] = $routingNumber; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } -} diff --git a/src/Adyen/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.php b/src/Adyen/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.php index 58430085f..ff6c690f4 100644 --- a/src/Adyen/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.php +++ b/src/Adyen/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.php @@ -218,6 +218,7 @@ public function getModelName() public const TERMS_OF_SERVICE_TYPES_ADYEN_ACCOUNT = 'adyenAccount'; public const TERMS_OF_SERVICE_TYPES_ADYEN_CAPITAL = 'adyenCapital'; public const TERMS_OF_SERVICE_TYPES_ADYEN_CARD = 'adyenCard'; + public const TERMS_OF_SERVICE_TYPES_ADYEN_CHARGE_CARD = 'adyenChargeCard'; public const TERMS_OF_SERVICE_TYPES_ADYEN_FOR_PLATFORMS_ADVANCED = 'adyenForPlatformsAdvanced'; public const TERMS_OF_SERVICE_TYPES_ADYEN_FOR_PLATFORMS_MANAGE = 'adyenForPlatformsManage'; public const TERMS_OF_SERVICE_TYPES_ADYEN_FRANCHISEE = 'adyenFranchisee'; @@ -235,6 +236,7 @@ public function getTermsOfServiceTypesAllowableValues() self::TERMS_OF_SERVICE_TYPES_ADYEN_ACCOUNT, self::TERMS_OF_SERVICE_TYPES_ADYEN_CAPITAL, self::TERMS_OF_SERVICE_TYPES_ADYEN_CARD, + self::TERMS_OF_SERVICE_TYPES_ADYEN_CHARGE_CARD, self::TERMS_OF_SERVICE_TYPES_ADYEN_FOR_PLATFORMS_ADVANCED, self::TERMS_OF_SERVICE_TYPES_ADYEN_FOR_PLATFORMS_MANAGE, self::TERMS_OF_SERVICE_TYPES_ADYEN_FRANCHISEE, diff --git a/src/Adyen/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.php b/src/Adyen/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.php new file mode 100644 index 000000000..8c596499e --- /dev/null +++ b/src/Adyen/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.php @@ -0,0 +1,535 @@ + + */ +class GetAcceptedTermsOfServiceDocumentResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetAcceptedTermsOfServiceDocumentResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'document' => 'string', + 'id' => 'string', + 'termsOfServiceAcceptanceReference' => 'string', + 'termsOfServiceDocumentFormat' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'document' => 'byte', + 'id' => null, + 'termsOfServiceAcceptanceReference' => null, + 'termsOfServiceDocumentFormat' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'document' => false, + 'id' => false, + 'termsOfServiceAcceptanceReference' => false, + 'termsOfServiceDocumentFormat' => 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 = [ + 'document' => 'document', + 'id' => 'id', + 'termsOfServiceAcceptanceReference' => 'termsOfServiceAcceptanceReference', + 'termsOfServiceDocumentFormat' => 'termsOfServiceDocumentFormat' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'document' => 'setDocument', + 'id' => 'setId', + 'termsOfServiceAcceptanceReference' => 'setTermsOfServiceAcceptanceReference', + 'termsOfServiceDocumentFormat' => 'setTermsOfServiceDocumentFormat' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'document' => 'getDocument', + 'id' => 'getId', + 'termsOfServiceAcceptanceReference' => 'getTermsOfServiceAcceptanceReference', + 'termsOfServiceDocumentFormat' => 'getTermsOfServiceDocumentFormat' + ]; + + /** + * 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 TERMS_OF_SERVICE_DOCUMENT_FORMAT_JSON = 'JSON'; + public const TERMS_OF_SERVICE_DOCUMENT_FORMAT_PDF = 'PDF'; + public const TERMS_OF_SERVICE_DOCUMENT_FORMAT_TXT = 'TXT'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTermsOfServiceDocumentFormatAllowableValues() + { + return [ + self::TERMS_OF_SERVICE_DOCUMENT_FORMAT_JSON, + self::TERMS_OF_SERVICE_DOCUMENT_FORMAT_PDF, + self::TERMS_OF_SERVICE_DOCUMENT_FORMAT_TXT, + ]; + } + /** + * 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('document', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('termsOfServiceAcceptanceReference', $data ?? [], null); + $this->setIfExists('termsOfServiceDocumentFormat', $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->getTermsOfServiceDocumentFormatAllowableValues(); + if (!is_null($this->container['termsOfServiceDocumentFormat']) && !in_array($this->container['termsOfServiceDocumentFormat'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'termsOfServiceDocumentFormat', must be one of '%s'", + $this->container['termsOfServiceDocumentFormat'], + 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 document + * + * @return string|null + */ + public function getDocument() + { + return $this->container['document']; + } + + /** + * Sets document + * + * @param string|null $document The accepted Terms of Service document in the requested format represented as a Base64-encoded bytes array. + * + * @return self + */ + public function setDocument($document) + { + $this->container['document'] = $document; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the legal entity. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets termsOfServiceAcceptanceReference + * + * @return string|null + */ + public function getTermsOfServiceAcceptanceReference() + { + return $this->container['termsOfServiceAcceptanceReference']; + } + + /** + * Sets termsOfServiceAcceptanceReference + * + * @param string|null $termsOfServiceAcceptanceReference An Adyen-generated reference for the accepted Terms of Service. + * + * @return self + */ + public function setTermsOfServiceAcceptanceReference($termsOfServiceAcceptanceReference) + { + $this->container['termsOfServiceAcceptanceReference'] = $termsOfServiceAcceptanceReference; + + return $this; + } + + /** + * Gets termsOfServiceDocumentFormat + * + * @return string|null + */ + public function getTermsOfServiceDocumentFormat() + { + return $this->container['termsOfServiceDocumentFormat']; + } + + /** + * Sets termsOfServiceDocumentFormat + * + * @param string|null $termsOfServiceDocumentFormat The format of the Terms of Service document. + * + * @return self + */ + public function setTermsOfServiceDocumentFormat($termsOfServiceDocumentFormat) + { + $allowedValues = $this->getTermsOfServiceDocumentFormatAllowableValues(); + if (!in_array($termsOfServiceDocumentFormat, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'termsOfServiceDocumentFormat', must be one of '%s'", + $termsOfServiceDocumentFormat, + implode("', '", $allowedValues) + ) + ); + } + $this->container['termsOfServiceDocumentFormat'] = $termsOfServiceDocumentFormat; + + 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/GetTermsOfServiceDocumentRequest.php b/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.php index 62554d91d..4b5a104d6 100644 --- a/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.php +++ b/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.php @@ -230,6 +230,7 @@ public function getModelName() public const TYPE_ADYEN_ACCOUNT = 'adyenAccount'; public const TYPE_ADYEN_CAPITAL = 'adyenCapital'; public const TYPE_ADYEN_CARD = 'adyenCard'; + public const TYPE_ADYEN_CHARGE_CARD = 'adyenChargeCard'; public const TYPE_ADYEN_FOR_PLATFORMS_ADVANCED = 'adyenForPlatformsAdvanced'; public const TYPE_ADYEN_FOR_PLATFORMS_MANAGE = 'adyenForPlatformsManage'; public const TYPE_ADYEN_FRANCHISEE = 'adyenFranchisee'; @@ -247,6 +248,7 @@ public function getTypeAllowableValues() self::TYPE_ADYEN_ACCOUNT, self::TYPE_ADYEN_CAPITAL, self::TYPE_ADYEN_CARD, + self::TYPE_ADYEN_CHARGE_CARD, self::TYPE_ADYEN_FOR_PLATFORMS_ADVANCED, self::TYPE_ADYEN_FOR_PLATFORMS_MANAGE, self::TYPE_ADYEN_FRANCHISEE, @@ -392,7 +394,7 @@ public function getType() /** * Sets type * - * @param string $type The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** + * @param string $type The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.php b/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.php index 990a5f4e4..d7e1d2612 100644 --- a/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.php +++ b/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.php @@ -248,6 +248,7 @@ public function getModelName() public const TYPE_ADYEN_ACCOUNT = 'adyenAccount'; public const TYPE_ADYEN_CAPITAL = 'adyenCapital'; public const TYPE_ADYEN_CARD = 'adyenCard'; + public const TYPE_ADYEN_CHARGE_CARD = 'adyenChargeCard'; public const TYPE_ADYEN_FOR_PLATFORMS_ADVANCED = 'adyenForPlatformsAdvanced'; public const TYPE_ADYEN_FOR_PLATFORMS_MANAGE = 'adyenForPlatformsManage'; public const TYPE_ADYEN_FRANCHISEE = 'adyenFranchisee'; @@ -265,6 +266,7 @@ public function getTypeAllowableValues() self::TYPE_ADYEN_ACCOUNT, self::TYPE_ADYEN_CAPITAL, self::TYPE_ADYEN_CARD, + self::TYPE_ADYEN_CHARGE_CARD, self::TYPE_ADYEN_FOR_PLATFORMS_ADVANCED, self::TYPE_ADYEN_FOR_PLATFORMS_MANAGE, self::TYPE_ADYEN_FRANCHISEE, @@ -479,7 +481,7 @@ public function getType() /** * Sets type * - * @param string|null $type The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** + * @param string|null $type The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.php b/src/Adyen/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.php index c124af258..d0f7d5d94 100644 --- a/src/Adyen/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.php +++ b/src/Adyen/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.php @@ -242,6 +242,7 @@ public function getModelName() public const TYPE_ADYEN_ACCOUNT = 'adyenAccount'; public const TYPE_ADYEN_CAPITAL = 'adyenCapital'; public const TYPE_ADYEN_CARD = 'adyenCard'; + public const TYPE_ADYEN_CHARGE_CARD = 'adyenChargeCard'; public const TYPE_ADYEN_FOR_PLATFORMS_ADVANCED = 'adyenForPlatformsAdvanced'; public const TYPE_ADYEN_FOR_PLATFORMS_MANAGE = 'adyenForPlatformsManage'; public const TYPE_ADYEN_FRANCHISEE = 'adyenFranchisee'; @@ -259,6 +260,7 @@ public function getTypeAllowableValues() self::TYPE_ADYEN_ACCOUNT, self::TYPE_ADYEN_CAPITAL, self::TYPE_ADYEN_CARD, + self::TYPE_ADYEN_CHARGE_CARD, self::TYPE_ADYEN_FOR_PLATFORMS_ADVANCED, self::TYPE_ADYEN_FOR_PLATFORMS_MANAGE, self::TYPE_ADYEN_FRANCHISEE, @@ -448,7 +450,7 @@ public function getType() /** * Sets type * - * @param string|null $type The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** + * @param string|null $type The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/UnincorporatedPartnership.php b/src/Adyen/Model/LegalEntityManagement/UnincorporatedPartnership.php deleted file mode 100644 index 10b5e13f8..000000000 --- a/src/Adyen/Model/LegalEntityManagement/UnincorporatedPartnership.php +++ /dev/null @@ -1,914 +0,0 @@ - - */ -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"; - } - 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) - ); - } - - $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) - { - if (is_null($countryOfGoverningLaw)) { - throw new \InvalidArgumentException('non-nullable countryOfGoverningLaw cannot be null'); - } - $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) - { - if (is_null($dateOfIncorporation)) { - throw new \InvalidArgumentException('non-nullable dateOfIncorporation cannot be null'); - } - $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) - { - if (is_null($description)) { - throw new \InvalidArgumentException('non-nullable description cannot be null'); - } - $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) - { - if (is_null($doingBusinessAs)) { - throw new \InvalidArgumentException('non-nullable doingBusinessAs cannot be null'); - } - $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) - { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); - } - $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) - { - if (is_null($principalPlaceOfBusiness)) { - throw new \InvalidArgumentException('non-nullable principalPlaceOfBusiness cannot be null'); - } - $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) - { - if (is_null($registeredAddress)) { - throw new \InvalidArgumentException('non-nullable registeredAddress cannot be null'); - } - $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) - { - if (is_null($registrationNumber)) { - throw new \InvalidArgumentException('non-nullable registrationNumber cannot be null'); - } - $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) - { - if (is_null($taxInformation)) { - throw new \InvalidArgumentException('non-nullable taxInformation cannot be null'); - } - $this->container['taxInformation'] = $taxInformation; - - return $this; - } - - /** - * Gets type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $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) - { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['type'] = $type; - - return $this; - } - - /** - * 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) - { - if (is_null($vatAbsenceReason)) { - throw new \InvalidArgumentException('non-nullable vatAbsenceReason cannot be null'); - } - $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) - { - if (is_null($vatNumber)) { - throw new \InvalidArgumentException('non-nullable vatNumber cannot be null'); - } - $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/Payments/ResponseAdditionalDataCard.php b/src/Adyen/Model/Payments/ResponseAdditionalDataCard.php index 97986396b..3a87adcb1 100644 --- a/src/Adyen/Model/Payments/ResponseAdditionalDataCard.php +++ b/src/Adyen/Model/Payments/ResponseAdditionalDataCard.php @@ -50,6 +50,7 @@ class ResponseAdditionalDataCard implements ModelInterface, ArrayAccess, \JsonSe 'cardIssuingCountry' => 'string', 'cardIssuingCurrency' => 'string', 'cardPaymentMethod' => 'string', + 'cardProductId' => 'string', 'cardSummary' => 'string', 'issuerBin' => 'string' ]; @@ -68,6 +69,7 @@ class ResponseAdditionalDataCard implements ModelInterface, ArrayAccess, \JsonSe 'cardIssuingCountry' => null, 'cardIssuingCurrency' => null, 'cardPaymentMethod' => null, + 'cardProductId' => null, 'cardSummary' => null, 'issuerBin' => null ]; @@ -84,6 +86,7 @@ class ResponseAdditionalDataCard implements ModelInterface, ArrayAccess, \JsonSe 'cardIssuingCountry' => false, 'cardIssuingCurrency' => false, 'cardPaymentMethod' => false, + 'cardProductId' => false, 'cardSummary' => false, 'issuerBin' => false ]; @@ -180,6 +183,7 @@ public function isNullableSetToNull(string $property): bool 'cardIssuingCountry' => 'cardIssuingCountry', 'cardIssuingCurrency' => 'cardIssuingCurrency', 'cardPaymentMethod' => 'cardPaymentMethod', + 'cardProductId' => 'cardProductId', 'cardSummary' => 'cardSummary', 'issuerBin' => 'issuerBin' ]; @@ -196,6 +200,7 @@ public function isNullableSetToNull(string $property): bool 'cardIssuingCountry' => 'setCardIssuingCountry', 'cardIssuingCurrency' => 'setCardIssuingCurrency', 'cardPaymentMethod' => 'setCardPaymentMethod', + 'cardProductId' => 'setCardProductId', 'cardSummary' => 'setCardSummary', 'issuerBin' => 'setIssuerBin' ]; @@ -212,6 +217,7 @@ public function isNullableSetToNull(string $property): bool 'cardIssuingCountry' => 'getCardIssuingCountry', 'cardIssuingCurrency' => 'getCardIssuingCurrency', 'cardPaymentMethod' => 'getCardPaymentMethod', + 'cardProductId' => 'getCardProductId', 'cardSummary' => 'getCardSummary', 'issuerBin' => 'getIssuerBin' ]; @@ -257,7 +263,39 @@ public function getModelName() return self::$openAPIModelName; } + public const CARD_PRODUCT_ID_A = 'A'; + public const CARD_PRODUCT_ID_B = 'B'; + public const CARD_PRODUCT_ID_C = 'C'; + public const CARD_PRODUCT_ID_D = 'D'; + public const CARD_PRODUCT_ID_F = 'F'; + public const CARD_PRODUCT_ID_MCC = 'MCC'; + public const CARD_PRODUCT_ID_MCE = 'MCE'; + public const CARD_PRODUCT_ID_MCF = 'MCF'; + public const CARD_PRODUCT_ID_MCG = 'MCG'; + public const CARD_PRODUCT_ID_MCH = 'MCH'; + public const CARD_PRODUCT_ID_MCI = 'MCI'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCardProductIdAllowableValues() + { + return [ + self::CARD_PRODUCT_ID_A, + self::CARD_PRODUCT_ID_B, + self::CARD_PRODUCT_ID_C, + self::CARD_PRODUCT_ID_D, + self::CARD_PRODUCT_ID_F, + self::CARD_PRODUCT_ID_MCC, + self::CARD_PRODUCT_ID_MCE, + self::CARD_PRODUCT_ID_MCF, + self::CARD_PRODUCT_ID_MCG, + self::CARD_PRODUCT_ID_MCH, + self::CARD_PRODUCT_ID_MCI, + ]; + } /** * Associative array for storing property values * @@ -279,6 +317,7 @@ public function __construct(array $data = null) $this->setIfExists('cardIssuingCountry', $data ?? [], null); $this->setIfExists('cardIssuingCurrency', $data ?? [], null); $this->setIfExists('cardPaymentMethod', $data ?? [], null); + $this->setIfExists('cardProductId', $data ?? [], null); $this->setIfExists('cardSummary', $data ?? [], null); $this->setIfExists('issuerBin', $data ?? [], null); } @@ -310,6 +349,15 @@ public function listInvalidProperties() { $invalidProperties = []; + $allowedValues = $this->getCardProductIdAllowableValues(); + if (!is_null($this->container['cardProductId']) && !in_array($this->container['cardProductId'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'cardProductId', must be one of '%s'", + $this->container['cardProductId'], + implode("', '", $allowedValues) + ); + } + return $invalidProperties; } @@ -469,6 +517,40 @@ public function setCardPaymentMethod($cardPaymentMethod) return $this; } + /** + * Gets cardProductId + * + * @return string|null + */ + public function getCardProductId() + { + return $this->container['cardProductId']; + } + + /** + * Sets cardProductId + * + * @param string|null $cardProductId The Card Product ID represents the type of card following card scheme product definitions and can be returned for Adyen Acquiring service level payments. Possible values Visa: * **A** - Visa Traditional * **B** - Visa Traditional Rewards * **C** - Visa Signature * **D** - Visa Signature Preferred * **F** - Visa Classic Possible values Mastercard: * **MCC** - Mastercard Card * **MCE** - Mastercard Electronic Card * **MCF** - Mastercard Corporate Fleet Card * **MCG** - Gold Mastercard Card * **MCH** - Mastercard Premium Charge * **MCI** - Mastercard Select Debit + * + * @return self + */ + public function setCardProductId($cardProductId) + { + $allowedValues = $this->getCardProductIdAllowableValues(); + if (!in_array($cardProductId, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'cardProductId', must be one of '%s'", + $cardProductId, + implode("', '", $allowedValues) + ) + ); + } + $this->container['cardProductId'] = $cardProductId; + + return $this; + } + /** * Gets cardSummary * diff --git a/src/Adyen/Model/TransactionWebhooks/BalancePlatformNotificationResponse.php b/src/Adyen/Model/TransactionWebhooks/BalancePlatformNotificationResponse.php index 65767d080..51fcad329 100644 --- a/src/Adyen/Model/TransactionWebhooks/BalancePlatformNotificationResponse.php +++ b/src/Adyen/Model/TransactionWebhooks/BalancePlatformNotificationResponse.php @@ -289,7 +289,7 @@ public function getNotificationResponse() /** * Sets notificationResponse * - * @param string|null $notificationResponse Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * @param string|null $notificationResponse Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). * * @return self */ diff --git a/src/Adyen/Model/Checkout/Configuration.php b/src/Adyen/Model/TransactionWebhooks/BankCategoryData.php similarity index 70% rename from src/Adyen/Model/Checkout/Configuration.php rename to src/Adyen/Model/TransactionWebhooks/BankCategoryData.php index 9427ed5ef..bd92fc0f7 100644 --- a/src/Adyen/Model/Checkout/Configuration.php +++ b/src/Adyen/Model/TransactionWebhooks/BankCategoryData.php @@ -1,9 +1,9 @@ */ -class Configuration implements ModelInterface, ArrayAccess, \JsonSerializable +class BankCategoryData implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class Configuration implements ModelInterface, ArrayAccess, \JsonSerializable * * @var string */ - protected static $openAPIModelName = 'Configuration'; + protected static $openAPIModelName = 'BankCategoryData'; /** * Array of property to type mappings. Used for (de)serialization @@ -44,10 +44,8 @@ class Configuration implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'avs' => '\Adyen\Model\Checkout\Avs', - 'cardHolderName' => 'string', - 'installments' => '\Adyen\Model\Checkout\InstallmentsNumber', - 'shopperInput' => '\Adyen\Model\Checkout\ShopperInput' + 'priority' => 'string', + 'type' => 'string' ]; /** @@ -58,10 +56,8 @@ class Configuration implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'avs' => null, - 'cardHolderName' => null, - 'installments' => null, - 'shopperInput' => null + 'priority' => null, + 'type' => null ]; /** @@ -70,10 +66,8 @@ class Configuration implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ - 'avs' => false, - 'cardHolderName' => false, - 'installments' => false, - 'shopperInput' => false + 'priority' => false, + 'type' => false ]; /** @@ -162,10 +156,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'avs' => 'avs', - 'cardHolderName' => 'cardHolderName', - 'installments' => 'installments', - 'shopperInput' => 'shopperInput' + 'priority' => 'priority', + 'type' => 'type' ]; /** @@ -174,10 +166,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'avs' => 'setAvs', - 'cardHolderName' => 'setCardHolderName', - 'installments' => 'setInstallments', - 'shopperInput' => 'setShopperInput' + 'priority' => 'setPriority', + 'type' => 'setType' ]; /** @@ -186,10 +176,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'avs' => 'getAvs', - 'cardHolderName' => 'getCardHolderName', - 'installments' => 'getInstallments', - 'shopperInput' => 'getShopperInput' + 'priority' => 'getPriority', + 'type' => 'getType' ]; /** @@ -233,21 +221,39 @@ public function getModelName() return self::$openAPIModelName; } - public const CARD_HOLDER_NAME_NONE = 'NONE'; - public const CARD_HOLDER_NAME_OPTIONAL = 'OPTIONAL'; - public const CARD_HOLDER_NAME_REQUIRED = 'REQUIRED'; + public const PRIORITY_CROSS_BORDER = 'crossBorder'; + public const PRIORITY_FAST = 'fast'; + public const PRIORITY_INSTANT = 'instant'; + public const PRIORITY_INTERNAL = 'internal'; + public const PRIORITY_REGULAR = 'regular'; + public const PRIORITY_WIRE = 'wire'; + public const TYPE_BANK = 'bank'; /** * Gets allowable values of the enum * * @return string[] */ - public function getCardHolderNameAllowableValues() + public function getPriorityAllowableValues() { return [ - self::CARD_HOLDER_NAME_NONE, - self::CARD_HOLDER_NAME_OPTIONAL, - self::CARD_HOLDER_NAME_REQUIRED, + self::PRIORITY_CROSS_BORDER, + self::PRIORITY_FAST, + self::PRIORITY_INSTANT, + self::PRIORITY_INTERNAL, + self::PRIORITY_REGULAR, + self::PRIORITY_WIRE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BANK, ]; } /** @@ -265,10 +271,8 @@ public function getCardHolderNameAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('avs', $data ?? [], null); - $this->setIfExists('cardHolderName', $data ?? [], null); - $this->setIfExists('installments', $data ?? [], null); - $this->setIfExists('shopperInput', $data ?? [], null); + $this->setIfExists('priority', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); } /** @@ -298,11 +302,20 @@ public function listInvalidProperties() { $invalidProperties = []; - $allowedValues = $this->getCardHolderNameAllowableValues(); - if (!is_null($this->container['cardHolderName']) && !in_array($this->container['cardHolderName'], $allowedValues, true)) { + $allowedValues = $this->getPriorityAllowableValues(); + if (!is_null($this->container['priority']) && !in_array($this->container['priority'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'priority', must be one of '%s'", + $this->container['priority'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'cardHolderName', must be one of '%s'", - $this->container['cardHolderName'], + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], implode("', '", $allowedValues) ); } @@ -323,107 +336,69 @@ public function valid() /** - * Gets avs - * - * @return \Adyen\Model\Checkout\Avs|null - */ - public function getAvs() - { - return $this->container['avs']; - } - - /** - * Sets avs - * - * @param \Adyen\Model\Checkout\Avs|null $avs avs - * - * @return self - */ - public function setAvs($avs) - { - $this->container['avs'] = $avs; - - return $this; - } - - /** - * Gets cardHolderName + * Gets priority * * @return string|null */ - public function getCardHolderName() + public function getPriority() { - return $this->container['cardHolderName']; + return $this->container['priority']; } /** - * Sets cardHolderName + * Sets priority * - * @param string|null $cardHolderName Determines whether the cardholder name should be provided or not. Permitted values: * NONE * OPTIONAL * REQUIRED + * @param string|null $priority The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). * * @return self */ - public function setCardHolderName($cardHolderName) + public function setPriority($priority) { - $allowedValues = $this->getCardHolderNameAllowableValues(); - if (!in_array($cardHolderName, $allowedValues, true)) { + $allowedValues = $this->getPriorityAllowableValues(); + if (!in_array($priority, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'cardHolderName', must be one of '%s'", - $cardHolderName, + "Invalid value '%s' for 'priority', must be one of '%s'", + $priority, implode("', '", $allowedValues) ) ); } - $this->container['cardHolderName'] = $cardHolderName; - - return $this; - } - - /** - * Gets installments - * - * @return \Adyen\Model\Checkout\InstallmentsNumber|null - */ - public function getInstallments() - { - return $this->container['installments']; - } - - /** - * Sets installments - * - * @param \Adyen\Model\Checkout\InstallmentsNumber|null $installments installments - * - * @return self - */ - public function setInstallments($installments) - { - $this->container['installments'] = $installments; + $this->container['priority'] = $priority; return $this; } /** - * Gets shopperInput + * Gets type * - * @return \Adyen\Model\Checkout\ShopperInput|null + * @return string|null */ - public function getShopperInput() + public function getType() { - return $this->container['shopperInput']; + return $this->container['type']; } /** - * Sets shopperInput + * Sets type * - * @param \Adyen\Model\Checkout\ShopperInput|null $shopperInput shopperInput + * @param string|null $type **bank** * * @return self */ - public function setShopperInput($shopperInput) + public function setType($type) { - $this->container['shopperInput'] = $shopperInput; + $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; } diff --git a/src/Adyen/Model/TransactionWebhooks/InternalCategoryData.php b/src/Adyen/Model/TransactionWebhooks/InternalCategoryData.php new file mode 100644 index 000000000..87ac3ba76 --- /dev/null +++ b/src/Adyen/Model/TransactionWebhooks/InternalCategoryData.php @@ -0,0 +1,500 @@ + + */ +class InternalCategoryData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InternalCategoryData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'modificationMerchantReference' => 'string', + 'modificationPspReference' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'modificationMerchantReference' => null, + 'modificationPspReference' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'modificationMerchantReference' => false, + 'modificationPspReference' => 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 = [ + 'modificationMerchantReference' => 'modificationMerchantReference', + 'modificationPspReference' => 'modificationPspReference', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'modificationMerchantReference' => 'setModificationMerchantReference', + 'modificationPspReference' => 'setModificationPspReference', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'modificationMerchantReference' => 'getModificationMerchantReference', + 'modificationPspReference' => 'getModificationPspReference', + '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_INTERNAL = 'internal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_INTERNAL, + ]; + } + /** + * 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('modificationMerchantReference', $data ?? [], null); + $this->setIfExists('modificationPspReference', $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 modificationMerchantReference + * + * @return string|null + */ + public function getModificationMerchantReference() + { + return $this->container['modificationMerchantReference']; + } + + /** + * Sets modificationMerchantReference + * + * @param string|null $modificationMerchantReference The capture's merchant reference included in the transfer. + * + * @return self + */ + public function setModificationMerchantReference($modificationMerchantReference) + { + $this->container['modificationMerchantReference'] = $modificationMerchantReference; + + return $this; + } + + /** + * Gets modificationPspReference + * + * @return string|null + */ + public function getModificationPspReference() + { + return $this->container['modificationPspReference']; + } + + /** + * Sets modificationPspReference + * + * @param string|null $modificationPspReference The capture reference included in the transfer. + * + * @return self + */ + public function setModificationPspReference($modificationPspReference) + { + $this->container['modificationPspReference'] = $modificationPspReference; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **internal** + * + * @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/RecurringDetail.php b/src/Adyen/Model/TransactionWebhooks/IssuedCard.php similarity index 50% rename from src/Adyen/Model/Checkout/RecurringDetail.php rename to src/Adyen/Model/TransactionWebhooks/IssuedCard.php index ee6977043..6507c02f1 100644 --- a/src/Adyen/Model/Checkout/RecurringDetail.php +++ b/src/Adyen/Model/TransactionWebhooks/IssuedCard.php @@ -1,9 +1,9 @@ */ -class RecurringDetail implements ModelInterface, ArrayAccess, \JsonSerializable +class IssuedCard implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class RecurringDetail implements ModelInterface, ArrayAccess, \JsonSerializable * * @var string */ - protected static $openAPIModelName = 'RecurringDetail'; + protected static $openAPIModelName = 'IssuedCard'; /** * Array of property to type mappings. Used for (de)serialization @@ -44,18 +44,14 @@ class RecurringDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'apps' => '\Adyen\Model\Checkout\PaymentMethodUPIApps[]', - 'brand' => 'string', - 'brands' => 'string[]', - 'configuration' => 'array', - 'fundingSource' => 'string', - 'group' => '\Adyen\Model\Checkout\PaymentMethodGroup', - 'inputDetails' => '\Adyen\Model\Checkout\InputDetail[]', - 'issuers' => '\Adyen\Model\Checkout\PaymentMethodIssuer[]', - 'name' => 'string', - 'recurringDetailReference' => 'string', - 'storedDetails' => '\Adyen\Model\Checkout\StoredDetails', - 'type' => 'string' + 'authorisationType' => 'string', + 'panEntryMode' => 'string', + 'processingType' => 'string', + 'relayedAuthorisationData' => '\Adyen\Model\TransactionWebhooks\RelayedAuthorisationData', + 'schemeTraceId' => 'string', + 'schemeUniqueTransactionId' => 'string', + 'type' => 'string', + 'validationFacts' => '\Adyen\Model\TransactionWebhooks\TransferNotificationValidationFact[]' ]; /** @@ -66,18 +62,14 @@ class RecurringDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'apps' => null, - 'brand' => null, - 'brands' => null, - 'configuration' => null, - 'fundingSource' => null, - 'group' => null, - 'inputDetails' => null, - 'issuers' => null, - 'name' => null, - 'recurringDetailReference' => null, - 'storedDetails' => null, - 'type' => null + 'authorisationType' => null, + 'panEntryMode' => null, + 'processingType' => null, + 'relayedAuthorisationData' => null, + 'schemeTraceId' => null, + 'schemeUniqueTransactionId' => null, + 'type' => null, + 'validationFacts' => null ]; /** @@ -86,18 +78,14 @@ class RecurringDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ - 'apps' => false, - 'brand' => false, - 'brands' => false, - 'configuration' => false, - 'fundingSource' => false, - 'group' => false, - 'inputDetails' => false, - 'issuers' => false, - 'name' => false, - 'recurringDetailReference' => false, - 'storedDetails' => false, - 'type' => false + 'authorisationType' => false, + 'panEntryMode' => false, + 'processingType' => false, + 'relayedAuthorisationData' => false, + 'schemeTraceId' => false, + 'schemeUniqueTransactionId' => false, + 'type' => false, + 'validationFacts' => false ]; /** @@ -186,18 +174,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'apps' => 'apps', - 'brand' => 'brand', - 'brands' => 'brands', - 'configuration' => 'configuration', - 'fundingSource' => 'fundingSource', - 'group' => 'group', - 'inputDetails' => 'inputDetails', - 'issuers' => 'issuers', - 'name' => 'name', - 'recurringDetailReference' => 'recurringDetailReference', - 'storedDetails' => 'storedDetails', - 'type' => 'type' + 'authorisationType' => 'authorisationType', + 'panEntryMode' => 'panEntryMode', + 'processingType' => 'processingType', + 'relayedAuthorisationData' => 'relayedAuthorisationData', + 'schemeTraceId' => 'schemeTraceId', + 'schemeUniqueTransactionId' => 'schemeUniqueTransactionId', + 'type' => 'type', + 'validationFacts' => 'validationFacts' ]; /** @@ -206,18 +190,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'apps' => 'setApps', - 'brand' => 'setBrand', - 'brands' => 'setBrands', - 'configuration' => 'setConfiguration', - 'fundingSource' => 'setFundingSource', - 'group' => 'setGroup', - 'inputDetails' => 'setInputDetails', - 'issuers' => 'setIssuers', - 'name' => 'setName', - 'recurringDetailReference' => 'setRecurringDetailReference', - 'storedDetails' => 'setStoredDetails', - 'type' => 'setType' + 'authorisationType' => 'setAuthorisationType', + 'panEntryMode' => 'setPanEntryMode', + 'processingType' => 'setProcessingType', + 'relayedAuthorisationData' => 'setRelayedAuthorisationData', + 'schemeTraceId' => 'setSchemeTraceId', + 'schemeUniqueTransactionId' => 'setSchemeUniqueTransactionId', + 'type' => 'setType', + 'validationFacts' => 'setValidationFacts' ]; /** @@ -226,18 +206,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'apps' => 'getApps', - 'brand' => 'getBrand', - 'brands' => 'getBrands', - 'configuration' => 'getConfiguration', - 'fundingSource' => 'getFundingSource', - 'group' => 'getGroup', - 'inputDetails' => 'getInputDetails', - 'issuers' => 'getIssuers', - 'name' => 'getName', - 'recurringDetailReference' => 'getRecurringDetailReference', - 'storedDetails' => 'getStoredDetails', - 'type' => 'getType' + 'authorisationType' => 'getAuthorisationType', + 'panEntryMode' => 'getPanEntryMode', + 'processingType' => 'getProcessingType', + 'relayedAuthorisationData' => 'getRelayedAuthorisationData', + 'schemeTraceId' => 'getSchemeTraceId', + 'schemeUniqueTransactionId' => 'getSchemeUniqueTransactionId', + 'type' => 'getType', + 'validationFacts' => 'getValidationFacts' ]; /** @@ -281,19 +257,67 @@ public function getModelName() return self::$openAPIModelName; } - public const FUNDING_SOURCE_CREDIT = 'credit'; - public const FUNDING_SOURCE_DEBIT = 'debit'; + public const PAN_ENTRY_MODE_CHIP = 'chip'; + public const PAN_ENTRY_MODE_COF = 'cof'; + public const PAN_ENTRY_MODE_CONTACTLESS = 'contactless'; + public const PAN_ENTRY_MODE_ECOMMERCE = 'ecommerce'; + public const PAN_ENTRY_MODE_MAGSTRIPE = 'magstripe'; + public const PAN_ENTRY_MODE_MANUAL = 'manual'; + public const PAN_ENTRY_MODE_TOKEN = 'token'; + public const PROCESSING_TYPE_ATM_WITHDRAW = 'atmWithdraw'; + public const PROCESSING_TYPE_BALANCE_INQUIRY = 'balanceInquiry'; + public const PROCESSING_TYPE_ECOMMERCE = 'ecommerce'; + public const PROCESSING_TYPE_MOTO = 'moto'; + public const PROCESSING_TYPE_POS = 'pos'; + public const PROCESSING_TYPE_PURCHASE_WITH_CASHBACK = 'purchaseWithCashback'; + public const PROCESSING_TYPE_RECURRING = 'recurring'; + public const PROCESSING_TYPE_TOKEN = 'token'; + public const TYPE_ISSUED_CARD = 'issuedCard'; /** * Gets allowable values of the enum * * @return string[] */ - public function getFundingSourceAllowableValues() + public function getPanEntryModeAllowableValues() { return [ - self::FUNDING_SOURCE_CREDIT, - self::FUNDING_SOURCE_DEBIT, + self::PAN_ENTRY_MODE_CHIP, + self::PAN_ENTRY_MODE_COF, + self::PAN_ENTRY_MODE_CONTACTLESS, + self::PAN_ENTRY_MODE_ECOMMERCE, + self::PAN_ENTRY_MODE_MAGSTRIPE, + self::PAN_ENTRY_MODE_MANUAL, + self::PAN_ENTRY_MODE_TOKEN, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getProcessingTypeAllowableValues() + { + return [ + self::PROCESSING_TYPE_ATM_WITHDRAW, + self::PROCESSING_TYPE_BALANCE_INQUIRY, + self::PROCESSING_TYPE_ECOMMERCE, + self::PROCESSING_TYPE_MOTO, + self::PROCESSING_TYPE_POS, + self::PROCESSING_TYPE_PURCHASE_WITH_CASHBACK, + self::PROCESSING_TYPE_RECURRING, + self::PROCESSING_TYPE_TOKEN, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_ISSUED_CARD, ]; } /** @@ -311,18 +335,14 @@ public function getFundingSourceAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('apps', $data ?? [], null); - $this->setIfExists('brand', $data ?? [], null); - $this->setIfExists('brands', $data ?? [], null); - $this->setIfExists('configuration', $data ?? [], null); - $this->setIfExists('fundingSource', $data ?? [], null); - $this->setIfExists('group', $data ?? [], null); - $this->setIfExists('inputDetails', $data ?? [], null); - $this->setIfExists('issuers', $data ?? [], null); - $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('recurringDetailReference', $data ?? [], null); - $this->setIfExists('storedDetails', $data ?? [], null); + $this->setIfExists('authorisationType', $data ?? [], null); + $this->setIfExists('panEntryMode', $data ?? [], null); + $this->setIfExists('processingType', $data ?? [], null); + $this->setIfExists('relayedAuthorisationData', $data ?? [], null); + $this->setIfExists('schemeTraceId', $data ?? [], null); + $this->setIfExists('schemeUniqueTransactionId', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('validationFacts', $data ?? [], null); } /** @@ -352,11 +372,29 @@ public function listInvalidProperties() { $invalidProperties = []; - $allowedValues = $this->getFundingSourceAllowableValues(); - if (!is_null($this->container['fundingSource']) && !in_array($this->container['fundingSource'], $allowedValues, true)) { + $allowedValues = $this->getPanEntryModeAllowableValues(); + if (!is_null($this->container['panEntryMode']) && !in_array($this->container['panEntryMode'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'panEntryMode', must be one of '%s'", + $this->container['panEntryMode'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getProcessingTypeAllowableValues(); + if (!is_null($this->container['processingType']) && !in_array($this->container['processingType'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'fundingSource', must be one of '%s'", - $this->container['fundingSource'], + "invalid value '%s' for 'processingType', must be one of '%s'", + $this->container['processingType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], implode("', '", $allowedValues) ); } @@ -377,301 +415,223 @@ public function valid() /** - * Gets apps - * - * @return \Adyen\Model\Checkout\PaymentMethodUPIApps[]|null - */ - public function getApps() - { - return $this->container['apps']; - } - - /** - * Sets apps - * - * @param \Adyen\Model\Checkout\PaymentMethodUPIApps[]|null $apps A list of apps for this payment method. - * - * @return self - */ - public function setApps($apps) - { - $this->container['apps'] = $apps; - - return $this; - } - - /** - * Gets brand + * Gets authorisationType * * @return string|null */ - public function getBrand() - { - return $this->container['brand']; - } - - /** - * Sets brand - * - * @param string|null $brand Brand for the selected gift card. For example: plastix, hmclub. - * - * @return self - */ - public function setBrand($brand) - { - $this->container['brand'] = $brand; - - return $this; - } - - /** - * Gets brands - * - * @return string[]|null - */ - public function getBrands() + public function getAuthorisationType() { - return $this->container['brands']; + return $this->container['authorisationType']; } /** - * Sets brands + * Sets authorisationType * - * @param string[]|null $brands List of possible brands. For example: visa, mc. + * @param string|null $authorisationType The authorisation type. For example, **defaultAuthorisation**, **preAuthorisation**, **finalAuthorisation** * * @return self */ - public function setBrands($brands) + public function setAuthorisationType($authorisationType) { - $this->container['brands'] = $brands; + $this->container['authorisationType'] = $authorisationType; return $this; } /** - * Gets configuration - * - * @return array|null - */ - public function getConfiguration() - { - return $this->container['configuration']; - } - - /** - * Sets configuration - * - * @param array|null $configuration The configuration of the payment method. - * - * @return self - */ - public function setConfiguration($configuration) - { - $this->container['configuration'] = $configuration; - - return $this; - } - - /** - * Gets fundingSource + * Gets panEntryMode * * @return string|null */ - public function getFundingSource() + public function getPanEntryMode() { - return $this->container['fundingSource']; + return $this->container['panEntryMode']; } /** - * Sets fundingSource + * Sets panEntryMode * - * @param string|null $fundingSource The funding source of the payment method. + * @param string|null $panEntryMode Indicates the method used for entering the PAN to initiate a transaction. Possible values: **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**. * * @return self */ - public function setFundingSource($fundingSource) + public function setPanEntryMode($panEntryMode) { - $allowedValues = $this->getFundingSourceAllowableValues(); - if (!in_array($fundingSource, $allowedValues, true)) { + $allowedValues = $this->getPanEntryModeAllowableValues(); + if (!in_array($panEntryMode, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'fundingSource', must be one of '%s'", - $fundingSource, + "Invalid value '%s' for 'panEntryMode', must be one of '%s'", + $panEntryMode, implode("', '", $allowedValues) ) ); } - $this->container['fundingSource'] = $fundingSource; + $this->container['panEntryMode'] = $panEntryMode; return $this; } /** - * Gets group - * - * @return \Adyen\Model\Checkout\PaymentMethodGroup|null - */ - public function getGroup() - { - return $this->container['group']; - } - - /** - * Sets group - * - * @param \Adyen\Model\Checkout\PaymentMethodGroup|null $group group + * Gets processingType * - * @return self - */ - public function setGroup($group) - { - $this->container['group'] = $group; - - return $this; - } - - /** - * Gets inputDetails - * - * @return \Adyen\Model\Checkout\InputDetail[]|null - * @deprecated + * @return string|null */ - public function getInputDetails() + public function getProcessingType() { - return $this->container['inputDetails']; + return $this->container['processingType']; } /** - * Sets inputDetails + * Sets processingType * - * @param \Adyen\Model\Checkout\InputDetail[]|null $inputDetails All input details to be provided to complete the payment with this payment method. + * @param string|null $processingType Contains information about how the payment was processed. For example, **ecommerce** for online or **pos** for in-person payments. * * @return self - * @deprecated */ - public function setInputDetails($inputDetails) + public function setProcessingType($processingType) { - $this->container['inputDetails'] = $inputDetails; + $allowedValues = $this->getProcessingTypeAllowableValues(); + if (!in_array($processingType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'processingType', must be one of '%s'", + $processingType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['processingType'] = $processingType; return $this; } /** - * Gets issuers + * Gets relayedAuthorisationData * - * @return \Adyen\Model\Checkout\PaymentMethodIssuer[]|null + * @return \Adyen\Model\TransactionWebhooks\RelayedAuthorisationData|null */ - public function getIssuers() + public function getRelayedAuthorisationData() { - return $this->container['issuers']; + return $this->container['relayedAuthorisationData']; } /** - * Sets issuers + * Sets relayedAuthorisationData * - * @param \Adyen\Model\Checkout\PaymentMethodIssuer[]|null $issuers A list of issuers for this payment method. + * @param \Adyen\Model\TransactionWebhooks\RelayedAuthorisationData|null $relayedAuthorisationData relayedAuthorisationData * * @return self */ - public function setIssuers($issuers) + public function setRelayedAuthorisationData($relayedAuthorisationData) { - $this->container['issuers'] = $issuers; + $this->container['relayedAuthorisationData'] = $relayedAuthorisationData; return $this; } /** - * Gets name + * Gets schemeTraceId * * @return string|null */ - public function getName() + public function getSchemeTraceId() { - return $this->container['name']; + return $this->container['schemeTraceId']; } /** - * Sets name + * Sets schemeTraceId * - * @param string|null $name The displayable name of this payment method. + * @param string|null $schemeTraceId The identifier of the original payment. This ID is provided by the scheme and can be alphanumeric or numeric, depending on the scheme. The `schemeTraceID` should refer to an original `schemeUniqueTransactionID` provided in an earlier payment (not necessarily processed by Adyen). A `schemeTraceId` is typically available for authorization adjustments or recurring payments. * * @return self */ - public function setName($name) + public function setSchemeTraceId($schemeTraceId) { - $this->container['name'] = $name; + $this->container['schemeTraceId'] = $schemeTraceId; return $this; } /** - * Gets recurringDetailReference + * Gets schemeUniqueTransactionId * * @return string|null */ - public function getRecurringDetailReference() + public function getSchemeUniqueTransactionId() { - return $this->container['recurringDetailReference']; + return $this->container['schemeUniqueTransactionId']; } /** - * Sets recurringDetailReference + * Sets schemeUniqueTransactionId * - * @param string|null $recurringDetailReference The reference that uniquely identifies the recurring detail. + * @param string|null $schemeUniqueTransactionId The unique identifier created by the scheme. This ID can be alphanumeric or numeric depending on the scheme. * * @return self */ - public function setRecurringDetailReference($recurringDetailReference) + public function setSchemeUniqueTransactionId($schemeUniqueTransactionId) { - $this->container['recurringDetailReference'] = $recurringDetailReference; + $this->container['schemeUniqueTransactionId'] = $schemeUniqueTransactionId; return $this; } /** - * Gets storedDetails + * Gets type * - * @return \Adyen\Model\Checkout\StoredDetails|null + * @return string|null */ - public function getStoredDetails() + public function getType() { - return $this->container['storedDetails']; + return $this->container['type']; } /** - * Sets storedDetails + * Sets type * - * @param \Adyen\Model\Checkout\StoredDetails|null $storedDetails storedDetails + * @param string|null $type **issuedCard** * * @return self */ - public function setStoredDetails($storedDetails) + public function setType($type) { - $this->container['storedDetails'] = $storedDetails; + $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 type + * Gets validationFacts * - * @return string|null + * @return \Adyen\Model\TransactionWebhooks\TransferNotificationValidationFact[]|null */ - public function getType() + public function getValidationFacts() { - return $this->container['type']; + return $this->container['validationFacts']; } /** - * Sets type + * Sets validationFacts * - * @param string|null $type The unique payment method code. + * @param \Adyen\Model\TransactionWebhooks\TransferNotificationValidationFact[]|null $validationFacts The evaluation of the validation facts. See [validation checks](https://docs.adyen.com/issuing/validation-checks) for more information. * * @return self */ - public function setType($type) + public function setValidationFacts($validationFacts) { - $this->container['type'] = $type; + $this->container['validationFacts'] = $validationFacts; return $this; } diff --git a/src/Adyen/Model/Checkout/ServiceErrorDetails.php b/src/Adyen/Model/TransactionWebhooks/PaymentInstrument.php similarity index 79% rename from src/Adyen/Model/Checkout/ServiceErrorDetails.php rename to src/Adyen/Model/TransactionWebhooks/PaymentInstrument.php index 753c663cb..4f653196e 100644 --- a/src/Adyen/Model/Checkout/ServiceErrorDetails.php +++ b/src/Adyen/Model/TransactionWebhooks/PaymentInstrument.php @@ -1,9 +1,9 @@ */ -class ServiceErrorDetails implements ModelInterface, ArrayAccess, \JsonSerializable +class PaymentInstrument implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class ServiceErrorDetails implements ModelInterface, ArrayAccess, \JsonSerializa * * @var string */ - protected static $openAPIModelName = 'ServiceErrorDetails'; + protected static $openAPIModelName = 'PaymentInstrument'; /** * Array of property to type mappings. Used for (de)serialization @@ -44,10 +44,10 @@ class ServiceErrorDetails implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'errorCode' => 'string', - 'errorType' => 'string', - 'message' => 'string', - 'pspReference' => 'string' + 'description' => 'string', + 'id' => 'string', + 'reference' => 'string', + 'tokenType' => 'string' ]; /** @@ -58,10 +58,10 @@ class ServiceErrorDetails implements ModelInterface, ArrayAccess, \JsonSerializa * @psalm-var array */ protected static $openAPIFormats = [ - 'errorCode' => null, - 'errorType' => null, - 'message' => null, - 'pspReference' => null + 'description' => null, + 'id' => null, + 'reference' => null, + 'tokenType' => null ]; /** @@ -70,10 +70,10 @@ class ServiceErrorDetails implements ModelInterface, ArrayAccess, \JsonSerializa * @var boolean[] */ protected static $openAPINullables = [ - 'errorCode' => false, - 'errorType' => false, - 'message' => false, - 'pspReference' => false + 'description' => false, + 'id' => false, + 'reference' => false, + 'tokenType' => false ]; /** @@ -162,10 +162,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'errorCode' => 'errorCode', - 'errorType' => 'errorType', - 'message' => 'message', - 'pspReference' => 'pspReference' + 'description' => 'description', + 'id' => 'id', + 'reference' => 'reference', + 'tokenType' => 'tokenType' ]; /** @@ -174,10 +174,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'errorCode' => 'setErrorCode', - 'errorType' => 'setErrorType', - 'message' => 'setMessage', - 'pspReference' => 'setPspReference' + 'description' => 'setDescription', + 'id' => 'setId', + 'reference' => 'setReference', + 'tokenType' => 'setTokenType' ]; /** @@ -186,10 +186,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'errorCode' => 'getErrorCode', - 'errorType' => 'getErrorType', - 'message' => 'getMessage', - 'pspReference' => 'getPspReference' + 'description' => 'getDescription', + 'id' => 'getId', + 'reference' => 'getReference', + 'tokenType' => 'getTokenType' ]; /** @@ -249,10 +249,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('errorCode', $data ?? [], null); - $this->setIfExists('errorType', $data ?? [], null); - $this->setIfExists('message', $data ?? [], null); - $this->setIfExists('pspReference', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('tokenType', $data ?? [], null); } /** @@ -298,97 +298,97 @@ public function valid() /** - * Gets errorCode + * Gets description * * @return string|null */ - public function getErrorCode() + public function getDescription() { - return $this->container['errorCode']; + return $this->container['description']; } /** - * Sets errorCode + * Sets description * - * @param string|null $errorCode errorCode + * @param string|null $description The description of the resource. * * @return self */ - public function setErrorCode($errorCode) + public function setDescription($description) { - $this->container['errorCode'] = $errorCode; + $this->container['description'] = $description; return $this; } /** - * Gets errorType + * Gets id * * @return string|null */ - public function getErrorType() + public function getId() { - return $this->container['errorType']; + return $this->container['id']; } /** - * Sets errorType + * Sets id * - * @param string|null $errorType errorType + * @param string|null $id The unique identifier of the resource. * * @return self */ - public function setErrorType($errorType) + public function setId($id) { - $this->container['errorType'] = $errorType; + $this->container['id'] = $id; return $this; } /** - * Gets message + * Gets reference * * @return string|null */ - public function getMessage() + public function getReference() { - return $this->container['message']; + return $this->container['reference']; } /** - * Sets message + * Sets reference * - * @param string|null $message message + * @param string|null $reference The reference for the resource. * * @return self */ - public function setMessage($message) + public function setReference($reference) { - $this->container['message'] = $message; + $this->container['reference'] = $reference; return $this; } /** - * Gets pspReference + * Gets tokenType * * @return string|null */ - public function getPspReference() + public function getTokenType() { - return $this->container['pspReference']; + return $this->container['tokenType']; } /** - * Sets pspReference + * Sets tokenType * - * @param string|null $pspReference pspReference + * @param string|null $tokenType The type of wallet that the network token is associated with. * * @return self */ - public function setPspReference($pspReference) + public function setTokenType($tokenType) { - $this->container['pspReference'] = $pspReference; + $this->container['tokenType'] = $tokenType; return $this; } diff --git a/src/Adyen/Model/ConfigurationWebhooks/USLocalAccountIdentification.php b/src/Adyen/Model/TransactionWebhooks/PlatformPayment.php similarity index 61% rename from src/Adyen/Model/ConfigurationWebhooks/USLocalAccountIdentification.php rename to src/Adyen/Model/TransactionWebhooks/PlatformPayment.php index c0b12080b..970ea9e03 100644 --- a/src/Adyen/Model/ConfigurationWebhooks/USLocalAccountIdentification.php +++ b/src/Adyen/Model/TransactionWebhooks/PlatformPayment.php @@ -1,9 +1,9 @@ */ -class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +class PlatformPayment implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json * * @var string */ - protected static $openAPIModelName = 'USLocalAccountIdentification'; + protected static $openAPIModelName = 'PlatformPayment'; /** * Array of property to type mappings. Used for (de)serialization @@ -44,10 +44,11 @@ class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json * @var string[] */ protected static $openAPITypes = [ - 'accountNumber' => 'string', - 'accountType' => 'string', - 'formFactor' => 'string', - 'routingNumber' => 'string', + 'modificationMerchantReference' => 'string', + 'modificationPspReference' => 'string', + 'paymentMerchantReference' => 'string', + 'platformPaymentType' => 'string', + 'pspPaymentReference' => 'string', 'type' => 'string' ]; @@ -59,10 +60,11 @@ class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json * @psalm-var array */ protected static $openAPIFormats = [ - 'accountNumber' => null, - 'accountType' => null, - 'formFactor' => null, - 'routingNumber' => null, + 'modificationMerchantReference' => null, + 'modificationPspReference' => null, + 'paymentMerchantReference' => null, + 'platformPaymentType' => null, + 'pspPaymentReference' => null, 'type' => null ]; @@ -72,10 +74,11 @@ class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json * @var boolean[] */ protected static $openAPINullables = [ - 'accountNumber' => false, - 'accountType' => false, - 'formFactor' => true, - 'routingNumber' => false, + 'modificationMerchantReference' => false, + 'modificationPspReference' => false, + 'paymentMerchantReference' => false, + 'platformPaymentType' => false, + 'pspPaymentReference' => false, 'type' => false ]; @@ -165,10 +168,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'accountNumber' => 'accountNumber', - 'accountType' => 'accountType', - 'formFactor' => 'formFactor', - 'routingNumber' => 'routingNumber', + 'modificationMerchantReference' => 'modificationMerchantReference', + 'modificationPspReference' => 'modificationPspReference', + 'paymentMerchantReference' => 'paymentMerchantReference', + 'platformPaymentType' => 'platformPaymentType', + 'pspPaymentReference' => 'pspPaymentReference', 'type' => 'type' ]; @@ -178,10 +182,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'accountNumber' => 'setAccountNumber', - 'accountType' => 'setAccountType', - 'formFactor' => 'setFormFactor', - 'routingNumber' => 'setRoutingNumber', + 'modificationMerchantReference' => 'setModificationMerchantReference', + 'modificationPspReference' => 'setModificationPspReference', + 'paymentMerchantReference' => 'setPaymentMerchantReference', + 'platformPaymentType' => 'setPlatformPaymentType', + 'pspPaymentReference' => 'setPspPaymentReference', 'type' => 'setType' ]; @@ -191,10 +196,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'accountNumber' => 'getAccountNumber', - 'accountType' => 'getAccountType', - 'formFactor' => 'getFormFactor', - 'routingNumber' => 'getRoutingNumber', + 'modificationMerchantReference' => 'getModificationMerchantReference', + 'modificationPspReference' => 'getModificationPspReference', + 'paymentMerchantReference' => 'getPaymentMerchantReference', + 'platformPaymentType' => 'getPlatformPaymentType', + 'pspPaymentReference' => 'getPspPaymentReference', 'type' => 'getType' ]; @@ -239,20 +245,46 @@ public function getModelName() return self::$openAPIModelName; } - public const ACCOUNT_TYPE_CHECKING = 'checking'; - public const ACCOUNT_TYPE_SAVINGS = 'savings'; - public const TYPE_US_LOCAL = 'usLocal'; + public const PLATFORM_PAYMENT_TYPE_ACQUIRING_FEES = 'AcquiringFees'; + public const PLATFORM_PAYMENT_TYPE_ADYEN_COMMISSION = 'AdyenCommission'; + public const PLATFORM_PAYMENT_TYPE_ADYEN_FEES = 'AdyenFees'; + public const PLATFORM_PAYMENT_TYPE_ADYEN_MARKUP = 'AdyenMarkup'; + public const PLATFORM_PAYMENT_TYPE_BALANCE_ACCOUNT = 'BalanceAccount'; + public const PLATFORM_PAYMENT_TYPE_COMMISSION = 'Commission'; + public const PLATFORM_PAYMENT_TYPE__DEFAULT = 'Default'; + public const PLATFORM_PAYMENT_TYPE_INTERCHANGE = 'Interchange'; + public const PLATFORM_PAYMENT_TYPE_PAYMENT_FEE = 'PaymentFee'; + public const PLATFORM_PAYMENT_TYPE_REMAINDER = 'Remainder'; + public const PLATFORM_PAYMENT_TYPE_SCHEME_FEE = 'SchemeFee'; + public const PLATFORM_PAYMENT_TYPE_SURCHARGE = 'Surcharge'; + public const PLATFORM_PAYMENT_TYPE_TIP = 'Tip'; + public const PLATFORM_PAYMENT_TYPE_TOP_UP = 'TopUp'; + public const PLATFORM_PAYMENT_TYPE_VAT = 'VAT'; + public const TYPE_PLATFORM_PAYMENT = 'platformPayment'; /** * Gets allowable values of the enum * * @return string[] */ - public function getAccountTypeAllowableValues() + public function getPlatformPaymentTypeAllowableValues() { return [ - self::ACCOUNT_TYPE_CHECKING, - self::ACCOUNT_TYPE_SAVINGS, + self::PLATFORM_PAYMENT_TYPE_ACQUIRING_FEES, + self::PLATFORM_PAYMENT_TYPE_ADYEN_COMMISSION, + self::PLATFORM_PAYMENT_TYPE_ADYEN_FEES, + self::PLATFORM_PAYMENT_TYPE_ADYEN_MARKUP, + self::PLATFORM_PAYMENT_TYPE_BALANCE_ACCOUNT, + self::PLATFORM_PAYMENT_TYPE_COMMISSION, + self::PLATFORM_PAYMENT_TYPE__DEFAULT, + self::PLATFORM_PAYMENT_TYPE_INTERCHANGE, + self::PLATFORM_PAYMENT_TYPE_PAYMENT_FEE, + self::PLATFORM_PAYMENT_TYPE_REMAINDER, + self::PLATFORM_PAYMENT_TYPE_SCHEME_FEE, + self::PLATFORM_PAYMENT_TYPE_SURCHARGE, + self::PLATFORM_PAYMENT_TYPE_TIP, + self::PLATFORM_PAYMENT_TYPE_TOP_UP, + self::PLATFORM_PAYMENT_TYPE_VAT, ]; } /** @@ -263,7 +295,7 @@ public function getAccountTypeAllowableValues() public function getTypeAllowableValues() { return [ - self::TYPE_US_LOCAL, + self::TYPE_PLATFORM_PAYMENT, ]; } /** @@ -281,10 +313,11 @@ public function getTypeAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('accountType', $data ?? [], null); - $this->setIfExists('formFactor', $data ?? [], null); - $this->setIfExists('routingNumber', $data ?? [], null); + $this->setIfExists('modificationMerchantReference', $data ?? [], null); + $this->setIfExists('modificationPspReference', $data ?? [], null); + $this->setIfExists('paymentMerchantReference', $data ?? [], null); + $this->setIfExists('platformPaymentType', $data ?? [], null); + $this->setIfExists('pspPaymentReference', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -315,24 +348,15 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['accountNumber'] === null) { - $invalidProperties[] = "'accountNumber' can't be null"; - } - $allowedValues = $this->getAccountTypeAllowableValues(); - if (!is_null($this->container['accountType']) && !in_array($this->container['accountType'], $allowedValues, true)) { + $allowedValues = $this->getPlatformPaymentTypeAllowableValues(); + if (!is_null($this->container['platformPaymentType']) && !in_array($this->container['platformPaymentType'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'accountType', must be one of '%s'", - $this->container['accountType'], + "invalid value '%s' for 'platformPaymentType', must be one of '%s'", + $this->container['platformPaymentType'], implode("', '", $allowedValues) ); } - if ($this->container['routingNumber'] === null) { - $invalidProperties[] = "'routingNumber' 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( @@ -358,126 +382,131 @@ public function valid() /** - * Gets accountNumber + * Gets modificationMerchantReference * - * @return string + * @return string|null */ - public function getAccountNumber() + public function getModificationMerchantReference() { - return $this->container['accountNumber']; + return $this->container['modificationMerchantReference']; } /** - * Sets accountNumber + * Sets modificationMerchantReference * - * @param string $accountNumber The bank account number, without separators or whitespace. + * @param string|null $modificationMerchantReference The capture's merchant reference included in the transfer. * * @return self */ - public function setAccountNumber($accountNumber) + public function setModificationMerchantReference($modificationMerchantReference) { - if (is_null($accountNumber)) { - throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); - } - $this->container['accountNumber'] = $accountNumber; + $this->container['modificationMerchantReference'] = $modificationMerchantReference; return $this; } /** - * Gets accountType + * Gets modificationPspReference * * @return string|null */ - public function getAccountType() + public function getModificationPspReference() { - return $this->container['accountType']; + return $this->container['modificationPspReference']; } /** - * Sets accountType + * Sets modificationPspReference * - * @param string|null $accountType The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * @param string|null $modificationPspReference The capture reference included in the transfer. * * @return self */ - public function setAccountType($accountType) + public function setModificationPspReference($modificationPspReference) { - if (is_null($accountType)) { - throw new \InvalidArgumentException('non-nullable accountType cannot be null'); - } - $allowedValues = $this->getAccountTypeAllowableValues(); - if (!in_array($accountType, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'accountType', must be one of '%s'", - $accountType, - implode("', '", $allowedValues) - ) - ); - } - $this->container['accountType'] = $accountType; + $this->container['modificationPspReference'] = $modificationPspReference; return $this; } /** - * Gets formFactor + * Gets paymentMerchantReference * * @return string|null */ - public function getFormFactor() + public function getPaymentMerchantReference() { - return $this->container['formFactor']; + return $this->container['paymentMerchantReference']; } /** - * Sets formFactor + * Sets paymentMerchantReference * - * @param string|null $formFactor The form factor of the account. Possible values: **physical**, **virtual**. Default value: **physical**. + * @param string|null $paymentMerchantReference The payment's merchant reference included in the transfer. * * @return self */ - public function setFormFactor($formFactor) + public function setPaymentMerchantReference($paymentMerchantReference) { - if (is_null($formFactor)) { - array_push($this->openAPINullablesSetToNull, 'formFactor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('formFactor', $nullablesSetToNull); - if ($index !== false) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['formFactor'] = $formFactor; + $this->container['paymentMerchantReference'] = $paymentMerchantReference; return $this; } /** - * Gets routingNumber + * Gets platformPaymentType * - * @return string + * @return string|null */ - public function getRoutingNumber() + public function getPlatformPaymentType() { - return $this->container['routingNumber']; + return $this->container['platformPaymentType']; } /** - * Sets routingNumber + * Sets platformPaymentType * - * @param string $routingNumber The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. + * @param string|null $platformPaymentType The type of the related split. * * @return self */ - public function setRoutingNumber($routingNumber) + public function setPlatformPaymentType($platformPaymentType) { - if (is_null($routingNumber)) { - throw new \InvalidArgumentException('non-nullable routingNumber cannot be null'); + $allowedValues = $this->getPlatformPaymentTypeAllowableValues(); + if (!in_array($platformPaymentType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'platformPaymentType', must be one of '%s'", + $platformPaymentType, + implode("', '", $allowedValues) + ) + ); } - $this->container['routingNumber'] = $routingNumber; + $this->container['platformPaymentType'] = $platformPaymentType; + + return $this; + } + + /** + * Gets pspPaymentReference + * + * @return string|null + */ + public function getPspPaymentReference() + { + return $this->container['pspPaymentReference']; + } + + /** + * Sets pspPaymentReference + * + * @param string|null $pspPaymentReference The payment reference included in the transfer. + * + * @return self + */ + public function setPspPaymentReference($pspPaymentReference) + { + $this->container['pspPaymentReference'] = $pspPaymentReference; return $this; } @@ -485,7 +514,7 @@ public function setRoutingNumber($routingNumber) /** * Gets type * - * @return string + * @return string|null */ public function getType() { @@ -495,15 +524,12 @@ public function getType() /** * Sets type * - * @param string $type **usLocal** + * @param string|null $type **platformPayment** * * @return self */ public function setType($type) { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( diff --git a/src/Adyen/Model/Checkout/PaymentVerificationRequest.php b/src/Adyen/Model/TransactionWebhooks/RelayedAuthorisationData.php similarity index 83% rename from src/Adyen/Model/Checkout/PaymentVerificationRequest.php rename to src/Adyen/Model/TransactionWebhooks/RelayedAuthorisationData.php index f420a2ace..ad581f49d 100644 --- a/src/Adyen/Model/Checkout/PaymentVerificationRequest.php +++ b/src/Adyen/Model/TransactionWebhooks/RelayedAuthorisationData.php @@ -1,9 +1,9 @@ */ -class PaymentVerificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class RelayedAuthorisationData implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class PaymentVerificationRequest implements ModelInterface, ArrayAccess, \JsonSe * * @var string */ - protected static $openAPIModelName = 'PaymentVerificationRequest'; + protected static $openAPIModelName = 'RelayedAuthorisationData'; /** * Array of property to type mappings. Used for (de)serialization @@ -44,7 +44,8 @@ class PaymentVerificationRequest implements ModelInterface, ArrayAccess, \JsonSe * @var string[] */ protected static $openAPITypes = [ - 'payload' => 'string' + 'metadata' => 'array', + 'reference' => 'string' ]; /** @@ -55,7 +56,8 @@ class PaymentVerificationRequest implements ModelInterface, ArrayAccess, \JsonSe * @psalm-var array */ protected static $openAPIFormats = [ - 'payload' => null + 'metadata' => null, + 'reference' => null ]; /** @@ -64,7 +66,8 @@ class PaymentVerificationRequest implements ModelInterface, ArrayAccess, \JsonSe * @var boolean[] */ protected static $openAPINullables = [ - 'payload' => false + 'metadata' => false, + 'reference' => false ]; /** @@ -153,7 +156,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'payload' => 'payload' + 'metadata' => 'metadata', + 'reference' => 'reference' ]; /** @@ -162,7 +166,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'payload' => 'setPayload' + 'metadata' => 'setMetadata', + 'reference' => 'setReference' ]; /** @@ -171,7 +176,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'payload' => 'getPayload' + 'metadata' => 'getMetadata', + 'reference' => 'getReference' ]; /** @@ -231,7 +237,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('payload', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); } /** @@ -261,9 +268,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['payload'] === null) { - $invalidProperties[] = "'payload' can't be null"; - } return $invalidProperties; } @@ -280,25 +284,49 @@ public function valid() /** - * Gets payload + * Gets metadata * - * @return string + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Contains key-value pairs of your references and descriptions, for example, `customId`:`your-own-custom-field-12345`. + * + * @return self + */ + public function setMetadata($metadata) + { + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets reference + * + * @return string|null */ - public function getPayload() + public function getReference() { - return $this->container['payload']; + return $this->container['reference']; } /** - * Sets payload + * Sets reference * - * @param string $payload Encrypted and signed payment result data. You should receive this value from the Checkout SDK after the shopper completes the payment. + * @param string|null $reference Your reference for the relayed authorisation data. * * @return self */ - public function setPayload($payload) + public function setReference($reference) { - $this->container['payload'] = $payload; + $this->container['reference'] = $reference; return $this; } diff --git a/src/Adyen/Model/TransactionWebhooks/Transaction.php b/src/Adyen/Model/TransactionWebhooks/Transaction.php index d5ebf56d4..3030136a5 100644 --- a/src/Adyen/Model/TransactionWebhooks/Transaction.php +++ b/src/Adyen/Model/TransactionWebhooks/Transaction.php @@ -50,9 +50,12 @@ class Transaction implements ModelInterface, ArrayAccess, \JsonSerializable 'balancePlatform' => 'string', 'bookingDate' => '\DateTime', 'creationDate' => '\DateTime', + 'description' => 'string', 'id' => 'string', + 'paymentInstrument' => '\Adyen\Model\TransactionWebhooks\PaymentInstrument', + 'referenceForBeneficiary' => 'string', 'status' => 'string', - 'transfer' => '\Adyen\Model\TransactionWebhooks\TransferData', + 'transfer' => '\Adyen\Model\TransactionWebhooks\TransferView', 'valueDate' => '\DateTime' ]; @@ -70,7 +73,10 @@ class Transaction implements ModelInterface, ArrayAccess, \JsonSerializable 'balancePlatform' => null, 'bookingDate' => 'date-time', 'creationDate' => 'date-time', + 'description' => null, 'id' => null, + 'paymentInstrument' => null, + 'referenceForBeneficiary' => null, 'status' => null, 'transfer' => null, 'valueDate' => 'date-time' @@ -88,7 +94,10 @@ class Transaction implements ModelInterface, ArrayAccess, \JsonSerializable 'balancePlatform' => false, 'bookingDate' => false, 'creationDate' => false, + 'description' => false, 'id' => false, + 'paymentInstrument' => false, + 'referenceForBeneficiary' => false, 'status' => false, 'transfer' => false, 'valueDate' => false @@ -186,7 +195,10 @@ public function isNullableSetToNull(string $property): bool 'balancePlatform' => 'balancePlatform', 'bookingDate' => 'bookingDate', 'creationDate' => 'creationDate', + 'description' => 'description', 'id' => 'id', + 'paymentInstrument' => 'paymentInstrument', + 'referenceForBeneficiary' => 'referenceForBeneficiary', 'status' => 'status', 'transfer' => 'transfer', 'valueDate' => 'valueDate' @@ -204,7 +216,10 @@ public function isNullableSetToNull(string $property): bool 'balancePlatform' => 'setBalancePlatform', 'bookingDate' => 'setBookingDate', 'creationDate' => 'setCreationDate', + 'description' => 'setDescription', 'id' => 'setId', + 'paymentInstrument' => 'setPaymentInstrument', + 'referenceForBeneficiary' => 'setReferenceForBeneficiary', 'status' => 'setStatus', 'transfer' => 'setTransfer', 'valueDate' => 'setValueDate' @@ -222,7 +237,10 @@ public function isNullableSetToNull(string $property): bool 'balancePlatform' => 'getBalancePlatform', 'bookingDate' => 'getBookingDate', 'creationDate' => 'getCreationDate', + 'description' => 'getDescription', 'id' => 'getId', + 'paymentInstrument' => 'getPaymentInstrument', + 'referenceForBeneficiary' => 'getReferenceForBeneficiary', 'status' => 'getStatus', 'transfer' => 'getTransfer', 'valueDate' => 'getValueDate' @@ -305,7 +323,10 @@ public function __construct(array $data = null) $this->setIfExists('balancePlatform', $data ?? [], null); $this->setIfExists('bookingDate', $data ?? [], null); $this->setIfExists('creationDate', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('paymentInstrument', $data ?? [], null); + $this->setIfExists('referenceForBeneficiary', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('transfer', $data ?? [], null); $this->setIfExists('valueDate', $data ?? [], null); @@ -530,6 +551,30 @@ public function setCreationDate($creationDate) return $this; } + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The `description` from the `/transfers` request. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + /** * Gets id * @@ -554,6 +599,54 @@ public function setId($id) return $this; } + /** + * Gets paymentInstrument + * + * @return \Adyen\Model\TransactionWebhooks\PaymentInstrument|null + */ + public function getPaymentInstrument() + { + return $this->container['paymentInstrument']; + } + + /** + * Sets paymentInstrument + * + * @param \Adyen\Model\TransactionWebhooks\PaymentInstrument|null $paymentInstrument paymentInstrument + * + * @return self + */ + public function setPaymentInstrument($paymentInstrument) + { + $this->container['paymentInstrument'] = $paymentInstrument; + + return $this; + } + + /** + * Gets referenceForBeneficiary + * + * @return string|null + */ + public function getReferenceForBeneficiary() + { + return $this->container['referenceForBeneficiary']; + } + + /** + * Sets referenceForBeneficiary + * + * @param string|null $referenceForBeneficiary The reference sent to or received from the counterparty. * For outgoing funds, this is the [`referenceForBeneficiary`](https://docs.adyen.com/api-explorer/#/transfers/latest/post/transfers__resParam_referenceForBeneficiary) from the [`/transfers`](https://docs.adyen.com/api-explorer/#/transfers/latest/post/transfers__reqParam_referenceForBeneficiary) request. * For incoming funds, this is the reference from the sender. + * + * @return self + */ + public function setReferenceForBeneficiary($referenceForBeneficiary) + { + $this->container['referenceForBeneficiary'] = $referenceForBeneficiary; + + return $this; + } + /** * Gets status * @@ -591,7 +684,7 @@ public function setStatus($status) /** * Gets transfer * - * @return \Adyen\Model\TransactionWebhooks\TransferData|null + * @return \Adyen\Model\TransactionWebhooks\TransferView|null */ public function getTransfer() { @@ -601,7 +694,7 @@ public function getTransfer() /** * Sets transfer * - * @param \Adyen\Model\TransactionWebhooks\TransferData|null $transfer transfer + * @param \Adyen\Model\TransactionWebhooks\TransferView|null $transfer transfer * * @return self */ diff --git a/src/Adyen/Model/Checkout/InstallmentsNumber.php b/src/Adyen/Model/TransactionWebhooks/TransferNotificationValidationFact.php similarity index 85% rename from src/Adyen/Model/Checkout/InstallmentsNumber.php rename to src/Adyen/Model/TransactionWebhooks/TransferNotificationValidationFact.php index db53d3a29..9d32266d0 100644 --- a/src/Adyen/Model/Checkout/InstallmentsNumber.php +++ b/src/Adyen/Model/TransactionWebhooks/TransferNotificationValidationFact.php @@ -1,9 +1,9 @@ */ -class InstallmentsNumber implements ModelInterface, ArrayAccess, \JsonSerializable +class TransferNotificationValidationFact implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class InstallmentsNumber implements ModelInterface, ArrayAccess, \JsonSerializab * * @var string */ - protected static $openAPIModelName = 'InstallmentsNumber'; + protected static $openAPIModelName = 'TransferNotificationValidationFact'; /** * Array of property to type mappings. Used for (de)serialization @@ -44,7 +44,8 @@ class InstallmentsNumber implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'maxNumberOfInstallments' => 'int' + 'result' => 'string', + 'type' => 'string' ]; /** @@ -55,7 +56,8 @@ class InstallmentsNumber implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ - 'maxNumberOfInstallments' => 'int32' + 'result' => null, + 'type' => null ]; /** @@ -64,7 +66,8 @@ class InstallmentsNumber implements ModelInterface, ArrayAccess, \JsonSerializab * @var boolean[] */ protected static $openAPINullables = [ - 'maxNumberOfInstallments' => true + 'result' => false, + 'type' => false ]; /** @@ -153,7 +156,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'maxNumberOfInstallments' => 'maxNumberOfInstallments' + 'result' => 'result', + 'type' => 'type' ]; /** @@ -162,7 +166,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'maxNumberOfInstallments' => 'setMaxNumberOfInstallments' + 'result' => 'setResult', + 'type' => 'setType' ]; /** @@ -171,7 +176,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'maxNumberOfInstallments' => 'getMaxNumberOfInstallments' + 'result' => 'getResult', + 'type' => 'getType' ]; /** @@ -231,7 +237,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('maxNumberOfInstallments', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); } /** @@ -261,9 +268,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['maxNumberOfInstallments'] === null) { - $invalidProperties[] = "'maxNumberOfInstallments' can't be null"; - } return $invalidProperties; } @@ -280,25 +284,49 @@ public function valid() /** - * Gets maxNumberOfInstallments + * Gets result + * + * @return string|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param string|null $result The evaluation result of the validation fact. + * + * @return self + */ + public function setResult($result) + { + $this->container['result'] = $result; + + return $this; + } + + /** + * Gets type * - * @return int + * @return string|null */ - public function getMaxNumberOfInstallments() + public function getType() { - return $this->container['maxNumberOfInstallments']; + return $this->container['type']; } /** - * Sets maxNumberOfInstallments + * Sets type * - * @param int $maxNumberOfInstallments Maximum number of installments + * @param string|null $type The type of the validation fact. * * @return self */ - public function setMaxNumberOfInstallments($maxNumberOfInstallments) + public function setType($type) { - $this->container['maxNumberOfInstallments'] = $maxNumberOfInstallments; + $this->container['type'] = $type; return $this; } diff --git a/src/Adyen/Model/TransactionWebhooks/TransferData.php b/src/Adyen/Model/TransactionWebhooks/TransferView.php similarity index 91% rename from src/Adyen/Model/TransactionWebhooks/TransferData.php rename to src/Adyen/Model/TransactionWebhooks/TransferView.php index a2727536d..20ed624e2 100644 --- a/src/Adyen/Model/TransactionWebhooks/TransferData.php +++ b/src/Adyen/Model/TransactionWebhooks/TransferView.php @@ -19,7 +19,7 @@ use Adyen\Model\TransactionWebhooks\ObjectSerializer; /** - * TransferData Class Doc Comment + * TransferView Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable +class TransferView implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable * * @var string */ - protected static $openAPIModelName = 'TransferData'; + protected static $openAPIModelName = 'TransferView'; /** * Array of property to type mappings. Used for (de)serialization @@ -44,6 +44,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'categoryData' => '\Adyen\Model\TransactionWebhooks\TransferViewCategoryData', 'id' => 'string', 'reference' => 'string' ]; @@ -56,6 +57,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'categoryData' => null, 'id' => null, 'reference' => null ]; @@ -66,6 +68,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ + 'categoryData' => false, 'id' => false, 'reference' => false ]; @@ -156,6 +159,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'categoryData' => 'categoryData', 'id' => 'id', 'reference' => 'reference' ]; @@ -166,6 +170,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'categoryData' => 'setCategoryData', 'id' => 'setId', 'reference' => 'setReference' ]; @@ -176,6 +181,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'categoryData' => 'getCategoryData', 'id' => 'getId', 'reference' => 'getReference' ]; @@ -237,6 +243,7 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('categoryData', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); } @@ -286,6 +293,30 @@ public function valid() } + /** + * Gets categoryData + * + * @return \Adyen\Model\TransactionWebhooks\TransferViewCategoryData|null + */ + public function getCategoryData() + { + return $this->container['categoryData']; + } + + /** + * Sets categoryData + * + * @param \Adyen\Model\TransactionWebhooks\TransferViewCategoryData|null $categoryData categoryData + * + * @return self + */ + public function setCategoryData($categoryData) + { + $this->container['categoryData'] = $categoryData; + + return $this; + } + /** * Gets id * diff --git a/src/Adyen/Model/TransactionWebhooks/TransferViewCategoryData.php b/src/Adyen/Model/TransactionWebhooks/TransferViewCategoryData.php new file mode 100644 index 000000000..366a91d4c --- /dev/null +++ b/src/Adyen/Model/TransactionWebhooks/TransferViewCategoryData.php @@ -0,0 +1,815 @@ + + */ +class TransferViewCategoryData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferView_categoryData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'priority' => 'string', + 'type' => 'string', + 'modificationMerchantReference' => 'string', + 'modificationPspReference' => 'string', + 'authorisationType' => 'string', + 'panEntryMode' => 'string', + 'processingType' => 'string', + 'relayedAuthorisationData' => '\Adyen\Model\TransactionWebhooks\RelayedAuthorisationData', + 'schemeTraceId' => 'string', + 'schemeUniqueTransactionId' => 'string', + 'validationFacts' => '\Adyen\Model\TransactionWebhooks\TransferNotificationValidationFact[]', + 'paymentMerchantReference' => 'string', + 'platformPaymentType' => 'string', + 'pspPaymentReference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'priority' => null, + 'type' => null, + 'modificationMerchantReference' => null, + 'modificationPspReference' => null, + 'authorisationType' => null, + 'panEntryMode' => null, + 'processingType' => null, + 'relayedAuthorisationData' => null, + 'schemeTraceId' => null, + 'schemeUniqueTransactionId' => null, + 'validationFacts' => null, + 'paymentMerchantReference' => null, + 'platformPaymentType' => null, + 'pspPaymentReference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'priority' => false, + 'type' => false, + 'modificationMerchantReference' => false, + 'modificationPspReference' => false, + 'authorisationType' => false, + 'panEntryMode' => false, + 'processingType' => false, + 'relayedAuthorisationData' => false, + 'schemeTraceId' => false, + 'schemeUniqueTransactionId' => false, + 'validationFacts' => false, + 'paymentMerchantReference' => false, + 'platformPaymentType' => false, + 'pspPaymentReference' => 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 = [ + 'priority' => 'priority', + 'type' => 'type', + 'modificationMerchantReference' => 'modificationMerchantReference', + 'modificationPspReference' => 'modificationPspReference', + 'authorisationType' => 'authorisationType', + 'panEntryMode' => 'panEntryMode', + 'processingType' => 'processingType', + 'relayedAuthorisationData' => 'relayedAuthorisationData', + 'schemeTraceId' => 'schemeTraceId', + 'schemeUniqueTransactionId' => 'schemeUniqueTransactionId', + 'validationFacts' => 'validationFacts', + 'paymentMerchantReference' => 'paymentMerchantReference', + 'platformPaymentType' => 'platformPaymentType', + 'pspPaymentReference' => 'pspPaymentReference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'priority' => 'setPriority', + 'type' => 'setType', + 'modificationMerchantReference' => 'setModificationMerchantReference', + 'modificationPspReference' => 'setModificationPspReference', + 'authorisationType' => 'setAuthorisationType', + 'panEntryMode' => 'setPanEntryMode', + 'processingType' => 'setProcessingType', + 'relayedAuthorisationData' => 'setRelayedAuthorisationData', + 'schemeTraceId' => 'setSchemeTraceId', + 'schemeUniqueTransactionId' => 'setSchemeUniqueTransactionId', + 'validationFacts' => 'setValidationFacts', + 'paymentMerchantReference' => 'setPaymentMerchantReference', + 'platformPaymentType' => 'setPlatformPaymentType', + 'pspPaymentReference' => 'setPspPaymentReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'priority' => 'getPriority', + 'type' => 'getType', + 'modificationMerchantReference' => 'getModificationMerchantReference', + 'modificationPspReference' => 'getModificationPspReference', + 'authorisationType' => 'getAuthorisationType', + 'panEntryMode' => 'getPanEntryMode', + 'processingType' => 'getProcessingType', + 'relayedAuthorisationData' => 'getRelayedAuthorisationData', + 'schemeTraceId' => 'getSchemeTraceId', + 'schemeUniqueTransactionId' => 'getSchemeUniqueTransactionId', + 'validationFacts' => 'getValidationFacts', + 'paymentMerchantReference' => 'getPaymentMerchantReference', + 'platformPaymentType' => 'getPlatformPaymentType', + 'pspPaymentReference' => 'getPspPaymentReference' + ]; + + /** + * 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('priority', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('modificationMerchantReference', $data ?? [], null); + $this->setIfExists('modificationPspReference', $data ?? [], null); + $this->setIfExists('authorisationType', $data ?? [], null); + $this->setIfExists('panEntryMode', $data ?? [], null); + $this->setIfExists('processingType', $data ?? [], null); + $this->setIfExists('relayedAuthorisationData', $data ?? [], null); + $this->setIfExists('schemeTraceId', $data ?? [], null); + $this->setIfExists('schemeUniqueTransactionId', $data ?? [], null); + $this->setIfExists('validationFacts', $data ?? [], null); + $this->setIfExists('paymentMerchantReference', $data ?? [], null); + $this->setIfExists('platformPaymentType', $data ?? [], null); + $this->setIfExists('pspPaymentReference', $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 priority + * + * @return string|null + */ + public function getPriority() + { + return $this->container['priority']; + } + + /** + * Sets priority + * + * @param string|null $priority The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). + * + * @return self + */ + public function setPriority($priority) + { + $this->container['priority'] = $priority; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **platformPayment** + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets modificationMerchantReference + * + * @return string|null + */ + public function getModificationMerchantReference() + { + return $this->container['modificationMerchantReference']; + } + + /** + * Sets modificationMerchantReference + * + * @param string|null $modificationMerchantReference The capture's merchant reference included in the transfer. + * + * @return self + */ + public function setModificationMerchantReference($modificationMerchantReference) + { + $this->container['modificationMerchantReference'] = $modificationMerchantReference; + + return $this; + } + + /** + * Gets modificationPspReference + * + * @return string|null + */ + public function getModificationPspReference() + { + return $this->container['modificationPspReference']; + } + + /** + * Sets modificationPspReference + * + * @param string|null $modificationPspReference The capture reference included in the transfer. + * + * @return self + */ + public function setModificationPspReference($modificationPspReference) + { + $this->container['modificationPspReference'] = $modificationPspReference; + + return $this; + } + + /** + * Gets authorisationType + * + * @return string|null + */ + public function getAuthorisationType() + { + return $this->container['authorisationType']; + } + + /** + * Sets authorisationType + * + * @param string|null $authorisationType The authorisation type. For example, **defaultAuthorisation**, **preAuthorisation**, **finalAuthorisation** + * + * @return self + */ + public function setAuthorisationType($authorisationType) + { + $this->container['authorisationType'] = $authorisationType; + + return $this; + } + + /** + * Gets panEntryMode + * + * @return string|null + */ + public function getPanEntryMode() + { + return $this->container['panEntryMode']; + } + + /** + * Sets panEntryMode + * + * @param string|null $panEntryMode Indicates the method used for entering the PAN to initiate a transaction. Possible values: **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**. + * + * @return self + */ + public function setPanEntryMode($panEntryMode) + { + $this->container['panEntryMode'] = $panEntryMode; + + return $this; + } + + /** + * Gets processingType + * + * @return string|null + */ + public function getProcessingType() + { + return $this->container['processingType']; + } + + /** + * Sets processingType + * + * @param string|null $processingType Contains information about how the payment was processed. For example, **ecommerce** for online or **pos** for in-person payments. + * + * @return self + */ + public function setProcessingType($processingType) + { + $this->container['processingType'] = $processingType; + + return $this; + } + + /** + * Gets relayedAuthorisationData + * + * @return \Adyen\Model\TransactionWebhooks\RelayedAuthorisationData|null + */ + public function getRelayedAuthorisationData() + { + return $this->container['relayedAuthorisationData']; + } + + /** + * Sets relayedAuthorisationData + * + * @param \Adyen\Model\TransactionWebhooks\RelayedAuthorisationData|null $relayedAuthorisationData relayedAuthorisationData + * + * @return self + */ + public function setRelayedAuthorisationData($relayedAuthorisationData) + { + $this->container['relayedAuthorisationData'] = $relayedAuthorisationData; + + return $this; + } + + /** + * Gets schemeTraceId + * + * @return string|null + */ + public function getSchemeTraceId() + { + return $this->container['schemeTraceId']; + } + + /** + * Sets schemeTraceId + * + * @param string|null $schemeTraceId The identifier of the original payment. This ID is provided by the scheme and can be alphanumeric or numeric, depending on the scheme. The `schemeTraceID` should refer to an original `schemeUniqueTransactionID` provided in an earlier payment (not necessarily processed by Adyen). A `schemeTraceId` is typically available for authorization adjustments or recurring payments. + * + * @return self + */ + public function setSchemeTraceId($schemeTraceId) + { + $this->container['schemeTraceId'] = $schemeTraceId; + + return $this; + } + + /** + * Gets schemeUniqueTransactionId + * + * @return string|null + */ + public function getSchemeUniqueTransactionId() + { + return $this->container['schemeUniqueTransactionId']; + } + + /** + * Sets schemeUniqueTransactionId + * + * @param string|null $schemeUniqueTransactionId The unique identifier created by the scheme. This ID can be alphanumeric or numeric depending on the scheme. + * + * @return self + */ + public function setSchemeUniqueTransactionId($schemeUniqueTransactionId) + { + $this->container['schemeUniqueTransactionId'] = $schemeUniqueTransactionId; + + return $this; + } + + /** + * Gets validationFacts + * + * @return \Adyen\Model\TransactionWebhooks\TransferNotificationValidationFact[]|null + */ + public function getValidationFacts() + { + return $this->container['validationFacts']; + } + + /** + * Sets validationFacts + * + * @param \Adyen\Model\TransactionWebhooks\TransferNotificationValidationFact[]|null $validationFacts The evaluation of the validation facts. See [validation checks](https://docs.adyen.com/issuing/validation-checks) for more information. + * + * @return self + */ + public function setValidationFacts($validationFacts) + { + $this->container['validationFacts'] = $validationFacts; + + return $this; + } + + /** + * Gets paymentMerchantReference + * + * @return string|null + */ + public function getPaymentMerchantReference() + { + return $this->container['paymentMerchantReference']; + } + + /** + * Sets paymentMerchantReference + * + * @param string|null $paymentMerchantReference The payment's merchant reference included in the transfer. + * + * @return self + */ + public function setPaymentMerchantReference($paymentMerchantReference) + { + $this->container['paymentMerchantReference'] = $paymentMerchantReference; + + return $this; + } + + /** + * Gets platformPaymentType + * + * @return string|null + */ + public function getPlatformPaymentType() + { + return $this->container['platformPaymentType']; + } + + /** + * Sets platformPaymentType + * + * @param string|null $platformPaymentType The type of the related split. + * + * @return self + */ + public function setPlatformPaymentType($platformPaymentType) + { + $this->container['platformPaymentType'] = $platformPaymentType; + + return $this; + } + + /** + * Gets pspPaymentReference + * + * @return string|null + */ + public function getPspPaymentReference() + { + return $this->container['pspPaymentReference']; + } + + /** + * Sets pspPaymentReference + * + * @param string|null $pspPaymentReference The payment reference included in the transfer. + * + * @return self + */ + public function setPspPaymentReference($pspPaymentReference) + { + $this->container['pspPaymentReference'] = $pspPaymentReference; + + 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/TransferData.php b/src/Adyen/Model/TransferWebhooks/TransferData.php index 226fccfb8..ff4b2ab48 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferData.php +++ b/src/Adyen/Model/TransferWebhooks/TransferData.php @@ -378,6 +378,7 @@ public function getModelName() public const REASON_PENDING_APPROVAL = 'pendingApproval'; public const REASON_PENDING_EXECUTION = 'pendingExecution'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; + public const REASON_REFUSED_BY_CUSTOMER = 'refusedByCustomer'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; @@ -541,6 +542,7 @@ public function getReasonAllowableValues() self::REASON_PENDING_APPROVAL, self::REASON_PENDING_EXECUTION, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, + self::REASON_REFUSED_BY_CUSTOMER, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, diff --git a/src/Adyen/Model/TransferWebhooks/TransferEvent.php b/src/Adyen/Model/TransferWebhooks/TransferEvent.php index 8577559cc..1875829e9 100644 --- a/src/Adyen/Model/TransferWebhooks/TransferEvent.php +++ b/src/Adyen/Model/TransferWebhooks/TransferEvent.php @@ -329,6 +329,7 @@ public function getModelName() public const REASON_PENDING_APPROVAL = 'pendingApproval'; public const REASON_PENDING_EXECUTION = 'pendingExecution'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; + public const REASON_REFUSED_BY_CUSTOMER = 'refusedByCustomer'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; @@ -429,6 +430,7 @@ public function getReasonAllowableValues() self::REASON_PENDING_APPROVAL, self::REASON_PENDING_EXECUTION, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, + self::REASON_REFUSED_BY_CUSTOMER, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, @@ -1054,7 +1056,7 @@ public function getValueDate() /** * Sets valueDate * - * @param \DateTime|null $valueDate A future date, when the funds are expected to be deducted from or credited to the balance account. + * @param \DateTime|null $valueDate The date when the funds are expected to be deducted from or credited to the balance account. This date can be in either the past or future. * * @return self */ diff --git a/src/Adyen/Model/Transfers/Transfer.php b/src/Adyen/Model/Transfers/Transfer.php index 1dc98acdd..88f38b303 100644 --- a/src/Adyen/Model/Transfers/Transfer.php +++ b/src/Adyen/Model/Transfers/Transfer.php @@ -342,6 +342,7 @@ public function getModelName() public const REASON_PENDING_APPROVAL = 'pendingApproval'; public const REASON_PENDING_EXECUTION = 'pendingExecution'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; + public const REASON_REFUSED_BY_CUSTOMER = 'refusedByCustomer'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; @@ -505,6 +506,7 @@ public function getReasonAllowableValues() self::REASON_PENDING_APPROVAL, self::REASON_PENDING_EXECUTION, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, + self::REASON_REFUSED_BY_CUSTOMER, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, diff --git a/src/Adyen/Model/Transfers/TransferData.php b/src/Adyen/Model/Transfers/TransferData.php index e969f985a..944792e46 100644 --- a/src/Adyen/Model/Transfers/TransferData.php +++ b/src/Adyen/Model/Transfers/TransferData.php @@ -378,6 +378,7 @@ public function getModelName() public const REASON_PENDING_APPROVAL = 'pendingApproval'; public const REASON_PENDING_EXECUTION = 'pendingExecution'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; + public const REASON_REFUSED_BY_CUSTOMER = 'refusedByCustomer'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; @@ -541,6 +542,7 @@ public function getReasonAllowableValues() self::REASON_PENDING_APPROVAL, self::REASON_PENDING_EXECUTION, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, + self::REASON_REFUSED_BY_CUSTOMER, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, diff --git a/src/Adyen/Model/Transfers/TransferEvent.php b/src/Adyen/Model/Transfers/TransferEvent.php index b892a6ad3..9fff596e4 100644 --- a/src/Adyen/Model/Transfers/TransferEvent.php +++ b/src/Adyen/Model/Transfers/TransferEvent.php @@ -329,6 +329,7 @@ public function getModelName() public const REASON_PENDING_APPROVAL = 'pendingApproval'; public const REASON_PENDING_EXECUTION = 'pendingExecution'; public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; + public const REASON_REFUSED_BY_CUSTOMER = 'refusedByCustomer'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; @@ -429,6 +430,7 @@ public function getReasonAllowableValues() self::REASON_PENDING_APPROVAL, self::REASON_PENDING_EXECUTION, self::REASON_REFUSED_BY_COUNTERPARTY_BANK, + self::REASON_REFUSED_BY_CUSTOMER, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, @@ -1054,7 +1056,7 @@ public function getValueDate() /** * Sets valueDate * - * @param \DateTime|null $valueDate A future date, when the funds are expected to be deducted from or credited to the balance account. + * @param \DateTime|null $valueDate The date when the funds are expected to be deducted from or credited to the balance account. This date can be in either the past or future. * * @return self */ diff --git a/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php b/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php index 10b3b8f2a..2342ec986 100644 --- a/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php +++ b/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php @@ -84,6 +84,21 @@ public function getAllBalanceAccountsOfAccountHolder(string $id, array $requestO return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\PaginatedBalanceAccountsResponse::class); } + /** + * Get all transaction rules for an account holder + * + * @param string $id + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\TransactionRulesResponse + * @throws AdyenException + */ + public function getAllTransactionRulesForAccountHolder(string $id, array $requestOptions = null): \Adyen\Model\BalancePlatform\TransactionRulesResponse + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/accountHolders/{id}/transactionRules"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\TransactionRulesResponse::class); + } + /** * Get a tax form * diff --git a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php index 980edd95b..7592a1286 100644 --- a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php +++ b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php @@ -100,6 +100,21 @@ public function getAllSweepsForBalanceAccount(string $balanceAccountId, array $r return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\BalanceSweepConfigurationsResponse::class); } + /** + * Get all transaction rules for a balance account + * + * @param string $id + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\TransactionRulesResponse + * @throws AdyenException + */ + public function getAllTransactionRulesForBalanceAccount(string $id, array $requestOptions = null): \Adyen\Model\BalancePlatform\TransactionRulesResponse + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/balanceAccounts/{id}/transactionRules"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\TransactionRulesResponse::class); + } + /** * Get a balance account * diff --git a/src/Adyen/Service/BalancePlatform/PINFunctionalityApi.php b/src/Adyen/Service/BalancePlatform/PINFunctionalityApi.php deleted file mode 100644 index 767809c8a..000000000 --- a/src/Adyen/Service/BalancePlatform/PINFunctionalityApi.php +++ /dev/null @@ -1,85 +0,0 @@ -baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); - } - - /** - * Change Pin - * - * @param \Adyen\Model\BalancePlatform\PinChangeRequest $pinChangeRequest - * @param array|null $requestOptions - * @return \Adyen\Model\BalancePlatform\PinChangeResponse - * @throws AdyenException - */ - public function changePin(\Adyen\Model\BalancePlatform\PinChangeRequest $pinChangeRequest, array $requestOptions = null): \Adyen\Model\BalancePlatform\PinChangeResponse - { - $endpoint = $this->baseURL . "/pins/change"; - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $pinChangeRequest->jsonSerialize(), $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\PinChangeResponse::class); - } - - /** - * Get RSA publicKey - * - * @param array|null $requestOptions ['queryParams' => ['purpose'=> string, 'format'=> string]] - * @return \Adyen\Model\BalancePlatform\PublicKeyResponse - * @throws AdyenException - */ - public function getRsaPublickey(array $requestOptions = null): \Adyen\Model\BalancePlatform\PublicKeyResponse - { - $endpoint = $this->baseURL . "/pins/publicKey"; - $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\PublicKeyResponse::class); - } - - /** - * Reveal Pin - * - * @param \Adyen\Model\BalancePlatform\RevealPinRequest $revealPinRequest - * @param array|null $requestOptions - * @return \Adyen\Model\BalancePlatform\RevealPinResponse - * @throws AdyenException - */ - public function revealPin(\Adyen\Model\BalancePlatform\RevealPinRequest $revealPinRequest, array $requestOptions = null): \Adyen\Model\BalancePlatform\RevealPinResponse - { - $endpoint = $this->baseURL . "/pins/reveal"; - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $revealPinRequest->jsonSerialize(), $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\RevealPinResponse::class); - } -} diff --git a/src/Adyen/Service/BalancePlatform/PlatformApi.php b/src/Adyen/Service/BalancePlatform/PlatformApi.php index 1fbecfc0d..1ed2691e4 100644 --- a/src/Adyen/Service/BalancePlatform/PlatformApi.php +++ b/src/Adyen/Service/BalancePlatform/PlatformApi.php @@ -54,6 +54,21 @@ public function getAllAccountHoldersUnderBalancePlatform(string $id, array $requ return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\PaginatedAccountHoldersResponse::class); } + /** + * Get all transaction rules for a balance platform + * + * @param string $id + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\TransactionRulesResponse + * @throws AdyenException + */ + public function getAllTransactionRulesForBalancePlatform(string $id, array $requestOptions = null): \Adyen\Model\BalancePlatform\TransactionRulesResponse + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/balancePlatforms/{id}/transactionRules"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\TransactionRulesResponse::class); + } + /** * Get a balance platform * diff --git a/src/Adyen/Service/Checkout/ClassicCheckoutSDKApi.php b/src/Adyen/Service/Checkout/ClassicCheckoutSDKApi.php deleted file mode 100644 index 1f4de6dd0..000000000 --- a/src/Adyen/Service/Checkout/ClassicCheckoutSDKApi.php +++ /dev/null @@ -1,71 +0,0 @@ -baseURL = $this->createBaseUrl("https://checkout-test.adyen.com/v71"); - } - - /** - * Create a payment session - * - * @param \Adyen\Model\Checkout\PaymentSetupRequest $paymentSetupRequest - * @param array|null $requestOptions - * @return \Adyen\Model\Checkout\PaymentSetupResponse - * @throws AdyenException - */ - public function paymentSession(\Adyen\Model\Checkout\PaymentSetupRequest $paymentSetupRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentSetupResponse - { - $endpoint = $this->baseURL . "/paymentSession"; - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentSetupRequest->jsonSerialize(), $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentSetupResponse::class); - } - - /** - * Verify a payment result - * - * @param \Adyen\Model\Checkout\PaymentVerificationRequest $paymentVerificationRequest - * @param array|null $requestOptions - * @return \Adyen\Model\Checkout\PaymentVerificationResponse - * @throws AdyenException - */ - public function verifyPaymentResult(\Adyen\Model\Checkout\PaymentVerificationRequest $paymentVerificationRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentVerificationResponse - { - $endpoint = $this->baseURL . "/payments/result"; - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentVerificationRequest->jsonSerialize(), $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentVerificationResponse::class); - } -} diff --git a/src/Adyen/Service/Checkout/PaymentsApi.php b/src/Adyen/Service/Checkout/PaymentsApi.php index f91aeb65e..95322cbbf 100644 --- a/src/Adyen/Service/Checkout/PaymentsApi.php +++ b/src/Adyen/Service/Checkout/PaymentsApi.php @@ -40,7 +40,7 @@ public function __construct(Client $client) } /** - * Get the list of brands on the card + * Get the brands and other details of a card * * @param \Adyen\Model\Checkout\CardDetailsRequest $cardDetailsRequest * @param array|null $requestOptions diff --git a/src/Adyen/Service/LegalEntityManagement/TermsOfServiceApi.php b/src/Adyen/Service/LegalEntityManagement/TermsOfServiceApi.php index 4db8819b7..f3ccef0bc 100644 --- a/src/Adyen/Service/LegalEntityManagement/TermsOfServiceApi.php +++ b/src/Adyen/Service/LegalEntityManagement/TermsOfServiceApi.php @@ -56,6 +56,22 @@ public function acceptTermsOfService(string $id, string $termsofservicedocumenti return ObjectSerializer::deserialize($response, \Adyen\Model\LegalEntityManagement\AcceptTermsOfServiceResponse::class); } + /** + * Get accepted Terms of Service document + * + * @param string $id + * @param string $termsofserviceacceptancereference + * @param array|null $requestOptions ['queryParams' => ['termsOfServiceDocumentFormat'=> string]] + * @return \Adyen\Model\LegalEntityManagement\GetAcceptedTermsOfServiceDocumentResponse + * @throws AdyenException + */ + public function getAcceptedTermsOfServiceDocument(string $id, string $termsofserviceacceptancereference, array $requestOptions = null): \Adyen\Model\LegalEntityManagement\GetAcceptedTermsOfServiceDocumentResponse + { + $endpoint = $this->baseURL . str_replace(['{id}', '{termsofserviceacceptancereference}'], [$id, $termsofserviceacceptancereference], "/legalEntities/{id}/acceptedTermsOfServiceDocument/{termsofserviceacceptancereference}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\LegalEntityManagement\GetAcceptedTermsOfServiceDocumentResponse::class); + } + /** * Get Terms of Service document * diff --git a/tests/Unit/ModelBasedCheckoutTest.php b/tests/Unit/ModelBasedCheckoutTest.php index 4e3a7d9e1..447fd984a 100644 --- a/tests/Unit/ModelBasedCheckoutTest.php +++ b/tests/Unit/ModelBasedCheckoutTest.php @@ -15,7 +15,6 @@ use Adyen\Model\Checkout\PaymentRequest; use Adyen\Model\Checkout\PaymentSetupRequest; use Adyen\Model\Checkout\PaymentVerificationRequest; -use Adyen\Service\Checkout\ClassicCheckoutSDKApi; use Adyen\Service\Checkout\DonationsApi; use Adyen\Service\Checkout\PaymentLinksApi; use Adyen\Service\Checkout\PaymentsApi; @@ -147,31 +146,6 @@ public static function successPaymentsDetailsProvider() ); } - /** - * @dataProvider successPaymentSessionProvider - */ - public function testPaymentSessionSuccess($jsonFile, $httpStatus) - { - // create Checkout client - $client = $this->createMockClient($jsonFile, $httpStatus); - - // initialize service - $service = new ClassicCheckoutSDKApi($client); - - $params = array( - 'merchant_account' => "YourMerchantAccount", - 'amount' => array('currency' => "EUR", 'value' => 1000), - 'country_code' => "NL", - 'reference' => "Your order number", - 'return_url' => self::RETURN_URL, - "sdk_version" => "1.3.0" - ); - - $result = $service->paymentSession(new PaymentSetupRequest($params)); - - $this->assertNotNull($result->getPaymentSession()); - } - public static function successPaymentSessionProvider() { return array( @@ -179,26 +153,6 @@ public static function successPaymentSessionProvider() ); } - /** - * @dataProvider successPaymentsResultProvider - */ - public function testPaymentsResultSuccess($jsonFile, $httpStatus) - { - // create Checkout client - $client = $this->createMockClient($jsonFile, $httpStatus); - - // initialize service - $service = new ClassicCheckoutSDKApi($client); - - $params = array( - 'payload' => "YourPayload" - ); - - $result = $service->verifyPaymentResult(new PaymentVerificationRequest($params)); - - $this->assertContains($result->getResultCode(), array('Authorised')); - } - public static function successPaymentsResultProvider() { return array(