From b99e78d19a7cc4bc5527727c39d836e1897364e5 Mon Sep 17 00:00:00 2001 From: AdyenAutomationBot <38424300+AdyenAutomationBot@users.noreply.github.com> Date: Fri, 4 Sep 2026 09:50:57 +0000 Subject: [PATCH] [transfers] Automated update from Adyen/adyen-openapi@f82d1fe --- sdk-generation-log/transfers.json | 8 + .../BankAccountV3AccountIdentification.php | 71 +- src/Adyen/Model/Transfers/CapitalGrant.php | 6 +- .../Model/Transfers/CapitalGrantInfo.php | 6 +- src/Adyen/Model/Transfers/CashOut.php | 666 ++++++++++++++++++ src/Adyen/Model/Transfers/CashOutInfo.php | 629 +++++++++++++++++ .../Transfers/CashOutInfoCounterparty.php | 404 +++++++++++ src/Adyen/Model/Transfers/CashOutTransfer.php | 508 +++++++++++++ .../Transfers/DefaultErrorResponseEntity.php | 623 ++++++++++++++++ ...Counterparty.php => GrantCounterparty.php} | 8 +- .../Model/Transfers/GrantInfoCounterparty.php | 435 ++++++++++++ .../Transfers/IbanAccountIdentification.php | 31 + src/Adyen/Model/Transfers/InterchangeData.php | 500 +++++++++++++ src/Adyen/Model/Transfers/IssuedCard.php | 2 +- src/Adyen/Model/Transfers/Modification.php | 6 + src/Adyen/Model/Transfers/NetworkReason.php | 503 +++++++++++++ src/Adyen/Model/Transfers/Transfer.php | 51 +- .../Model/Transfers/TransferCategoryData.php | 7 +- src/Adyen/Model/Transfers/TransferData.php | 101 ++- .../Model/Transfers/TransferDataTracing.php | 480 +++++++++++++ .../Model/Transfers/TransferDataTracking.php | 5 +- src/Adyen/Model/Transfers/TransferEvent.php | 39 + .../TransferEventEventsDataInner.php | 95 ++- .../Transfers/TransferEventTracingData.php | 480 +++++++++++++ .../Transfers/TransferEventTrackingData.php | 5 +- .../TransferNotificationMerchantData.php | 31 + .../Model/Transfers/UKFpsTracingData.php | 472 +++++++++++++ .../Model/Transfers/USAchTracingData.php | 472 +++++++++++++ src/Adyen/Service/Transfers/CashOutApi.php | 56 ++ 29 files changed, 6628 insertions(+), 72 deletions(-) create mode 100644 sdk-generation-log/transfers.json create mode 100644 src/Adyen/Model/Transfers/CashOut.php create mode 100644 src/Adyen/Model/Transfers/CashOutInfo.php create mode 100644 src/Adyen/Model/Transfers/CashOutInfoCounterparty.php create mode 100644 src/Adyen/Model/Transfers/CashOutTransfer.php create mode 100644 src/Adyen/Model/Transfers/DefaultErrorResponseEntity.php rename src/Adyen/Model/Transfers/{Counterparty.php => GrantCounterparty.php} (97%) create mode 100644 src/Adyen/Model/Transfers/GrantInfoCounterparty.php create mode 100644 src/Adyen/Model/Transfers/InterchangeData.php create mode 100644 src/Adyen/Model/Transfers/NetworkReason.php create mode 100644 src/Adyen/Model/Transfers/TransferDataTracing.php create mode 100644 src/Adyen/Model/Transfers/TransferEventTracingData.php create mode 100644 src/Adyen/Model/Transfers/UKFpsTracingData.php create mode 100644 src/Adyen/Model/Transfers/USAchTracingData.php create mode 100644 src/Adyen/Service/Transfers/CashOutApi.php diff --git a/sdk-generation-log/transfers.json b/sdk-generation-log/transfers.json new file mode 100644 index 000000000..b7e87b3db --- /dev/null +++ b/sdk-generation-log/transfers.json @@ -0,0 +1,8 @@ +{ + "service": "transfers", + "project": "php", + "generatedAt": "2026-09-04T09:50:56Z", + "openapiCommitSha": "f82d1fe674e536cc2c6b0d7946e0e827873a4fbf", + "automationCommitSha": "712ab8db80d60bee9054458ea1522cae0073333a", + "libraryCommitSha": "077f8fe9bba23381af53c625b18db85e7887c50f" +} diff --git a/src/Adyen/Model/Transfers/BankAccountV3AccountIdentification.php b/src/Adyen/Model/Transfers/BankAccountV3AccountIdentification.php index 5f32627e5..c4249127f 100644 --- a/src/Adyen/Model/Transfers/BankAccountV3AccountIdentification.php +++ b/src/Adyen/Model/Transfers/BankAccountV3AccountIdentification.php @@ -28,7 +28,7 @@ */ class BankAccountV3AccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = null; + public const DISCRIMINATOR = 'type'; /** * The original name of the model. @@ -53,9 +53,9 @@ class BankAccountV3AccountIdentification implements ModelInterface, ArrayAccess, 'institutionNumber' => 'string', 'transitNumber' => 'string', 'clearingCode' => 'string', + 'bic' => 'string', 'iban' => 'string', 'additionalBankIdentification' => '\Adyen\Model\Transfers\AdditionalBankIdentification', - 'bic' => 'string', 'clearingNumber' => 'string', 'sortCode' => 'string', 'routingNumber' => 'string' @@ -79,9 +79,9 @@ class BankAccountV3AccountIdentification implements ModelInterface, ArrayAccess, 'institutionNumber' => null, 'transitNumber' => null, 'clearingCode' => null, + 'bic' => null, 'iban' => null, 'additionalBankIdentification' => null, - 'bic' => null, 'clearingNumber' => null, 'sortCode' => null, 'routingNumber' => null @@ -103,9 +103,9 @@ class BankAccountV3AccountIdentification implements ModelInterface, ArrayAccess, 'institutionNumber' => false, 'transitNumber' => false, 'clearingCode' => false, + 'bic' => false, 'iban' => false, 'additionalBankIdentification' => false, - 'bic' => false, 'clearingNumber' => false, 'sortCode' => false, 'routingNumber' => false @@ -207,9 +207,9 @@ public function isNullableSetToNull(string $property): bool 'institutionNumber' => 'institutionNumber', 'transitNumber' => 'transitNumber', 'clearingCode' => 'clearingCode', + 'bic' => 'bic', 'iban' => 'iban', 'additionalBankIdentification' => 'additionalBankIdentification', - 'bic' => 'bic', 'clearingNumber' => 'clearingNumber', 'sortCode' => 'sortCode', 'routingNumber' => 'routingNumber' @@ -231,9 +231,9 @@ public function isNullableSetToNull(string $property): bool 'institutionNumber' => 'setInstitutionNumber', 'transitNumber' => 'setTransitNumber', 'clearingCode' => 'setClearingCode', + 'bic' => 'setBic', 'iban' => 'setIban', 'additionalBankIdentification' => 'setAdditionalBankIdentification', - 'bic' => 'setBic', 'clearingNumber' => 'setClearingNumber', 'sortCode' => 'setSortCode', 'routingNumber' => 'setRoutingNumber' @@ -255,9 +255,9 @@ public function isNullableSetToNull(string $property): bool 'institutionNumber' => 'getInstitutionNumber', 'transitNumber' => 'getTransitNumber', 'clearingCode' => 'getClearingCode', + 'bic' => 'getBic', 'iban' => 'getIban', 'additionalBankIdentification' => 'getAdditionalBankIdentification', - 'bic' => 'getBic', 'clearingNumber' => 'getClearingNumber', 'sortCode' => 'getSortCode', 'routingNumber' => 'getRoutingNumber' @@ -329,12 +329,15 @@ public function __construct(?array $data = null) $this->setIfExists('institutionNumber', $data ?? [], null); $this->setIfExists('transitNumber', $data ?? [], null); $this->setIfExists('clearingCode', $data ?? [], null); + $this->setIfExists('bic', $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); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; } /** @@ -390,12 +393,12 @@ public function listInvalidProperties() 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['iban'] === null) { + $invalidProperties[] = "'iban' can't be null"; + } if ($this->container['clearingNumber'] === null) { $invalidProperties[] = "'clearingNumber' can't be null"; } @@ -661,73 +664,73 @@ public function setClearingCode($clearingCode) } /** - * Gets iban + * Gets bic * * @return string */ - public function getIban() + public function getBic() { - return $this->container['iban']; + return $this->container['bic']; } /** - * Sets iban + * Sets bic * - * @param string $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * @param string $bic The bank's 8- or 11-character BIC or SWIFT code. * * @return self */ - public function setIban($iban) + public function setBic($bic) { - $this->container['iban'] = $iban; + $this->container['bic'] = $bic; return $this; } /** - * Gets additionalBankIdentification + * Gets iban * - * @return \Adyen\Model\Transfers\AdditionalBankIdentification|null + * @return string */ - public function getAdditionalBankIdentification() + public function getIban() { - return $this->container['additionalBankIdentification']; + return $this->container['iban']; } /** - * Sets additionalBankIdentification + * Sets iban * - * @param \Adyen\Model\Transfers\AdditionalBankIdentification|null $additionalBankIdentification additionalBankIdentification + * @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 setAdditionalBankIdentification($additionalBankIdentification) + public function setIban($iban) { - $this->container['additionalBankIdentification'] = $additionalBankIdentification; + $this->container['iban'] = $iban; return $this; } /** - * Gets bic + * Gets additionalBankIdentification * - * @return string + * @return \Adyen\Model\Transfers\AdditionalBankIdentification|null */ - public function getBic() + public function getAdditionalBankIdentification() { - return $this->container['bic']; + return $this->container['additionalBankIdentification']; } /** - * Sets bic + * Sets additionalBankIdentification * - * @param string $bic The bank's 8- or 11-character BIC or SWIFT code. + * @param \Adyen\Model\Transfers\AdditionalBankIdentification|null $additionalBankIdentification additionalBankIdentification * * @return self */ - public function setBic($bic) + public function setAdditionalBankIdentification($additionalBankIdentification) { - $this->container['bic'] = $bic; + $this->container['additionalBankIdentification'] = $additionalBankIdentification; return $this; } diff --git a/src/Adyen/Model/Transfers/CapitalGrant.php b/src/Adyen/Model/Transfers/CapitalGrant.php index bc0ac5193..fc0cb691b 100644 --- a/src/Adyen/Model/Transfers/CapitalGrant.php +++ b/src/Adyen/Model/Transfers/CapitalGrant.php @@ -43,7 +43,7 @@ class CapitalGrant implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'amount' => '\Adyen\Model\Transfers\Amount', 'balances' => '\Adyen\Model\Transfers\CapitalBalance', - 'counterparty' => '\Adyen\Model\Transfers\Counterparty', + 'counterparty' => '\Adyen\Model\Transfers\GrantCounterparty', 'fee' => '\Adyen\Model\Transfers\Fee', 'grantAccountId' => 'string', 'grantOfferId' => 'string', @@ -426,7 +426,7 @@ public function setBalances($balances) /** * Gets counterparty * - * @return \Adyen\Model\Transfers\Counterparty|null + * @return \Adyen\Model\Transfers\GrantCounterparty|null */ public function getCounterparty() { @@ -436,7 +436,7 @@ public function getCounterparty() /** * Sets counterparty * - * @param \Adyen\Model\Transfers\Counterparty|null $counterparty counterparty + * @param \Adyen\Model\Transfers\GrantCounterparty|null $counterparty counterparty * * @return self */ diff --git a/src/Adyen/Model/Transfers/CapitalGrantInfo.php b/src/Adyen/Model/Transfers/CapitalGrantInfo.php index ccfd1e6b3..4b002f9db 100644 --- a/src/Adyen/Model/Transfers/CapitalGrantInfo.php +++ b/src/Adyen/Model/Transfers/CapitalGrantInfo.php @@ -41,7 +41,7 @@ class CapitalGrantInfo implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'counterparty' => '\Adyen\Model\Transfers\Counterparty', + 'counterparty' => '\Adyen\Model\Transfers\GrantInfoCounterparty', 'grantAccountId' => 'string', 'grantOfferId' => 'string' ]; @@ -296,7 +296,7 @@ public function valid() /** * Gets counterparty * - * @return \Adyen\Model\Transfers\Counterparty|null + * @return \Adyen\Model\Transfers\GrantInfoCounterparty|null */ public function getCounterparty() { @@ -306,7 +306,7 @@ public function getCounterparty() /** * Sets counterparty * - * @param \Adyen\Model\Transfers\Counterparty|null $counterparty counterparty + * @param \Adyen\Model\Transfers\GrantInfoCounterparty|null $counterparty counterparty * * @return self */ diff --git a/src/Adyen/Model/Transfers/CashOut.php b/src/Adyen/Model/Transfers/CashOut.php new file mode 100644 index 000000000..76f78f0d3 --- /dev/null +++ b/src/Adyen/Model/Transfers/CashOut.php @@ -0,0 +1,666 @@ + + */ +class CashOut implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CashOut'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Transfers\Amount', + 'counterparty' => '\Adyen\Model\Transfers\CashOutInfoCounterparty', + 'description' => 'string', + 'fee' => '\Adyen\Model\Transfers\Fee', + 'id' => 'string', + 'instructingBalanceAccountId' => 'string', + 'referenceForBeneficiary' => 'string', + 'transferInstrumentId' => 'string', + 'transfers' => '\Adyen\Model\Transfers\CashOutTransfer[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'counterparty' => null, + 'description' => null, + 'fee' => null, + 'id' => null, + 'instructingBalanceAccountId' => null, + 'referenceForBeneficiary' => null, + 'transferInstrumentId' => null, + 'transfers' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'counterparty' => false, + 'description' => false, + 'fee' => false, + 'id' => false, + 'instructingBalanceAccountId' => false, + 'referenceForBeneficiary' => false, + 'transferInstrumentId' => false, + 'transfers' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'counterparty' => 'counterparty', + 'description' => 'description', + 'fee' => 'fee', + 'id' => 'id', + 'instructingBalanceAccountId' => 'instructingBalanceAccountId', + 'referenceForBeneficiary' => 'referenceForBeneficiary', + 'transferInstrumentId' => 'transferInstrumentId', + 'transfers' => 'transfers' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'counterparty' => 'setCounterparty', + 'description' => 'setDescription', + 'fee' => 'setFee', + 'id' => 'setId', + 'instructingBalanceAccountId' => 'setInstructingBalanceAccountId', + 'referenceForBeneficiary' => 'setReferenceForBeneficiary', + 'transferInstrumentId' => 'setTransferInstrumentId', + 'transfers' => 'setTransfers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'counterparty' => 'getCounterparty', + 'description' => 'getDescription', + 'fee' => 'getFee', + 'id' => 'getId', + 'instructingBalanceAccountId' => 'getInstructingBalanceAccountId', + 'referenceForBeneficiary' => 'getReferenceForBeneficiary', + 'transferInstrumentId' => 'getTransferInstrumentId', + 'transfers' => 'getTransfers' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('counterparty', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('fee', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('instructingBalanceAccountId', $data ?? [], null); + $this->setIfExists('referenceForBeneficiary', $data ?? [], null); + $this->setIfExists('transferInstrumentId', $data ?? [], null); + $this->setIfExists('transfers', $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"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['instructingBalanceAccountId'] === null) { + $invalidProperties[] = "'instructingBalanceAccountId' can't be null"; + } + if ($this->container['transfers'] === null) { + $invalidProperties[] = "'transfers' 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 amount + * + * @return \Adyen\Model\Transfers\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Transfers\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets counterparty + * + * @return \Adyen\Model\Transfers\CashOutInfoCounterparty|null + */ + public function getCounterparty() + { + return $this->container['counterparty']; + } + + /** + * Sets counterparty + * + * @param \Adyen\Model\Transfers\CashOutInfoCounterparty|null $counterparty counterparty + * + * @return self + */ + public function setCounterparty($counterparty) + { + $this->container['counterparty'] = $counterparty; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Allowed and returned only when you provide the `counterparty.transferInstrumentId` field. Your description of the cashout transfer. This description is used by most banks as the transfer description. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. If you do not provide a description, Adyen generates a description automatically. This generated description is not returned in the response. Supported characters: **[a-z] [A-Z] [0-9] / - ? : ( ) . , ' + Space**. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets fee + * + * @return \Adyen\Model\Transfers\Fee|null + */ + public function getFee() + { + return $this->container['fee']; + } + + /** + * Sets fee + * + * @param \Adyen\Model\Transfers\Fee|null $fee fee + * + * @return self + */ + public function setFee($fee) + { + $this->container['fee'] = $fee; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the cashout reference. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets instructingBalanceAccountId + * + * @return string + */ + public function getInstructingBalanceAccountId() + { + return $this->container['instructingBalanceAccountId']; + } + + /** + * Sets instructingBalanceAccountId + * + * @param string $instructingBalanceAccountId The unique identifier of the balance account that initiates the cashout request. + * + * @return self + */ + public function setInstructingBalanceAccountId($instructingBalanceAccountId) + { + $this->container['instructingBalanceAccountId'] = $instructingBalanceAccountId; + + return $this; + } + + /** + * Gets referenceForBeneficiary + * + * @return string|null + */ + public function getReferenceForBeneficiary() + { + return $this->container['referenceForBeneficiary']; + } + + /** + * Sets referenceForBeneficiary + * + * @param string|null $referenceForBeneficiary Allowed and returned only when you provide the `counterparty.transferInstrumentId` field. The reference that is sent to the recipient of a cashout transfer. This reference is also sent in all webhooks related to the cashout transfer, so you can use it to track the status of the transfer. If you do not provide a reference for the beneficiary, Adyen generates one automatically. This generated reference for the beneficiary is not returned in the response. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @return self + */ + public function setReferenceForBeneficiary($referenceForBeneficiary) + { + $this->container['referenceForBeneficiary'] = $referenceForBeneficiary; + + return $this; + } + + /** + * Gets transferInstrumentId + * + * @return string|null + * @deprecated + */ + public function getTransferInstrumentId() + { + return $this->container['transferInstrumentId']; + } + + /** + * Sets transferInstrumentId + * + * @param string|null $transferInstrumentId **Use `counterparty.transferInstrumentId` instead.** The unique identifier of the counterparty transfer instrument. + * + * @return self + * @deprecated + */ + public function setTransferInstrumentId($transferInstrumentId) + { + $this->container['transferInstrumentId'] = $transferInstrumentId; + + return $this; + } + + /** + * Gets transfers + * + * @return \Adyen\Model\Transfers\CashOutTransfer[] + */ + public function getTransfers() + { + return $this->container['transfers']; + } + + /** + * Sets transfers + * + * @param \Adyen\Model\Transfers\CashOutTransfer[] $transfers The list of transfers related to cashout. + * + * @return self + */ + public function setTransfers($transfers) + { + $this->container['transfers'] = $transfers; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/CashOutInfo.php b/src/Adyen/Model/Transfers/CashOutInfo.php new file mode 100644 index 000000000..1e8d3a6e7 --- /dev/null +++ b/src/Adyen/Model/Transfers/CashOutInfo.php @@ -0,0 +1,629 @@ + + */ +class CashOutInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CashOutInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Transfers\Amount', + 'counterparty' => '\Adyen\Model\Transfers\CashOutInfoCounterparty', + 'description' => 'string', + 'fee' => '\Adyen\Model\Transfers\Fee', + 'id' => 'string', + 'instructingBalanceAccountId' => 'string', + 'referenceForBeneficiary' => 'string', + 'transferInstrumentId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'counterparty' => null, + 'description' => null, + 'fee' => null, + 'id' => null, + 'instructingBalanceAccountId' => null, + 'referenceForBeneficiary' => null, + 'transferInstrumentId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'counterparty' => false, + 'description' => false, + 'fee' => false, + 'id' => false, + 'instructingBalanceAccountId' => false, + 'referenceForBeneficiary' => false, + 'transferInstrumentId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'counterparty' => 'counterparty', + 'description' => 'description', + 'fee' => 'fee', + 'id' => 'id', + 'instructingBalanceAccountId' => 'instructingBalanceAccountId', + 'referenceForBeneficiary' => 'referenceForBeneficiary', + 'transferInstrumentId' => 'transferInstrumentId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'counterparty' => 'setCounterparty', + 'description' => 'setDescription', + 'fee' => 'setFee', + 'id' => 'setId', + 'instructingBalanceAccountId' => 'setInstructingBalanceAccountId', + 'referenceForBeneficiary' => 'setReferenceForBeneficiary', + 'transferInstrumentId' => 'setTransferInstrumentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'counterparty' => 'getCounterparty', + 'description' => 'getDescription', + 'fee' => 'getFee', + 'id' => 'getId', + 'instructingBalanceAccountId' => 'getInstructingBalanceAccountId', + 'referenceForBeneficiary' => 'getReferenceForBeneficiary', + 'transferInstrumentId' => 'getTransferInstrumentId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('counterparty', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('fee', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('instructingBalanceAccountId', $data ?? [], null); + $this->setIfExists('referenceForBeneficiary', $data ?? [], null); + $this->setIfExists('transferInstrumentId', $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"; + } + if ($this->container['instructingBalanceAccountId'] === null) { + $invalidProperties[] = "'instructingBalanceAccountId' 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 amount + * + * @return \Adyen\Model\Transfers\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Transfers\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets counterparty + * + * @return \Adyen\Model\Transfers\CashOutInfoCounterparty|null + */ + public function getCounterparty() + { + return $this->container['counterparty']; + } + + /** + * Sets counterparty + * + * @param \Adyen\Model\Transfers\CashOutInfoCounterparty|null $counterparty counterparty + * + * @return self + */ + public function setCounterparty($counterparty) + { + $this->container['counterparty'] = $counterparty; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Allowed and returned only when you provide the `counterparty.transferInstrumentId` field. Your description of the cashout transfer. This description is used by most banks as the transfer description. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. If you do not provide a description, Adyen generates a description automatically. This generated description is not returned in the response. Supported characters: **[a-z] [A-Z] [0-9] / - ? : ( ) . , ' + Space**. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets fee + * + * @return \Adyen\Model\Transfers\Fee|null + */ + public function getFee() + { + return $this->container['fee']; + } + + /** + * Sets fee + * + * @param \Adyen\Model\Transfers\Fee|null $fee fee + * + * @return self + */ + public function setFee($fee) + { + $this->container['fee'] = $fee; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The ID of the resource. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets instructingBalanceAccountId + * + * @return string + */ + public function getInstructingBalanceAccountId() + { + return $this->container['instructingBalanceAccountId']; + } + + /** + * Sets instructingBalanceAccountId + * + * @param string $instructingBalanceAccountId The unique identifier of the balance account that initiates the cashout request. + * + * @return self + */ + public function setInstructingBalanceAccountId($instructingBalanceAccountId) + { + $this->container['instructingBalanceAccountId'] = $instructingBalanceAccountId; + + return $this; + } + + /** + * Gets referenceForBeneficiary + * + * @return string|null + */ + public function getReferenceForBeneficiary() + { + return $this->container['referenceForBeneficiary']; + } + + /** + * Sets referenceForBeneficiary + * + * @param string|null $referenceForBeneficiary Allowed and returned only when you provide the `counterparty.transferInstrumentId` field. The reference that is sent to the recipient of a cashout transfer. This reference is also sent in all webhooks related to the cashout transfer, so you can use it to track the status of the transfer. If you do not provide a reference for the beneficiary, Adyen generates one automatically. This generated reference for the beneficiary is not returned in the response. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @return self + */ + public function setReferenceForBeneficiary($referenceForBeneficiary) + { + $this->container['referenceForBeneficiary'] = $referenceForBeneficiary; + + return $this; + } + + /** + * Gets transferInstrumentId + * + * @return string|null + * @deprecated + */ + public function getTransferInstrumentId() + { + return $this->container['transferInstrumentId']; + } + + /** + * Sets transferInstrumentId + * + * @param string|null $transferInstrumentId **Use `counterparty.transferInstrumentId` instead.** The unique identifier of the counterparty transfer instrument. + * + * @return self + * @deprecated + */ + public function setTransferInstrumentId($transferInstrumentId) + { + $this->container['transferInstrumentId'] = $transferInstrumentId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/CashOutInfoCounterparty.php b/src/Adyen/Model/Transfers/CashOutInfoCounterparty.php new file mode 100644 index 000000000..7321d5958 --- /dev/null +++ b/src/Adyen/Model/Transfers/CashOutInfoCounterparty.php @@ -0,0 +1,404 @@ + + */ +class CashOutInfoCounterparty implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CashOutInfoCounterparty'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'transferInstrumentId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'transferInstrumentId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'transferInstrumentId' => 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 = [ + 'transferInstrumentId' => 'transferInstrumentId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'transferInstrumentId' => 'setTransferInstrumentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'transferInstrumentId' => 'getTransferInstrumentId' + ]; + + /** + * 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('transferInstrumentId', $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 transferInstrumentId + * + * @return string|null + */ + public function getTransferInstrumentId() + { + return $this->container['transferInstrumentId']; + } + + /** + * Sets transferInstrumentId + * + * @param string|null $transferInstrumentId The unique identifier of the counterparty transfer instrument. If you do not provide this field, the cashout funds remain in the instructing balance account after the cashout transfer is settled. + * + * @return self + */ + public function setTransferInstrumentId($transferInstrumentId) + { + $this->container['transferInstrumentId'] = $transferInstrumentId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/CashOutTransfer.php b/src/Adyen/Model/Transfers/CashOutTransfer.php new file mode 100644 index 000000000..9fdbae527 --- /dev/null +++ b/src/Adyen/Model/Transfers/CashOutTransfer.php @@ -0,0 +1,508 @@ + + */ +class CashOutTransfer implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CashOutTransfer'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Transfers\Amount', + 'id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'id' => 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 = [ + 'amount' => 'amount', + 'id' => 'id', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'id' => 'setId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'id' => 'getId', + '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_CASHOUT_REPAYMENT = 'cashoutRepayment'; + public const TYPE_CASHOUT_FEE = 'cashoutFee'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CASHOUT_REPAYMENT, + self::TYPE_CASHOUT_FEE, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('id', $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['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return \Adyen\Model\Transfers\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Transfers\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The reference of the cashout transfer. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of the cashout transfer. Possible values: - **cashoutRepayment**: Corresponds to the transfer created to deduct the cashout amount after settlement. - **cashoutFee**: Corresponds to the transfer created to debit the cashout fee form the user's balance account. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + error_log( + sprintf( + "type: unexpected enum value '%s' - Supported values are [%s]", + $type, + implode(', ', $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/DefaultErrorResponseEntity.php b/src/Adyen/Model/Transfers/DefaultErrorResponseEntity.php new file mode 100644 index 000000000..40d3be38c --- /dev/null +++ b/src/Adyen/Model/Transfers/DefaultErrorResponseEntity.php @@ -0,0 +1,623 @@ + + */ +class DefaultErrorResponseEntity implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DefaultErrorResponseEntity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'detail' => 'string', + 'errorCode' => 'string', + 'instance' => 'string', + 'invalidFields' => '\Adyen\Model\Transfers\InvalidField[]', + 'requestId' => 'string', + 'status' => 'int', + 'title' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'detail' => null, + 'errorCode' => null, + 'instance' => null, + 'invalidFields' => null, + 'requestId' => null, + 'status' => 'int32', + 'title' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'detail' => false, + 'errorCode' => false, + 'instance' => false, + 'invalidFields' => false, + 'requestId' => false, + 'status' => true, + 'title' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'detail' => 'detail', + 'errorCode' => 'errorCode', + 'instance' => 'instance', + 'invalidFields' => 'invalidFields', + 'requestId' => 'requestId', + 'status' => 'status', + 'title' => 'title', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'detail' => 'setDetail', + 'errorCode' => 'setErrorCode', + 'instance' => 'setInstance', + 'invalidFields' => 'setInvalidFields', + 'requestId' => 'setRequestId', + 'status' => 'setStatus', + 'title' => 'setTitle', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'detail' => 'getDetail', + 'errorCode' => 'getErrorCode', + 'instance' => 'getInstance', + 'invalidFields' => 'getInvalidFields', + 'requestId' => 'getRequestId', + 'status' => 'getStatus', + 'title' => 'getTitle', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('detail', $data ?? [], null); + $this->setIfExists('errorCode', $data ?? [], null); + $this->setIfExists('instance', $data ?? [], null); + $this->setIfExists('invalidFields', $data ?? [], null); + $this->setIfExists('requestId', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets detail + * + * @return string|null + */ + public function getDetail() + { + return $this->container['detail']; + } + + /** + * Sets detail + * + * @param string|null $detail A human-readable explanation specific to this occurrence of the problem. + * + * @return self + */ + public function setDetail($detail) + { + $this->container['detail'] = $detail; + + return $this; + } + + /** + * Gets errorCode + * + * @return string|null + */ + public function getErrorCode() + { + return $this->container['errorCode']; + } + + /** + * Sets errorCode + * + * @param string|null $errorCode Unique business error code. + * + * @return self + */ + public function setErrorCode($errorCode) + { + $this->container['errorCode'] = $errorCode; + + return $this; + } + + /** + * Gets instance + * + * @return string|null + */ + public function getInstance() + { + return $this->container['instance']; + } + + /** + * Sets instance + * + * @param string|null $instance A URI that identifies the specific occurrence of the problem if applicable. + * + * @return self + */ + public function setInstance($instance) + { + $this->container['instance'] = $instance; + + return $this; + } + + /** + * Gets invalidFields + * + * @return \Adyen\Model\Transfers\InvalidField[]|null + */ + public function getInvalidFields() + { + return $this->container['invalidFields']; + } + + /** + * Sets invalidFields + * + * @param \Adyen\Model\Transfers\InvalidField[]|null $invalidFields Array of fields with validation errors when applicable. + * + * @return self + */ + public function setInvalidFields($invalidFields) + { + $this->container['invalidFields'] = $invalidFields; + + return $this; + } + + /** + * Gets requestId + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['requestId']; + } + + /** + * Sets requestId + * + * @param string|null $requestId The unique reference for the request. + * + * @return self + */ + public function setRequestId($requestId) + { + $this->container['requestId'] = $requestId; + + return $this; + } + + /** + * Gets status + * + * @return int|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param int|null $status The HTTP status code. + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title A short, human-readable summary of the problem type. + * + * @return self + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type A URI that identifies the validation error type. It points to human-readable documentation for the problem type. + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/Counterparty.php b/src/Adyen/Model/Transfers/GrantCounterparty.php similarity index 97% rename from src/Adyen/Model/Transfers/Counterparty.php rename to src/Adyen/Model/Transfers/GrantCounterparty.php index d03913fc0..6320834cb 100644 --- a/src/Adyen/Model/Transfers/Counterparty.php +++ b/src/Adyen/Model/Transfers/GrantCounterparty.php @@ -19,12 +19,12 @@ use Adyen\Model\Transfers\ObjectSerializer; /** - * Counterparty Class Doc Comment + * GrantCounterparty Class Doc Comment * * @package Adyen * @implements ArrayAccess */ -class Counterparty implements ModelInterface, ArrayAccess, \JsonSerializable +class GrantCounterparty implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -33,7 +33,7 @@ class Counterparty implements ModelInterface, ArrayAccess, \JsonSerializable * * @var string */ - protected static $openAPIModelName = 'Counterparty'; + protected static $openAPIModelName = 'GrantCounterparty'; /** * Array of property to type mappings. Used for (de)serialization @@ -300,7 +300,7 @@ public function getAccountHolderId() /** * Sets accountHolderId * - * @param string|null $accountHolderId The identifier of the receiving account holder. The payout will default to the primary balance account of this account holder if no `balanceAccountId` is provided. + * @param string|null $accountHolderId The identifier of the receiving account holder. * * @return self */ diff --git a/src/Adyen/Model/Transfers/GrantInfoCounterparty.php b/src/Adyen/Model/Transfers/GrantInfoCounterparty.php new file mode 100644 index 000000000..261e5fdc9 --- /dev/null +++ b/src/Adyen/Model/Transfers/GrantInfoCounterparty.php @@ -0,0 +1,435 @@ + + */ +class GrantInfoCounterparty implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GrantInfoCounterparty'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balanceAccountId' => 'string', + 'transferInstrumentId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balanceAccountId' => null, + 'transferInstrumentId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balanceAccountId' => false, + 'transferInstrumentId' => 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 = [ + 'balanceAccountId' => 'balanceAccountId', + 'transferInstrumentId' => 'transferInstrumentId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balanceAccountId' => 'setBalanceAccountId', + 'transferInstrumentId' => 'setTransferInstrumentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balanceAccountId' => 'getBalanceAccountId', + 'transferInstrumentId' => 'getTransferInstrumentId' + ]; + + /** + * 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('balanceAccountId', $data ?? [], null); + $this->setIfExists('transferInstrumentId', $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 balanceAccountId + * + * @return string|null + */ + public function getBalanceAccountId() + { + return $this->container['balanceAccountId']; + } + + /** + * Sets balanceAccountId + * + * @param string|null $balanceAccountId The identifier of the balance account that belongs to the receiving account holder. + * + * @return self + */ + public function setBalanceAccountId($balanceAccountId) + { + $this->container['balanceAccountId'] = $balanceAccountId; + + return $this; + } + + /** + * Gets transferInstrumentId + * + * @return string|null + */ + public function getTransferInstrumentId() + { + return $this->container['transferInstrumentId']; + } + + /** + * Sets transferInstrumentId + * + * @param string|null $transferInstrumentId The identifier of the transfer instrument that belongs to the legal entity of the account holder. + * + * @return self + */ + public function setTransferInstrumentId($transferInstrumentId) + { + $this->container['transferInstrumentId'] = $transferInstrumentId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/IbanAccountIdentification.php b/src/Adyen/Model/Transfers/IbanAccountIdentification.php index 1f2ac2e68..181259865 100644 --- a/src/Adyen/Model/Transfers/IbanAccountIdentification.php +++ b/src/Adyen/Model/Transfers/IbanAccountIdentification.php @@ -41,6 +41,7 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ + 'bic' => 'string', 'iban' => 'string', 'type' => 'string' ]; @@ -53,6 +54,7 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ + 'bic' => null, 'iban' => null, 'type' => null ]; @@ -63,6 +65,7 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static $openAPINullables = [ + 'bic' => false, 'iban' => false, 'type' => false ]; @@ -153,6 +156,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'bic' => 'bic', 'iban' => 'iban', 'type' => 'type' ]; @@ -163,6 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'bic' => 'setBic', 'iban' => 'setIban', 'type' => 'setType' ]; @@ -173,6 +178,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'bic' => 'getBic', 'iban' => 'getIban', 'type' => 'getType' ]; @@ -246,6 +252,7 @@ public function getTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('bic', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -307,6 +314,30 @@ public function valid() } + /** + * Gets bic + * + * @return string|null + */ + public function getBic() + { + return $this->container['bic']; + } + + /** + * Sets bic + * + * @param string|null $bic The bank's 8- or 11-character BIC or SWIFT code. + * + * @return self + */ + public function setBic($bic) + { + $this->container['bic'] = $bic; + + return $this; + } + /** * Gets iban * diff --git a/src/Adyen/Model/Transfers/InterchangeData.php b/src/Adyen/Model/Transfers/InterchangeData.php new file mode 100644 index 000000000..0c8a64996 --- /dev/null +++ b/src/Adyen/Model/Transfers/InterchangeData.php @@ -0,0 +1,500 @@ + + */ +class InterchangeData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InterchangeData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'interchangeAmount' => '\Adyen\Model\Transfers\Amount', + 'interchangeRateIndicator' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'interchangeAmount' => null, + 'interchangeRateIndicator' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'interchangeAmount' => false, + 'interchangeRateIndicator' => 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 = [ + 'interchangeAmount' => 'interchangeAmount', + 'interchangeRateIndicator' => 'interchangeRateIndicator', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'interchangeAmount' => 'setInterchangeAmount', + 'interchangeRateIndicator' => 'setInterchangeRateIndicator', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'interchangeAmount' => 'getInterchangeAmount', + 'interchangeRateIndicator' => 'getInterchangeRateIndicator', + '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_INTERCHANGE_DATA = 'interchangeData'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_INTERCHANGE_DATA, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('interchangeAmount', $data ?? [], null); + $this->setIfExists('interchangeRateIndicator', $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 interchangeAmount + * + * @return \Adyen\Model\Transfers\Amount|null + */ + public function getInterchangeAmount() + { + return $this->container['interchangeAmount']; + } + + /** + * Sets interchangeAmount + * + * @param \Adyen\Model\Transfers\Amount|null $interchangeAmount interchangeAmount + * + * @return self + */ + public function setInterchangeAmount($interchangeAmount) + { + $this->container['interchangeAmount'] = $interchangeAmount; + + return $this; + } + + /** + * Gets interchangeRateIndicator + * + * @return string|null + */ + public function getInterchangeRateIndicator() + { + return $this->container['interchangeRateIndicator']; + } + + /** + * Sets interchangeRateIndicator + * + * @param string|null $interchangeRateIndicator A 3-character alphanumeric code assigned by Visa that identifies the specific interchange reimbursement program a transaction qualified for. The code is assigned based on the card type, entry mode, and security data provided. + * + * @return self + */ + public function setInterchangeRateIndicator($interchangeRateIndicator) + { + $this->container['interchangeRateIndicator'] = $interchangeRateIndicator; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of events data. Possible values: - **interchangeData**: information about the interchange fee applied to a transaction. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + error_log( + sprintf( + "type: unexpected enum value '%s' - Supported values are [%s]", + $type, + implode(', ', $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/IssuedCard.php b/src/Adyen/Model/Transfers/IssuedCard.php index 5af9ebc11..3d023a35d 100644 --- a/src/Adyen/Model/Transfers/IssuedCard.php +++ b/src/Adyen/Model/Transfers/IssuedCard.php @@ -489,7 +489,7 @@ public function getProcessingType() /** * 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. + * @param string|null $processingType Contains information about how the payment was processed. Possible values: **atmWithdraw**, **balanceInquiry**, **ecommerce**, **moto**, **pos**, **purchaseWithCashback**, **recurring**, **token**. * * @return self */ diff --git a/src/Adyen/Model/Transfers/Modification.php b/src/Adyen/Model/Transfers/Modification.php index dce7e80dc..f4c137cc2 100644 --- a/src/Adyen/Model/Transfers/Modification.php +++ b/src/Adyen/Model/Transfers/Modification.php @@ -271,6 +271,7 @@ public function getModelName() public const STATUS_FAILED = 'failed'; public const STATUS_FEE = 'fee'; public const STATUS_FEE_PENDING = 'feePending'; + public const STATUS_INTERCHANGE_ADJUSTED = 'interchangeAdjusted'; public const STATUS_INTERNAL_TRANSFER = 'internalTransfer'; public const STATUS_INTERNAL_TRANSFER_PENDING = 'internalTransferPending'; public const STATUS_INVOICE_DEDUCTION = 'invoiceDeduction'; @@ -287,6 +288,7 @@ public function getModelName() public const STATUS_MISC_COST_PENDING = 'miscCostPending'; public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; + public const STATUS_PENDING = 'pending'; public const STATUS_PENDING_APPROVAL = 'pendingApproval'; public const STATUS_PENDING_EXECUTION = 'pendingExecution'; public const STATUS_RECEIVED = 'received'; @@ -300,6 +302,7 @@ public function getModelName() public const STATUS_RESERVE_ADJUSTMENT = 'reserveAdjustment'; public const STATUS_RESERVE_ADJUSTMENT_PENDING = 'reserveAdjustmentPending'; public const STATUS_RETURNED = 'returned'; + public const STATUS_REVERSED = 'reversed'; public const STATUS_SECOND_CHARGEBACK = 'secondChargeback'; public const STATUS_SECOND_CHARGEBACK_PENDING = 'secondChargebackPending'; public const STATUS_UNDEFINED = 'undefined'; @@ -347,6 +350,7 @@ public function getStatusAllowableValues() self::STATUS_FAILED, self::STATUS_FEE, self::STATUS_FEE_PENDING, + self::STATUS_INTERCHANGE_ADJUSTED, self::STATUS_INTERNAL_TRANSFER, self::STATUS_INTERNAL_TRANSFER_PENDING, self::STATUS_INVOICE_DEDUCTION, @@ -363,6 +367,7 @@ public function getStatusAllowableValues() self::STATUS_MISC_COST_PENDING, self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, + self::STATUS_PENDING, self::STATUS_PENDING_APPROVAL, self::STATUS_PENDING_EXECUTION, self::STATUS_RECEIVED, @@ -376,6 +381,7 @@ public function getStatusAllowableValues() self::STATUS_RESERVE_ADJUSTMENT, self::STATUS_RESERVE_ADJUSTMENT_PENDING, self::STATUS_RETURNED, + self::STATUS_REVERSED, self::STATUS_SECOND_CHARGEBACK, self::STATUS_SECOND_CHARGEBACK_PENDING, self::STATUS_UNDEFINED, diff --git a/src/Adyen/Model/Transfers/NetworkReason.php b/src/Adyen/Model/Transfers/NetworkReason.php new file mode 100644 index 000000000..c5cf3ea89 --- /dev/null +++ b/src/Adyen/Model/Transfers/NetworkReason.php @@ -0,0 +1,503 @@ + + */ +class NetworkReason implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NetworkReason'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'code' => 'string', + 'description' => 'string', + 'namespace' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => null, + 'description' => null, + 'namespace' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'code' => false, + 'description' => false, + 'namespace' => 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 = [ + 'code' => 'code', + 'description' => 'description', + 'namespace' => 'namespace' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'description' => 'setDescription', + 'namespace' => 'setNamespace' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'description' => 'getDescription', + 'namespace' => 'getNamespace' + ]; + + /** + * 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 MODEL_NAMESPACE_ISO8583_RESPONSE_CODE = 'iso8583ResponseCode'; + public const MODEL_NAMESPACE_UK_FPS_REJECTION_CODE = 'ukFpsRejectionCode'; + public const MODEL_NAMESPACE_UK_FPS_RETURN_REASON_CODE = 'ukFpsReturnReasonCode'; + public const MODEL_NAMESPACE_US_ACH_RETURN_REASON_CODE = 'usAchReturnReasonCode'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNamespaceAllowableValues() + { + return [ + self::MODEL_NAMESPACE_ISO8583_RESPONSE_CODE, + self::MODEL_NAMESPACE_UK_FPS_REJECTION_CODE, + self::MODEL_NAMESPACE_UK_FPS_RETURN_REASON_CODE, + self::MODEL_NAMESPACE_US_ACH_RETURN_REASON_CODE, + ]; + } + /** + * 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('code', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('namespace', $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->getNamespaceAllowableValues(); + if (!is_null($this->container['namespace']) && !in_array($this->container['namespace'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'namespace', must be one of '%s'", + $this->container['namespace'], + 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 code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The reason code provided by the network. + * + * @return self + */ + public function setCode($code) + { + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the reason code. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets namespace + * + * @return string|null + */ + public function getNamespace() + { + return $this->container['namespace']; + } + + /** + * Sets namespace + * + * @param string|null $namespace The namespace that corresponds to the reason code. Possible values: * **ukFpsRejectionCode** * **ukFpsReturnReasonCode** * **usAchReturnReasonCode** * **iso8583ResponseCode** + * + * @return self + */ + public function setNamespace($namespace) + { + $allowedValues = $this->getNamespaceAllowableValues(); + if (!in_array($namespace, $allowedValues, true)) { + error_log( + sprintf( + "namespace: unexpected enum value '%s' - Supported values are [%s]", + $namespace, + implode(', ', $allowedValues) + ) + ); + } + $this->container['namespace'] = $namespace; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/Transfer.php b/src/Adyen/Model/Transfers/Transfer.php index 9de53afa9..e2e873875 100644 --- a/src/Adyen/Model/Transfers/Transfer.php +++ b/src/Adyen/Model/Transfers/Transfer.php @@ -60,7 +60,8 @@ class Transfer implements ModelInterface, ArrayAccess, \JsonSerializable 'referenceForBeneficiary' => 'string', 'review' => '\Adyen\Model\Transfers\TransferReview', 'status' => 'string', - 'type' => 'string' + 'type' => 'string', + 'ultimateParty' => '\Adyen\Model\Transfers\UltimatePartyIdentification' ]; /** @@ -90,7 +91,8 @@ class Transfer implements ModelInterface, ArrayAccess, \JsonSerializable 'referenceForBeneficiary' => null, 'review' => null, 'status' => null, - 'type' => null + 'type' => null, + 'ultimateParty' => null ]; /** @@ -118,7 +120,8 @@ class Transfer implements ModelInterface, ArrayAccess, \JsonSerializable 'referenceForBeneficiary' => false, 'review' => false, 'status' => false, - 'type' => false + 'type' => false, + 'ultimateParty' => false ]; /** @@ -226,7 +229,8 @@ public function isNullableSetToNull(string $property): bool 'referenceForBeneficiary' => 'referenceForBeneficiary', 'review' => 'review', 'status' => 'status', - 'type' => 'type' + 'type' => 'type', + 'ultimateParty' => 'ultimateParty' ]; /** @@ -254,7 +258,8 @@ public function isNullableSetToNull(string $property): bool 'referenceForBeneficiary' => 'setReferenceForBeneficiary', 'review' => 'setReview', 'status' => 'setStatus', - 'type' => 'setType' + 'type' => 'setType', + 'ultimateParty' => 'setUltimateParty' ]; /** @@ -282,7 +287,8 @@ public function isNullableSetToNull(string $property): bool 'referenceForBeneficiary' => 'getReferenceForBeneficiary', 'review' => 'getReview', 'status' => 'getStatus', - 'type' => 'getType' + 'type' => 'getType', + 'ultimateParty' => 'getUltimateParty' ]; /** @@ -454,6 +460,7 @@ public function getModelName() public const STATUS_FAILED = 'failed'; public const STATUS_FEE = 'fee'; public const STATUS_FEE_PENDING = 'feePending'; + public const STATUS_INTERCHANGE_ADJUSTED = 'interchangeAdjusted'; public const STATUS_INTERNAL_TRANSFER = 'internalTransfer'; public const STATUS_INTERNAL_TRANSFER_PENDING = 'internalTransferPending'; public const STATUS_INVOICE_DEDUCTION = 'invoiceDeduction'; @@ -470,6 +477,7 @@ public function getModelName() public const STATUS_MISC_COST_PENDING = 'miscCostPending'; public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; + public const STATUS_PENDING = 'pending'; public const STATUS_PENDING_APPROVAL = 'pendingApproval'; public const STATUS_PENDING_EXECUTION = 'pendingExecution'; public const STATUS_RECEIVED = 'received'; @@ -483,6 +491,7 @@ public function getModelName() public const STATUS_RESERVE_ADJUSTMENT = 'reserveAdjustment'; public const STATUS_RESERVE_ADJUSTMENT_PENDING = 'reserveAdjustmentPending'; public const STATUS_RETURNED = 'returned'; + public const STATUS_REVERSED = 'reversed'; public const STATUS_SECOND_CHARGEBACK = 'secondChargeback'; public const STATUS_SECOND_CHARGEBACK_PENDING = 'secondChargebackPending'; public const STATUS_UNDEFINED = 'undefined'; @@ -691,6 +700,7 @@ public function getStatusAllowableValues() self::STATUS_FAILED, self::STATUS_FEE, self::STATUS_FEE_PENDING, + self::STATUS_INTERCHANGE_ADJUSTED, self::STATUS_INTERNAL_TRANSFER, self::STATUS_INTERNAL_TRANSFER_PENDING, self::STATUS_INVOICE_DEDUCTION, @@ -707,6 +717,7 @@ public function getStatusAllowableValues() self::STATUS_MISC_COST_PENDING, self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, + self::STATUS_PENDING, self::STATUS_PENDING_APPROVAL, self::STATUS_PENDING_EXECUTION, self::STATUS_RECEIVED, @@ -720,6 +731,7 @@ public function getStatusAllowableValues() self::STATUS_RESERVE_ADJUSTMENT, self::STATUS_RESERVE_ADJUSTMENT_PENDING, self::STATUS_RETURNED, + self::STATUS_REVERSED, self::STATUS_SECOND_CHARGEBACK, self::STATUS_SECOND_CHARGEBACK_PENDING, self::STATUS_UNDEFINED, @@ -808,6 +820,7 @@ public function __construct(?array $data = null) $this->setIfExists('review', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('ultimateParty', $data ?? [], null); } /** @@ -1386,7 +1399,7 @@ public function getStatus() /** * Sets status * - * @param string $status The result of the transfer. For example: - **received**: an outgoing transfer request is created. - **refused**: the transfer request is rejected by Adyen for one of the following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule requirements violated. - **authorised**: the transfer request is authorized and the funds are reserved. - **booked**: the funds are deducted from your user's balance account. - **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned by the counterparty's bank. + * @param string $status The result of the transfer. For example: - **received**: an outgoing transfer request is created. - **refused**: the transfer request is rejected by Adyen for one of the following reasons: - Transfer limit exceeded. - Transaction rule requirements violated. - **authorised**: the transfer request is authorized and the funds are reserved. - **booked**: the funds are deducted from your user's balance account. - **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned by the counterparty's bank. * * @return self */ @@ -1440,6 +1453,30 @@ public function setType($type) return $this; } + + /** + * Gets ultimateParty + * + * @return \Adyen\Model\Transfers\UltimatePartyIdentification|null + */ + public function getUltimateParty() + { + return $this->container['ultimateParty']; + } + + /** + * Sets ultimateParty + * + * @param \Adyen\Model\Transfers\UltimatePartyIdentification|null $ultimateParty ultimateParty + * + * @return self + */ + public function setUltimateParty($ultimateParty) + { + $this->container['ultimateParty'] = $ultimateParty; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Transfers/TransferCategoryData.php b/src/Adyen/Model/Transfers/TransferCategoryData.php index 276983fd8..1c65a8666 100644 --- a/src/Adyen/Model/Transfers/TransferCategoryData.php +++ b/src/Adyen/Model/Transfers/TransferCategoryData.php @@ -28,7 +28,7 @@ */ class TransferCategoryData implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = null; + public const DISCRIMINATOR = 'type'; /** * The original name of the model. @@ -328,6 +328,9 @@ public function __construct(?array $data = null) $this->setIfExists('paymentMerchantReference', $data ?? [], null); $this->setIfExists('platformPaymentType', $data ?? [], null); $this->setIfExists('pspPaymentReference', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; } /** @@ -534,7 +537,7 @@ public function getProcessingType() /** * 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. + * @param string|null $processingType Contains information about how the payment was processed. Possible values: **atmWithdraw**, **balanceInquiry**, **ecommerce**, **moto**, **pos**, **purchaseWithCashback**, **recurring**, **token**. * * @return self */ diff --git a/src/Adyen/Model/Transfers/TransferData.php b/src/Adyen/Model/Transfers/TransferData.php index 5e51bb7b6..cbd398e11 100644 --- a/src/Adyen/Model/Transfers/TransferData.php +++ b/src/Adyen/Model/Transfers/TransferData.php @@ -59,6 +59,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'executionDate' => '\Adyen\Model\Transfers\ExecutionDate', 'externalReason' => '\Adyen\Model\Transfers\ExternalReason', 'id' => 'string', + 'networkReason' => '\Adyen\Model\Transfers\NetworkReason', 'paymentInstrument' => '\Adyen\Model\Transfers\PaymentInstrument', 'reason' => 'string', 'reference' => 'string', @@ -66,9 +67,11 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'review' => '\Adyen\Model\Transfers\TransferReview', 'sequenceNumber' => 'int', 'status' => 'string', + 'tracing' => '\Adyen\Model\Transfers\TransferDataTracing', 'tracking' => '\Adyen\Model\Transfers\TransferDataTracking', 'transactionRulesResult' => '\Adyen\Model\Transfers\TransactionRulesResult', 'type' => 'string', + 'ultimateParty' => '\Adyen\Model\Transfers\UltimatePartyIdentification', 'updatedAt' => '\DateTime' ]; @@ -98,6 +101,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'executionDate' => null, 'externalReason' => null, 'id' => null, + 'networkReason' => null, 'paymentInstrument' => null, 'reason' => null, 'reference' => null, @@ -105,9 +109,11 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'review' => null, 'sequenceNumber' => 'int32', 'status' => null, + 'tracing' => null, 'tracking' => null, 'transactionRulesResult' => null, 'type' => null, + 'ultimateParty' => null, 'updatedAt' => 'date-time' ]; @@ -135,6 +141,7 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'executionDate' => false, 'externalReason' => false, 'id' => false, + 'networkReason' => false, 'paymentInstrument' => false, 'reason' => false, 'reference' => false, @@ -142,9 +149,11 @@ class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable 'review' => false, 'sequenceNumber' => true, 'status' => false, + 'tracing' => false, 'tracking' => false, 'transactionRulesResult' => false, 'type' => false, + 'ultimateParty' => false, 'updatedAt' => false ]; @@ -252,6 +261,7 @@ public function isNullableSetToNull(string $property): bool 'executionDate' => 'executionDate', 'externalReason' => 'externalReason', 'id' => 'id', + 'networkReason' => 'networkReason', 'paymentInstrument' => 'paymentInstrument', 'reason' => 'reason', 'reference' => 'reference', @@ -259,9 +269,11 @@ public function isNullableSetToNull(string $property): bool 'review' => 'review', 'sequenceNumber' => 'sequenceNumber', 'status' => 'status', + 'tracing' => 'tracing', 'tracking' => 'tracking', 'transactionRulesResult' => 'transactionRulesResult', 'type' => 'type', + 'ultimateParty' => 'ultimateParty', 'updatedAt' => 'updatedAt' ]; @@ -289,6 +301,7 @@ public function isNullableSetToNull(string $property): bool 'executionDate' => 'setExecutionDate', 'externalReason' => 'setExternalReason', 'id' => 'setId', + 'networkReason' => 'setNetworkReason', 'paymentInstrument' => 'setPaymentInstrument', 'reason' => 'setReason', 'reference' => 'setReference', @@ -296,9 +309,11 @@ public function isNullableSetToNull(string $property): bool 'review' => 'setReview', 'sequenceNumber' => 'setSequenceNumber', 'status' => 'setStatus', + 'tracing' => 'setTracing', 'tracking' => 'setTracking', 'transactionRulesResult' => 'setTransactionRulesResult', 'type' => 'setType', + 'ultimateParty' => 'setUltimateParty', 'updatedAt' => 'setUpdatedAt' ]; @@ -326,6 +341,7 @@ public function isNullableSetToNull(string $property): bool 'executionDate' => 'getExecutionDate', 'externalReason' => 'getExternalReason', 'id' => 'getId', + 'networkReason' => 'getNetworkReason', 'paymentInstrument' => 'getPaymentInstrument', 'reason' => 'getReason', 'reference' => 'getReference', @@ -333,9 +349,11 @@ public function isNullableSetToNull(string $property): bool 'review' => 'getReview', 'sequenceNumber' => 'getSequenceNumber', 'status' => 'getStatus', + 'tracing' => 'getTracing', 'tracking' => 'getTracking', 'transactionRulesResult' => 'getTransactionRulesResult', 'type' => 'getType', + 'ultimateParty' => 'getUltimateParty', 'updatedAt' => 'getUpdatedAt' ]; @@ -508,6 +526,7 @@ public function getModelName() public const STATUS_FAILED = 'failed'; public const STATUS_FEE = 'fee'; public const STATUS_FEE_PENDING = 'feePending'; + public const STATUS_INTERCHANGE_ADJUSTED = 'interchangeAdjusted'; public const STATUS_INTERNAL_TRANSFER = 'internalTransfer'; public const STATUS_INTERNAL_TRANSFER_PENDING = 'internalTransferPending'; public const STATUS_INVOICE_DEDUCTION = 'invoiceDeduction'; @@ -524,6 +543,7 @@ public function getModelName() public const STATUS_MISC_COST_PENDING = 'miscCostPending'; public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; + public const STATUS_PENDING = 'pending'; public const STATUS_PENDING_APPROVAL = 'pendingApproval'; public const STATUS_PENDING_EXECUTION = 'pendingExecution'; public const STATUS_RECEIVED = 'received'; @@ -537,6 +557,7 @@ public function getModelName() public const STATUS_RESERVE_ADJUSTMENT = 'reserveAdjustment'; public const STATUS_RESERVE_ADJUSTMENT_PENDING = 'reserveAdjustmentPending'; public const STATUS_RETURNED = 'returned'; + public const STATUS_REVERSED = 'reversed'; public const STATUS_SECOND_CHARGEBACK = 'secondChargeback'; public const STATUS_SECOND_CHARGEBACK_PENDING = 'secondChargebackPending'; public const STATUS_UNDEFINED = 'undefined'; @@ -745,6 +766,7 @@ public function getStatusAllowableValues() self::STATUS_FAILED, self::STATUS_FEE, self::STATUS_FEE_PENDING, + self::STATUS_INTERCHANGE_ADJUSTED, self::STATUS_INTERNAL_TRANSFER, self::STATUS_INTERNAL_TRANSFER_PENDING, self::STATUS_INVOICE_DEDUCTION, @@ -761,6 +783,7 @@ public function getStatusAllowableValues() self::STATUS_MISC_COST_PENDING, self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, + self::STATUS_PENDING, self::STATUS_PENDING_APPROVAL, self::STATUS_PENDING_EXECUTION, self::STATUS_RECEIVED, @@ -774,6 +797,7 @@ public function getStatusAllowableValues() self::STATUS_RESERVE_ADJUSTMENT, self::STATUS_RESERVE_ADJUSTMENT_PENDING, self::STATUS_RETURNED, + self::STATUS_REVERSED, self::STATUS_SECOND_CHARGEBACK, self::STATUS_SECOND_CHARGEBACK_PENDING, self::STATUS_UNDEFINED, @@ -860,6 +884,7 @@ public function __construct(?array $data = null) $this->setIfExists('executionDate', $data ?? [], null); $this->setIfExists('externalReason', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('networkReason', $data ?? [], null); $this->setIfExists('paymentInstrument', $data ?? [], null); $this->setIfExists('reason', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); @@ -867,9 +892,11 @@ public function __construct(?array $data = null) $this->setIfExists('review', $data ?? [], null); $this->setIfExists('sequenceNumber', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('tracing', $data ?? [], null); $this->setIfExists('tracking', $data ?? [], null); $this->setIfExists('transactionRulesResult', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('ultimateParty', $data ?? [], null); $this->setIfExists('updatedAt', $data ?? [], null); } @@ -1423,6 +1450,30 @@ public function setId($id) return $this; } + /** + * Gets networkReason + * + * @return \Adyen\Model\Transfers\NetworkReason|null + */ + public function getNetworkReason() + { + return $this->container['networkReason']; + } + + /** + * Sets networkReason + * + * @param \Adyen\Model\Transfers\NetworkReason|null $networkReason networkReason + * + * @return self + */ + public function setNetworkReason($networkReason) + { + $this->container['networkReason'] = $networkReason; + + return $this; + } + /** * Gets paymentInstrument * @@ -1590,7 +1641,7 @@ public function getStatus() /** * Sets status * - * @param string $status The result of the transfer. For example: - **received**: an outgoing transfer request is created. - **refused**: the transfer request is rejected by Adyen for one of the following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule requirements violated. - **authorised**: the transfer request is authorized and the funds are reserved. - **booked**: the funds are deducted from your user's balance account. - **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned by the counterparty's bank. + * @param string $status The result of the transfer. For example: - **received**: an outgoing transfer request is created. - **refused**: the transfer request is rejected by Adyen for one of the following reasons: - Transfer limit exceeded. - Transaction rule requirements violated. - **authorised**: the transfer request is authorized and the funds are reserved. - **booked**: the funds are deducted from your user's balance account. - **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned by the counterparty's bank. * * @return self */ @@ -1611,6 +1662,30 @@ public function setStatus($status) return $this; } + /** + * Gets tracing + * + * @return \Adyen\Model\Transfers\TransferDataTracing|null + */ + public function getTracing() + { + return $this->container['tracing']; + } + + /** + * Sets tracing + * + * @param \Adyen\Model\Transfers\TransferDataTracing|null $tracing tracing + * + * @return self + */ + public function setTracing($tracing) + { + $this->container['tracing'] = $tracing; + + return $this; + } + /** * Gets tracking * @@ -1693,6 +1768,30 @@ public function setType($type) return $this; } + /** + * Gets ultimateParty + * + * @return \Adyen\Model\Transfers\UltimatePartyIdentification|null + */ + public function getUltimateParty() + { + return $this->container['ultimateParty']; + } + + /** + * Sets ultimateParty + * + * @param \Adyen\Model\Transfers\UltimatePartyIdentification|null $ultimateParty ultimateParty + * + * @return self + */ + public function setUltimateParty($ultimateParty) + { + $this->container['ultimateParty'] = $ultimateParty; + + return $this; + } + /** * Gets updatedAt * diff --git a/src/Adyen/Model/Transfers/TransferDataTracing.php b/src/Adyen/Model/Transfers/TransferDataTracing.php new file mode 100644 index 000000000..ca79607b3 --- /dev/null +++ b/src/Adyen/Model/Transfers/TransferDataTracing.php @@ -0,0 +1,480 @@ + + */ +class TransferDataTracing implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferData_tracing'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'fpid' => 'string', + 'type' => 'string', + 'traceNumber' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'fpid' => null, + 'type' => null, + 'traceNumber' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'fpid' => false, + 'type' => false, + 'traceNumber' => 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 = [ + 'fpid' => 'fpid', + 'type' => 'type', + 'traceNumber' => 'traceNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'fpid' => 'setFpid', + 'type' => 'setType', + 'traceNumber' => 'setTraceNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'fpid' => 'getFpid', + 'type' => 'getType', + 'traceNumber' => 'getTraceNumber' + ]; + + /** + * 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('fpid', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('traceNumber', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * 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['fpid'] === null) { + $invalidProperties[] = "'fpid' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + + if ($this->container['traceNumber'] === null) { + $invalidProperties[] = "'traceNumber' 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 fpid + * + * @return string + */ + public function getFpid() + { + return $this->container['fpid']; + } + + /** + * Sets fpid + * + * @param string $fpid The FPS trace number. This is a unique identifier assigned to transfers processed by [FPS](https://www.bankofengland.co.uk/payment-systems/services/faster-payments-service). + * + * @return self + */ + public function setFpid($fpid) + { + $this->container['fpid'] = $fpid; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **usAch** + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets traceNumber + * + * @return string + */ + public function getTraceNumber() + { + return $this->container['traceNumber']; + } + + /** + * Sets traceNumber + * + * @param string $traceNumber The ACH trace number. This is a unique 15-digit identifier assigned to transfers processed by [ACH](https://fiscal.treasury.gov/payments-from-government/automated-clearing-house-ach). + * + * @return self + */ + public function setTraceNumber($traceNumber) + { + $this->container['traceNumber'] = $traceNumber; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/TransferDataTracking.php b/src/Adyen/Model/Transfers/TransferDataTracking.php index a6d085527..dcce94270 100644 --- a/src/Adyen/Model/Transfers/TransferDataTracking.php +++ b/src/Adyen/Model/Transfers/TransferDataTracking.php @@ -28,7 +28,7 @@ */ class TransferDataTracking implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = null; + public const DISCRIMINATOR = 'type'; /** * The original name of the model. @@ -251,6 +251,9 @@ public function __construct(?array $data = null) $this->setIfExists('type', $data ?? [], null); $this->setIfExists('estimatedArrivalTime', $data ?? [], null); $this->setIfExists('reason', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; } /** diff --git a/src/Adyen/Model/Transfers/TransferEvent.php b/src/Adyen/Model/Transfers/TransferEvent.php index 0efb61cc1..e6544909d 100644 --- a/src/Adyen/Model/Transfers/TransferEvent.php +++ b/src/Adyen/Model/Transfers/TransferEvent.php @@ -54,6 +54,7 @@ class TransferEvent implements ModelInterface, ArrayAccess, \JsonSerializable 'originalAmount' => '\Adyen\Model\Transfers\Amount', 'reason' => 'string', 'status' => 'string', + 'tracingData' => '\Adyen\Model\Transfers\TransferEventTracingData', 'trackingData' => '\Adyen\Model\Transfers\TransferEventTrackingData', 'transactionId' => 'string', 'type' => 'string', @@ -82,6 +83,7 @@ class TransferEvent implements ModelInterface, ArrayAccess, \JsonSerializable 'originalAmount' => null, 'reason' => null, 'status' => null, + 'tracingData' => null, 'trackingData' => null, 'transactionId' => null, 'type' => null, @@ -108,6 +110,7 @@ class TransferEvent implements ModelInterface, ArrayAccess, \JsonSerializable 'originalAmount' => false, 'reason' => false, 'status' => false, + 'tracingData' => false, 'trackingData' => false, 'transactionId' => false, 'type' => false, @@ -214,6 +217,7 @@ public function isNullableSetToNull(string $property): bool 'originalAmount' => 'originalAmount', 'reason' => 'reason', 'status' => 'status', + 'tracingData' => 'tracingData', 'trackingData' => 'trackingData', 'transactionId' => 'transactionId', 'type' => 'type', @@ -240,6 +244,7 @@ public function isNullableSetToNull(string $property): bool 'originalAmount' => 'setOriginalAmount', 'reason' => 'setReason', 'status' => 'setStatus', + 'tracingData' => 'setTracingData', 'trackingData' => 'setTrackingData', 'transactionId' => 'setTransactionId', 'type' => 'setType', @@ -266,6 +271,7 @@ public function isNullableSetToNull(string $property): bool 'originalAmount' => 'getOriginalAmount', 'reason' => 'getReason', 'status' => 'getStatus', + 'tracingData' => 'getTracingData', 'trackingData' => 'getTrackingData', 'transactionId' => 'getTransactionId', 'type' => 'getType', @@ -434,6 +440,7 @@ public function getModelName() public const STATUS_FAILED = 'failed'; public const STATUS_FEE = 'fee'; public const STATUS_FEE_PENDING = 'feePending'; + public const STATUS_INTERCHANGE_ADJUSTED = 'interchangeAdjusted'; public const STATUS_INTERNAL_TRANSFER = 'internalTransfer'; public const STATUS_INTERNAL_TRANSFER_PENDING = 'internalTransferPending'; public const STATUS_INVOICE_DEDUCTION = 'invoiceDeduction'; @@ -450,6 +457,7 @@ public function getModelName() public const STATUS_MISC_COST_PENDING = 'miscCostPending'; public const STATUS_PAYMENT_COST = 'paymentCost'; public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; + public const STATUS_PENDING = 'pending'; public const STATUS_PENDING_APPROVAL = 'pendingApproval'; public const STATUS_PENDING_EXECUTION = 'pendingExecution'; public const STATUS_RECEIVED = 'received'; @@ -463,10 +471,12 @@ public function getModelName() public const STATUS_RESERVE_ADJUSTMENT = 'reserveAdjustment'; public const STATUS_RESERVE_ADJUSTMENT_PENDING = 'reserveAdjustmentPending'; public const STATUS_RETURNED = 'returned'; + public const STATUS_REVERSED = 'reversed'; public const STATUS_SECOND_CHARGEBACK = 'secondChargeback'; public const STATUS_SECOND_CHARGEBACK_PENDING = 'secondChargebackPending'; public const STATUS_UNDEFINED = 'undefined'; public const TYPE_ACCOUNTING = 'accounting'; + public const TYPE_TRACING = 'tracing'; public const TYPE_TRACKING = 'tracking'; /** @@ -607,6 +617,7 @@ public function getStatusAllowableValues() self::STATUS_FAILED, self::STATUS_FEE, self::STATUS_FEE_PENDING, + self::STATUS_INTERCHANGE_ADJUSTED, self::STATUS_INTERNAL_TRANSFER, self::STATUS_INTERNAL_TRANSFER_PENDING, self::STATUS_INVOICE_DEDUCTION, @@ -623,6 +634,7 @@ public function getStatusAllowableValues() self::STATUS_MISC_COST_PENDING, self::STATUS_PAYMENT_COST, self::STATUS_PAYMENT_COST_PENDING, + self::STATUS_PENDING, self::STATUS_PENDING_APPROVAL, self::STATUS_PENDING_EXECUTION, self::STATUS_RECEIVED, @@ -636,6 +648,7 @@ public function getStatusAllowableValues() self::STATUS_RESERVE_ADJUSTMENT, self::STATUS_RESERVE_ADJUSTMENT_PENDING, self::STATUS_RETURNED, + self::STATUS_REVERSED, self::STATUS_SECOND_CHARGEBACK, self::STATUS_SECOND_CHARGEBACK_PENDING, self::STATUS_UNDEFINED, @@ -650,6 +663,7 @@ public function getTypeAllowableValues() { return [ self::TYPE_ACCOUNTING, + self::TYPE_TRACING, self::TYPE_TRACKING, ]; } @@ -681,6 +695,7 @@ public function __construct(?array $data = null) $this->setIfExists('originalAmount', $data ?? [], null); $this->setIfExists('reason', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('tracingData', $data ?? [], null); $this->setIfExists('trackingData', $data ?? [], null); $this->setIfExists('transactionId', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); @@ -1089,6 +1104,30 @@ public function setStatus($status) return $this; } + /** + * Gets tracingData + * + * @return \Adyen\Model\Transfers\TransferEventTracingData|null + */ + public function getTracingData() + { + return $this->container['tracingData']; + } + + /** + * Sets tracingData + * + * @param \Adyen\Model\Transfers\TransferEventTracingData|null $tracingData tracingData + * + * @return self + */ + public function setTracingData($tracingData) + { + $this->container['tracingData'] = $tracingData; + + return $this; + } + /** * Gets trackingData * diff --git a/src/Adyen/Model/Transfers/TransferEventEventsDataInner.php b/src/Adyen/Model/Transfers/TransferEventEventsDataInner.php index 391da27f1..f6fb640c0 100644 --- a/src/Adyen/Model/Transfers/TransferEventEventsDataInner.php +++ b/src/Adyen/Model/Transfers/TransferEventEventsDataInner.php @@ -26,7 +26,7 @@ */ class TransferEventEventsDataInner implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = null; + public const DISCRIMINATOR = 'type'; /** * The original name of the model. @@ -41,8 +41,10 @@ class TransferEventEventsDataInner implements ModelInterface, ArrayAccess, \Json * @var string[] */ protected static $openAPITypes = [ - 'captureCycleId' => 'string', + 'interchangeAmount' => '\Adyen\Model\Transfers\Amount', + 'interchangeRateIndicator' => 'string', 'type' => 'string', + 'captureCycleId' => 'string', 'airline' => '\Adyen\Model\Transfers\Airline', 'lodging' => '\Adyen\Model\Transfers\Lodging[]' ]; @@ -55,8 +57,10 @@ class TransferEventEventsDataInner implements ModelInterface, ArrayAccess, \Json * @psalm-var array */ protected static $openAPIFormats = [ - 'captureCycleId' => null, + 'interchangeAmount' => null, + 'interchangeRateIndicator' => null, 'type' => null, + 'captureCycleId' => null, 'airline' => null, 'lodging' => null ]; @@ -67,8 +71,10 @@ class TransferEventEventsDataInner implements ModelInterface, ArrayAccess, \Json * @var boolean[] */ protected static $openAPINullables = [ - 'captureCycleId' => false, + 'interchangeAmount' => false, + 'interchangeRateIndicator' => false, 'type' => false, + 'captureCycleId' => false, 'airline' => false, 'lodging' => false ]; @@ -159,8 +165,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'captureCycleId' => 'captureCycleId', + 'interchangeAmount' => 'interchangeAmount', + 'interchangeRateIndicator' => 'interchangeRateIndicator', 'type' => 'type', + 'captureCycleId' => 'captureCycleId', 'airline' => 'airline', 'lodging' => 'lodging' ]; @@ -171,8 +179,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'captureCycleId' => 'setCaptureCycleId', + 'interchangeAmount' => 'setInterchangeAmount', + 'interchangeRateIndicator' => 'setInterchangeRateIndicator', 'type' => 'setType', + 'captureCycleId' => 'setCaptureCycleId', 'airline' => 'setAirline', 'lodging' => 'setLodging' ]; @@ -183,8 +193,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'captureCycleId' => 'getCaptureCycleId', + 'interchangeAmount' => 'getInterchangeAmount', + 'interchangeRateIndicator' => 'getInterchangeRateIndicator', 'type' => 'getType', + 'captureCycleId' => 'getCaptureCycleId', 'airline' => 'getAirline', 'lodging' => 'getLodging' ]; @@ -245,10 +257,15 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('captureCycleId', $data ?? [], null); + $this->setIfExists('interchangeAmount', $data ?? [], null); + $this->setIfExists('interchangeRateIndicator', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('captureCycleId', $data ?? [], null); $this->setIfExists('airline', $data ?? [], null); $this->setIfExists('lodging', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; } /** @@ -298,25 +315,49 @@ public function valid() /** - * Gets captureCycleId + * Gets interchangeAmount + * + * @return \Adyen\Model\Transfers\Amount|null + */ + public function getInterchangeAmount() + { + return $this->container['interchangeAmount']; + } + + /** + * Sets interchangeAmount + * + * @param \Adyen\Model\Transfers\Amount|null $interchangeAmount interchangeAmount + * + * @return self + */ + public function setInterchangeAmount($interchangeAmount) + { + $this->container['interchangeAmount'] = $interchangeAmount; + + return $this; + } + + /** + * Gets interchangeRateIndicator * * @return string|null */ - public function getCaptureCycleId() + public function getInterchangeRateIndicator() { - return $this->container['captureCycleId']; + return $this->container['interchangeRateIndicator']; } /** - * Sets captureCycleId + * Sets interchangeRateIndicator * - * @param string|null $captureCycleId captureCycleId associated with transfer event. + * @param string|null $interchangeRateIndicator A 3-character alphanumeric code assigned by Visa that identifies the specific interchange reimbursement program a transaction qualified for. The code is assigned based on the card type, entry mode, and security data provided. * * @return self */ - public function setCaptureCycleId($captureCycleId) + public function setInterchangeRateIndicator($interchangeRateIndicator) { - $this->container['captureCycleId'] = $captureCycleId; + $this->container['interchangeRateIndicator'] = $interchangeRateIndicator; return $this; } @@ -345,6 +386,30 @@ public function setType($type) return $this; } + /** + * Gets captureCycleId + * + * @return string|null + */ + public function getCaptureCycleId() + { + return $this->container['captureCycleId']; + } + + /** + * Sets captureCycleId + * + * @param string|null $captureCycleId captureCycleId associated with transfer event. + * + * @return self + */ + public function setCaptureCycleId($captureCycleId) + { + $this->container['captureCycleId'] = $captureCycleId; + + return $this; + } + /** * Gets airline * diff --git a/src/Adyen/Model/Transfers/TransferEventTracingData.php b/src/Adyen/Model/Transfers/TransferEventTracingData.php new file mode 100644 index 000000000..185332b10 --- /dev/null +++ b/src/Adyen/Model/Transfers/TransferEventTracingData.php @@ -0,0 +1,480 @@ + + */ +class TransferEventTracingData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferEvent_tracingData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'fpid' => 'string', + 'type' => 'string', + 'traceNumber' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'fpid' => null, + 'type' => null, + 'traceNumber' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'fpid' => false, + 'type' => false, + 'traceNumber' => 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 = [ + 'fpid' => 'fpid', + 'type' => 'type', + 'traceNumber' => 'traceNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'fpid' => 'setFpid', + 'type' => 'setType', + 'traceNumber' => 'setTraceNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'fpid' => 'getFpid', + 'type' => 'getType', + 'traceNumber' => 'getTraceNumber' + ]; + + /** + * 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('fpid', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('traceNumber', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * 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['fpid'] === null) { + $invalidProperties[] = "'fpid' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + + if ($this->container['traceNumber'] === null) { + $invalidProperties[] = "'traceNumber' 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 fpid + * + * @return string + */ + public function getFpid() + { + return $this->container['fpid']; + } + + /** + * Sets fpid + * + * @param string $fpid The FPS trace number. This is a unique identifier assigned to transfers processed by [FPS](https://www.bankofengland.co.uk/payment-systems/services/faster-payments-service). + * + * @return self + */ + public function setFpid($fpid) + { + $this->container['fpid'] = $fpid; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **usAch** + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets traceNumber + * + * @return string + */ + public function getTraceNumber() + { + return $this->container['traceNumber']; + } + + /** + * Sets traceNumber + * + * @param string $traceNumber The ACH trace number. This is a unique 15-digit identifier assigned to transfers processed by [ACH](https://fiscal.treasury.gov/payments-from-government/automated-clearing-house-ach). + * + * @return self + */ + public function setTraceNumber($traceNumber) + { + $this->container['traceNumber'] = $traceNumber; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/TransferEventTrackingData.php b/src/Adyen/Model/Transfers/TransferEventTrackingData.php index a22821ccd..b0a1fe08d 100644 --- a/src/Adyen/Model/Transfers/TransferEventTrackingData.php +++ b/src/Adyen/Model/Transfers/TransferEventTrackingData.php @@ -28,7 +28,7 @@ */ class TransferEventTrackingData implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = null; + public const DISCRIMINATOR = 'type'; /** * The original name of the model. @@ -251,6 +251,9 @@ public function __construct(?array $data = null) $this->setIfExists('type', $data ?? [], null); $this->setIfExists('estimatedArrivalTime', $data ?? [], null); $this->setIfExists('reason', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; } /** diff --git a/src/Adyen/Model/Transfers/TransferNotificationMerchantData.php b/src/Adyen/Model/Transfers/TransferNotificationMerchantData.php index dc7138126..4688fbf26 100644 --- a/src/Adyen/Model/Transfers/TransferNotificationMerchantData.php +++ b/src/Adyen/Model/Transfers/TransferNotificationMerchantData.php @@ -44,6 +44,7 @@ class TransferNotificationMerchantData implements ModelInterface, ArrayAccess, \ 'acquirerId' => 'string', 'city' => 'string', 'country' => 'string', + 'countryCode' => 'string', 'mcc' => 'string', 'merchantId' => 'string', 'name' => 'string', @@ -61,6 +62,7 @@ class TransferNotificationMerchantData implements ModelInterface, ArrayAccess, \ 'acquirerId' => null, 'city' => null, 'country' => null, + 'countryCode' => null, 'mcc' => null, 'merchantId' => null, 'name' => null, @@ -76,6 +78,7 @@ class TransferNotificationMerchantData implements ModelInterface, ArrayAccess, \ 'acquirerId' => false, 'city' => false, 'country' => false, + 'countryCode' => false, 'mcc' => false, 'merchantId' => false, 'name' => false, @@ -171,6 +174,7 @@ public function isNullableSetToNull(string $property): bool 'acquirerId' => 'acquirerId', 'city' => 'city', 'country' => 'country', + 'countryCode' => 'countryCode', 'mcc' => 'mcc', 'merchantId' => 'merchantId', 'name' => 'name', @@ -186,6 +190,7 @@ public function isNullableSetToNull(string $property): bool 'acquirerId' => 'setAcquirerId', 'city' => 'setCity', 'country' => 'setCountry', + 'countryCode' => 'setCountryCode', 'mcc' => 'setMcc', 'merchantId' => 'setMerchantId', 'name' => 'setName', @@ -201,6 +206,7 @@ public function isNullableSetToNull(string $property): bool 'acquirerId' => 'getAcquirerId', 'city' => 'getCity', 'country' => 'getCountry', + 'countryCode' => 'getCountryCode', 'mcc' => 'getMcc', 'merchantId' => 'getMerchantId', 'name' => 'getName', @@ -267,6 +273,7 @@ public function __construct(?array $data = null) $this->setIfExists('acquirerId', $data ?? [], null); $this->setIfExists('city', $data ?? [], null); $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('countryCode', $data ?? [], null); $this->setIfExists('mcc', $data ?? [], null); $this->setIfExists('merchantId', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -387,6 +394,30 @@ public function setCountry($country) return $this; } + /** + * Gets countryCode + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['countryCode']; + } + + /** + * Sets countryCode + * + * @param string|null $countryCode The two-character country code of the merchant's location, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. + * + * @return self + */ + public function setCountryCode($countryCode) + { + $this->container['countryCode'] = $countryCode; + + return $this; + } + /** * Gets mcc * diff --git a/src/Adyen/Model/Transfers/UKFpsTracingData.php b/src/Adyen/Model/Transfers/UKFpsTracingData.php new file mode 100644 index 000000000..07bbef0e9 --- /dev/null +++ b/src/Adyen/Model/Transfers/UKFpsTracingData.php @@ -0,0 +1,472 @@ + + */ +class UKFpsTracingData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UKFpsTracingData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'fpid' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'fpid' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'fpid' => 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 = [ + 'fpid' => 'fpid', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'fpid' => 'setFpid', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'fpid' => 'getFpid', + '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_UK_FPS = 'ukFps'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_UK_FPS, + ]; + } + /** + * 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('fpid', $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['fpid'] === null) { + $invalidProperties[] = "'fpid' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets fpid + * + * @return string + */ + public function getFpid() + { + return $this->container['fpid']; + } + + /** + * Sets fpid + * + * @param string $fpid The FPS trace number. This is a unique identifier assigned to transfers processed by [FPS](https://www.bankofengland.co.uk/payment-systems/services/faster-payments-service). + * + * @return self + */ + public function setFpid($fpid) + { + $this->container['fpid'] = $fpid; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **ukFps** + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + error_log( + sprintf( + "type: unexpected enum value '%s' - Supported values are [%s]", + $type, + implode(', ', $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/USAchTracingData.php b/src/Adyen/Model/Transfers/USAchTracingData.php new file mode 100644 index 000000000..2fddb943c --- /dev/null +++ b/src/Adyen/Model/Transfers/USAchTracingData.php @@ -0,0 +1,472 @@ + + */ +class USAchTracingData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'USAchTracingData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'traceNumber' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'traceNumber' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'traceNumber' => 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 = [ + 'traceNumber' => 'traceNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'traceNumber' => 'setTraceNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'traceNumber' => 'getTraceNumber', + '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_US_ACH = 'usAch'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_US_ACH, + ]; + } + /** + * 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('traceNumber', $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['traceNumber'] === null) { + $invalidProperties[] = "'traceNumber' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets traceNumber + * + * @return string + */ + public function getTraceNumber() + { + return $this->container['traceNumber']; + } + + /** + * Sets traceNumber + * + * @param string $traceNumber The ACH trace number. This is a unique 15-digit identifier assigned to transfers processed by [ACH](https://fiscal.treasury.gov/payments-from-government/automated-clearing-house-ach). + * + * @return self + */ + public function setTraceNumber($traceNumber) + { + $this->container['traceNumber'] = $traceNumber; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **usAch** + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + error_log( + sprintf( + "type: unexpected enum value '%s' - Supported values are [%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/Service/Transfers/CashOutApi.php b/src/Adyen/Service/Transfers/CashOutApi.php new file mode 100644 index 000000000..df64ae47d --- /dev/null +++ b/src/Adyen/Service/Transfers/CashOutApi.php @@ -0,0 +1,56 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/btl/v4"); + } + + /** + * Initiate a cashout + * + * @param \Adyen\Model\Transfers\CashOutInfo $cashOutInfo + * @param array|null $requestOptions + * @return \Adyen\Model\Transfers\CashOut + * @throws AdyenException + */ + public function initiateCashout(\Adyen\Model\Transfers\CashOutInfo $cashOutInfo, ?array $requestOptions = null): \Adyen\Model\Transfers\CashOut + { + $endpoint = $this->baseURL . "/cashouts"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $cashOutInfo->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Transfers\CashOut::class); + } +}