diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1610eedfe..08bb43df1 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @AlexandrosMor @acampos1916 @peterojo @rikterbeek @morerice @michaelpaul @candemiralp @RokPopov \ No newline at end of file +* @Adyen/integration-tools-testing diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 5a98fdaed..000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: 2 -updates: -- package-ecosystem: composer - directory: "/" - schedule: - interval: daily - time: "04:00" - open-pull-requests-limit: 10 diff --git a/.github/workflows/gh_release.yml b/.github/workflows/gh_release.yml new file mode 100644 index 000000000..35601dfee --- /dev/null +++ b/.github/workflows/gh_release.yml @@ -0,0 +1,16 @@ +name: Github Release + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + gh_release: + permissions: + contents: write + uses: Adyen/adyen-node-api-library/.github/workflows/lib-gh-release.yml@develop + with: + project-name: PHP + secrets: inherit diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7b28e82c0..5392dcb63 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,7 @@ -on: ["push", "pull_request"] name: Main Workflow +on: ["pull_request"] + jobs: run: name: Run @@ -8,14 +9,14 @@ jobs: strategy: matrix: - php-version: [ 7.3, 7.4, 8.0, 8.1, 8.2 ] + php-version: [ 7.3, 8.2 ] steps: - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - tools: composer:v1 + tools: composer:v2 - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/release_request.yml b/.github/workflows/release_request.yml new file mode 100644 index 000000000..b437f0925 --- /dev/null +++ b/.github/workflows/release_request.yml @@ -0,0 +1,23 @@ +name: Release request + +on: + workflow_dispatch: + inputs: + prerelease: + required: false + type: boolean + default: false + description: "This release will be labeled as non-production ready" + push: + branches: + - develop + +jobs: + release: + permissions: + contents: write + pull-requests: write + uses: Adyen/adyen-node-api-library/.github/workflows/lib-release.yml@develop + with: + prerelease: ${{ inputs.prerelease || false }} + secrets: inherit diff --git a/.gitignore b/.gitignore index 6f394b85d..5662d99ca 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ Thumbs.db /.vscode/ /.vagrant/ /.idea/ +Vagrantfile # Packages /vendor/ diff --git a/Makefile b/Makefile index 1bf98c589..b7ba2f110 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ openapi-generator-jar:=target/openapi-generator-cli.jar openapi-generator-cli:=java -jar $(openapi-generator-jar) generator:=php -modelGen:=BalanceControl BalancePlatform Checkout StoredValue Payments Payout Management LegalEntityManagement Transfers BinLookup StoredValue POSTerminalManagement Recurring +modelGen:=BalanceControl BalancePlatform Checkout ConfigurationWebhooks StoredValue Payments Payout Management LegalEntityManagement TransferWebhooks Transfers BinLookup StoredValue POSTerminalManagement Recurring ReportWebhooks models:=src/Adyen/Model output:=target/out @@ -24,6 +24,10 @@ Payout: spec=PayoutService-v68 Management: spec=ManagementService-v1 LegalEntityManagement: spec=LegalEntityService-v3 Transfers: spec=TransferService-v3 +# BalanceWebhooks +ConfigurationWebhooks: spec=BalancePlatformConfigurationNotification-v1 +ReportWebhooks: spec=BalancePlatformReportNotification-v1 +TransferWebhooks: spec=BalancePlatformTransferNotification-v3 # Classic Platforms marketpay/account: spec=AccountService-v6 @@ -39,7 +43,7 @@ $(modelGen): target/spec $(openapi-generator-jar) -g $(generator) \ -o $(output) \ -t ./templates \ - --inline-schema-name-mappings PaymentDonationRequest_paymentMethod=CheckoutPaymentMethod \ + --inline-schema-name-mappings DonationPaymentRequest_paymentMethod=CheckoutPaymentMethod \ --model-package Model\\$@ \ --api-package Service\\$@ \ --reserved-words-mappings configuration=configuration \ @@ -65,7 +69,7 @@ $(Services): target/spec $(openapi-generator-jar) -g $(generator) \ -o $(output) \ -t ./templates \ - --inline-schema-name-mappings PaymentDonationRequest_paymentMethod=CheckoutPaymentMethod \ + --inline-schema-name-mappings DonationPaymentRequest_paymentMethod=CheckoutPaymentMethod \ --model-package Model\\$@ \ --api-package Service\\$@ \ --inline-schema-name-mappings BankAccountInfo_accountIdentification=BankAccount \ @@ -89,7 +93,7 @@ $(SingleFileServices): target/spec $(openapi-generator-jar) -c templates/config.yaml \ --model-package Model\\$@ \ --api-package Service\\$@ \ - --inline-schema-name-mappings PaymentDonationRequest_paymentMethod=CheckoutPaymentMethod \ + --inline-schema-name-mappings DonationPaymentRequest_paymentMethod=CheckoutPaymentMethod \ --reserved-words-mappings configuration=configuration \ --skip-validate-spec \ --additional-properties variableNamingConvention=camelCase \ @@ -99,7 +103,7 @@ $(SingleFileServices): target/spec $(openapi-generator-jar) rm -rf src/Adyen/Service/$@Api src/Adyen/Model/$@ mv $(output)/lib/Model/$@ $(models)/$@ mv $(output)/lib/ObjectSerializer.php $(models)/$@ - mv $(output)/lib/Service/$@/GeneralApiSingle.php src/Adyen/Service/$@Api.php + mv $(output)/lib/Service/$@/*ApiSingle.php src/Adyen/Service/$@Api.php # Checkout spec (and patch version) target/spec: @@ -124,4 +128,12 @@ clean: git clean -f -d $(models) -.PHONY: templates models $(services) \ No newline at end of file +## Releases + +version: + perl -lne 'print "currentVersion=$$1" if /LIB_VERSION = "(.+)";/' < src/Adyen/Client.php >> "$$GITHUB_OUTPUT" + +bump: + perl -i -pe 's/$$ENV{"CURRENT_VERSION"}/$$ENV{"NEXT_VERSION"}/' src/Adyen/Client.php + +.PHONY: templates models $(services) version bump diff --git a/README.md b/README.md index e384c9934..817f4a59b 100644 --- a/README.md +++ b/README.md @@ -11,23 +11,32 @@ The library supports all APIs under the following services: | API | Description | Service Name | Supported version | |------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------|------------------------------------------------------------------| -| [Checkout API](https://docs.adyen.com/api-explorer/#/CheckoutService/v70/overview) | Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). | [Checkout](src/Adyen/Service/Checkout) | **v70** | -| [Payments API](https://docs.adyen.com/api-explorer/#/Payment/v68/overview) | A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods.| [Payments](src/Adyen/Service/Payments) | **v68** | -| [Recurring API](https://docs.adyen.com/api-explorer/#/Recurring/v68/overview) | The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. | [Recurring](src/Adyen/Service/RecurringApi.php) | **v68** | -| [Payouts API](https://docs.adyen.com/api-explorer/#/Payout/v68/overview) | A set of API endpoints that allow you to store payout details, confirm, or decline a payout. | [Payout](src/Adyen/Service/Payout) | **v68** | -| [Adyen BinLookup API](https://docs.adyen.com/api-explorer/#/BinLookup/v54/overview) | Endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. Current supported version | [BinLookup](src/Adyen/Service/BinLookupApi.php) | **v54** | +| [Checkout API](https://docs.adyen.com/api-explorer/Checkout/70/overview) | Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). | [Checkout](src/Adyen/Service/Checkout) | **v70** | +| [Payments API](https://docs.adyen.com/api-explorer/Payment/68/overview) | A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods.| [Payments](src/Adyen/Service/Payments) | **v68** | +| [Recurring API](https://docs.adyen.com/api-explorer/Recurring/68/overview) | The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. | [Recurring](src/Adyen/Service/RecurringApi.php) | **v68** | +| [Payouts API](https://docs.adyen.com/api-explorer/Payout/68/overview) | A set of API endpoints that allow you to store payout details, confirm, or decline a payout. | [Payout](src/Adyen/Service/Payout) | **v68** | +| [Adyen BinLookup API](https://docs.adyen.com/api-explorer/BinLookup/54/overview) | Endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. Current supported version | [BinLookup](src/Adyen/Service/BinLookupApi.php) | **v54** | | [Stored Value API](https://docs.adyen.com/payment-methods/gift-cards/stored-value-api) | Manage both online and point-of-sale gift cards and other stored-value cards. | [StoredValue](src/Adyen/Service/StoredValueApi.php) | **v46** | | [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/3/overview) | The Legal Entity Management API enables you to manage legal entities that contain information required for verification | [LegalEntityManagement](src/Adyen/Service/LegalEntityManagement) | **v3** | | [Transfers API](https://docs.adyen.com/api-explorer/transfers/3/overview) | The Transfers API provides endpoints that you can use to get information about all your transactions, move funds within your balance platform or send funds from your balance platform to a transfer instrument. | [Transfers](src/Adyen/Service/Transfers) | **v3** | | [Balance Control API](https://docs.adyen.com/api-explorer/BalanceControl/1/overview) | The Balance Control API lets you transfer funds between merchant accounts that belong to the same legal entity and are under the same company account. | [BalanceControl](src/Adyen/Service/BalanceControlApi.php) | **v1** | | [Data Protection API](https://docs.adyen.com/development-resources/data-protection-api) | Our Data Protection API allows you to process Subject Erasure Requests as mandated in General Data Protection Regulation (GDPR). | [DataProtection](src/Adyen/Service/DataProtectionApi.php) | **v1** | -| [Hosted Onboarding API](https://docs.adyen.com/api-explorer/#/Hop/v1/overview) | The Hosted onboarding API provides endpoints that you can use to generate links to Adyen-hosted pages, such as an onboarding page or a PCI compliance questionnaire. You can provide these links to your account holders so that they can complete their onboarding. | [HostedOnboardingPages](src/Adyen/Service/Hop.php) | **v1** | -| [Account API](https://docs.adyen.com/api-explorer/#/Account/v5/overview) | The Account API provides endpoints for managing account-related entities on your platform. These related entities include account holders, accounts, bank accounts, shareholders, and verification-related documents. The management operations include actions such as creation, retrieval, updating, and deletion of them. | [Account](src/Adyen/Service/Account.php) | **v5** | -| [Fund API](https://docs.adyen.com/api-explorer/#/Fund/v5/overview) | The Fund API provides endpoints for managing the funds in the accounts on your platform. These management operations include, for example, the transfer of funds from one account to another, the payout of funds to an account holder, and the retrieval of balances in an account. | [Fund](src/Adyen/Service/Fund.php) | **v5** | +| [Hosted Onboarding API](https://docs.adyen.com/api-explorer/Hop/1/overview) | The Hosted onboarding API provides endpoints that you can use to generate links to Adyen-hosted pages, such as an onboarding page or a PCI compliance questionnaire. You can provide these links to your account holders so that they can complete their onboarding. | [HostedOnboardingPages](src/Adyen/Service/Hop.php) | **v1** | +| [Account API](https://docs.adyen.com/api-explorer/Account/5/overview) | The Account API provides endpoints for managing account-related entities on your platform. These related entities include account holders, accounts, bank accounts, shareholders, and verification-related documents. The management operations include actions such as creation, retrieval, updating, and deletion of them. | [Account](src/Adyen/Service/Account.php) | **v5** | +| [Fund API](https://docs.adyen.com/api-explorer/Fund/5/overview) | The Fund API provides endpoints for managing the funds in the accounts on your platform. These management operations include, for example, the transfer of funds from one account to another, the payout of funds to an account holder, and the retrieval of balances in an account. | [Fund](src/Adyen/Service/Fund.php) | **v5** | | [Terminal API (Cloud communications)](https://docs.adyen.com/point-of-sale/choose-your-architecture/cloud) | Our point-of-sale integration. | [Cloud-based Terminal API](src/Adyen/Service/PosPayment.php) | Cloud-based Terminal API | | | [Terminal API (Local communications)](https://docs.adyen.com/point-of-sale/choose-your-architecture/local) | Our point-of-sale integration. | [Local-based Terminal API](src/Adyen/Service/PosPayment.php) | Local-based Terminal API | | -| [POS Terminal Management API](https://docs.adyen.com/api-explorer/#/postfmapi/v1/overview) | This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. | [POSTerminalManagement](src/Adyen/Service/POSTerminalManagementApi.php) | **v1** | +| [POS Terminal Management API](https://docs.adyen.com/api-explorer/postfmapi/1/overview) | This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. | [POSTerminalManagement](src/Adyen/Service/POSTerminalManagementApi.php) | **v1** | +## Supported Webhook versions +The library supports all webhooks under the following model directories: + +| Webhooks | Description | Model Name | Supported Version | +|---------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|-------------------| +| [Configuration Webhooks](https://docs.adyen.com/api-explorer/balanceplatform-webhooks/1/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update internal statuses when the status of a capability is changed. | [ConfigurationNotification](src/Adyen/Model/ConfigurationWebhooks) | **v1** | +| [Transfer Webhooks](https://docs.adyen.com/api-explorer/transfer-webhooks/3/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update balances in your own dashboards or to keep track of incoming funds. | [TransferNotification](src/Adyen/Model/TransferWebhooks) | **v3** | +| [Report Webhooks](https://docs.adyen.com/api-explorer/report-webhooks/1/overview) | You can download reports programmatically by making an HTTP GET request, or manually from your Balance Platform Customer Area | [ReportNotification](src/Adyen/Model/ReportWebhooks) | **v1** | +| [Notification Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) | We use webhooks to send you updates about payment status updates, newly available reports, and other events that you can subscribe to. For more information, refer to our documentation | [Notification](src/Adyen/Service/Notification.php) | **v1** | For more information, refer to our [documentation](https://docs.adyen.com/) or the [API Explorer](https://docs.adyen.com/api-explorer/). @@ -38,8 +47,8 @@ For more information, refer to our [documentation](https://docs.adyen.com/) or t - [API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). For testing, your API credential needs to have the [API PCI Payments role](https://docs.adyen.com/development-resources/api-credentials#roles). - PHP 7.3 or later - cURL with SSL support. -- The JSON PHP extension. -- See [composer require list](https://github.com/Adyen/adyen-php-api-library/blob/develop/composer.json#L10) for the complete list of dependencies +- The PHP extensions: ctype, curl, json, mbstring and openssl. +- See [composer require list](https://github.com/Adyen/adyen-php-api-library/blob/develop/composer.json#L10) for the complete list of dependencies. ### Legacy version support @@ -146,6 +155,18 @@ $result = $service->paymentLinks($createPaymentLinkRequest); $paymentLink = $result->getUrl(); // or use $result['url'] if you want to use arrayAccess ~~~~ +### Using Banking Webhooks +~~~~ php +... + +$jsonString = 'webhook_payload'; +$isValid = $hmac->validateHMAC("YOUR_HMAC_KEY", "YOUR_HMAC_SIGN", $jsonString); + +if ($isValid) { + $webhookParser = new BankingWebhookParser($jsonString); + $result = $webhookParser->getGenericWebhook(); +} +~~~~ ### Example integration @@ -156,6 +177,9 @@ For the test cases you need the PCI permission enabled on you account. There are By default the test will then be skipped. If you have these permissions fill in your account details in the config/test.ini file to let the test work. To make the automatic testing cases work for your account change the credentials in the config/test.ini file. +## Feedback +We value your input! Help us enhance our API Libraries and improve the integration experience by providing your feedback. Please take a moment to fill out [our feedback form](https://forms.gle/A4EERrR6CWgKWe5r9) to share your thoughts, suggestions or ideas. + ## Contributing We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements. diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index 728ae5035..000000000 --- a/Vagrantfile +++ /dev/null @@ -1,29 +0,0 @@ -$script = <<-SCRIPT -sudo apt-get update -sudo apt-get install unzip wget nano php7.4 php7.4-common php7.4-opcache php7.4-cli php7.4-curl php7.4-xml php7.4-mbstring php7.4-xdebug -y -cd /home/vagrant/adyen-php-api-library -echo "Installing composer" -sh bin/composer-installer.sh -if [ $? -ne 0 ] - then - echo "Failed installing composer" - exit 1 - else - echo "Composer installed successfully" - sudo mv composer.phar /bin/composer - sudo chmod a+x /bin/composer - composer install -fi -SCRIPT - -Vagrant.configure("2") do |config| - config.vm.box = "mpasternak/focal64-arm" - config.vm.network "private_network", ip: "192.168.58.30" - config.vm.provider :parallels do |v| - v.memory = "4096" - v.cpus = 2 - end - config.vm.synced_folder '.', '/home/vagrant/adyen-php-api-library', disabled: false - config.vm.network :forwarded_port, guest:3000, host: 3000 - config.vm.provision "shell", inline: $script -end diff --git a/composer.json b/composer.json index c453b9c48..2cb6d0fa4 100644 --- a/composer.json +++ b/composer.json @@ -13,14 +13,13 @@ "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "ext-openssl": "*", - "monolog/monolog": "^1.16 || ^2.0 || ^3.0" + "ext-openssl": "*" }, "require-dev": { - "dms/phpunit-arraysubset-asserts": "0.4.0", + "dms/phpunit-arraysubset-asserts": "0.5.0", "friendsofphp/php-cs-fixer": "*", - "phpunit/phpunit": "9.6.7", - "php-coveralls/php-coveralls": "2.5.3", + "phpunit/phpunit": "9.6.10", + "php-coveralls/php-coveralls": "2.6.0", "squizlabs/php_codesniffer": "3.7.2" }, "autoload": { @@ -33,4 +32,4 @@ "Adyen\\Tests\\": "tests/" } } -} \ No newline at end of file +} diff --git a/src/Adyen/AdyenException.php b/src/Adyen/AdyenException.php index 3169738a2..454f549f3 100644 --- a/src/Adyen/AdyenException.php +++ b/src/Adyen/AdyenException.php @@ -31,7 +31,7 @@ class AdyenException extends Exception * * @param string $message * @param int $code - * @param Exception|null $previous + * @param \Throwable|null $previous * @param string|null $status * @param string|null $errorType * @param string|null $pspReference @@ -40,7 +40,7 @@ class AdyenException extends Exception public function __construct( $message = "", $code = 0, - Exception $previous = null, + \Throwable $previous = null, $status = null, $errorType = null, $pspReference = null, diff --git a/src/Adyen/Client.php b/src/Adyen/Client.php index efbedac63..f9dfc2961 100644 --- a/src/Adyen/Client.php +++ b/src/Adyen/Client.php @@ -4,13 +4,10 @@ use Adyen\HttpClient\ClientInterface; use Adyen\HttpClient\CurlClient; -use Psr\Log\LoggerInterface; -use Monolog\Logger; -use Monolog\Handler\StreamHandler; class Client { - const LIB_VERSION = "15.0.0-beta"; + const LIB_VERSION = "15.0.0"; const LIB_NAME = "adyen-php-api-library"; const USER_AGENT_SUFFIX = "adyen-php-api-library/"; const ENDPOINT_TEST = "https://pal-test.adyen.com"; @@ -53,7 +50,7 @@ class Client const MANAGEMENT_API = "v1"; /** - * @var Config|ConfigInterface + * @var Config */ private $config; @@ -62,38 +59,12 @@ class Client */ private $httpClient; - /** - * @var LoggerInterface|null - */ - private $logger; - - /** - * Client constructor. - * - * @param ConfigInterface|null $config - * @throws AdyenException - */ - public function __construct($config = null) + public function __construct(?Config $config = null) { - if ($config === null) { - // Create config - $config = new Config(); - } - - if (! $config instanceof ConfigInterface) { - throw new \Adyen\AdyenException( - 'This config object is not supported,' . - ' you need to implement the ConfigInterface' - ); - } - - $this->config = $config; + $this->config = $config ?? new Config(); } - /** - * @return Config|ConfigInterface - */ - public function getConfig() + public function getConfig(): ?Config { return $this->config; } @@ -133,11 +104,21 @@ public function setXApiKey($xApiKey) * * @param string $proxy */ - public function setHttpProxy($proxy) + public function setHttpProxy(string $proxy) { $this->config->set('http-proxy', $proxy); } + /** + * Set the path to a CA bundle file that enables verification using a custom certificate + * + * @param string $certFilePath + */ + public function setSslVerify(string $certFilePath) + { + $this->config->set('ssl-verify', $certFilePath); + } + /** * Set environment to connect to test or live platform of Adyen * For live please specify the unique identifier. @@ -147,12 +128,11 @@ public function setHttpProxy($proxy) * menu in the Adyen Customer Area * @throws AdyenException */ - public function setEnvironment($environment, $liveEndpointUrlPrefix = null) + public function setEnvironment(string $environment, ?string $liveEndpointUrlPrefix = null) { - if ($environment == \Adyen\Environment::TEST) { - $this->config->set('environment', \Adyen\Environment::TEST); + if ($environment == Environment::TEST) { + $this->config->set('environment', Environment::TEST); $this->config->set('endpoint', self::ENDPOINT_TEST); - $this->config->set('endpointDirectorylookup', self::ENDPOINT_TEST_DIRECTORY_LOOKUP); $this->config->set('endpointTerminalCloud', self::ENDPOINT_TERMINAL_CLOUD_TEST); $this->config->set('endpointCheckout', self::ENDPOINT_CHECKOUT_TEST); $this->config->set('endpointNotification', self::ENDPOINT_NOTIFICATION_TEST); @@ -162,9 +142,8 @@ public function setEnvironment($environment, $liveEndpointUrlPrefix = null) $this->config->set('endpointCustomerArea', self::ENDPOINT_CUSTOMER_AREA_TEST); $this->config->set('endpointHop', self::ENDPOINT_HOP_TEST); $this->config->set('endpointManagementApi', self::MANAGEMENT_API_TEST); - } elseif ($environment == \Adyen\Environment::LIVE) { - $this->config->set('environment', \Adyen\Environment::LIVE); - $this->config->set('endpointDirectorylookup', self::ENDPOINT_LIVE_DIRECTORY_LOOKUP); + } elseif ($environment == Environment::LIVE) { + $this->config->set('environment', Environment::LIVE); $this->config->set('endpointTerminalCloud', self::ENDPOINT_TERMINAL_CLOUD_LIVE); $this->config->set('endpointNotification', self::ENDPOINT_NOTIFICATION_LIVE); $this->config->set('endpointAccount', self::ENDPOINT_ACCOUNT_LIVE); @@ -190,9 +169,8 @@ public function setEnvironment($environment, $liveEndpointUrlPrefix = null) } } else { // environment does not exist - $msg = "This environment does not exist, use " . - \Adyen\Environment::TEST . ' or ' . \Adyen\Environment::LIVE; - throw new \Adyen\AdyenException($msg); + $msg = "This environment does not exist, use " . Environment::TEST . ' or ' . Environment::LIVE; + throw new AdyenException($msg); } } @@ -206,16 +184,6 @@ public function setRequestUrl($url) $this->config->set('endpoint', $url); } - /** - * Set directory lookup URL - * - * @param $url - */ - public function setDirectoryLookupUrl($url) - { - $this->config->set('endpointDirectorylookup', $url); - } - /** * @param $merchantAccount */ @@ -239,7 +207,7 @@ public function setApplicationName($applicationName) * @param string $version * @param string $integrator */ - public function setExternalPlatform($name, $version, $integrator = "") + public function setExternalPlatform(string $name, string $version, string $integrator = "") { $this->config->set( 'externalPlatform', @@ -253,9 +221,9 @@ public function setExternalPlatform($name, $version, $integrator = "") * @param string $name * @param string $version */ - public function setAdyenPaymentSource($name, $version) + public function setAdyenPaymentSource(string $name, string $version) { - $this->config->set('adyenPaymentSource', array('name' => $name, 'version' => $version)); + $this->config->set('adyenPaymentSource', ['name' => $name, 'version' => $version]); } /** @@ -264,9 +232,9 @@ public function setAdyenPaymentSource($name, $version) * @param string $name * @param string $version */ - public function setMerchantApplication($name, $version) + public function setMerchantApplication(string $name, string $version) { - $this->config->set('merchantApplication', array('name' => $name, 'version' => $version)); + $this->config->set('merchantApplication', ['name' => $name, 'version' => $version]); } /** @@ -301,8 +269,9 @@ public function setTimeout($value) * Get the library name * * @return string + * @deprecated */ - public function getLibraryName() + public function getLibraryName(): string { return self::LIB_NAME; } @@ -311,8 +280,9 @@ public function getLibraryName() * Get the library version * * @return string + * @deprecated */ - public function getLibraryVersion() + public function getLibraryVersion(): string { return self::LIB_VERSION; } @@ -321,8 +291,9 @@ public function getLibraryVersion() * Get the version of the API Payment endpoint * * @return string + * @deprecated */ - public function getApiPaymentVersion() + public function getApiPaymentVersion(): string { return self::API_PAYMENT_VERSION; } @@ -331,8 +302,9 @@ public function getApiPaymentVersion() * Get the version of the API BinLookUp endpoint * * @return string + * @deprecated */ - public function getApiBinLookupVersion() + public function getApiBinLookupVersion(): string { return self::API_BIN_LOOKUP_VERSION; } @@ -341,8 +313,9 @@ public function getApiBinLookupVersion() * Get the version of the API Payout endpoint * * @return string + * @deprecated */ - public function getApiPayoutVersion() + public function getApiPayoutVersion(): string { return self::API_PAYOUT_VERSION; } @@ -351,8 +324,9 @@ public function getApiPayoutVersion() * Get the version of the Recurring API endpoint * * @return string + * @deprecated */ - public function getApiRecurringVersion() + public function getApiRecurringVersion(): string { return self::API_RECURRING_VERSION; } @@ -361,8 +335,9 @@ public function getApiRecurringVersion() * Get the version of the Checkout API endpoint * * @return string + * @deprecated */ - public function getApiCheckoutVersion() + public function getApiCheckoutVersion(): string { return self::API_CHECKOUT_VERSION; } @@ -371,8 +346,9 @@ public function getApiCheckoutVersion() * Get the version of the Checkout Utility API endpoint * * @return string + * @deprecated */ - public function getApiCheckoutUtilityVersion() + public function getApiCheckoutUtilityVersion(): string { return self::API_CHECKOUT_UTILITY_VERSION; } @@ -381,8 +357,9 @@ public function getApiCheckoutUtilityVersion() * Get the version of the Notification API endpoint * * @return string + * @deprecated */ - public function getApiNotificationVersion() + public function getApiNotificationVersion(): string { return self::API_NOTIFICATION_VERSION; } @@ -391,8 +368,9 @@ public function getApiNotificationVersion() * Get the version of the Account API endpoint * * @return string + * @deprecated */ - public function getApiAccountVersion() + public function getApiAccountVersion(): string { return self::API_ACCOUNT_VERSION; } @@ -401,8 +379,9 @@ public function getApiAccountVersion() * Get the version of the HOP (Hosted Onboarding Page) API endpoint * * @return string + * @deprecated */ - public function getApiHopVersion() + public function getApiHopVersion(): string { return self::API_HOP_VERSION; } @@ -411,8 +390,9 @@ public function getApiHopVersion() * Get the version of the Fund API endpoint * * @return string + * @deprecated */ - public function getApiFundVersion() + public function getApiFundVersion(): string { return self::API_FUND_VERSION; } @@ -421,8 +401,9 @@ public function getApiFundVersion() * Get the disputes service API version * * @return string + * @deprecated */ - public function getDisputeServiceVersion() + public function getDisputeServiceVersion(): string { return self::API_DISPUTE_SERVICE_VERSION; } @@ -431,8 +412,9 @@ public function getDisputeServiceVersion() * Get the version of the management API endpoint * * @return string + * @deprecated */ - public function getManagementApiVersion() + public function getManagementApiVersion(): string { return self::MANAGEMENT_API; } @@ -459,50 +441,11 @@ public function getHttpClient() /** * @return CurlClient */ - protected function createDefaultHttpClient() + protected function createDefaultHttpClient(): CurlClient { return new CurlClient(); } - /** - * Set the Logger object - * - * @param LoggerInterface $logger - * - * @deprecated Please do not use Logger as we will deprecate this in the - * future for improvements on the library - */ - public function setLogger(LoggerInterface $logger) - { - $this->logger = $logger; - } - - /** - * @return LoggerInterface - * - * @deprecated Please do not use Logger as we will deprecate this in the - * future for improvements on the library - */ - public function getLogger() - { - if ($this->logger === null) { - $this->logger = $this->createDefaultLogger(); - } - - return $this->logger; - } - - /** - * @return Logger - */ - protected function createDefaultLogger() - { - $logger = new Logger('adyen-php-api-library'); - $logger->pushHandler(new StreamHandler('php://stderr', Logger::NOTICE)); - - return $logger; - } - /** * @param string $region * @return void diff --git a/src/Adyen/Config.php b/src/Adyen/Config.php index 93e300e28..febdbc692 100644 --- a/src/Adyen/Config.php +++ b/src/Adyen/Config.php @@ -2,17 +2,17 @@ namespace Adyen; -class Config implements ConfigInterface +class Config { /** * @var array */ - protected $data = array(); + protected $data = []; /** * @var array */ - protected $allowedInput = array('array', 'json'); + protected $allowedInput = ['array', 'json']; /** * @var string @@ -22,7 +22,7 @@ class Config implements ConfigInterface /** * @var array */ - protected $allowedOutput = array('array', 'json'); + protected $allowedOutput = ['array', 'json']; /** * @var string @@ -36,7 +36,7 @@ class Config implements ConfigInterface */ public function __construct(array $params = null) { - if ($params && is_array($params)) { + if ($params) { foreach ($params as $key => $param) { $this->data[$key] = $param; } @@ -50,9 +50,9 @@ public function __construct(array $params = null) * * @return mixed|null Value of the key or NULL */ - public function get($key) + public function get(string $key) { - return isset($this->data[$key]) ? $this->data[$key] : null; + return $this->data[$key] ?? null; } /** @@ -61,7 +61,7 @@ public function get($key) * @param string $key Key to set * @param mixed $value Value to set */ - public function set($key, $value) + public function set(string $key, $value) { $this->data[$key] = $value; } @@ -71,7 +71,7 @@ public function set($key, $value) */ public function getUsername() { - return isset($this->data['username']) ? $this->data['username'] : null; + return $this->data['username'] ?? null; } /** @@ -79,7 +79,7 @@ public function getUsername() */ public function getPassword() { - return isset($this->data['password']) ? $this->data['password'] : null; + return $this->data['password'] ?? null; } /** @@ -102,6 +102,16 @@ public function getHttpProxy() return !empty($this->data['http-proxy']) ? $this->data['http-proxy'] : null; } + /** + * Get the path to a CA bundle file that enables verification using a custom certificate + * + * @return mixed|null + */ + public function getSslVerify() + { + return !empty($this->data['ssl-verify']) ? $this->data['ssl-verify'] : null; + } + /** * @return mixed|string */ @@ -139,7 +149,7 @@ public function getTimeout() */ public function getMerchantAccount() { - return isset($this->data['merchantAccount']) ? $this->data['merchantAccount'] : null; + return $this->data['merchantAccount'] ?? null; } /** @@ -147,15 +157,15 @@ public function getMerchantAccount() */ public function getAdyenPaymentSource() { - return isset($this->data['adyenPaymentSource']) ? $this->data['adyenPaymentSource'] : null; + return $this->data['adyenPaymentSource'] ?? null; } /** * @return array|null an array with 'name' and 'version' */ - public function getMerchantApplication() + public function getMerchantApplication(): ?array { - return isset($this->data['merchantApplication']) ? $this->data['merchantApplication'] : null; + return $this->data['merchantApplication'] ?? null; } /** @@ -163,14 +173,14 @@ public function getMerchantApplication() */ public function getExternalPlatform() { - return isset($this->data['externalPlatform']) ? $this->data['externalPlatform'] : null; + return $this->data['externalPlatform'] ?? null; } /** * @return string|null */ - public function getEnvironment() + public function getEnvironment(): ?string { - return isset($this->data['environment']) ? $this->data['environment'] : null; + return $this->data['environment'] ?? null; } } diff --git a/src/Adyen/ConfigInterface.php b/src/Adyen/ConfigInterface.php deleted file mode 100644 index 1b5dc0800..000000000 --- a/src/Adyen/ConfigInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - array( - 'paymentData' - ) - ); - - // List of parameters that needs to be masked with the same array structure as it appears in - // the request array - - private static $requestParamsToMask = array( - 'paymentData', - 'card' => array( - 'number', - 'cvc' - ), - 'additionalData' => array( - 'card.encrypted.json' - ), - 'paymentMethod' => array( - 'number', - 'expiryMonth', - 'expiryYear', - 'cvc', - 'encryptedCardNumber', - 'encryptedExpiryMonth', - 'encryptedExpiryYear', - 'encryptedSecurityCode', - 'applepay.token', - 'paywithgoogle.token' - ) - ); - /** * Json API request to Adyen * - * @param \Adyen\Service $service + * @param Service $service * @param $requestUrl * @param $params + * @param null $requestOptions * @return mixed * @throws AdyenException + * @throws ConnectionException */ - public function requestJson(\Adyen\Service $service, $requestUrl, $params, $requestOptions = null) + public function requestJson(Service $service, $requestUrl, $params, $requestOptions = null) { return $this->requestHttp($service, $requestUrl, $params, 'post', $requestOptions); } @@ -65,21 +35,25 @@ public function requestJson(\Adyen\Service $service, $requestUrl, $params, $requ * Set httpProxy in the current curl configuration * * @param resource $ch - * @param string $httpProxy + * @param string|null $httpProxy * @throws AdyenException */ - public function curlSetHttpProxy($ch, $httpProxy) + public function curlSetHttpProxy($ch, ?string $httpProxy) { if (empty($httpProxy)) { return; } $urlParts = parse_url($httpProxy); - if ($urlParts == false || !array_key_exists("host", $urlParts)) { + if (!$urlParts || !array_key_exists("host", $urlParts)) { throw new AdyenException("Invalid proxy configuration " . $httpProxy); } - $proxy = $urlParts["host"]; + $proxy = ""; + if (isset($urlParts["scheme"])) { + $proxy = $urlParts["scheme"] . "://"; + } + $proxy .= $urlParts["host"]; if (isset($urlParts["port"])) { $proxy .= ":" . $urlParts["port"]; } @@ -90,27 +64,46 @@ public function curlSetHttpProxy($ch, $httpProxy) } } + /** + * Set the path to a custom CA bundle in the current curl configuration. + * + * @param resource $ch + * @param string|null $certFilePath + * @throws AdyenException + */ + public function curlSetSslVerify($ch, ?string $certFilePath) + { + if (empty($certFilePath)) { + return; + } + + if (!file_exists($certFilePath)) { + throw new AdyenException("SSL CA bundle not found: $certFilePath"); + } + + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); + curl_setopt($ch, CURLOPT_CAINFO, $certFilePath); + } + /** * Request to Adyen with query string used for Directory Lookup * - * @param \Adyen\Service $service + * @param Service $service * @param $requestUrl * @param $params * @return mixed * @throws AdyenException + * @throws ConnectionException */ - public function requestPost(\Adyen\Service $service, $requestUrl, $params) + public function requestPost(Service $service, $requestUrl, $params) { $client = $service->getClient(); $config = $client->getConfig(); - $logger = $client->getLogger(); $username = $config->getUsername(); $password = $config->getPassword(); $httpProxy = $config->getHttpProxy(); - $environment = $config->getEnvironment(); - - // Log the request - $this->logRequest($logger, $requestUrl, $environment, $params); + $sslVerify = $config->getSslVerify(); // Initiate cURL. $ch = curl_init($requestUrl); @@ -119,6 +112,7 @@ public function requestPost(\Adyen\Service $service, $requestUrl, $params) curl_setopt($ch, CURLOPT_POST, 1); $this->curlSetHttpProxy($ch, $httpProxy); + $this->curlSetSslVerify($ch, $sslVerify); // set authorisation curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); @@ -128,7 +122,7 @@ public function requestPost(\Adyen\Service $service, $requestUrl, $params) // set a custom User-Agent $userAgent = $config->get('applicationName') . " " . - \Adyen\Client::USER_AGENT_SUFFIX . $client->getLibraryVersion(); + Client::USER_AGENT_SUFFIX . $client->getLibraryVersion(); // Add application info in headers $libraryName = self::LIBRARY_NAME . $client->getLibraryName(); @@ -148,23 +142,19 @@ public function requestPost(\Adyen\Service $service, $requestUrl, $params) curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Execute the request - list($result, $httpStatus) = $this->curlRequest($ch); - - // Log the response - $decodedResult = json_decode($result, true); - $this->logResponse($logger, $environment, $decodedResult); + [$result, $httpStatus] = $this->curlRequest($ch); // Get errors - list($errno, $message) = $this->curlError($ch); + [$errno] = $this->curlError($ch); curl_close($ch); $resultOKHttpStatusCodes = array(200, 201, 202, 204); if (!in_array($httpStatus, $resultOKHttpStatusCodes) && $result) { - $this->handleResultError($result, $logger); + $this->handleResultError($result); } elseif (!$result) { - $this->handleCurlError($requestUrl, $errno, $message, $logger); + $this->handleCurlError($requestUrl, $errno); } // Result in array or json @@ -174,7 +164,6 @@ public function requestPost(\Adyen\Service $service, $requestUrl, $params) if (!$result) { $msg = "The result is empty, looks like your request is invalid"; - $logger->error($msg); throw new AdyenException($msg); } } @@ -188,11 +177,9 @@ public function requestPost(\Adyen\Service $service, $requestUrl, $params) * * @param $url * @param $errno - * @param $message - * @param $logger - * @throws \Adyen\ConnectionException + * @throws ConnectionException */ - protected function handleCurlError($url, $errno, $message, $logger) + protected function handleCurlError($url, $errno) { switch ($errno) { case CURLE_OK: @@ -213,136 +200,43 @@ protected function handleCurlError($url, $errno, $message, $logger) default: $msg = "Unexpected error communicating with Adyen."; } - $msg .= "\n(Network error [errno $errno]: $message)"; - $logger->error($msg); - throw new \Adyen\ConnectionException($msg, $errno); + throw new ConnectionException($msg, $errno); } /** * Handle result errors from Adyen * * @param $result - * @param $logger * @throws AdyenException */ - protected function handleResultError($result, $logger) + protected function handleResultError($result) { $decodeResult = json_decode($result, true); if (isset($decodeResult['message']) && isset($decodeResult['errorCode'])) { - $logger->error($decodeResult['errorCode'] . ': ' . $decodeResult['message']); throw new AdyenException( $decodeResult['message'], $decodeResult['status'], null, $decodeResult['status'], $decodeResult['errorType'], - isset($decodeResult['pspReference']) ? $decodeResult['pspReference'] : null, + $decodeResult['pspReference'] ?? null, $decodeResult['errorCode'] ); } - $logger->error($result); throw new AdyenException($result); } - /** - * Logs the API request, removing sensitive data - * - * @param \Psr\Log\LoggerInterface $logger - * @param string requestUrl - * @param string $environment - * @param array $params - */ - private function logRequest(\Psr\Log\LoggerInterface $logger, $requestUrl, $environment, $params) - { - // log the requestUr, params and json request - $logger->info("Request url to Adyen: " . $requestUrl); - - // Filter sensitive data from logs when live - if (\Adyen\Environment::LIVE == $environment) { - $params = $this->maskParametersRecursive(self::$requestParamsToMask, $params); - } - - $logger->info('JSON Request to Adyen:' . json_encode($params)); - } - - /** - * Logs the API request, removing sensitive data - * - * @param \Psr\Log\LoggerInterface $logger - * @param string requestUrl - * @param string $environment - * @param array $params - */ - private function logResponse(\Psr\Log\LoggerInterface $logger, $environment, $params) - { - // Filter sensitive data from logs when live - if (\Adyen\Environment::LIVE == $environment) { - $params = $this->maskParametersRecursive(self::$responseParamsToMask, $params); - } - - $logger->info('JSON Response to Adyen:' . json_encode($params)); - } - - /** - * @param $value - * @param $key - * @param $param - */ - private function maskParametersRecursive($paramsToMaskList, $params) - { - if (is_array($paramsToMaskList)) { - foreach ($paramsToMaskList as $key => $paramsToMask) { - if (is_array($paramsToMask) && isset($params[$key])) { - // if $paramsToMask is an array and $params[$key] exists, $paramsToMask is an array of keys - $params[$key] = $this->maskParametersRecursive($paramsToMask, $params[$key]); - } elseif (!is_array($paramsToMask) && isset($params[$paramsToMask])) { - // if $paramsToMask is not an array and $params[$paramsToMask] exists, $params[$paramsToMask] is - // a parameter that needs to be masked - $params[$paramsToMask] = $this->maskParameter($params[$paramsToMask]); - } - } - } else { - // in case $paramsToMaskList is not an array then it is a parameter that needs to be masked - $params[$paramsToMaskList] = $this->maskParameter($params[$paramsToMaskList]); - } - - return $params; - } - - /** - * Masks the parameter - * If the value is longer than 6 char then 3 asterisks are appended to the first 6 char of the value - * If the value is shorter than 6 char then replace all the chars with asterisks - * - * @param $parameter - * @return string - */ - private function maskParameter($parameter) - { - if (empty($parameter)) { - return $parameter; - } - - if (strlen($parameter) > 6) { - $parameter = substr($parameter, 0, 6) . '***'; - } else { - $parameter = str_repeat('*', strlen($parameter)); - } - - return $parameter; - } - /** * Execute curl, return the result and the http response code * * @param $ch * @return array */ - protected function curlRequest($ch) + protected function curlRequest($ch): array { $result = curl_exec($ch); $httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE); - return array($result, $httpStatus); + return [$result, $httpStatus]; } /** @@ -351,29 +245,29 @@ protected function curlRequest($ch) * @param $ch * @return array */ - protected function curlError($ch) + protected function curlError($ch): array { $errno = curl_errno($ch); $message = curl_error($ch); - return array($errno, $message); + return [$errno, $message]; } - public function requestHttp(\Adyen\Service $service, $requestUrl, $params, $method, $requestOptions = null) + /** + * @throws ConnectionException + * @throws AdyenException + */ + public function requestHttp(Service $service, $requestUrl, $params, $method, $requestOptions = null) { $client = $service->getClient(); $config = $client->getConfig(); - $logger = $client->getLogger(); $username = $config->getUsername(); $password = $config->getPassword(); $xApiKey = $config->getXApiKey(); $httpProxy = $config->getHttpProxy(); - $environment = $config->getEnvironment(); + $sslVerify = $config->getSslVerify(); $jsonRequest = json_encode($params); - // Log the request - $this->logRequest($logger, $requestUrl, $environment, $params); - // Initiate cURL. $ch = curl_init($requestUrl); @@ -394,10 +288,11 @@ public function requestHttp(\Adyen\Service $service, $requestUrl, $params, $meth } $this->curlSetHttpProxy($ch, $httpProxy); + $this->curlSetSslVerify($ch, $sslVerify); // Create a custom User-Agent $userAgent = $config->get('applicationName') . " " . - \Adyen\Client::USER_AGENT_SUFFIX . $client->getLibraryVersion(); + Client::USER_AGENT_SUFFIX . $client->getLibraryVersion(); // Add application info in headers $libraryName = self::LIBRARY_NAME . $client->getLibraryName(); @@ -441,23 +336,19 @@ public function requestHttp(\Adyen\Service $service, $requestUrl, $params, $meth curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Execute the request - list($result, $httpStatus) = $this->curlRequest($ch); - - // Log the response - $decodedResult = json_decode($result, true); - $this->logResponse($logger, $environment, $decodedResult); + [$result, $httpStatus] = $this->curlRequest($ch); // Get errors - list($errno, $message) = $this->curlError($ch); + [$errno] = $this->curlError($ch); curl_close($ch); $hasFailed = !in_array($httpStatus, array(200, 201, 202, 204)); if ($hasFailed && $result) { - $this->handleResultError($result, $logger); + $this->handleResultError($result); } elseif ($hasFailed && !$result) { - $this->handleCurlError($requestUrl, $errno, $message, $logger); + $this->handleCurlError($requestUrl, $errno); } // Result in array or json diff --git a/src/Adyen/Model/BalancePlatform/AccountHolder.php b/src/Adyen/Model/BalancePlatform/AccountHolder.php index 3e017b887..1a3c65f28 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolder.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolder.php @@ -50,6 +50,7 @@ class AccountHolder implements ModelInterface, ArrayAccess, \JsonSerializable 'description' => 'string', 'id' => 'string', 'legalEntityId' => 'string', + 'metadata' => 'array', 'primaryBalanceAccount' => 'string', 'reference' => 'string', 'status' => 'string', @@ -71,6 +72,7 @@ class AccountHolder implements ModelInterface, ArrayAccess, \JsonSerializable 'description' => null, 'id' => null, 'legalEntityId' => null, + 'metadata' => null, 'primaryBalanceAccount' => null, 'reference' => null, 'status' => null, @@ -90,6 +92,7 @@ class AccountHolder implements ModelInterface, ArrayAccess, \JsonSerializable 'description' => false, 'id' => false, 'legalEntityId' => false, + 'metadata' => false, 'primaryBalanceAccount' => false, 'reference' => false, 'status' => false, @@ -189,6 +192,7 @@ public function isNullableSetToNull(string $property): bool 'description' => 'description', 'id' => 'id', 'legalEntityId' => 'legalEntityId', + 'metadata' => 'metadata', 'primaryBalanceAccount' => 'primaryBalanceAccount', 'reference' => 'reference', 'status' => 'status', @@ -208,6 +212,7 @@ public function isNullableSetToNull(string $property): bool 'description' => 'setDescription', 'id' => 'setId', 'legalEntityId' => 'setLegalEntityId', + 'metadata' => 'setMetadata', 'primaryBalanceAccount' => 'setPrimaryBalanceAccount', 'reference' => 'setReference', 'status' => 'setStatus', @@ -227,6 +232,7 @@ public function isNullableSetToNull(string $property): bool 'description' => 'getDescription', 'id' => 'getId', 'legalEntityId' => 'getLegalEntityId', + 'metadata' => 'getMetadata', 'primaryBalanceAccount' => 'getPrimaryBalanceAccount', 'reference' => 'getReference', 'status' => 'getStatus', @@ -315,6 +321,7 @@ public function __construct(array $data = null) $this->setIfExists('description', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('legalEntityId', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); $this->setIfExists('primaryBalanceAccount', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); @@ -541,6 +548,33 @@ public function setLegalEntityId($legalEntityId) return $this; } + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + /** * Gets primaryBalanceAccount * @@ -645,7 +679,7 @@ public function getTimeZone() /** * Sets timeZone * - * @param string|null $timeZone The [time zone](https://www.iana.org/time-zones) of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * @param string|null $timeZone The time zone of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php b/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php index 962600035..f9def21d4 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php @@ -46,12 +46,12 @@ class AccountHolderCapability implements ModelInterface, ArrayAccess, \JsonSeria protected static $openAPITypes = [ 'allowed' => 'bool', 'allowedLevel' => 'string', - 'allowedSettings' => '\Adyen\Model\BalancePlatform\JSONObject', + 'allowedSettings' => '\Adyen\Model\BalancePlatform\CapabilitySettings', 'enabled' => 'bool', 'problems' => 'object[]', 'requested' => 'bool', 'requestedLevel' => 'string', - 'requestedSettings' => '\Adyen\Model\BalancePlatform\JSONObject', + 'requestedSettings' => '\Adyen\Model\BalancePlatform\CapabilitySettings', 'transferInstruments' => '\Adyen\Model\BalancePlatform\AccountSupportingEntityCapability[]', 'verificationStatus' => 'string' ]; @@ -487,7 +487,7 @@ public function setAllowedLevel($allowedLevel) /** * Gets allowedSettings * - * @return \Adyen\Model\BalancePlatform\JSONObject|null + * @return \Adyen\Model\BalancePlatform\CapabilitySettings|null */ public function getAllowedSettings() { @@ -497,7 +497,7 @@ public function getAllowedSettings() /** * Sets allowedSettings * - * @param \Adyen\Model\BalancePlatform\JSONObject|null $allowedSettings allowedSettings + * @param \Adyen\Model\BalancePlatform\CapabilitySettings|null $allowedSettings allowedSettings * * @return self */ @@ -632,7 +632,7 @@ public function setRequestedLevel($requestedLevel) /** * Gets requestedSettings * - * @return \Adyen\Model\BalancePlatform\JSONObject|null + * @return \Adyen\Model\BalancePlatform\CapabilitySettings|null */ public function getRequestedSettings() { @@ -642,7 +642,7 @@ public function getRequestedSettings() /** * Sets requestedSettings * - * @param \Adyen\Model\BalancePlatform\JSONObject|null $requestedSettings requestedSettings + * @param \Adyen\Model\BalancePlatform\CapabilitySettings|null $requestedSettings requestedSettings * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php b/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php index 045d8d14d..aa8c70c5e 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php @@ -49,6 +49,7 @@ class AccountHolderInfo implements ModelInterface, ArrayAccess, \JsonSerializabl 'contactDetails' => '\Adyen\Model\BalancePlatform\ContactDetails', 'description' => 'string', 'legalEntityId' => 'string', + 'metadata' => 'array', 'reference' => 'string', 'timeZone' => 'string' ]; @@ -66,6 +67,7 @@ class AccountHolderInfo implements ModelInterface, ArrayAccess, \JsonSerializabl 'contactDetails' => null, 'description' => null, 'legalEntityId' => null, + 'metadata' => null, 'reference' => null, 'timeZone' => null ]; @@ -81,6 +83,7 @@ class AccountHolderInfo implements ModelInterface, ArrayAccess, \JsonSerializabl 'contactDetails' => false, 'description' => false, 'legalEntityId' => false, + 'metadata' => false, 'reference' => false, 'timeZone' => false ]; @@ -176,6 +179,7 @@ public function isNullableSetToNull(string $property): bool 'contactDetails' => 'contactDetails', 'description' => 'description', 'legalEntityId' => 'legalEntityId', + 'metadata' => 'metadata', 'reference' => 'reference', 'timeZone' => 'timeZone' ]; @@ -191,6 +195,7 @@ public function isNullableSetToNull(string $property): bool 'contactDetails' => 'setContactDetails', 'description' => 'setDescription', 'legalEntityId' => 'setLegalEntityId', + 'metadata' => 'setMetadata', 'reference' => 'setReference', 'timeZone' => 'setTimeZone' ]; @@ -206,6 +211,7 @@ public function isNullableSetToNull(string $property): bool 'contactDetails' => 'getContactDetails', 'description' => 'getDescription', 'legalEntityId' => 'getLegalEntityId', + 'metadata' => 'getMetadata', 'reference' => 'getReference', 'timeZone' => 'getTimeZone' ]; @@ -272,6 +278,7 @@ public function __construct(array $data = null) $this->setIfExists('contactDetails', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); $this->setIfExists('legalEntityId', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('timeZone', $data ?? [], null); } @@ -456,6 +463,33 @@ public function setLegalEntityId($legalEntityId) return $this; } + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + /** * Gets reference * @@ -496,7 +530,7 @@ public function getTimeZone() /** * Sets timeZone * - * @param string|null $timeZone The [time zone](https://www.iana.org/time-zones) of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * @param string|null $timeZone The time zone of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccount.php b/src/Adyen/Model/BalancePlatform/BalanceAccount.php index cc5af096c..6bcda02ae 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccount.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccount.php @@ -49,6 +49,7 @@ class BalanceAccount implements ModelInterface, ArrayAccess, \JsonSerializable 'defaultCurrencyCode' => 'string', 'description' => 'string', 'id' => 'string', + 'metadata' => 'array', 'reference' => 'string', 'status' => 'string', 'timeZone' => 'string' @@ -67,6 +68,7 @@ class BalanceAccount implements ModelInterface, ArrayAccess, \JsonSerializable 'defaultCurrencyCode' => null, 'description' => null, 'id' => null, + 'metadata' => null, 'reference' => null, 'status' => null, 'timeZone' => null @@ -83,6 +85,7 @@ class BalanceAccount implements ModelInterface, ArrayAccess, \JsonSerializable 'defaultCurrencyCode' => false, 'description' => false, 'id' => false, + 'metadata' => false, 'reference' => false, 'status' => false, 'timeZone' => false @@ -179,6 +182,7 @@ public function isNullableSetToNull(string $property): bool 'defaultCurrencyCode' => 'defaultCurrencyCode', 'description' => 'description', 'id' => 'id', + 'metadata' => 'metadata', 'reference' => 'reference', 'status' => 'status', 'timeZone' => 'timeZone' @@ -195,6 +199,7 @@ public function isNullableSetToNull(string $property): bool 'defaultCurrencyCode' => 'setDefaultCurrencyCode', 'description' => 'setDescription', 'id' => 'setId', + 'metadata' => 'setMetadata', 'reference' => 'setReference', 'status' => 'setStatus', 'timeZone' => 'setTimeZone' @@ -211,6 +216,7 @@ public function isNullableSetToNull(string $property): bool 'defaultCurrencyCode' => 'getDefaultCurrencyCode', 'description' => 'getDescription', 'id' => 'getId', + 'metadata' => 'getMetadata', 'reference' => 'getReference', 'status' => 'getStatus', 'timeZone' => 'getTimeZone' @@ -296,6 +302,7 @@ public function __construct(array $data = null) $this->setIfExists('defaultCurrencyCode', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('timeZone', $data ?? [], null); @@ -493,6 +500,33 @@ public function setId($id) return $this; } + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + /** * Gets reference * @@ -570,7 +604,7 @@ public function getTimeZone() /** * Sets timeZone * - * @param string|null $timeZone The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * @param string|null $timeZone The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountBase.php b/src/Adyen/Model/BalancePlatform/BalanceAccountBase.php index e2f5eed94..3c0bfc830 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccountBase.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountBase.php @@ -48,6 +48,7 @@ class BalanceAccountBase implements ModelInterface, ArrayAccess, \JsonSerializab 'defaultCurrencyCode' => 'string', 'description' => 'string', 'id' => 'string', + 'metadata' => 'array', 'reference' => 'string', 'status' => 'string', 'timeZone' => 'string' @@ -65,6 +66,7 @@ class BalanceAccountBase implements ModelInterface, ArrayAccess, \JsonSerializab 'defaultCurrencyCode' => null, 'description' => null, 'id' => null, + 'metadata' => null, 'reference' => null, 'status' => null, 'timeZone' => null @@ -80,6 +82,7 @@ class BalanceAccountBase implements ModelInterface, ArrayAccess, \JsonSerializab 'defaultCurrencyCode' => false, 'description' => false, 'id' => false, + 'metadata' => false, 'reference' => false, 'status' => false, 'timeZone' => false @@ -175,6 +178,7 @@ public function isNullableSetToNull(string $property): bool 'defaultCurrencyCode' => 'defaultCurrencyCode', 'description' => 'description', 'id' => 'id', + 'metadata' => 'metadata', 'reference' => 'reference', 'status' => 'status', 'timeZone' => 'timeZone' @@ -190,6 +194,7 @@ public function isNullableSetToNull(string $property): bool 'defaultCurrencyCode' => 'setDefaultCurrencyCode', 'description' => 'setDescription', 'id' => 'setId', + 'metadata' => 'setMetadata', 'reference' => 'setReference', 'status' => 'setStatus', 'timeZone' => 'setTimeZone' @@ -205,6 +210,7 @@ public function isNullableSetToNull(string $property): bool 'defaultCurrencyCode' => 'getDefaultCurrencyCode', 'description' => 'getDescription', 'id' => 'getId', + 'metadata' => 'getMetadata', 'reference' => 'getReference', 'status' => 'getStatus', 'timeZone' => 'getTimeZone' @@ -289,6 +295,7 @@ public function __construct(array $data = null) $this->setIfExists('defaultCurrencyCode', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('timeZone', $data ?? [], null); @@ -459,6 +466,33 @@ public function setId($id) return $this; } + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + /** * Gets reference * @@ -536,7 +570,7 @@ public function getTimeZone() /** * Sets timeZone * - * @param string|null $timeZone The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * @param string|null $timeZone The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php b/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php index e89859ba0..222fa639f 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php @@ -47,6 +47,7 @@ class BalanceAccountInfo implements ModelInterface, ArrayAccess, \JsonSerializab 'accountHolderId' => 'string', 'defaultCurrencyCode' => 'string', 'description' => 'string', + 'metadata' => 'array', 'reference' => 'string', 'timeZone' => 'string' ]; @@ -62,6 +63,7 @@ class BalanceAccountInfo implements ModelInterface, ArrayAccess, \JsonSerializab 'accountHolderId' => null, 'defaultCurrencyCode' => null, 'description' => null, + 'metadata' => null, 'reference' => null, 'timeZone' => null ]; @@ -75,6 +77,7 @@ class BalanceAccountInfo implements ModelInterface, ArrayAccess, \JsonSerializab 'accountHolderId' => false, 'defaultCurrencyCode' => false, 'description' => false, + 'metadata' => false, 'reference' => false, 'timeZone' => false ]; @@ -168,6 +171,7 @@ public function isNullableSetToNull(string $property): bool 'accountHolderId' => 'accountHolderId', 'defaultCurrencyCode' => 'defaultCurrencyCode', 'description' => 'description', + 'metadata' => 'metadata', 'reference' => 'reference', 'timeZone' => 'timeZone' ]; @@ -181,6 +185,7 @@ public function isNullableSetToNull(string $property): bool 'accountHolderId' => 'setAccountHolderId', 'defaultCurrencyCode' => 'setDefaultCurrencyCode', 'description' => 'setDescription', + 'metadata' => 'setMetadata', 'reference' => 'setReference', 'timeZone' => 'setTimeZone' ]; @@ -194,6 +199,7 @@ public function isNullableSetToNull(string $property): bool 'accountHolderId' => 'getAccountHolderId', 'defaultCurrencyCode' => 'getDefaultCurrencyCode', 'description' => 'getDescription', + 'metadata' => 'getMetadata', 'reference' => 'getReference', 'timeZone' => 'getTimeZone' ]; @@ -258,6 +264,7 @@ public function __construct(array $data = null) $this->setIfExists('accountHolderId', $data ?? [], null); $this->setIfExists('defaultCurrencyCode', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('timeZone', $data ?? [], null); } @@ -388,6 +395,33 @@ public function setDescription($description) return $this; } + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + /** * Gets reference * @@ -428,7 +462,7 @@ public function getTimeZone() /** * Sets timeZone * - * @param string|null $timeZone The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * @param string|null $timeZone The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php b/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php index f047752ca..783e01676 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php @@ -47,6 +47,7 @@ class BalanceAccountUpdateRequest implements ModelInterface, ArrayAccess, \JsonS 'accountHolderId' => 'string', 'defaultCurrencyCode' => 'string', 'description' => 'string', + 'metadata' => 'array', 'reference' => 'string', 'status' => 'string', 'timeZone' => 'string' @@ -63,6 +64,7 @@ class BalanceAccountUpdateRequest implements ModelInterface, ArrayAccess, \JsonS 'accountHolderId' => null, 'defaultCurrencyCode' => null, 'description' => null, + 'metadata' => null, 'reference' => null, 'status' => null, 'timeZone' => null @@ -77,6 +79,7 @@ class BalanceAccountUpdateRequest implements ModelInterface, ArrayAccess, \JsonS 'accountHolderId' => false, 'defaultCurrencyCode' => false, 'description' => false, + 'metadata' => false, 'reference' => false, 'status' => false, 'timeZone' => false @@ -171,6 +174,7 @@ public function isNullableSetToNull(string $property): bool 'accountHolderId' => 'accountHolderId', 'defaultCurrencyCode' => 'defaultCurrencyCode', 'description' => 'description', + 'metadata' => 'metadata', 'reference' => 'reference', 'status' => 'status', 'timeZone' => 'timeZone' @@ -185,6 +189,7 @@ public function isNullableSetToNull(string $property): bool 'accountHolderId' => 'setAccountHolderId', 'defaultCurrencyCode' => 'setDefaultCurrencyCode', 'description' => 'setDescription', + 'metadata' => 'setMetadata', 'reference' => 'setReference', 'status' => 'setStatus', 'timeZone' => 'setTimeZone' @@ -199,6 +204,7 @@ public function isNullableSetToNull(string $property): bool 'accountHolderId' => 'getAccountHolderId', 'defaultCurrencyCode' => 'getDefaultCurrencyCode', 'description' => 'getDescription', + 'metadata' => 'getMetadata', 'reference' => 'getReference', 'status' => 'getStatus', 'timeZone' => 'getTimeZone' @@ -282,6 +288,7 @@ public function __construct(array $data = null) $this->setIfExists('accountHolderId', $data ?? [], null); $this->setIfExists('defaultCurrencyCode', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('timeZone', $data ?? [], null); @@ -419,6 +426,33 @@ public function setDescription($description) return $this; } + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + /** * Gets reference * @@ -496,7 +530,7 @@ public function getTimeZone() /** * Sets timeZone * - * @param string|null $timeZone The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * @param string|null $timeZone The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/CapabilitySettings.php b/src/Adyen/Model/BalancePlatform/CapabilitySettings.php new file mode 100644 index 000000000..b03b47262 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/CapabilitySettings.php @@ -0,0 +1,580 @@ + + */ +class CapabilitySettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CapabilitySettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amountPerIndustry' => 'array', + 'authorizedCardUsers' => 'bool', + 'fundingSource' => 'string[]', + 'interval' => 'string', + 'maxAmount' => '\Adyen\Model\BalancePlatform\Amount' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amountPerIndustry' => null, + 'authorizedCardUsers' => null, + 'fundingSource' => null, + 'interval' => null, + 'maxAmount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amountPerIndustry' => false, + 'authorizedCardUsers' => false, + 'fundingSource' => false, + 'interval' => false, + 'maxAmount' => 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 = [ + 'amountPerIndustry' => 'amountPerIndustry', + 'authorizedCardUsers' => 'authorizedCardUsers', + 'fundingSource' => 'fundingSource', + 'interval' => 'interval', + 'maxAmount' => 'maxAmount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amountPerIndustry' => 'setAmountPerIndustry', + 'authorizedCardUsers' => 'setAuthorizedCardUsers', + 'fundingSource' => 'setFundingSource', + 'interval' => 'setInterval', + 'maxAmount' => 'setMaxAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amountPerIndustry' => 'getAmountPerIndustry', + 'authorizedCardUsers' => 'getAuthorizedCardUsers', + 'fundingSource' => 'getFundingSource', + 'interval' => 'getInterval', + 'maxAmount' => 'getMaxAmount' + ]; + + /** + * 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 FUNDING_SOURCE_CREDIT = 'credit'; + public const FUNDING_SOURCE_DEBIT = 'debit'; + public const FUNDING_SOURCE_PREPAID = 'prepaid'; + public const INTERVAL_DAILY = 'daily'; + public const INTERVAL_MONTHLY = 'monthly'; + public const INTERVAL_WEEKLY = 'weekly'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFundingSourceAllowableValues() + { + return [ + self::FUNDING_SOURCE_CREDIT, + self::FUNDING_SOURCE_DEBIT, + self::FUNDING_SOURCE_PREPAID, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getIntervalAllowableValues() + { + return [ + self::INTERVAL_DAILY, + self::INTERVAL_MONTHLY, + self::INTERVAL_WEEKLY, + ]; + } + /** + * 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('amountPerIndustry', $data ?? [], null); + $this->setIfExists('authorizedCardUsers', $data ?? [], null); + $this->setIfExists('fundingSource', $data ?? [], null); + $this->setIfExists('interval', $data ?? [], null); + $this->setIfExists('maxAmount', $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->getIntervalAllowableValues(); + if (!is_null($this->container['interval']) && !in_array($this->container['interval'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'interval', must be one of '%s'", + $this->container['interval'], + 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 amountPerIndustry + * + * @return array|null + */ + public function getAmountPerIndustry() + { + return $this->container['amountPerIndustry']; + } + + /** + * Sets amountPerIndustry + * + * @param array|null $amountPerIndustry + * + * @return self + */ + public function setAmountPerIndustry($amountPerIndustry) + { + if (is_null($amountPerIndustry)) { + throw new \InvalidArgumentException('non-nullable amountPerIndustry cannot be null'); + } + $this->container['amountPerIndustry'] = $amountPerIndustry; + + return $this; + } + + /** + * Gets authorizedCardUsers + * + * @return bool|null + */ + public function getAuthorizedCardUsers() + { + return $this->container['authorizedCardUsers']; + } + + /** + * Sets authorizedCardUsers + * + * @param bool|null $authorizedCardUsers + * + * @return self + */ + public function setAuthorizedCardUsers($authorizedCardUsers) + { + if (is_null($authorizedCardUsers)) { + throw new \InvalidArgumentException('non-nullable authorizedCardUsers cannot be null'); + } + $this->container['authorizedCardUsers'] = $authorizedCardUsers; + + return $this; + } + + /** + * Gets fundingSource + * + * @return string[]|null + */ + public function getFundingSource() + { + return $this->container['fundingSource']; + } + + /** + * Sets fundingSource + * + * @param string[]|null $fundingSource + * + * @return self + */ + public function setFundingSource($fundingSource) + { + if (is_null($fundingSource)) { + throw new \InvalidArgumentException('non-nullable fundingSource cannot be null'); + } + $allowedValues = $this->getFundingSourceAllowableValues(); + if (array_diff($fundingSource, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'fundingSource', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['fundingSource'] = $fundingSource; + + return $this; + } + + /** + * Gets interval + * + * @return string|null + */ + public function getInterval() + { + return $this->container['interval']; + } + + /** + * Sets interval + * + * @param string|null $interval + * + * @return self + */ + public function setInterval($interval) + { + if (is_null($interval)) { + throw new \InvalidArgumentException('non-nullable interval cannot be null'); + } + $allowedValues = $this->getIntervalAllowableValues(); + if (!in_array($interval, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'interval', must be one of '%s'", + $interval, + implode("', '", $allowedValues) + ) + ); + } + $this->container['interval'] = $interval; + + return $this; + } + + /** + * Gets maxAmount + * + * @return \Adyen\Model\BalancePlatform\Amount|null + */ + public function getMaxAmount() + { + return $this->container['maxAmount']; + } + + /** + * Sets maxAmount + * + * @param \Adyen\Model\BalancePlatform\Amount|null $maxAmount maxAmount + * + * @return self + */ + public function setMaxAmount($maxAmount) + { + if (is_null($maxAmount)) { + throw new \InvalidArgumentException('non-nullable maxAmount cannot be null'); + } + $this->container['maxAmount'] = $maxAmount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/CapitalBalance.php b/src/Adyen/Model/BalancePlatform/CapitalBalance.php new file mode 100644 index 000000000..251907823 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/CapitalBalance.php @@ -0,0 +1,498 @@ + + */ +class CapitalBalance implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CapitalBalance'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'fee' => 'int', + 'principal' => 'int', + 'total' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'fee' => 'int64', + 'principal' => 'int64', + 'total' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'fee' => false, + 'principal' => false, + 'total' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'fee' => 'fee', + 'principal' => 'principal', + 'total' => 'total' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'fee' => 'setFee', + 'principal' => 'setPrincipal', + 'total' => 'setTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'fee' => 'getFee', + 'principal' => 'getPrincipal', + 'total' => 'getTotal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('fee', $data ?? [], null); + $this->setIfExists('principal', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['fee'] === null) { + $invalidProperties[] = "'fee' can't be null"; + } + if ($this->container['principal'] === null) { + $invalidProperties[] = "'principal' can't be null"; + } + if ($this->container['total'] === null) { + $invalidProperties[] = "'total' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets fee + * + * @return int + */ + public function getFee() + { + return $this->container['fee']; + } + + /** + * Sets fee + * + * @param int $fee Fee amount. + * + * @return self + */ + public function setFee($fee) + { + if (is_null($fee)) { + throw new \InvalidArgumentException('non-nullable fee cannot be null'); + } + $this->container['fee'] = $fee; + + return $this; + } + + /** + * Gets principal + * + * @return int + */ + public function getPrincipal() + { + return $this->container['principal']; + } + + /** + * Sets principal + * + * @param int $principal Principal amount. + * + * @return self + */ + public function setPrincipal($principal) + { + if (is_null($principal)) { + throw new \InvalidArgumentException('non-nullable principal cannot be null'); + } + $this->container['principal'] = $principal; + + return $this; + } + + /** + * Gets total + * + * @return int + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int $total Total amount. A sum of principal amount and fee amount. + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/CapitalGrantAccount.php b/src/Adyen/Model/BalancePlatform/CapitalGrantAccount.php new file mode 100644 index 000000000..d327bc522 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/CapitalGrantAccount.php @@ -0,0 +1,486 @@ + + */ +class CapitalGrantAccount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CapitalGrantAccount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balances' => '\Adyen\Model\BalancePlatform\CapitalBalance[]', + 'fundingBalanceAccountId' => 'string', + 'id' => 'string', + 'limits' => '\Adyen\Model\BalancePlatform\GrantLimit[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balances' => null, + 'fundingBalanceAccountId' => null, + 'id' => null, + 'limits' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balances' => false, + 'fundingBalanceAccountId' => false, + 'id' => false, + 'limits' => 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 = [ + 'balances' => 'balances', + 'fundingBalanceAccountId' => 'fundingBalanceAccountId', + 'id' => 'id', + 'limits' => 'limits' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balances' => 'setBalances', + 'fundingBalanceAccountId' => 'setFundingBalanceAccountId', + 'id' => 'setId', + 'limits' => 'setLimits' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balances' => 'getBalances', + 'fundingBalanceAccountId' => 'getFundingBalanceAccountId', + 'id' => 'getId', + 'limits' => 'getLimits' + ]; + + /** + * 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('balances', $data ?? [], null); + $this->setIfExists('fundingBalanceAccountId', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('limits', $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 balances + * + * @return \Adyen\Model\BalancePlatform\CapitalBalance[]|null + */ + public function getBalances() + { + return $this->container['balances']; + } + + /** + * Sets balances + * + * @param \Adyen\Model\BalancePlatform\CapitalBalance[]|null $balances The balances of the grant account. + * + * @return self + */ + public function setBalances($balances) + { + if (is_null($balances)) { + throw new \InvalidArgumentException('non-nullable balances cannot be null'); + } + $this->container['balances'] = $balances; + + return $this; + } + + /** + * Gets fundingBalanceAccountId + * + * @return string|null + */ + public function getFundingBalanceAccountId() + { + return $this->container['fundingBalanceAccountId']; + } + + /** + * Sets fundingBalanceAccountId + * + * @param string|null $fundingBalanceAccountId The unique identifier of the balance account used to fund the grant. + * + * @return self + */ + public function setFundingBalanceAccountId($fundingBalanceAccountId) + { + if (is_null($fundingBalanceAccountId)) { + throw new \InvalidArgumentException('non-nullable fundingBalanceAccountId cannot be null'); + } + $this->container['fundingBalanceAccountId'] = $fundingBalanceAccountId; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The identifier of the grant account. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets limits + * + * @return \Adyen\Model\BalancePlatform\GrantLimit[]|null + */ + public function getLimits() + { + return $this->container['limits']; + } + + /** + * Sets limits + * + * @param \Adyen\Model\BalancePlatform\GrantLimit[]|null $limits The limits of the grant account. + * + * @return self + */ + public function setLimits($limits) + { + if (is_null($limits)) { + throw new \InvalidArgumentException('non-nullable limits cannot be null'); + } + $this->container['limits'] = $limits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php b/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php index b3cf2631a..c8d27666b 100644 --- a/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php +++ b/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php @@ -355,7 +355,7 @@ public function getType() /** * Sets type * - * @param string|null $type The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. + * @param string|null $type The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/Address2.php b/src/Adyen/Model/BalancePlatform/DeliveryAddress.php similarity index 98% rename from src/Adyen/Model/BalancePlatform/Address2.php rename to src/Adyen/Model/BalancePlatform/DeliveryAddress.php index 403ace51b..623dfa472 100644 --- a/src/Adyen/Model/BalancePlatform/Address2.php +++ b/src/Adyen/Model/BalancePlatform/DeliveryAddress.php @@ -19,7 +19,7 @@ use Adyen\Model\BalancePlatform\ObjectSerializer; /** - * Address2 Class Doc Comment + * DeliveryAddress Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class Address2 implements ModelInterface, ArrayAccess, \JsonSerializable +class DeliveryAddress implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class Address2 implements ModelInterface, ArrayAccess, \JsonSerializable * * @var string */ - protected static $openAPIModelName = 'Address-2'; + protected static $openAPIModelName = 'DeliveryAddress'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Adyen/Model/BalancePlatform/DeliveryContact.php b/src/Adyen/Model/BalancePlatform/DeliveryContact.php index 845fad5c5..4973f2b86 100644 --- a/src/Adyen/Model/BalancePlatform/DeliveryContact.php +++ b/src/Adyen/Model/BalancePlatform/DeliveryContact.php @@ -44,7 +44,7 @@ class DeliveryContact implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'address' => '\Adyen\Model\BalancePlatform\Address2', + 'address' => '\Adyen\Model\BalancePlatform\DeliveryAddress', 'email' => 'string', 'fullPhoneNumber' => 'string', 'name' => '\Adyen\Model\BalancePlatform\Name', @@ -320,7 +320,7 @@ public function valid() /** * Gets address * - * @return \Adyen\Model\BalancePlatform\Address2 + * @return \Adyen\Model\BalancePlatform\DeliveryAddress */ public function getAddress() { @@ -330,7 +330,7 @@ public function getAddress() /** * Sets address * - * @param \Adyen\Model\BalancePlatform\Address2 $address address + * @param \Adyen\Model\BalancePlatform\DeliveryAddress $address address * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/Fee.php b/src/Adyen/Model/BalancePlatform/Fee.php new file mode 100644 index 000000000..a7804a1c0 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Fee.php @@ -0,0 +1,387 @@ + + */ +class Fee implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Fee'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\BalancePlatform\Amount' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' 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\BalancePlatform\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\BalancePlatform\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/GrantLimit.php b/src/Adyen/Model/BalancePlatform/GrantLimit.php new file mode 100644 index 000000000..6274ece8c --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/GrantLimit.php @@ -0,0 +1,384 @@ + + */ +class GrantLimit implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GrantLimit'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\BalancePlatform\Amount' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return \Adyen\Model\BalancePlatform\Amount|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\BalancePlatform\Amount|null $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/GrantOffer.php b/src/Adyen/Model/BalancePlatform/GrantOffer.php new file mode 100644 index 000000000..264f5817b --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/GrantOffer.php @@ -0,0 +1,658 @@ + + */ +class GrantOffer implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GrantOffer'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountHolderId' => 'string', + 'amount' => '\Adyen\Model\BalancePlatform\Amount', + 'contractType' => 'string', + 'expiresAt' => 'object', + 'fee' => '\Adyen\Model\BalancePlatform\Fee', + 'id' => 'string', + 'repayment' => '\Adyen\Model\BalancePlatform\Repayment', + 'startsAt' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountHolderId' => null, + 'amount' => null, + 'contractType' => null, + 'expiresAt' => null, + 'fee' => null, + 'id' => null, + 'repayment' => null, + 'startsAt' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountHolderId' => false, + 'amount' => false, + 'contractType' => false, + 'expiresAt' => false, + 'fee' => false, + 'id' => false, + 'repayment' => false, + 'startsAt' => 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 = [ + 'accountHolderId' => 'accountHolderId', + 'amount' => 'amount', + 'contractType' => 'contractType', + 'expiresAt' => 'expiresAt', + 'fee' => 'fee', + 'id' => 'id', + 'repayment' => 'repayment', + 'startsAt' => 'startsAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountHolderId' => 'setAccountHolderId', + 'amount' => 'setAmount', + 'contractType' => 'setContractType', + 'expiresAt' => 'setExpiresAt', + 'fee' => 'setFee', + 'id' => 'setId', + 'repayment' => 'setRepayment', + 'startsAt' => 'setStartsAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountHolderId' => 'getAccountHolderId', + 'amount' => 'getAmount', + 'contractType' => 'getContractType', + 'expiresAt' => 'getExpiresAt', + 'fee' => 'getFee', + 'id' => 'getId', + 'repayment' => 'getRepayment', + 'startsAt' => 'getStartsAt' + ]; + + /** + * 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 CONTRACT_TYPE_CASH_ADVANCE = 'cashAdvance'; + public const CONTRACT_TYPE_LOAN = 'loan'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getContractTypeAllowableValues() + { + return [ + self::CONTRACT_TYPE_CASH_ADVANCE, + self::CONTRACT_TYPE_LOAN, + ]; + } + /** + * 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('accountHolderId', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('contractType', $data ?? [], null); + $this->setIfExists('expiresAt', $data ?? [], null); + $this->setIfExists('fee', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('repayment', $data ?? [], null); + $this->setIfExists('startsAt', $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['accountHolderId'] === null) { + $invalidProperties[] = "'accountHolderId' can't be null"; + } + $allowedValues = $this->getContractTypeAllowableValues(); + if (!is_null($this->container['contractType']) && !in_array($this->container['contractType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'contractType', must be one of '%s'", + $this->container['contractType'], + 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 accountHolderId + * + * @return string + */ + public function getAccountHolderId() + { + return $this->container['accountHolderId']; + } + + /** + * Sets accountHolderId + * + * @param string $accountHolderId The identifier of the account holder to which the grant is offered. + * + * @return self + */ + public function setAccountHolderId($accountHolderId) + { + if (is_null($accountHolderId)) { + throw new \InvalidArgumentException('non-nullable accountHolderId cannot be null'); + } + $this->container['accountHolderId'] = $accountHolderId; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\BalancePlatform\Amount|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\BalancePlatform\Amount|null $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets contractType + * + * @return string|null + */ + public function getContractType() + { + return $this->container['contractType']; + } + + /** + * Sets contractType + * + * @param string|null $contractType The contract type of the grant offer. Possible value: **cashAdvance**, **loan**. + * + * @return self + */ + public function setContractType($contractType) + { + if (is_null($contractType)) { + throw new \InvalidArgumentException('non-nullable contractType cannot be null'); + } + $allowedValues = $this->getContractTypeAllowableValues(); + if (!in_array($contractType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'contractType', must be one of '%s'", + $contractType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['contractType'] = $contractType; + + return $this; + } + + /** + * Gets expiresAt + * + * @return object|null + */ + public function getExpiresAt() + { + return $this->container['expiresAt']; + } + + /** + * Sets expiresAt + * + * @param object|null $expiresAt expiresAt + * + * @return self + */ + public function setExpiresAt($expiresAt) + { + if (is_null($expiresAt)) { + throw new \InvalidArgumentException('non-nullable expiresAt cannot be null'); + } + $this->container['expiresAt'] = $expiresAt; + + return $this; + } + + /** + * Gets fee + * + * @return \Adyen\Model\BalancePlatform\Fee|null + */ + public function getFee() + { + return $this->container['fee']; + } + + /** + * Sets fee + * + * @param \Adyen\Model\BalancePlatform\Fee|null $fee fee + * + * @return self + */ + public function setFee($fee) + { + if (is_null($fee)) { + throw new \InvalidArgumentException('non-nullable fee cannot be null'); + } + $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 unique identifier of the grant offer. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets repayment + * + * @return \Adyen\Model\BalancePlatform\Repayment|null + */ + public function getRepayment() + { + return $this->container['repayment']; + } + + /** + * Sets repayment + * + * @param \Adyen\Model\BalancePlatform\Repayment|null $repayment repayment + * + * @return self + */ + public function setRepayment($repayment) + { + if (is_null($repayment)) { + throw new \InvalidArgumentException('non-nullable repayment cannot be null'); + } + $this->container['repayment'] = $repayment; + + return $this; + } + + /** + * Gets startsAt + * + * @return object|null + */ + public function getStartsAt() + { + return $this->container['startsAt']; + } + + /** + * Sets startsAt + * + * @param object|null $startsAt startsAt + * + * @return self + */ + public function setStartsAt($startsAt) + { + if (is_null($startsAt)) { + throw new \InvalidArgumentException('non-nullable startsAt cannot be null'); + } + $this->container['startsAt'] = $startsAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/GrantOffers.php b/src/Adyen/Model/BalancePlatform/GrantOffers.php new file mode 100644 index 000000000..ba0672f95 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/GrantOffers.php @@ -0,0 +1,387 @@ + + */ +class GrantOffers implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GrantOffers'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'grantOffers' => '\Adyen\Model\BalancePlatform\GrantOffer[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'grantOffers' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'grantOffers' => 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 = [ + 'grantOffers' => 'grantOffers' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'grantOffers' => 'setGrantOffers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'grantOffers' => 'getGrantOffers' + ]; + + /** + * 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('grantOffers', $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['grantOffers'] === null) { + $invalidProperties[] = "'grantOffers' 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 grantOffers + * + * @return \Adyen\Model\BalancePlatform\GrantOffer[] + */ + public function getGrantOffers() + { + return $this->container['grantOffers']; + } + + /** + * Sets grantOffers + * + * @param \Adyen\Model\BalancePlatform\GrantOffer[] $grantOffers A list of available grant offers. + * + * @return self + */ + public function setGrantOffers($grantOffers) + { + if (is_null($grantOffers)) { + throw new \InvalidArgumentException('non-nullable grantOffers cannot be null'); + } + $this->container['grantOffers'] = $grantOffers; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrument.php b/src/Adyen/Model/BalancePlatform/PaymentInstrument.php index b01f08808..42057ff3a 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrument.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrument.php @@ -287,6 +287,7 @@ public function getModelName() public const STATUS_REASON_OTHER = 'other'; public const STATUS_REASON_STOLEN = 'stolen'; public const STATUS_REASON_SUSPECTED_FRAUD = 'suspectedFraud'; + public const STATUS_REASON_TRANSACTION_RULE = 'transactionRule'; public const TYPE_BANK_ACCOUNT = 'bankAccount'; public const TYPE_CARD = 'card'; @@ -320,6 +321,7 @@ public function getStatusReasonAllowableValues() self::STATUS_REASON_OTHER, self::STATUS_REASON_STOLEN, self::STATUS_REASON_SUSPECTED_FRAUD, + self::STATUS_REASON_TRANSACTION_RULE, ]; } /** @@ -709,7 +711,7 @@ public function getStatusReason() /** * Sets statusReason * - * @param string|null $statusReason The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. + * @param string|null $statusReason The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php index ca670dccd..3932e4e82 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php @@ -275,6 +275,7 @@ public function getModelName() public const STATUS_REASON_OTHER = 'other'; public const STATUS_REASON_STOLEN = 'stolen'; public const STATUS_REASON_SUSPECTED_FRAUD = 'suspectedFraud'; + public const STATUS_REASON_TRANSACTION_RULE = 'transactionRule'; public const TYPE_BANK_ACCOUNT = 'bankAccount'; public const TYPE_CARD = 'card'; @@ -308,6 +309,7 @@ public function getStatusReasonAllowableValues() self::STATUS_REASON_OTHER, self::STATUS_REASON_STOLEN, self::STATUS_REASON_SUSPECTED_FRAUD, + self::STATUS_REASON_TRANSACTION_RULE, ]; } /** @@ -638,7 +640,7 @@ public function getStatusReason() /** * Sets statusReason * - * @param string|null $statusReason The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. + * @param string|null $statusReason The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php index fc43a7ec6..894083084 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php @@ -251,6 +251,7 @@ public function getModelName() public const STATUS_REASON_OTHER = 'other'; public const STATUS_REASON_STOLEN = 'stolen'; public const STATUS_REASON_SUSPECTED_FRAUD = 'suspectedFraud'; + public const STATUS_REASON_TRANSACTION_RULE = 'transactionRule'; /** * Gets allowable values of the enum @@ -282,6 +283,7 @@ public function getStatusReasonAllowableValues() self::STATUS_REASON_OTHER, self::STATUS_REASON_STOLEN, self::STATUS_REASON_SUSPECTED_FRAUD, + self::STATUS_REASON_TRANSACTION_RULE, ]; } /** diff --git a/src/Adyen/Model/BalancePlatform/Repayment.php b/src/Adyen/Model/BalancePlatform/Repayment.php new file mode 100644 index 000000000..86e0100c1 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Repayment.php @@ -0,0 +1,453 @@ + + */ +class Repayment implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Repayment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'basisPoints' => 'int', + 'term' => '\Adyen\Model\BalancePlatform\RepaymentTerm', + 'threshold' => '\Adyen\Model\BalancePlatform\ThresholdRepayment' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'basisPoints' => 'int32', + 'term' => null, + 'threshold' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'basisPoints' => true, + 'term' => false, + 'threshold' => 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 = [ + 'basisPoints' => 'basisPoints', + 'term' => 'term', + 'threshold' => 'threshold' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'basisPoints' => 'setBasisPoints', + 'term' => 'setTerm', + 'threshold' => 'setThreshold' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'basisPoints' => 'getBasisPoints', + 'term' => 'getTerm', + 'threshold' => 'getThreshold' + ]; + + /** + * 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('basisPoints', $data ?? [], null); + $this->setIfExists('term', $data ?? [], null); + $this->setIfExists('threshold', $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['basisPoints'] === null) { + $invalidProperties[] = "'basisPoints' 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 basisPoints + * + * @return int + */ + public function getBasisPoints() + { + return $this->container['basisPoints']; + } + + /** + * Sets basisPoints + * + * @param int $basisPoints The repayment that is deducted daily from incoming net volume, in [basis points](https://www.investopedia.com/terms/b/basispoint.asp). + * + * @return self + */ + public function setBasisPoints($basisPoints) + { + // Do nothing for nullable integers + $this->container['basisPoints'] = $basisPoints; + + return $this; + } + + /** + * Gets term + * + * @return \Adyen\Model\BalancePlatform\RepaymentTerm|null + */ + public function getTerm() + { + return $this->container['term']; + } + + /** + * Sets term + * + * @param \Adyen\Model\BalancePlatform\RepaymentTerm|null $term term + * + * @return self + */ + public function setTerm($term) + { + if (is_null($term)) { + throw new \InvalidArgumentException('non-nullable term cannot be null'); + } + $this->container['term'] = $term; + + return $this; + } + + /** + * Gets threshold + * + * @return \Adyen\Model\BalancePlatform\ThresholdRepayment|null + */ + public function getThreshold() + { + return $this->container['threshold']; + } + + /** + * Sets threshold + * + * @param \Adyen\Model\BalancePlatform\ThresholdRepayment|null $threshold threshold + * + * @return self + */ + public function setThreshold($threshold) + { + if (is_null($threshold)) { + throw new \InvalidArgumentException('non-nullable threshold cannot be null'); + } + $this->container['threshold'] = $threshold; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/RepaymentTerm.php b/src/Adyen/Model/BalancePlatform/RepaymentTerm.php new file mode 100644 index 000000000..72ed3f35c --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/RepaymentTerm.php @@ -0,0 +1,417 @@ + + */ +class RepaymentTerm implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RepaymentTerm'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'estimatedDays' => 'int', + 'maximumDays' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'estimatedDays' => 'int32', + 'maximumDays' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'estimatedDays' => true, + 'maximumDays' => true + ]; + + /** + * 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 = [ + 'estimatedDays' => 'estimatedDays', + 'maximumDays' => 'maximumDays' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'estimatedDays' => 'setEstimatedDays', + 'maximumDays' => 'setMaximumDays' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'estimatedDays' => 'getEstimatedDays', + 'maximumDays' => 'getMaximumDays' + ]; + + /** + * 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('estimatedDays', $data ?? [], null); + $this->setIfExists('maximumDays', $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['estimatedDays'] === null) { + $invalidProperties[] = "'estimatedDays' 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 estimatedDays + * + * @return int + */ + public function getEstimatedDays() + { + return $this->container['estimatedDays']; + } + + /** + * Sets estimatedDays + * + * @param int $estimatedDays The estimated term for repaying the grant, in days. + * + * @return self + */ + public function setEstimatedDays($estimatedDays) + { + // Do nothing for nullable integers + $this->container['estimatedDays'] = $estimatedDays; + + return $this; + } + + /** + * Gets maximumDays + * + * @return int|null + */ + public function getMaximumDays() + { + return $this->container['maximumDays']; + } + + /** + * Sets maximumDays + * + * @param int|null $maximumDays The maximum term for repaying the grant, in days. Only applies when `contractType` is **loan**. + * + * @return self + */ + public function setMaximumDays($maximumDays) + { + // Do nothing for nullable integers + $this->container['maximumDays'] = $maximumDays; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php index 1480ab75c..da70889aa 100644 --- a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php +++ b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php @@ -327,7 +327,7 @@ public function getType() /** * Sets type * - * @param string|null $type The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. + * @param string|null $type The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/SweepSchedule.php b/src/Adyen/Model/BalancePlatform/SweepSchedule.php index d0aa80403..db9908ba1 100644 --- a/src/Adyen/Model/BalancePlatform/SweepSchedule.php +++ b/src/Adyen/Model/BalancePlatform/SweepSchedule.php @@ -318,7 +318,7 @@ public function getType() /** * Sets type * - * @param string|null $type The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. + * @param string|null $type The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/ThresholdRepayment.php b/src/Adyen/Model/BalancePlatform/ThresholdRepayment.php new file mode 100644 index 000000000..626106254 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ThresholdRepayment.php @@ -0,0 +1,387 @@ + + */ +class ThresholdRepayment implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThresholdRepayment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\BalancePlatform\Amount' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' 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\BalancePlatform\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\BalancePlatform\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php b/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php index cd15bced9..15f69aa6b 100644 --- a/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php +++ b/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php @@ -293,6 +293,7 @@ public function getModelName() public const STATUS_REASON_OTHER = 'other'; public const STATUS_REASON_STOLEN = 'stolen'; public const STATUS_REASON_SUSPECTED_FRAUD = 'suspectedFraud'; + public const STATUS_REASON_TRANSACTION_RULE = 'transactionRule'; public const TYPE_BANK_ACCOUNT = 'bankAccount'; public const TYPE_CARD = 'card'; @@ -326,6 +327,7 @@ public function getStatusReasonAllowableValues() self::STATUS_REASON_OTHER, self::STATUS_REASON_STOLEN, self::STATUS_REASON_SUSPECTED_FRAUD, + self::STATUS_REASON_TRANSACTION_RULE, ]; } /** @@ -743,7 +745,7 @@ public function getStatusReason() /** * Sets statusReason * - * @param string|null $statusReason The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. + * @param string|null $statusReason The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. * * @return self */ diff --git a/src/Adyen/Model/Capital/Amount.php b/src/Adyen/Model/Capital/Amount.php new file mode 100644 index 000000000..ecb17c779 --- /dev/null +++ b/src/Adyen/Model/Capital/Amount.php @@ -0,0 +1,424 @@ + + */ +class Amount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Amount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'value' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * 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/Capital/CapitalBalance.php b/src/Adyen/Model/Capital/CapitalBalance.php new file mode 100644 index 000000000..8a7e8997b --- /dev/null +++ b/src/Adyen/Model/Capital/CapitalBalance.php @@ -0,0 +1,498 @@ + + */ +class CapitalBalance implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CapitalBalance'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'fee' => 'int', + 'principal' => 'int', + 'total' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'fee' => 'int64', + 'principal' => 'int64', + 'total' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'fee' => false, + 'principal' => false, + 'total' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'fee' => 'fee', + 'principal' => 'principal', + 'total' => 'total' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'fee' => 'setFee', + 'principal' => 'setPrincipal', + 'total' => 'setTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'fee' => 'getFee', + 'principal' => 'getPrincipal', + 'total' => 'getTotal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('fee', $data ?? [], null); + $this->setIfExists('principal', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['fee'] === null) { + $invalidProperties[] = "'fee' can't be null"; + } + if ($this->container['principal'] === null) { + $invalidProperties[] = "'principal' can't be null"; + } + if ($this->container['total'] === null) { + $invalidProperties[] = "'total' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets fee + * + * @return int + */ + public function getFee() + { + return $this->container['fee']; + } + + /** + * Sets fee + * + * @param int $fee Fee amount. + * + * @return self + */ + public function setFee($fee) + { + if (is_null($fee)) { + throw new \InvalidArgumentException('non-nullable fee cannot be null'); + } + $this->container['fee'] = $fee; + + return $this; + } + + /** + * Gets principal + * + * @return int + */ + public function getPrincipal() + { + return $this->container['principal']; + } + + /** + * Sets principal + * + * @param int $principal Principal amount. + * + * @return self + */ + public function setPrincipal($principal) + { + if (is_null($principal)) { + throw new \InvalidArgumentException('non-nullable principal cannot be null'); + } + $this->container['principal'] = $principal; + + return $this; + } + + /** + * Gets total + * + * @return int + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int $total Total amount. A sum of principal amount and fee amount. + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Capital/CapitalGrant.php b/src/Adyen/Model/Capital/CapitalGrant.php new file mode 100644 index 000000000..57855ce63 --- /dev/null +++ b/src/Adyen/Model/Capital/CapitalGrant.php @@ -0,0 +1,706 @@ + + */ +class CapitalGrant implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CapitalGrant'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Capital\Amount', + 'balances' => '\Adyen\Model\Capital\CapitalBalance', + 'counterparty' => '\Adyen\Model\Capital\Counterparty', + 'fee' => '\Adyen\Model\Capital\Fee', + 'grantAccountId' => 'string', + 'grantOfferId' => 'string', + 'id' => 'string', + 'repayment' => '\Adyen\Model\Capital\Repayment', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'balances' => null, + 'counterparty' => null, + 'fee' => null, + 'grantAccountId' => null, + 'grantOfferId' => null, + 'id' => null, + 'repayment' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'balances' => false, + 'counterparty' => false, + 'fee' => false, + 'grantAccountId' => false, + 'grantOfferId' => false, + 'id' => false, + 'repayment' => false, + 'status' => 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', + 'balances' => 'balances', + 'counterparty' => 'counterparty', + 'fee' => 'fee', + 'grantAccountId' => 'grantAccountId', + 'grantOfferId' => 'grantOfferId', + 'id' => 'id', + 'repayment' => 'repayment', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'balances' => 'setBalances', + 'counterparty' => 'setCounterparty', + 'fee' => 'setFee', + 'grantAccountId' => 'setGrantAccountId', + 'grantOfferId' => 'setGrantOfferId', + 'id' => 'setId', + 'repayment' => 'setRepayment', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'balances' => 'getBalances', + 'counterparty' => 'getCounterparty', + 'fee' => 'getFee', + 'grantAccountId' => 'getGrantAccountId', + 'grantOfferId' => 'getGrantOfferId', + 'id' => 'getId', + 'repayment' => 'getRepayment', + 'status' => 'getStatus' + ]; + + /** + * 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 STATUS_PENDING = 'Pending'; + public const STATUS_ACTIVE = 'Active'; + public const STATUS_REPAID = 'Repaid'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_PENDING, + self::STATUS_ACTIVE, + self::STATUS_REPAID, + ]; + } + /** + * 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('balances', $data ?? [], null); + $this->setIfExists('counterparty', $data ?? [], null); + $this->setIfExists('fee', $data ?? [], null); + $this->setIfExists('grantAccountId', $data ?? [], null); + $this->setIfExists('grantOfferId', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('repayment', $data ?? [], null); + $this->setIfExists('status', $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['balances'] === null) { + $invalidProperties[] = "'balances' can't be null"; + } + if ($this->container['grantAccountId'] === null) { + $invalidProperties[] = "'grantAccountId' can't be null"; + } + if ($this->container['grantOfferId'] === null) { + $invalidProperties[] = "'grantOfferId' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + 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\Capital\Amount|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Capital\Amount|null $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets balances + * + * @return \Adyen\Model\Capital\CapitalBalance + */ + public function getBalances() + { + return $this->container['balances']; + } + + /** + * Sets balances + * + * @param \Adyen\Model\Capital\CapitalBalance $balances balances + * + * @return self + */ + public function setBalances($balances) + { + if (is_null($balances)) { + throw new \InvalidArgumentException('non-nullable balances cannot be null'); + } + $this->container['balances'] = $balances; + + return $this; + } + + /** + * Gets counterparty + * + * @return \Adyen\Model\Capital\Counterparty|null + */ + public function getCounterparty() + { + return $this->container['counterparty']; + } + + /** + * Sets counterparty + * + * @param \Adyen\Model\Capital\Counterparty|null $counterparty counterparty + * + * @return self + */ + public function setCounterparty($counterparty) + { + if (is_null($counterparty)) { + throw new \InvalidArgumentException('non-nullable counterparty cannot be null'); + } + $this->container['counterparty'] = $counterparty; + + return $this; + } + + /** + * Gets fee + * + * @return \Adyen\Model\Capital\Fee|null + */ + public function getFee() + { + return $this->container['fee']; + } + + /** + * Sets fee + * + * @param \Adyen\Model\Capital\Fee|null $fee fee + * + * @return self + */ + public function setFee($fee) + { + if (is_null($fee)) { + throw new \InvalidArgumentException('non-nullable fee cannot be null'); + } + $this->container['fee'] = $fee; + + return $this; + } + + /** + * Gets grantAccountId + * + * @return string + */ + public function getGrantAccountId() + { + return $this->container['grantAccountId']; + } + + /** + * Sets grantAccountId + * + * @param string $grantAccountId The identifier of the grant account used for the grant. + * + * @return self + */ + public function setGrantAccountId($grantAccountId) + { + if (is_null($grantAccountId)) { + throw new \InvalidArgumentException('non-nullable grantAccountId cannot be null'); + } + $this->container['grantAccountId'] = $grantAccountId; + + return $this; + } + + /** + * Gets grantOfferId + * + * @return string + */ + public function getGrantOfferId() + { + return $this->container['grantOfferId']; + } + + /** + * Sets grantOfferId + * + * @param string $grantOfferId The identifier of the grant offer that has been selected and from which the grant details will be used. + * + * @return self + */ + public function setGrantOfferId($grantOfferId) + { + if (is_null($grantOfferId)) { + throw new \InvalidArgumentException('non-nullable grantOfferId cannot be null'); + } + $this->container['grantOfferId'] = $grantOfferId; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The identifier of the grant reference. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets repayment + * + * @return \Adyen\Model\Capital\Repayment|null + */ + public function getRepayment() + { + return $this->container['repayment']; + } + + /** + * Sets repayment + * + * @param \Adyen\Model\Capital\Repayment|null $repayment repayment + * + * @return self + */ + public function setRepayment($repayment) + { + if (is_null($repayment)) { + throw new \InvalidArgumentException('non-nullable repayment cannot be null'); + } + $this->container['repayment'] = $repayment; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The current status of the grant. Possible values: **Pending**, **Active**, **Repaid**. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Capital/CapitalGrantInfo.php b/src/Adyen/Model/Capital/CapitalGrantInfo.php new file mode 100644 index 000000000..a4dd4041d --- /dev/null +++ b/src/Adyen/Model/Capital/CapitalGrantInfo.php @@ -0,0 +1,458 @@ + + */ +class CapitalGrantInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CapitalGrantInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'counterparty' => '\Adyen\Model\Capital\Counterparty', + 'grantAccountId' => 'string', + 'grantOfferId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'counterparty' => null, + 'grantAccountId' => null, + 'grantOfferId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'counterparty' => false, + 'grantAccountId' => false, + 'grantOfferId' => 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 = [ + 'counterparty' => 'counterparty', + 'grantAccountId' => 'grantAccountId', + 'grantOfferId' => 'grantOfferId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'counterparty' => 'setCounterparty', + 'grantAccountId' => 'setGrantAccountId', + 'grantOfferId' => 'setGrantOfferId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'counterparty' => 'getCounterparty', + 'grantAccountId' => 'getGrantAccountId', + 'grantOfferId' => 'getGrantOfferId' + ]; + + /** + * 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('counterparty', $data ?? [], null); + $this->setIfExists('grantAccountId', $data ?? [], null); + $this->setIfExists('grantOfferId', $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['grantAccountId'] === null) { + $invalidProperties[] = "'grantAccountId' can't be null"; + } + if ($this->container['grantOfferId'] === null) { + $invalidProperties[] = "'grantOfferId' 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 counterparty + * + * @return \Adyen\Model\Capital\Counterparty|null + */ + public function getCounterparty() + { + return $this->container['counterparty']; + } + + /** + * Sets counterparty + * + * @param \Adyen\Model\Capital\Counterparty|null $counterparty counterparty + * + * @return self + */ + public function setCounterparty($counterparty) + { + if (is_null($counterparty)) { + throw new \InvalidArgumentException('non-nullable counterparty cannot be null'); + } + $this->container['counterparty'] = $counterparty; + + return $this; + } + + /** + * Gets grantAccountId + * + * @return string + */ + public function getGrantAccountId() + { + return $this->container['grantAccountId']; + } + + /** + * Sets grantAccountId + * + * @param string $grantAccountId The identifier of the grant account used for the grant. + * + * @return self + */ + public function setGrantAccountId($grantAccountId) + { + if (is_null($grantAccountId)) { + throw new \InvalidArgumentException('non-nullable grantAccountId cannot be null'); + } + $this->container['grantAccountId'] = $grantAccountId; + + return $this; + } + + /** + * Gets grantOfferId + * + * @return string + */ + public function getGrantOfferId() + { + return $this->container['grantOfferId']; + } + + /** + * Sets grantOfferId + * + * @param string $grantOfferId The identifier of the grant offer that has been selected and from which the grant details will be used. + * + * @return self + */ + public function setGrantOfferId($grantOfferId) + { + if (is_null($grantOfferId)) { + throw new \InvalidArgumentException('non-nullable grantOfferId cannot be null'); + } + $this->container['grantOfferId'] = $grantOfferId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Capital/CapitalGrants.php b/src/Adyen/Model/Capital/CapitalGrants.php new file mode 100644 index 000000000..eab814cab --- /dev/null +++ b/src/Adyen/Model/Capital/CapitalGrants.php @@ -0,0 +1,387 @@ + + */ +class CapitalGrants implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CapitalGrants'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'grants' => '\Adyen\Model\Capital\CapitalGrant[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'grants' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'grants' => 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 = [ + 'grants' => 'grants' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'grants' => 'setGrants' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'grants' => 'getGrants' + ]; + + /** + * 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('grants', $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['grants'] === null) { + $invalidProperties[] = "'grants' 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 grants + * + * @return \Adyen\Model\Capital\CapitalGrant[] + */ + public function getGrants() + { + return $this->container['grants']; + } + + /** + * Sets grants + * + * @param \Adyen\Model\Capital\CapitalGrant[] $grants The unique identifier of the grant. + * + * @return self + */ + public function setGrants($grants) + { + if (is_null($grants)) { + throw new \InvalidArgumentException('non-nullable grants cannot be null'); + } + $this->container['grants'] = $grants; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Capital/Counterparty.php b/src/Adyen/Model/Capital/Counterparty.php new file mode 100644 index 000000000..21973d43f --- /dev/null +++ b/src/Adyen/Model/Capital/Counterparty.php @@ -0,0 +1,452 @@ + + */ +class Counterparty implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Counterparty'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountHolderId' => 'string', + '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 = [ + 'accountHolderId' => null, + 'balanceAccountId' => null, + 'transferInstrumentId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountHolderId' => false, + '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 = [ + 'accountHolderId' => 'accountHolderId', + 'balanceAccountId' => 'balanceAccountId', + 'transferInstrumentId' => 'transferInstrumentId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountHolderId' => 'setAccountHolderId', + 'balanceAccountId' => 'setBalanceAccountId', + 'transferInstrumentId' => 'setTransferInstrumentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountHolderId' => 'getAccountHolderId', + '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('accountHolderId', $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 accountHolderId + * + * @return string|null + */ + public function getAccountHolderId() + { + return $this->container['accountHolderId']; + } + + /** + * 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. + * + * @return self + */ + public function setAccountHolderId($accountHolderId) + { + if (is_null($accountHolderId)) { + throw new \InvalidArgumentException('non-nullable accountHolderId cannot be null'); + } + $this->container['accountHolderId'] = $accountHolderId; + + return $this; + } + + /** + * 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) + { + if (is_null($balanceAccountId)) { + throw new \InvalidArgumentException('non-nullable balanceAccountId cannot be null'); + } + $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) + { + if (is_null($transferInstrumentId)) { + throw new \InvalidArgumentException('non-nullable transferInstrumentId cannot be null'); + } + $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); + } + + /** + * 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/Capital/Fee.php b/src/Adyen/Model/Capital/Fee.php new file mode 100644 index 000000000..f0b380d19 --- /dev/null +++ b/src/Adyen/Model/Capital/Fee.php @@ -0,0 +1,387 @@ + + */ +class Fee implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Fee'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Capital\Amount' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' 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\Capital\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Capital\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * 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/Capital/InvalidField.php b/src/Adyen/Model/Capital/InvalidField.php new file mode 100644 index 000000000..3383c8eb7 --- /dev/null +++ b/src/Adyen/Model/Capital/InvalidField.php @@ -0,0 +1,461 @@ + + */ +class InvalidField implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InvalidField'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string', + 'name' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null, + 'name' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'message' => false, + 'name' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message', + 'name' => 'name', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + 'name' => 'setName', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + 'name' => 'getName', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message Description of the validation error. + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The field that has an invalid value. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value The invalid value. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * 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/Capital/JSONObject.php b/src/Adyen/Model/Capital/JSONObject.php new file mode 100644 index 000000000..58af36306 --- /dev/null +++ b/src/Adyen/Model/Capital/JSONObject.php @@ -0,0 +1,418 @@ + + */ +class JSONObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'JSONObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'paths' => '\Adyen\Model\Capital\JSONPath[]', + 'rootPath' => '\Adyen\Model\Capital\JSONPath' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'paths' => null, + 'rootPath' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'paths' => false, + 'rootPath' => 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 = [ + 'paths' => 'paths', + 'rootPath' => 'rootPath' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'paths' => 'setPaths', + 'rootPath' => 'setRootPath' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'paths' => 'getPaths', + 'rootPath' => 'getRootPath' + ]; + + /** + * 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('paths', $data ?? [], null); + $this->setIfExists('rootPath', $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 paths + * + * @return \Adyen\Model\Capital\JSONPath[]|null + */ + public function getPaths() + { + return $this->container['paths']; + } + + /** + * Sets paths + * + * @param \Adyen\Model\Capital\JSONPath[]|null $paths paths + * + * @return self + */ + public function setPaths($paths) + { + if (is_null($paths)) { + throw new \InvalidArgumentException('non-nullable paths cannot be null'); + } + $this->container['paths'] = $paths; + + return $this; + } + + /** + * Gets rootPath + * + * @return \Adyen\Model\Capital\JSONPath|null + */ + public function getRootPath() + { + return $this->container['rootPath']; + } + + /** + * Sets rootPath + * + * @param \Adyen\Model\Capital\JSONPath|null $rootPath rootPath + * + * @return self + */ + public function setRootPath($rootPath) + { + if (is_null($rootPath)) { + throw new \InvalidArgumentException('non-nullable rootPath cannot be null'); + } + $this->container['rootPath'] = $rootPath; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Capital/JSONPath.php b/src/Adyen/Model/Capital/JSONPath.php new file mode 100644 index 000000000..9f9024822 --- /dev/null +++ b/src/Adyen/Model/Capital/JSONPath.php @@ -0,0 +1,384 @@ + + */ +class JSONPath implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'JSONPath'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'content' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'content' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'content' => 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 = [ + 'content' => 'content' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent' + ]; + + /** + * 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('content', $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 content + * + * @return string[]|null + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string[]|null $content content + * + * @return self + */ + public function setContent($content) + { + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Capital/ModelInterface.php b/src/Adyen/Model/Capital/ModelInterface.php new file mode 100644 index 000000000..d2777b684 --- /dev/null +++ b/src/Adyen/Model/Capital/ModelInterface.php @@ -0,0 +1,92 @@ +format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach ($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) { + return $timestamp; + } + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if (is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Adyen\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/src/Adyen/Model/Capital/Repayment.php b/src/Adyen/Model/Capital/Repayment.php new file mode 100644 index 000000000..873ea9d20 --- /dev/null +++ b/src/Adyen/Model/Capital/Repayment.php @@ -0,0 +1,453 @@ + + */ +class Repayment implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Repayment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'basisPoints' => 'int', + 'term' => '\Adyen\Model\Capital\RepaymentTerm', + 'threshold' => '\Adyen\Model\Capital\ThresholdRepayment' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'basisPoints' => 'int32', + 'term' => null, + 'threshold' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'basisPoints' => true, + 'term' => false, + 'threshold' => 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 = [ + 'basisPoints' => 'basisPoints', + 'term' => 'term', + 'threshold' => 'threshold' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'basisPoints' => 'setBasisPoints', + 'term' => 'setTerm', + 'threshold' => 'setThreshold' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'basisPoints' => 'getBasisPoints', + 'term' => 'getTerm', + 'threshold' => 'getThreshold' + ]; + + /** + * 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('basisPoints', $data ?? [], null); + $this->setIfExists('term', $data ?? [], null); + $this->setIfExists('threshold', $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['basisPoints'] === null) { + $invalidProperties[] = "'basisPoints' 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 basisPoints + * + * @return int + */ + public function getBasisPoints() + { + return $this->container['basisPoints']; + } + + /** + * Sets basisPoints + * + * @param int $basisPoints The repayment that is deducted daily from incoming net volume, in [basis points](https://www.investopedia.com/terms/b/basispoint.asp). + * + * @return self + */ + public function setBasisPoints($basisPoints) + { + // Do nothing for nullable integers + $this->container['basisPoints'] = $basisPoints; + + return $this; + } + + /** + * Gets term + * + * @return \Adyen\Model\Capital\RepaymentTerm|null + */ + public function getTerm() + { + return $this->container['term']; + } + + /** + * Sets term + * + * @param \Adyen\Model\Capital\RepaymentTerm|null $term term + * + * @return self + */ + public function setTerm($term) + { + if (is_null($term)) { + throw new \InvalidArgumentException('non-nullable term cannot be null'); + } + $this->container['term'] = $term; + + return $this; + } + + /** + * Gets threshold + * + * @return \Adyen\Model\Capital\ThresholdRepayment|null + */ + public function getThreshold() + { + return $this->container['threshold']; + } + + /** + * Sets threshold + * + * @param \Adyen\Model\Capital\ThresholdRepayment|null $threshold threshold + * + * @return self + */ + public function setThreshold($threshold) + { + if (is_null($threshold)) { + throw new \InvalidArgumentException('non-nullable threshold cannot be null'); + } + $this->container['threshold'] = $threshold; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Capital/RepaymentTerm.php b/src/Adyen/Model/Capital/RepaymentTerm.php new file mode 100644 index 000000000..30f7f3f08 --- /dev/null +++ b/src/Adyen/Model/Capital/RepaymentTerm.php @@ -0,0 +1,417 @@ + + */ +class RepaymentTerm implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RepaymentTerm'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'estimatedDays' => 'int', + 'maximumDays' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'estimatedDays' => 'int32', + 'maximumDays' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'estimatedDays' => true, + 'maximumDays' => true + ]; + + /** + * 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 = [ + 'estimatedDays' => 'estimatedDays', + 'maximumDays' => 'maximumDays' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'estimatedDays' => 'setEstimatedDays', + 'maximumDays' => 'setMaximumDays' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'estimatedDays' => 'getEstimatedDays', + 'maximumDays' => 'getMaximumDays' + ]; + + /** + * 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('estimatedDays', $data ?? [], null); + $this->setIfExists('maximumDays', $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['estimatedDays'] === null) { + $invalidProperties[] = "'estimatedDays' 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 estimatedDays + * + * @return int + */ + public function getEstimatedDays() + { + return $this->container['estimatedDays']; + } + + /** + * Sets estimatedDays + * + * @param int $estimatedDays The estimated term for repaying the grant, in days. + * + * @return self + */ + public function setEstimatedDays($estimatedDays) + { + // Do nothing for nullable integers + $this->container['estimatedDays'] = $estimatedDays; + + return $this; + } + + /** + * Gets maximumDays + * + * @return int|null + */ + public function getMaximumDays() + { + return $this->container['maximumDays']; + } + + /** + * Sets maximumDays + * + * @param int|null $maximumDays The maximum term for repaying the grant, in days. Only applies when `contractType` is **loan**. + * + * @return self + */ + public function setMaximumDays($maximumDays) + { + // Do nothing for nullable integers + $this->container['maximumDays'] = $maximumDays; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Capital/RestServiceError.php b/src/Adyen/Model/Capital/RestServiceError.php new file mode 100644 index 000000000..94267a65a --- /dev/null +++ b/src/Adyen/Model/Capital/RestServiceError.php @@ -0,0 +1,669 @@ + + */ +class RestServiceError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RestServiceError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'detail' => 'string', + 'errorCode' => 'string', + 'instance' => 'string', + 'invalidFields' => '\Adyen\Model\Capital\InvalidField[]', + 'requestId' => 'string', + 'response' => '\Adyen\Model\Capital\JSONObject', + 'status' => 'int', + 'title' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'detail' => null, + 'errorCode' => null, + 'instance' => null, + 'invalidFields' => null, + 'requestId' => null, + 'response' => null, + 'status' => 'int32', + 'title' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'detail' => false, + 'errorCode' => false, + 'instance' => false, + 'invalidFields' => false, + 'requestId' => false, + 'response' => false, + 'status' => true, + 'title' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'detail' => 'detail', + 'errorCode' => 'errorCode', + 'instance' => 'instance', + 'invalidFields' => 'invalidFields', + 'requestId' => 'requestId', + 'response' => 'response', + 'status' => 'status', + 'title' => 'title', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'detail' => 'setDetail', + 'errorCode' => 'setErrorCode', + 'instance' => 'setInstance', + 'invalidFields' => 'setInvalidFields', + 'requestId' => 'setRequestId', + 'response' => 'setResponse', + 'status' => 'setStatus', + 'title' => 'setTitle', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'detail' => 'getDetail', + 'errorCode' => 'getErrorCode', + 'instance' => 'getInstance', + 'invalidFields' => 'getInvalidFields', + 'requestId' => 'getRequestId', + 'response' => 'getResponse', + 'status' => 'getStatus', + 'title' => 'getTitle', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('detail', $data ?? [], null); + $this->setIfExists('errorCode', $data ?? [], null); + $this->setIfExists('instance', $data ?? [], null); + $this->setIfExists('invalidFields', $data ?? [], null); + $this->setIfExists('requestId', $data ?? [], null); + $this->setIfExists('response', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['detail'] === null) { + $invalidProperties[] = "'detail' can't be null"; + } + if ($this->container['errorCode'] === null) { + $invalidProperties[] = "'errorCode' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets detail + * + * @return string + */ + public function getDetail() + { + return $this->container['detail']; + } + + /** + * Sets detail + * + * @param string $detail A human-readable explanation specific to this occurrence of the problem. + * + * @return self + */ + public function setDetail($detail) + { + if (is_null($detail)) { + throw new \InvalidArgumentException('non-nullable detail cannot be null'); + } + $this->container['detail'] = $detail; + + return $this; + } + + /** + * Gets errorCode + * + * @return string + */ + public function getErrorCode() + { + return $this->container['errorCode']; + } + + /** + * Sets errorCode + * + * @param string $errorCode A code that identifies the problem type. + * + * @return self + */ + public function setErrorCode($errorCode) + { + if (is_null($errorCode)) { + throw new \InvalidArgumentException('non-nullable errorCode cannot be null'); + } + $this->container['errorCode'] = $errorCode; + + return $this; + } + + /** + * Gets instance + * + * @return string|null + */ + public function getInstance() + { + return $this->container['instance']; + } + + /** + * Sets instance + * + * @param string|null $instance A unique URI that identifies the specific occurrence of the problem. + * + * @return self + */ + public function setInstance($instance) + { + if (is_null($instance)) { + throw new \InvalidArgumentException('non-nullable instance cannot be null'); + } + $this->container['instance'] = $instance; + + return $this; + } + + /** + * Gets invalidFields + * + * @return \Adyen\Model\Capital\InvalidField[]|null + */ + public function getInvalidFields() + { + return $this->container['invalidFields']; + } + + /** + * Sets invalidFields + * + * @param \Adyen\Model\Capital\InvalidField[]|null $invalidFields Detailed explanation of each validation error, when applicable. + * + * @return self + */ + public function setInvalidFields($invalidFields) + { + if (is_null($invalidFields)) { + throw new \InvalidArgumentException('non-nullable invalidFields cannot be null'); + } + $this->container['invalidFields'] = $invalidFields; + + return $this; + } + + /** + * Gets requestId + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['requestId']; + } + + /** + * Sets requestId + * + * @param string|null $requestId A unique reference for the request, essentially the same as `pspReference`. + * + * @return self + */ + public function setRequestId($requestId) + { + if (is_null($requestId)) { + throw new \InvalidArgumentException('non-nullable requestId cannot be null'); + } + $this->container['requestId'] = $requestId; + + return $this; + } + + /** + * Gets response + * + * @return \Adyen\Model\Capital\JSONObject|null + */ + public function getResponse() + { + return $this->container['response']; + } + + /** + * Sets response + * + * @param \Adyen\Model\Capital\JSONObject|null $response response + * + * @return self + */ + public function setResponse($response) + { + if (is_null($response)) { + throw new \InvalidArgumentException('non-nullable response cannot be null'); + } + $this->container['response'] = $response; + + return $this; + } + + /** + * Gets status + * + * @return int + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param int $status The HTTP status code. + * + * @return self + */ + public function setStatus($status) + { + // Do nothing for nullable integers + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title A short, human-readable summary of the problem type. + * + * @return self + */ + public function setTitle($title) + { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type A URI that identifies the problem type, pointing to human-readable documentation on this problem type. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * 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/Capital/ThresholdRepayment.php b/src/Adyen/Model/Capital/ThresholdRepayment.php new file mode 100644 index 000000000..b654fcb84 --- /dev/null +++ b/src/Adyen/Model/Capital/ThresholdRepayment.php @@ -0,0 +1,387 @@ + + */ +class ThresholdRepayment implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThresholdRepayment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Capital\Amount' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' 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\Capital\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Capital\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AchDetails.php b/src/Adyen/Model/Checkout/AchDetails.php index c34b38a26..1c36e6ca9 100644 --- a/src/Adyen/Model/Checkout/AchDetails.php +++ b/src/Adyen/Model/Checkout/AchDetails.php @@ -264,6 +264,7 @@ public function getModelName() } public const TYPE_ACH = 'ach'; + public const TYPE_ACH_PLAID = 'ach_plaid'; /** * Gets allowable values of the enum @@ -274,6 +275,7 @@ public function getTypeAllowableValues() { return [ self::TYPE_ACH, + self::TYPE_ACH_PLAID, ]; } /** diff --git a/src/Adyen/Model/Checkout/AdditionalDataAirline.php b/src/Adyen/Model/Checkout/AdditionalDataAirline.php index c861f1e63..6b5fa6173 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataAirline.php +++ b/src/Adyen/Model/Checkout/AdditionalDataAirline.php @@ -481,7 +481,7 @@ public function getAirlineAgencyInvoiceNumber() /** * Sets airlineAgencyInvoiceNumber * - * @param string|null $airlineAgencyInvoiceNumber Reference number for the invoice, issued by the agency. * minLength: 1 * maxLength: 6 + * @param string|null $airlineAgencyInvoiceNumber The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters * * @return self */ @@ -508,7 +508,7 @@ public function getAirlineAgencyPlanName() /** * Sets airlineAgencyPlanName * - * @param string|null $airlineAgencyPlanName 2-letter agency plan identifier; alphabetical. * minLength: 2 * maxLength: 2 + * @param string|null $airlineAgencyPlanName The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters * * @return self */ @@ -535,7 +535,7 @@ public function getAirlineAirlineCode() /** * Sets airlineAirlineCode * - * @param string|null $airlineAirlineCode [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX); numeric. It identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 * maxLength: 3 + * @param string|null $airlineAirlineCode The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros * * @return self */ @@ -562,7 +562,7 @@ public function getAirlineAirlineDesignatorCode() /** * Sets airlineAirlineDesignatorCode * - * @param string|null $airlineAirlineDesignatorCode [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX); alphabetical. It identifies the carrier. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter airline code * Example: KLM = KL * minLength: 2 * maxLength: 2 + * @param string|null $airlineAirlineDesignatorCode The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros * * @return self */ @@ -589,7 +589,7 @@ public function getAirlineBoardingFee() /** * Sets airlineBoardingFee * - * @param string|null $airlineBoardingFee Chargeable amount for boarding the plane. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). * minLength: 1 * maxLength: 18 + * @param string|null $airlineBoardingFee The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 18 characters * * @return self */ @@ -616,7 +616,7 @@ public function getAirlineComputerizedReservationSystem() /** * Sets airlineComputerizedReservationSystem * - * @param string|null $airlineComputerizedReservationSystem The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Format: alphanumeric. * minLength: 4 * maxLength: 4 + * @param string|null $airlineComputerizedReservationSystem The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters * * @return self */ @@ -643,7 +643,7 @@ public function getAirlineCustomerReferenceNumber() /** * Sets airlineCustomerReferenceNumber * - * @param string|null $airlineCustomerReferenceNumber Reference number; alphanumeric. * minLength: 0 * maxLength: 20 + * @param string|null $airlineCustomerReferenceNumber The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not be all spaces * * @return self */ @@ -670,7 +670,7 @@ public function getAirlineDocumentType() /** * Sets airlineDocumentType * - * @param string|null $airlineDocumentType Optional 2-digit code; alphanumeric. It identifies the type of product of the transaction. The description of the code may appear on credit card statements. * Format: 2-digit code * Example: Passenger ticket = 01 * minLength: 2 * maxLength: 2 + * @param string|null $airlineDocumentType A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters * * @return self */ @@ -697,7 +697,7 @@ public function getAirlineFlightDate() /** * Sets airlineFlightDate * - * @param string|null $airlineFlightDate Flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 * maxLength: 16 + * @param string|null $airlineFlightDate The flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 characters * maxLength: 16 characters * * @return self */ @@ -724,7 +724,7 @@ public function getAirlineLegCarrierCode() /** * Sets airlineLegCarrierCode * - * @param string|null $airlineLegCarrierCode [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX); alphabetical. It identifies the carrier. This field is required/mandatory if the airline data includes leg details. * Format: IATA 2-letter airline code * Example: KLM = KL * minLength: 2 * maxLength: 2 + * @param string|null $airlineLegCarrierCode The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros * * @return self */ @@ -751,7 +751,7 @@ public function getAirlineLegClassOfTravel() /** * Sets airlineLegClassOfTravel * - * @param string|null $airlineLegClassOfTravel 1-letter travel class identifier; alphabetical. There is no standard; however, the following codes are used rather consistently: * F: first class * J: business class * Y: economy class * W: premium economy Limitations: * minLength: 1 * maxLength: 1 + * @param string|null $airlineLegClassOfTravel A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces * Must not be all zeros * * @return self */ @@ -778,7 +778,7 @@ public function getAirlineLegDateOfTravel() /** * Sets airlineLegDateOfTravel * - * @param string|null $airlineLegDateOfTravel Date and time of travel. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)-compliant. * Format: `yyyy-MM-dd HH:mm` * minLength: 16 * maxLength: 16 + * @param string|null $airlineLegDateOfTravel Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters * * @return self */ @@ -805,7 +805,7 @@ public function getAirlineLegDepartAirport() /** * Sets airlineLegDepartAirport * - * @param string|null $airlineLegDepartAirport Alphabetical identifier of the departure airport. This field is required if the airline data includes leg details. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code. * Example: Amsterdam = AMS * minLength: 3 * maxLength: 3 + * @param string|null $airlineLegDepartAirport The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros * * @return self */ @@ -832,7 +832,7 @@ public function getAirlineLegDepartTax() /** * Sets airlineLegDepartTax * - * @param string|null $airlineLegDepartTax [Departure tax](https://en.wikipedia.org/wiki/Departure_tax). Amount charged by a country to an individual upon their leaving. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). * minLength: 1 * maxLength: 12 + * @param string|null $airlineLegDepartTax The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 * Must not be all zeros * * @return self */ @@ -859,7 +859,7 @@ public function getAirlineLegDestinationCode() /** * Sets airlineLegDestinationCode * - * @param string|null $airlineLegDestinationCode Alphabetical identifier of the destination/arrival airport. This field is required/mandatory if the airline data includes leg details. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code. * Example: Amsterdam = AMS * minLength: 3 * maxLength: 3 + * @param string|null $airlineLegDestinationCode The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros * * @return self */ @@ -886,7 +886,7 @@ public function getAirlineLegFareBaseCode() /** * Sets airlineLegFareBaseCode * - * @param string|null $airlineLegFareBaseCode [Fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code); alphanumeric. * minLength: 1 * maxLength: 7 + * @param string|null $airlineLegFareBaseCode The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces * Must not be all zeros * * @return self */ @@ -913,7 +913,7 @@ public function getAirlineLegFlightNumber() /** * Sets airlineLegFlightNumber * - * @param string|null $airlineLegFlightNumber The flight identifier. * minLength: 1 * maxLength: 5 + * @param string|null $airlineLegFlightNumber The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros * * @return self */ @@ -940,7 +940,7 @@ public function getAirlineLegStopOverCode() /** * Sets airlineLegStopOverCode * - * @param string|null $airlineLegStopOverCode 1-letter code that indicates whether the passenger is entitled to make a stopover. Only two types of characters are allowed: * O: Stopover allowed * X: Stopover not allowed Limitations: * minLength: 1 * maxLength: 1 + * @param string|null $airlineLegStopOverCode A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * * @return self */ @@ -967,7 +967,7 @@ public function getAirlinePassengerDateOfBirth() /** * Sets airlinePassengerDateOfBirth * - * @param string|null $airlinePassengerDateOfBirth Date of birth of the passenger. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 + * @param string|null $airlinePassengerDateOfBirth The passenger's date of birth. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 * * @return self */ @@ -994,7 +994,7 @@ public function getAirlinePassengerFirstName() /** * Sets airlinePassengerFirstName * - * @param string|null $airlinePassengerFirstName Passenger first name/given name. > This field is required/mandatory if the airline data includes passenger details or leg details. + * @param string|null $airlinePassengerFirstName The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII * * @return self */ @@ -1021,7 +1021,7 @@ public function getAirlinePassengerLastName() /** * Sets airlinePassengerLastName * - * @param string|null $airlinePassengerLastName Passenger last name/family name. > This field is required/mandatory if the airline data includes passenger details or leg details. + * @param string|null $airlinePassengerLastName The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII * * @return self */ @@ -1048,7 +1048,7 @@ public function getAirlinePassengerTelephoneNumber() /** * Sets airlinePassengerTelephoneNumber * - * @param string|null $airlinePassengerTelephoneNumber Telephone number of the passenger, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * minLength: 3 * maxLength: 30 + * @param string|null $airlinePassengerTelephoneNumber The passenger's telephone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters * * @return self */ @@ -1075,7 +1075,7 @@ public function getAirlinePassengerTravellerType() /** * Sets airlinePassengerTravellerType * - * @param string|null $airlinePassengerTravellerType Passenger type code (PTC). IATA PTC values are 3-letter alphabetical. Example: ADT, SRC, CNN, INS. However, several carriers use non-standard codes that can be up to 5 alphanumeric characters. * minLength: 3 * maxLength: 6 + * @param string|null $airlinePassengerTravellerType The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters * * @return self */ @@ -1102,7 +1102,7 @@ public function getAirlinePassengerName() /** * Sets airlinePassengerName * - * @param string $airlinePassengerName Passenger name, initials, and a title. * Format: last name + first name or initials + title. * Example: *FLYER / MARY MS*. * minLength: 1 * maxLength: 49 + * @param string $airlinePassengerName The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros * * @return self */ @@ -1129,7 +1129,7 @@ public function getAirlineTicketIssueAddress() /** * Sets airlineTicketIssueAddress * - * @param string|null $airlineTicketIssueAddress Address of the place/agency that issued the ticket. * minLength: 0 * maxLength: 16 + * @param string|null $airlineTicketIssueAddress The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters * * @return self */ @@ -1156,7 +1156,7 @@ public function getAirlineTicketNumber() /** * Sets airlineTicketNumber * - * @param string|null $airlineTicketNumber The ticket's unique identifier. * minLength: 1 * maxLength: 150 + * @param string|null $airlineTicketNumber The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros * * @return self */ @@ -1183,7 +1183,7 @@ public function getAirlineTravelAgencyCode() /** * Sets airlineTravelAgencyCode * - * @param string|null $airlineTravelAgencyCode IATA number, also ARC number or ARC/IATA number. Unique identifier number for travel agencies. * minLength: 1 * maxLength: 8 + * @param string|null $airlineTravelAgencyCode The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces * Must not be all zeros * * @return self */ @@ -1210,7 +1210,7 @@ public function getAirlineTravelAgencyName() /** * Sets airlineTravelAgencyName * - * @param string|null $airlineTravelAgencyName The name of the travel agency. * minLength: 1 * maxLength: 25 + * @param string|null $airlineTravelAgencyName The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros * * @return self */ diff --git a/src/Adyen/Model/Checkout/AdditionalDataCarRental.php b/src/Adyen/Model/Checkout/AdditionalDataCarRental.php index 29625f501..0882c9d5b 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataCarRental.php +++ b/src/Adyen/Model/Checkout/AdditionalDataCarRental.php @@ -443,7 +443,7 @@ public function getCarRentalCheckOutDate() /** * Sets carRentalCheckOutDate * - * @param string|null $carRentalCheckOutDate Pick-up date. * Date format: `yyyyMMdd` + * @param string|null $carRentalCheckOutDate The pick-up date. * Date format: `yyyyMMdd` * * @return self */ @@ -470,7 +470,7 @@ public function getCarRentalCustomerServiceTollFreeNumber() /** * Sets carRentalCustomerServiceTollFreeNumber * - * @param string|null $carRentalCustomerServiceTollFreeNumber The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 + * @param string|null $carRentalCustomerServiceTollFreeNumber The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - * * @return self */ @@ -497,7 +497,7 @@ public function getCarRentalDaysRented() /** * Sets carRentalDaysRented * - * @param string|null $carRentalDaysRented Number of days for which the car is being rented. * Format: Numeric * maxLength: 19 + * @param string|null $carRentalDaysRented Number of days for which the car is being rented. * Format: Numeric * maxLength: 4 * Must not be all spaces * * @return self */ @@ -524,7 +524,7 @@ public function getCarRentalFuelCharges() /** * Sets carRentalFuelCharges * - * @param string|null $carRentalFuelCharges Any fuel charges associated with the rental. * Format: Numeric * maxLength: 12 + * @param string|null $carRentalFuelCharges Any fuel charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * * @return self */ @@ -551,7 +551,7 @@ public function getCarRentalInsuranceCharges() /** * Sets carRentalInsuranceCharges * - * @param string|null $carRentalInsuranceCharges Any insurance charges associated with the rental. * Format: Numeric * maxLength: 12 + * @param string|null $carRentalInsuranceCharges Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces * Must not be all zeros * * @return self */ @@ -578,7 +578,7 @@ public function getCarRentalLocationCity() /** * Sets carRentalLocationCity * - * @param string|null $carRentalLocationCity The city from which the car is rented. * Format: Alphanumeric * maxLength: 18 + * @param string|null $carRentalLocationCity The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros * * @return self */ @@ -605,7 +605,7 @@ public function getCarRentalLocationCountry() /** * Sets carRentalLocationCountry * - * @param string|null $carRentalLocationCountry The country from which the car is rented. * Format: Alphanumeric * maxLength: 2 + * @param string|null $carRentalLocationCountry The country where the car is rented, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 * * @return self */ @@ -632,7 +632,7 @@ public function getCarRentalLocationStateProvince() /** * Sets carRentalLocationStateProvince * - * @param string|null $carRentalLocationStateProvince The state or province from where the car is rented. * Format: Alphanumeric * maxLength: 3 + * @param string|null $carRentalLocationStateProvince The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces * Must not be all zeros * * @return self */ @@ -659,7 +659,7 @@ public function getCarRentalNoShowIndicator() /** * Sets carRentalNoShowIndicator * - * @param string|null $carRentalNoShowIndicator Indicates if the customer was a \"no-show\" (neither keeps nor cancels their booking). * Y - Customer was a no show. * N - Not applicable. + * @param string|null $carRentalNoShowIndicator Indicates if the customer didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable * * @return self */ @@ -686,7 +686,7 @@ public function getCarRentalOneWayDropOffCharges() /** * Sets carRentalOneWayDropOffCharges * - * @param string|null $carRentalOneWayDropOffCharges Charge associated with not returning a vehicle to the original rental location. + * @param string|null $carRentalOneWayDropOffCharges The charge for not returning a car to the original rental location, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 12 * * @return self */ @@ -713,7 +713,7 @@ public function getCarRentalRate() /** * Sets carRentalRate * - * @param string|null $carRentalRate Daily rental rate. * Format: Alphanumeric * maxLength: 12 + * @param string|null $carRentalRate The daily rental rate, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Alphanumeric * maxLength: 12 * * @return self */ @@ -740,7 +740,7 @@ public function getCarRentalRateIndicator() /** * Sets carRentalRateIndicator * - * @param string|null $carRentalRateIndicator Specifies whether the given rate is applied daily or weekly. * D - Daily rate. * W - Weekly rate. + * @param string|null $carRentalRateIndicator Specifies whether the given rate is applied daily or weekly. * D - Daily rate * W - Weekly rate * * @return self */ @@ -767,7 +767,7 @@ public function getCarRentalRentalAgreementNumber() /** * Sets carRentalRentalAgreementNumber * - * @param string|null $carRentalRentalAgreementNumber The rental agreement number associated with this car rental. * Format: Alphanumeric * maxLength: 9 + * @param string|null $carRentalRentalAgreementNumber The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces * Must not be all zeros * * @return self */ @@ -794,7 +794,7 @@ public function getCarRentalRentalClassId() /** * Sets carRentalRentalClassId * - * @param string|null $carRentalRentalClassId Daily rental rate. * Format: Alphanumeric * maxLength: 12 + * @param string|null $carRentalRentalClassId The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces * Must not be all zeros * * @return self */ @@ -821,7 +821,7 @@ public function getCarRentalRenterName() /** * Sets carRentalRenterName * - * @param string|null $carRentalRenterName The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 + * @param string|null $carRentalRenterName The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces * Must not be all zeros * * @return self */ @@ -848,7 +848,7 @@ public function getCarRentalReturnCity() /** * Sets carRentalReturnCity * - * @param string|null $carRentalReturnCity The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 + * @param string|null $carRentalReturnCity The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros * * @return self */ @@ -875,7 +875,7 @@ public function getCarRentalReturnCountry() /** * Sets carRentalReturnCountry * - * @param string|null $carRentalReturnCountry The country where the car must be returned. * Format: Alphanumeric * maxLength: 2 + * @param string|null $carRentalReturnCountry The country where the car must be returned, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 * * @return self */ @@ -902,7 +902,7 @@ public function getCarRentalReturnDate() /** * Sets carRentalReturnDate * - * @param string|null $carRentalReturnDate The last date to return the car by. * Date format: `yyyyMMdd` + * @param string|null $carRentalReturnDate The last date to return the car by. * Date format: `yyyyMMdd` * maxLength: 8 * * @return self */ @@ -929,7 +929,7 @@ public function getCarRentalReturnLocationId() /** * Sets carRentalReturnLocationId * - * @param string|null $carRentalReturnLocationId Agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 + * @param string|null $carRentalReturnLocationId The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces * Must not be all zeros * * @return self */ @@ -956,7 +956,7 @@ public function getCarRentalReturnStateProvince() /** * Sets carRentalReturnStateProvince * - * @param string|null $carRentalReturnStateProvince The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 + * @param string|null $carRentalReturnStateProvince The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces * Must not be all zeros * * @return self */ @@ -983,7 +983,7 @@ public function getCarRentalTaxExemptIndicator() /** * Sets carRentalTaxExemptIndicator * - * @param string|null $carRentalTaxExemptIndicator Indicates whether the goods or services were tax-exempt, or tax was not collected. Values: * Y - Goods or services were tax exempt * N - Tax was not collected + * @param string|null $carRentalTaxExemptIndicator Indicates if the goods or services were tax-exempt, or if tax was not paid on them. Values: * Y - Goods or services were tax exempt * N - Tax was not collected * * @return self */ @@ -1010,7 +1010,7 @@ public function getTravelEntertainmentAuthDataDuration() /** * Sets travelEntertainmentAuthDataDuration * - * @param string|null $travelEntertainmentAuthDataDuration Number of nights. This should be included in the auth message. * Format: Numeric * maxLength: 2 + * @param string|null $travelEntertainmentAuthDataDuration Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 4 * * @return self */ @@ -1037,7 +1037,7 @@ public function getTravelEntertainmentAuthDataMarket() /** * Sets travelEntertainmentAuthDataMarket * - * @param string|null $travelEntertainmentAuthDataMarket Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"A\" for Car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 + * @param string|null $travelEntertainmentAuthDataMarket Indicates what market-specific dataset will be submitted or is being submitted. Value should be 'A' for car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 * * @return self */ diff --git a/src/Adyen/Model/Checkout/AdditionalDataLevel23.php b/src/Adyen/Model/Checkout/AdditionalDataLevel23.php index d82c7a0c2..0cd47a510 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataLevel23.php +++ b/src/Adyen/Model/Checkout/AdditionalDataLevel23.php @@ -401,7 +401,7 @@ public function getEnhancedSchemeDataCustomerReference() /** * Sets enhancedSchemeDataCustomerReference * - * @param string|null $enhancedSchemeDataCustomerReference Customer code, if supplied by a customer. Encoding: ASCII. Max length: 25 characters. > Required for Level 2 and Level 3 data. + * @param string|null $enhancedSchemeDataCustomerReference The customer code. Encoding: ASCII Max length: 25 characters Must not start with a space or be all spaces Must not be all zeros * * @return self */ @@ -428,7 +428,7 @@ public function getEnhancedSchemeDataDestinationCountryCode() /** * Sets enhancedSchemeDataDestinationCountryCode * - * @param string|null $enhancedSchemeDataDestinationCountryCode Destination country code. Encoding: ASCII. Max length: 3 characters. + * @param string|null $enhancedSchemeDataDestinationCountryCode The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. Encoding: ASCII Fixed length: 3 characters * * @return self */ @@ -455,7 +455,7 @@ public function getEnhancedSchemeDataDestinationPostalCode() /** * Sets enhancedSchemeDataDestinationPostalCode * - * @param string|null $enhancedSchemeDataDestinationPostalCode The postal code of a destination address. Encoding: ASCII. Max length: 10 characters. > Required for American Express. + * @param string|null $enhancedSchemeDataDestinationPostalCode The postal code of the destination address. Encoding: ASCII Max length: 10 characters Must not start with a space * * @return self */ @@ -482,7 +482,7 @@ public function getEnhancedSchemeDataDestinationStateProvinceCode() /** * Sets enhancedSchemeDataDestinationStateProvinceCode * - * @param string|null $enhancedSchemeDataDestinationStateProvinceCode Destination state or province code. Encoding: ASCII.Max length: 3 characters. + * @param string|null $enhancedSchemeDataDestinationStateProvinceCode Destination state or province code. Encoding: ASCII Max length: 3 characters Must not start with a space * * @return self */ @@ -509,7 +509,7 @@ public function getEnhancedSchemeDataDutyAmount() /** * Sets enhancedSchemeDataDutyAmount * - * @param string|null $enhancedSchemeDataDutyAmount Duty amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * @param string|null $enhancedSchemeDataDutyAmount The duty amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters * * @return self */ @@ -536,7 +536,7 @@ public function getEnhancedSchemeDataFreightAmount() /** * Sets enhancedSchemeDataFreightAmount * - * @param string|null $enhancedSchemeDataFreightAmount Shipping amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * @param string|null $enhancedSchemeDataFreightAmount The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters * * @return self */ @@ -563,7 +563,7 @@ public function getEnhancedSchemeDataItemDetailLineItemNrCommodityCode() /** * Sets enhancedSchemeDataItemDetailLineItemNrCommodityCode * - * @param string|null $enhancedSchemeDataItemDetailLineItemNrCommodityCode Item commodity code. Encoding: ASCII. Max length: 12 characters. + * @param string|null $enhancedSchemeDataItemDetailLineItemNrCommodityCode The [UNSPC commodity code](https://www.unspsc.org/) of the item. Encoding: ASCII Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros * * @return self */ @@ -590,7 +590,7 @@ public function getEnhancedSchemeDataItemDetailLineItemNrDescription() /** * Sets enhancedSchemeDataItemDetailLineItemNrDescription * - * @param string|null $enhancedSchemeDataItemDetailLineItemNrDescription Item description. Encoding: ASCII. Max length: 26 characters. + * @param string|null $enhancedSchemeDataItemDetailLineItemNrDescription A description of the item. Encoding: ASCII Max length: 26 characters Must not start with a space or be all spaces Must not be all zeros * * @return self */ @@ -617,7 +617,7 @@ public function getEnhancedSchemeDataItemDetailLineItemNrDiscountAmount() /** * Sets enhancedSchemeDataItemDetailLineItemNrDiscountAmount * - * @param string|null $enhancedSchemeDataItemDetailLineItemNrDiscountAmount Discount amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * @param string|null $enhancedSchemeDataItemDetailLineItemNrDiscountAmount The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters * * @return self */ @@ -644,7 +644,7 @@ public function getEnhancedSchemeDataItemDetailLineItemNrProductCode() /** * Sets enhancedSchemeDataItemDetailLineItemNrProductCode * - * @param string|null $enhancedSchemeDataItemDetailLineItemNrProductCode Product code. Encoding: ASCII. Max length: 12 characters. + * @param string|null $enhancedSchemeDataItemDetailLineItemNrProductCode The product code. Encoding: ASCII. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros * * @return self */ @@ -671,7 +671,7 @@ public function getEnhancedSchemeDataItemDetailLineItemNrQuantity() /** * Sets enhancedSchemeDataItemDetailLineItemNrQuantity * - * @param string|null $enhancedSchemeDataItemDetailLineItemNrQuantity Quantity, specified as an integer value. Value must be greater than 0. Max length: 12 characters. + * @param string|null $enhancedSchemeDataItemDetailLineItemNrQuantity The number of items. Must be an integer greater than zero. Encoding: Numeric Max length: 12 characters Must not start with a space or be all spaces * * @return self */ @@ -698,7 +698,7 @@ public function getEnhancedSchemeDataItemDetailLineItemNrTotalAmount() /** * Sets enhancedSchemeDataItemDetailLineItemNrTotalAmount * - * @param string|null $enhancedSchemeDataItemDetailLineItemNrTotalAmount Total amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * @param string|null $enhancedSchemeDataItemDetailLineItemNrTotalAmount The total amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros * * @return self */ @@ -725,7 +725,7 @@ public function getEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure() /** * Sets enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure * - * @param string|null $enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure Item unit of measurement. Encoding: ASCII. Max length: 3 characters. + * @param string|null $enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure The unit of measurement for an item. Encoding: ASCII Max length: 3 characters Must not start with a space or be all spaces Must not be all zeros * * @return self */ @@ -752,7 +752,7 @@ public function getEnhancedSchemeDataItemDetailLineItemNrUnitPrice() /** * Sets enhancedSchemeDataItemDetailLineItemNrUnitPrice * - * @param string|null $enhancedSchemeDataItemDetailLineItemNrUnitPrice Unit price, specified in [minor units](https://docs.adyen.com/development-resources/currency-codes). Max length: 12 characters. + * @param string|null $enhancedSchemeDataItemDetailLineItemNrUnitPrice The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters * * @return self */ @@ -779,7 +779,7 @@ public function getEnhancedSchemeDataOrderDate() /** * Sets enhancedSchemeDataOrderDate * - * @param string|null $enhancedSchemeDataOrderDate Order date. * Format: `ddMMyy` Encoding: ASCII. Max length: 6 characters. + * @param string|null $enhancedSchemeDataOrderDate The order date. * Format: `ddMMyy` Encoding: ASCII Max length: 6 characters * * @return self */ @@ -806,7 +806,7 @@ public function getEnhancedSchemeDataShipFromPostalCode() /** * Sets enhancedSchemeDataShipFromPostalCode * - * @param string|null $enhancedSchemeDataShipFromPostalCode The postal code of a \"ship-from\" address. Encoding: ASCII. Max length: 10 characters. + * @param string|null $enhancedSchemeDataShipFromPostalCode The postal code of the address the item is shipped from. Encoding: ASCII Max length: 10 characters Must not start with a space or be all spaces Must not be all zeros * * @return self */ @@ -833,7 +833,7 @@ public function getEnhancedSchemeDataTotalTaxAmount() /** * Sets enhancedSchemeDataTotalTaxAmount * - * @param string|null $enhancedSchemeDataTotalTaxAmount Total tax amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. > Required for Level 2 and Level 3 data. + * @param string|null $enhancedSchemeDataTotalTaxAmount The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters * * @return self */ diff --git a/src/Adyen/Model/Checkout/AdditionalDataLodging.php b/src/Adyen/Model/Checkout/AdditionalDataLodging.php index fe01d570b..b30c0a01f 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataLodging.php +++ b/src/Adyen/Model/Checkout/AdditionalDataLodging.php @@ -56,7 +56,6 @@ class AdditionalDataLodging implements ModelInterface, ArrayAccess, \JsonSeriali 'lodgingPropertyPhoneNumber' => 'string', 'lodgingRoom1NumberOfNights' => 'string', 'lodgingRoom1Rate' => 'string', - 'lodgingRoom1Tax' => 'string', 'lodgingTotalRoomTax' => 'string', 'lodgingTotalTax' => 'string', 'travelEntertainmentAuthDataDuration' => 'string', @@ -83,7 +82,6 @@ class AdditionalDataLodging implements ModelInterface, ArrayAccess, \JsonSeriali 'lodgingPropertyPhoneNumber' => null, 'lodgingRoom1NumberOfNights' => null, 'lodgingRoom1Rate' => null, - 'lodgingRoom1Tax' => null, 'lodgingTotalRoomTax' => null, 'lodgingTotalTax' => null, 'travelEntertainmentAuthDataDuration' => null, @@ -108,7 +106,6 @@ class AdditionalDataLodging implements ModelInterface, ArrayAccess, \JsonSeriali 'lodgingPropertyPhoneNumber' => false, 'lodgingRoom1NumberOfNights' => false, 'lodgingRoom1Rate' => false, - 'lodgingRoom1Tax' => false, 'lodgingTotalRoomTax' => false, 'lodgingTotalTax' => false, 'travelEntertainmentAuthDataDuration' => false, @@ -213,7 +210,6 @@ public function isNullableSetToNull(string $property): bool 'lodgingPropertyPhoneNumber' => 'lodging.propertyPhoneNumber', 'lodgingRoom1NumberOfNights' => 'lodging.room1.numberOfNights', 'lodgingRoom1Rate' => 'lodging.room1.rate', - 'lodgingRoom1Tax' => 'lodging.room1.tax', 'lodgingTotalRoomTax' => 'lodging.totalRoomTax', 'lodgingTotalTax' => 'lodging.totalTax', 'travelEntertainmentAuthDataDuration' => 'travelEntertainmentAuthData.duration', @@ -238,7 +234,6 @@ public function isNullableSetToNull(string $property): bool 'lodgingPropertyPhoneNumber' => 'setLodgingPropertyPhoneNumber', 'lodgingRoom1NumberOfNights' => 'setLodgingRoom1NumberOfNights', 'lodgingRoom1Rate' => 'setLodgingRoom1Rate', - 'lodgingRoom1Tax' => 'setLodgingRoom1Tax', 'lodgingTotalRoomTax' => 'setLodgingTotalRoomTax', 'lodgingTotalTax' => 'setLodgingTotalTax', 'travelEntertainmentAuthDataDuration' => 'setTravelEntertainmentAuthDataDuration', @@ -263,7 +258,6 @@ public function isNullableSetToNull(string $property): bool 'lodgingPropertyPhoneNumber' => 'getLodgingPropertyPhoneNumber', 'lodgingRoom1NumberOfNights' => 'getLodgingRoom1NumberOfNights', 'lodgingRoom1Rate' => 'getLodgingRoom1Rate', - 'lodgingRoom1Tax' => 'getLodgingRoom1Tax', 'lodgingTotalRoomTax' => 'getLodgingTotalRoomTax', 'lodgingTotalTax' => 'getLodgingTotalTax', 'travelEntertainmentAuthDataDuration' => 'getTravelEntertainmentAuthDataDuration', @@ -339,7 +333,6 @@ public function __construct(array $data = null) $this->setIfExists('lodgingPropertyPhoneNumber', $data ?? [], null); $this->setIfExists('lodgingRoom1NumberOfNights', $data ?? [], null); $this->setIfExists('lodgingRoom1Rate', $data ?? [], null); - $this->setIfExists('lodgingRoom1Tax', $data ?? [], null); $this->setIfExists('lodgingTotalRoomTax', $data ?? [], null); $this->setIfExists('lodgingTotalTax', $data ?? [], null); $this->setIfExists('travelEntertainmentAuthDataDuration', $data ?? [], null); @@ -401,7 +394,7 @@ public function getLodgingCheckInDate() /** * Sets lodgingCheckInDate * - * @param string|null $lodgingCheckInDate The arrival date. * Date format: `yyyyMMdd` + * @param string|null $lodgingCheckInDate The arrival date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. * * @return self */ @@ -428,7 +421,7 @@ public function getLodgingCheckOutDate() /** * Sets lodgingCheckOutDate * - * @param string|null $lodgingCheckOutDate The departure date. * Date format: `yyyyMMdd` + * @param string|null $lodgingCheckOutDate The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. * * @return self */ @@ -455,7 +448,7 @@ public function getLodgingCustomerServiceTollFreeNumber() /** * Sets lodgingCustomerServiceTollFreeNumber * - * @param string|null $lodgingCustomerServiceTollFreeNumber The toll free phone number for the hotel/lodgings. * Format: Alphanumeric * maxLength: 17 + * @param string|null $lodgingCustomerServiceTollFreeNumber The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - * * @return self */ @@ -482,7 +475,7 @@ public function getLodgingFireSafetyActIndicator() /** * Sets lodgingFireSafetyActIndicator * - * @param string|null $lodgingFireSafetyActIndicator Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Values can be: 'Y' or 'N'. * Format: Alphabetic * maxLength: 1 + * @param string|null $lodgingFireSafetyActIndicator Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Must be 'Y' or 'N'. * Format: alphabetic * Max length: 1 character * * @return self */ @@ -509,7 +502,7 @@ public function getLodgingFolioCashAdvances() /** * Sets lodgingFolioCashAdvances * - * @param string|null $lodgingFolioCashAdvances The folio cash advances. * Format: Numeric * maxLength: 12 + * @param string|null $lodgingFolioCashAdvances The folio cash advances, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * * @return self */ @@ -536,7 +529,7 @@ public function getLodgingFolioNumber() /** * Sets lodgingFolioNumber * - * @param string|null $lodgingFolioNumber Card acceptor’s internal invoice or billing ID reference number. * Format: Alphanumeric * maxLength: 25 + * @param string|null $lodgingFolioNumber The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters. * Must not start with a space * Must not be all zeros * * @return self */ @@ -563,7 +556,7 @@ public function getLodgingFoodBeverageCharges() /** * Sets lodgingFoodBeverageCharges * - * @param string|null $lodgingFoodBeverageCharges Any charges for food and beverages associated with the booking. * Format: Numeric * maxLength: 12 + * @param string|null $lodgingFoodBeverageCharges Any charges for food and beverages associated with the booking, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * * @return self */ @@ -590,7 +583,7 @@ public function getLodgingNoShowIndicator() /** * Sets lodgingNoShowIndicator * - * @param string|null $lodgingNoShowIndicator Indicates if the customer was a \"no-show\" (neither keeps nor cancels their booking). Value should be Y or N. * Format: Numeric * maxLength: 1 + * @param string|null $lodgingNoShowIndicator Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in * **N**: the customer checked in * * @return self */ @@ -617,7 +610,7 @@ public function getLodgingPrepaidExpenses() /** * Sets lodgingPrepaidExpenses * - * @param string|null $lodgingPrepaidExpenses Prepaid expenses for the booking. * Format: Numeric * maxLength: 12 + * @param string|null $lodgingPrepaidExpenses The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters * * @return self */ @@ -644,7 +637,7 @@ public function getLodgingPropertyPhoneNumber() /** * Sets lodgingPropertyPhoneNumber * - * @param string|null $lodgingPropertyPhoneNumber Identifies specific lodging property location by its local phone number. * Format: Alphanumeric * maxLength: 17 + * @param string|null $lodgingPropertyPhoneNumber The lodging property location's phone number. * Format: numeric. * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - * * @return self */ @@ -671,7 +664,7 @@ public function getLodgingRoom1NumberOfNights() /** * Sets lodgingRoom1NumberOfNights * - * @param string|null $lodgingRoom1NumberOfNights Total number of nights the room will be rented. * Format: Numeric * maxLength: 4 + * @param string|null $lodgingRoom1NumberOfNights The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 4 characters * * @return self */ @@ -698,7 +691,7 @@ public function getLodgingRoom1Rate() /** * Sets lodgingRoom1Rate * - * @param string|null $lodgingRoom1Rate The rate of the room. * Format: Numeric * maxLength: 12 + * @param string|null $lodgingRoom1Rate The rate for the room, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number * * @return self */ @@ -712,33 +705,6 @@ public function setLodgingRoom1Rate($lodgingRoom1Rate) return $this; } - /** - * Gets lodgingRoom1Tax - * - * @return string|null - */ - public function getLodgingRoom1Tax() - { - return $this->container['lodgingRoom1Tax']; - } - - /** - * Sets lodgingRoom1Tax - * - * @param string|null $lodgingRoom1Tax The total amount of tax to be paid. * Format: Numeric * maxLength: 12 - * - * @return self - */ - public function setLodgingRoom1Tax($lodgingRoom1Tax) - { - if (is_null($lodgingRoom1Tax)) { - throw new \InvalidArgumentException('non-nullable lodgingRoom1Tax cannot be null'); - } - $this->container['lodgingRoom1Tax'] = $lodgingRoom1Tax; - - return $this; - } - /** * Gets lodgingTotalRoomTax * @@ -752,7 +718,7 @@ public function getLodgingTotalRoomTax() /** * Sets lodgingTotalRoomTax * - * @param string|null $lodgingTotalRoomTax Total room tax amount. * Format: Numeric * maxLength: 12 + * @param string|null $lodgingTotalRoomTax The total room tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number * * @return self */ @@ -779,7 +745,7 @@ public function getLodgingTotalTax() /** * Sets lodgingTotalTax * - * @param string|null $lodgingTotalTax Total tax amount. * Format: Numeric * maxLength: 12 + * @param string|null $lodgingTotalTax The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number * * @return self */ @@ -806,7 +772,7 @@ public function getTravelEntertainmentAuthDataDuration() /** * Sets travelEntertainmentAuthDataDuration * - * @param string|null $travelEntertainmentAuthDataDuration Number of nights. This should be included in the auth message. * Format: Numeric * maxLength: 2 + * @param string|null $travelEntertainmentAuthDataDuration The number of nights. This should be included in the auth message. * Format: numeric * Max length: 4 characters * * @return self */ @@ -833,7 +799,7 @@ public function getTravelEntertainmentAuthDataMarket() /** * Sets travelEntertainmentAuthDataMarket * - * @param string|null $travelEntertainmentAuthDataMarket Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"H\" for Hotel. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 + * @param string|null $travelEntertainmentAuthDataMarket Indicates what market-specific dataset will be submitted. Must be 'H' for Hotel. This should be included in the auth message. * Format: alphanumeric * Max length: 1 character * * @return self */ diff --git a/src/Adyen/Model/Checkout/AdditionalDataTemporaryServices.php b/src/Adyen/Model/Checkout/AdditionalDataTemporaryServices.php index 63964769d..755c28146 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataTemporaryServices.php +++ b/src/Adyen/Model/Checkout/AdditionalDataTemporaryServices.php @@ -345,7 +345,7 @@ public function getEnhancedSchemeDataCustomerReference() /** * Sets enhancedSchemeDataCustomerReference * - * @param string|null $enhancedSchemeDataCustomerReference Customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 + * @param string|null $enhancedSchemeDataCustomerReference The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 * * @return self */ @@ -372,7 +372,7 @@ public function getEnhancedSchemeDataEmployeeName() /** * Sets enhancedSchemeDataEmployeeName * - * @param string|null $enhancedSchemeDataEmployeeName Name or ID associated with the individual working in a temporary capacity. * maxLength: 40 + * @param string|null $enhancedSchemeDataEmployeeName The name or ID of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces * * @return self */ @@ -399,7 +399,7 @@ public function getEnhancedSchemeDataJobDescription() /** * Sets enhancedSchemeDataJobDescription * - * @param string|null $enhancedSchemeDataJobDescription Description of the job or task of the individual working in a temporary capacity. * maxLength: 40 + * @param string|null $enhancedSchemeDataJobDescription The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces * * @return self */ @@ -426,7 +426,7 @@ public function getEnhancedSchemeDataRegularHoursRate() /** * Sets enhancedSchemeDataRegularHoursRate * - * @param string|null $enhancedSchemeDataRegularHoursRate Amount paid per regular hours worked, minor units. * maxLength: 7 + * @param string|null $enhancedSchemeDataRegularHoursRate The amount paid for regular hours worked, [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 7 * Must not be empty * Can be all zeros * * @return self */ @@ -453,7 +453,7 @@ public function getEnhancedSchemeDataRegularHoursWorked() /** * Sets enhancedSchemeDataRegularHoursWorked * - * @param string|null $enhancedSchemeDataRegularHoursWorked Amount of time worked during a normal operation for the task or job. * maxLength: 7 + * @param string|null $enhancedSchemeDataRegularHoursWorked The hours worked. * maxLength: 7 * Must not be empty * Can be all zeros * * @return self */ @@ -480,7 +480,7 @@ public function getEnhancedSchemeDataRequestName() /** * Sets enhancedSchemeDataRequestName * - * @param string|null $enhancedSchemeDataRequestName Name of the individual requesting temporary services. * maxLength: 40 + * @param string|null $enhancedSchemeDataRequestName The name of the person requesting temporary services. * maxLength: 40 * Must not be all zeros * Must not be all spaces * * @return self */ @@ -507,7 +507,7 @@ public function getEnhancedSchemeDataTempStartDate() /** * Sets enhancedSchemeDataTempStartDate * - * @param string|null $enhancedSchemeDataTempStartDate Date for the beginning of the pay period. * Format: ddMMyy * maxLength: 6 + * @param string|null $enhancedSchemeDataTempStartDate The billing period start date. * Format: ddMMyy * maxLength: 6 * * @return self */ @@ -534,7 +534,7 @@ public function getEnhancedSchemeDataTempWeekEnding() /** * Sets enhancedSchemeDataTempWeekEnding * - * @param string|null $enhancedSchemeDataTempWeekEnding Date of the end of the billing cycle. * Format: ddMMyy * maxLength: 6 + * @param string|null $enhancedSchemeDataTempWeekEnding The billing period end date. * Format: ddMMyy * maxLength: 6 * * @return self */ @@ -561,7 +561,7 @@ public function getEnhancedSchemeDataTotalTaxAmount() /** * Sets enhancedSchemeDataTotalTaxAmount * - * @param string|null $enhancedSchemeDataTotalTaxAmount Total tax amount, in minor units. For example, 2000 means USD 20.00 * maxLength: 12 + * @param string|null $enhancedSchemeDataTotalTaxAmount The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00 * maxLength: 12 * * @return self */ diff --git a/src/Adyen/Model/Checkout/CreateApplePaySessionRequest.php b/src/Adyen/Model/Checkout/ApplePaySessionRequest.php similarity index 98% rename from src/Adyen/Model/Checkout/CreateApplePaySessionRequest.php rename to src/Adyen/Model/Checkout/ApplePaySessionRequest.php index 7abdb45f0..310d1c7b0 100644 --- a/src/Adyen/Model/Checkout/CreateApplePaySessionRequest.php +++ b/src/Adyen/Model/Checkout/ApplePaySessionRequest.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * CreateApplePaySessionRequest Class Doc Comment + * ApplePaySessionRequest Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class CreateApplePaySessionRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class ApplePaySessionRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class CreateApplePaySessionRequest implements ModelInterface, ArrayAccess, \Json * * @var string */ - protected static $openAPIModelName = 'CreateApplePaySessionRequest'; + protected static $openAPIModelName = 'ApplePaySessionRequest'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Adyen/Model/Checkout/AuthenticationData.php b/src/Adyen/Model/Checkout/AuthenticationData.php index 225cd144a..5a6e7d23c 100644 --- a/src/Adyen/Model/Checkout/AuthenticationData.php +++ b/src/Adyen/Model/Checkout/AuthenticationData.php @@ -326,7 +326,7 @@ public function getAttemptAuthentication() /** * Sets attemptAuthentication * - * @param string|null $attemptAuthentication Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. * **preferNo**: Do not perform 3D Secure authentication if not required by PSD2 SCA or other national regulations. + * @param string|null $attemptAuthentication Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. * * @return self */ @@ -363,7 +363,7 @@ public function getAuthenticationOnly() /** * Sets authenticationOnly * - * @param bool|null $authenticationOnly If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: *false**. + * @param bool|null $authenticationOnly If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: **false**. * * @return self */ diff --git a/src/Adyen/Model/Checkout/CheckoutBalanceCheckRequest.php b/src/Adyen/Model/Checkout/BalanceCheckRequest.php similarity index 96% rename from src/Adyen/Model/Checkout/CheckoutBalanceCheckRequest.php rename to src/Adyen/Model/Checkout/BalanceCheckRequest.php index 8f0a60640..f2785821d 100644 --- a/src/Adyen/Model/Checkout/CheckoutBalanceCheckRequest.php +++ b/src/Adyen/Model/Checkout/BalanceCheckRequest.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * CheckoutBalanceCheckRequest Class Doc Comment + * BalanceCheckRequest Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class CheckoutBalanceCheckRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class BalanceCheckRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class CheckoutBalanceCheckRequest implements ModelInterface, ArrayAccess, \JsonS * * @var string */ - protected static $openAPIModelName = 'CheckoutBalanceCheckRequest'; + protected static $openAPIModelName = 'BalanceCheckRequest'; /** * Array of property to type mappings. Used for (de)serialization @@ -596,6 +596,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } if ($this->container['merchantAccount'] === null) { $invalidProperties[] = "'merchantAccount' can't be null"; } @@ -719,7 +722,7 @@ public function setAdditionalData($additionalData) /** * Gets amount * - * @return \Adyen\Model\Checkout\Amount|null + * @return \Adyen\Model\Checkout\Amount */ public function getAmount() { @@ -729,7 +732,7 @@ public function getAmount() /** * Sets amount * - * @param \Adyen\Model\Checkout\Amount|null $amount amount + * @param \Adyen\Model\Checkout\Amount $amount amount * * @return self */ @@ -1049,7 +1052,7 @@ public function getLocalizedShopperStatement() /** * Sets localizedShopperStatement * - * @param array|null $localizedShopperStatement This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * @param array|null $localizedShopperStatement This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. * * @return self */ @@ -1292,7 +1295,7 @@ public function getRecurringProcessingModel() /** * Sets recurringProcessingModel * - * @param string|null $recurringProcessingModel Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * @param string|null $recurringProcessingModel Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. * * @return self */ @@ -1690,7 +1693,7 @@ public function getStore() /** * Sets store * - * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). * * @return self */ diff --git a/src/Adyen/Model/Checkout/CheckoutBalanceCheckResponse.php b/src/Adyen/Model/Checkout/BalanceCheckResponse.php similarity index 98% rename from src/Adyen/Model/Checkout/CheckoutBalanceCheckResponse.php rename to src/Adyen/Model/Checkout/BalanceCheckResponse.php index 8db41c973..651ce8efe 100644 --- a/src/Adyen/Model/Checkout/CheckoutBalanceCheckResponse.php +++ b/src/Adyen/Model/Checkout/BalanceCheckResponse.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * CheckoutBalanceCheckResponse Class Doc Comment + * BalanceCheckResponse Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class CheckoutBalanceCheckResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class BalanceCheckResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class CheckoutBalanceCheckResponse implements ModelInterface, ArrayAccess, \Json * * @var string */ - protected static $openAPIModelName = 'CheckoutBalanceCheckResponse'; + protected static $openAPIModelName = 'BalanceCheckResponse'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Adyen/Model/Checkout/CheckoutCancelOrderRequest.php b/src/Adyen/Model/Checkout/CancelOrderRequest.php similarity index 96% rename from src/Adyen/Model/Checkout/CheckoutCancelOrderRequest.php rename to src/Adyen/Model/Checkout/CancelOrderRequest.php index 805ce6a09..4578ff26c 100644 --- a/src/Adyen/Model/Checkout/CheckoutCancelOrderRequest.php +++ b/src/Adyen/Model/Checkout/CancelOrderRequest.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * CheckoutCancelOrderRequest Class Doc Comment + * CancelOrderRequest Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class CheckoutCancelOrderRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class CancelOrderRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class CheckoutCancelOrderRequest implements ModelInterface, ArrayAccess, \JsonSe * * @var string */ - protected static $openAPIModelName = 'CheckoutCancelOrderRequest'; + protected static $openAPIModelName = 'CancelOrderRequest'; /** * Array of property to type mappings. Used for (de)serialization @@ -45,7 +45,7 @@ class CheckoutCancelOrderRequest implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPITypes = [ 'merchantAccount' => 'string', - 'order' => '\Adyen\Model\Checkout\CheckoutOrder' + 'order' => '\Adyen\Model\Checkout\EncryptedOrderData' ]; /** @@ -319,7 +319,7 @@ public function setMerchantAccount($merchantAccount) /** * Gets order * - * @return \Adyen\Model\Checkout\CheckoutOrder + * @return \Adyen\Model\Checkout\EncryptedOrderData */ public function getOrder() { @@ -329,7 +329,7 @@ public function getOrder() /** * Sets order * - * @param \Adyen\Model\Checkout\CheckoutOrder $order order + * @param \Adyen\Model\Checkout\EncryptedOrderData $order order * * @return self */ diff --git a/src/Adyen/Model/Checkout/CheckoutCancelOrderResponse.php b/src/Adyen/Model/Checkout/CancelOrderResponse.php similarity index 98% rename from src/Adyen/Model/Checkout/CheckoutCancelOrderResponse.php rename to src/Adyen/Model/Checkout/CancelOrderResponse.php index 6636223ce..422526618 100644 --- a/src/Adyen/Model/Checkout/CheckoutCancelOrderResponse.php +++ b/src/Adyen/Model/Checkout/CancelOrderResponse.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * CheckoutCancelOrderResponse Class Doc Comment + * CancelOrderResponse Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class CheckoutCancelOrderResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class CancelOrderResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class CheckoutCancelOrderResponse implements ModelInterface, ArrayAccess, \JsonS * * @var string */ - protected static $openAPIModelName = 'CheckoutCancelOrderResponse'; + protected static $openAPIModelName = 'CancelOrderResponse'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Adyen/Model/Checkout/Card.php b/src/Adyen/Model/Checkout/Card.php index 450ccde24..11b875bf7 100644 --- a/src/Adyen/Model/Checkout/Card.php +++ b/src/Adyen/Model/Checkout/Card.php @@ -310,12 +310,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['expiryYear'] === null) { - $invalidProperties[] = "'expiryYear' can't be null"; - } - if ($this->container['holderName'] === null) { - $invalidProperties[] = "'holderName' can't be null"; - } return $invalidProperties; } @@ -388,7 +382,7 @@ public function setExpiryMonth($expiryMonth) /** * Gets expiryYear * - * @return string + * @return string|null */ public function getExpiryYear() { @@ -398,7 +392,7 @@ public function getExpiryYear() /** * Sets expiryYear * - * @param string $expiryYear The card expiry year. Format: 4 digits. For example: 2020 + * @param string|null $expiryYear The card expiry year. Format: 4 digits. For example: 2020 * * @return self */ @@ -415,7 +409,7 @@ public function setExpiryYear($expiryYear) /** * Gets holderName * - * @return string + * @return string|null */ public function getHolderName() { @@ -425,7 +419,7 @@ public function getHolderName() /** * Sets holderName * - * @param string $holderName The name of the cardholder, as printed on the card. + * @param string|null $holderName The name of the cardholder, as printed on the card. * * @return self */ diff --git a/src/Adyen/Model/Checkout/CardDetails.php b/src/Adyen/Model/Checkout/CardDetails.php index 9631e802f..c5280513b 100644 --- a/src/Adyen/Model/Checkout/CardDetails.php +++ b/src/Adyen/Model/Checkout/CardDetails.php @@ -938,7 +938,7 @@ public function getThreeDS2SdkVersion() /** * Sets threeDS2SdkVersion * - * @param string|null $threeDS2SdkVersion Version of the 3D Secure 2 mobile SDK. + * @param string|null $threeDS2SdkVersion Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. * * @return self */ diff --git a/src/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.php b/src/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.php new file mode 100644 index 000000000..3bcfde57b --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.php @@ -0,0 +1,588 @@ + + */ +class CheckoutDelegatedAuthenticationAction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutDelegatedAuthenticationAction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authorisationToken' => 'string', + 'paymentData' => 'string', + 'paymentMethodType' => 'string', + 'token' => 'string', + 'type' => 'string', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authorisationToken' => null, + 'paymentData' => null, + 'paymentMethodType' => null, + 'token' => null, + 'type' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authorisationToken' => false, + 'paymentData' => false, + 'paymentMethodType' => false, + 'token' => false, + 'type' => false, + 'url' => 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 = [ + 'authorisationToken' => 'authorisationToken', + 'paymentData' => 'paymentData', + 'paymentMethodType' => 'paymentMethodType', + 'token' => 'token', + 'type' => 'type', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authorisationToken' => 'setAuthorisationToken', + 'paymentData' => 'setPaymentData', + 'paymentMethodType' => 'setPaymentMethodType', + 'token' => 'setToken', + 'type' => 'setType', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authorisationToken' => 'getAuthorisationToken', + 'paymentData' => 'getPaymentData', + 'paymentMethodType' => 'getPaymentMethodType', + 'token' => 'getToken', + 'type' => 'getType', + 'url' => 'getUrl' + ]; + + /** + * 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_DELEGATED_AUTHENTICATION = 'delegatedAuthentication'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DELEGATED_AUTHENTICATION, + ]; + } + /** + * 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('authorisationToken', $data ?? [], null); + $this->setIfExists('paymentData', $data ?? [], null); + $this->setIfExists('paymentMethodType', $data ?? [], null); + $this->setIfExists('token', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('url', $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 authorisationToken + * + * @return string|null + */ + public function getAuthorisationToken() + { + return $this->container['authorisationToken']; + } + + /** + * Sets authorisationToken + * + * @param string|null $authorisationToken A token needed to authorise a payment. + * + * @return self + */ + public function setAuthorisationToken($authorisationToken) + { + if (is_null($authorisationToken)) { + throw new \InvalidArgumentException('non-nullable authorisationToken cannot be null'); + } + $this->container['authorisationToken'] = $authorisationToken; + + return $this; + } + + /** + * Gets paymentData + * + * @return string|null + */ + public function getPaymentData() + { + return $this->container['paymentData']; + } + + /** + * Sets paymentData + * + * @param string|null $paymentData A value that must be submitted to the `/payments/details` endpoint to verify this payment. + * + * @return self + */ + public function setPaymentData($paymentData) + { + if (is_null($paymentData)) { + throw new \InvalidArgumentException('non-nullable paymentData cannot be null'); + } + $this->container['paymentData'] = $paymentData; + + return $this; + } + + /** + * Gets paymentMethodType + * + * @return string|null + */ + public function getPaymentMethodType() + { + return $this->container['paymentMethodType']; + } + + /** + * Sets paymentMethodType + * + * @param string|null $paymentMethodType Specifies the payment method. + * + * @return self + */ + public function setPaymentMethodType($paymentMethodType) + { + if (is_null($paymentMethodType)) { + throw new \InvalidArgumentException('non-nullable paymentMethodType cannot be null'); + } + $this->container['paymentMethodType'] = $paymentMethodType; + + return $this; + } + + /** + * Gets token + * + * @return string|null + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * + * @param string|null $token A token to pass to the delegatedAuthentication component. + * + * @return self + */ + public function setToken($token) + { + if (is_null($token)) { + throw new \InvalidArgumentException('non-nullable token cannot be null'); + } + $this->container['token'] = $token; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **delegatedAuthentication** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url Specifies the URL to redirect to. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php index be91a5f43..45101359a 100644 --- a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php +++ b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php @@ -83,7 +83,9 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'googlePayToken' => 'string', 'masterpassTransactionId' => 'string', 'orderID' => 'string', + 'payeePreferred' => 'string', 'payerID' => 'string', + 'payerSelected' => 'string', 'subtype' => 'string', 'virtualPaymentAddress' => 'string', 'samsungPayToken' => 'string', @@ -141,7 +143,9 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'googlePayToken' => null, 'masterpassTransactionId' => null, 'orderID' => null, + 'payeePreferred' => null, 'payerID' => null, + 'payerSelected' => null, 'subtype' => null, 'virtualPaymentAddress' => null, 'samsungPayToken' => null, @@ -197,7 +201,9 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'googlePayToken' => false, 'masterpassTransactionId' => false, 'orderID' => false, + 'payeePreferred' => false, 'payerID' => false, + 'payerSelected' => false, 'subtype' => false, 'virtualPaymentAddress' => false, 'samsungPayToken' => false, @@ -333,7 +339,9 @@ public function isNullableSetToNull(string $property): bool 'googlePayToken' => 'googlePayToken', 'masterpassTransactionId' => 'masterpassTransactionId', 'orderID' => 'orderID', + 'payeePreferred' => 'payeePreferred', 'payerID' => 'payerID', + 'payerSelected' => 'payerSelected', 'subtype' => 'subtype', 'virtualPaymentAddress' => 'virtualPaymentAddress', 'samsungPayToken' => 'samsungPayToken', @@ -389,7 +397,9 @@ public function isNullableSetToNull(string $property): bool 'googlePayToken' => 'setGooglePayToken', 'masterpassTransactionId' => 'setMasterpassTransactionId', 'orderID' => 'setOrderID', + 'payeePreferred' => 'setPayeePreferred', 'payerID' => 'setPayerID', + 'payerSelected' => 'setPayerSelected', 'subtype' => 'setSubtype', 'virtualPaymentAddress' => 'setVirtualPaymentAddress', 'samsungPayToken' => 'setSamsungPayToken', @@ -445,7 +455,9 @@ public function isNullableSetToNull(string $property): bool 'googlePayToken' => 'getGooglePayToken', 'masterpassTransactionId' => 'getMasterpassTransactionId', 'orderID' => 'getOrderID', + 'payeePreferred' => 'getPayeePreferred', 'payerID' => 'getPayerID', + 'payerSelected' => 'getPayerSelected', 'subtype' => 'getSubtype', 'virtualPaymentAddress' => 'getVirtualPaymentAddress', 'samsungPayToken' => 'getSamsungPayToken', @@ -551,7 +563,9 @@ public function __construct(array $data = null) $this->setIfExists('googlePayToken', $data ?? [], null); $this->setIfExists('masterpassTransactionId', $data ?? [], null); $this->setIfExists('orderID', $data ?? [], null); + $this->setIfExists('payeePreferred', $data ?? [], null); $this->setIfExists('payerID', $data ?? [], null); + $this->setIfExists('payerSelected', $data ?? [], null); $this->setIfExists('subtype', $data ?? [], null); $this->setIfExists('virtualPaymentAddress', $data ?? [], null); $this->setIfExists('samsungPayToken', $data ?? [], null); @@ -1480,7 +1494,7 @@ public function getThreeDS2SdkVersion() /** * Sets threeDS2SdkVersion * - * @param string|null $threeDS2SdkVersion Version of the 3D Secure 2 mobile SDK. + * @param string|null $threeDS2SdkVersion Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. * * @return self */ @@ -1683,6 +1697,33 @@ public function setOrderID($orderID) return $this; } + /** + * Gets payeePreferred + * + * @return string|null + */ + public function getPayeePreferred() + { + return $this->container['payeePreferred']; + } + + /** + * Sets payeePreferred + * + * @param string|null $payeePreferred IMMEDIATE_PAYMENT_REQUIRED or UNRESTRICTED + * + * @return self + */ + public function setPayeePreferred($payeePreferred) + { + if (is_null($payeePreferred)) { + throw new \InvalidArgumentException('non-nullable payeePreferred cannot be null'); + } + $this->container['payeePreferred'] = $payeePreferred; + + return $this; + } + /** * Gets payerID * @@ -1710,6 +1751,33 @@ public function setPayerID($payerID) return $this; } + /** + * Gets payerSelected + * + * @return string|null + */ + public function getPayerSelected() + { + return $this->container['payerSelected']; + } + + /** + * Sets payerSelected + * + * @param string|null $payerSelected PAYPAL or PAYPAL_CREDIT + * + * @return self + */ + public function setPayerSelected($payerSelected) + { + if (is_null($payerSelected)) { + throw new \InvalidArgumentException('non-nullable payerSelected cannot be null'); + } + $this->container['payerSelected'] = $payerSelected; + + return $this; + } + /** * Gets subtype * diff --git a/src/Adyen/Model/Checkout/CheckoutVoucherAction.php b/src/Adyen/Model/Checkout/CheckoutVoucherAction.php index ca27ce65f..82ef44eff 100644 --- a/src/Adyen/Model/Checkout/CheckoutVoucherAction.php +++ b/src/Adyen/Model/Checkout/CheckoutVoucherAction.php @@ -55,6 +55,7 @@ class CheckoutVoucherAction implements ModelInterface, ArrayAccess, \JsonSeriali 'maskedTelephoneNumber' => 'string', 'merchantName' => 'string', 'merchantReference' => 'string', + 'passCreationToken' => 'string', 'paymentData' => 'string', 'paymentMethodType' => 'string', 'reference' => 'string', @@ -85,6 +86,7 @@ class CheckoutVoucherAction implements ModelInterface, ArrayAccess, \JsonSeriali 'maskedTelephoneNumber' => null, 'merchantName' => null, 'merchantReference' => null, + 'passCreationToken' => null, 'paymentData' => null, 'paymentMethodType' => null, 'reference' => null, @@ -113,6 +115,7 @@ class CheckoutVoucherAction implements ModelInterface, ArrayAccess, \JsonSeriali 'maskedTelephoneNumber' => false, 'merchantName' => false, 'merchantReference' => false, + 'passCreationToken' => false, 'paymentData' => false, 'paymentMethodType' => false, 'reference' => false, @@ -221,6 +224,7 @@ public function isNullableSetToNull(string $property): bool 'maskedTelephoneNumber' => 'maskedTelephoneNumber', 'merchantName' => 'merchantName', 'merchantReference' => 'merchantReference', + 'passCreationToken' => 'passCreationToken', 'paymentData' => 'paymentData', 'paymentMethodType' => 'paymentMethodType', 'reference' => 'reference', @@ -249,6 +253,7 @@ public function isNullableSetToNull(string $property): bool 'maskedTelephoneNumber' => 'setMaskedTelephoneNumber', 'merchantName' => 'setMerchantName', 'merchantReference' => 'setMerchantReference', + 'passCreationToken' => 'setPassCreationToken', 'paymentData' => 'setPaymentData', 'paymentMethodType' => 'setPaymentMethodType', 'reference' => 'setReference', @@ -277,6 +282,7 @@ public function isNullableSetToNull(string $property): bool 'maskedTelephoneNumber' => 'getMaskedTelephoneNumber', 'merchantName' => 'getMerchantName', 'merchantReference' => 'getMerchantReference', + 'passCreationToken' => 'getPassCreationToken', 'paymentData' => 'getPaymentData', 'paymentMethodType' => 'getPaymentMethodType', 'reference' => 'getReference', @@ -368,6 +374,7 @@ public function __construct(array $data = null) $this->setIfExists('maskedTelephoneNumber', $data ?? [], null); $this->setIfExists('merchantName', $data ?? [], null); $this->setIfExists('merchantReference', $data ?? [], null); + $this->setIfExists('passCreationToken', $data ?? [], null); $this->setIfExists('paymentData', $data ?? [], null); $this->setIfExists('paymentMethodType', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); @@ -730,6 +737,33 @@ public function setMerchantReference($merchantReference) return $this; } + /** + * Gets passCreationToken + * + * @return string|null + */ + public function getPassCreationToken() + { + return $this->container['passCreationToken']; + } + + /** + * Sets passCreationToken + * + * @param string|null $passCreationToken A base64 encoded signature of all properties + * + * @return self + */ + public function setPassCreationToken($passCreationToken) + { + if (is_null($passCreationToken)) { + throw new \InvalidArgumentException('non-nullable passCreationToken cannot be null'); + } + $this->container['passCreationToken'] = $passCreationToken; + + return $this; + } + /** * Gets paymentData * diff --git a/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php b/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php index 50c932661..faaa4cc9b 100644 --- a/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php +++ b/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php @@ -74,6 +74,7 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'merchantOrderReference' => 'string', 'metadata' => 'array', 'mpiData' => '\Adyen\Model\Checkout\ThreeDSecureData', + 'platformChargebackLogic' => '\Adyen\Model\Checkout\PlatformChargebackLogic', 'recurringExpiry' => 'string', 'recurringFrequency' => 'string', 'recurringProcessingModel' => 'string', @@ -138,6 +139,7 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'merchantOrderReference' => null, 'metadata' => null, 'mpiData' => null, + 'platformChargebackLogic' => null, 'recurringExpiry' => null, 'recurringFrequency' => null, 'recurringProcessingModel' => null, @@ -200,6 +202,7 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'merchantOrderReference' => false, 'metadata' => false, 'mpiData' => false, + 'platformChargebackLogic' => false, 'recurringExpiry' => false, 'recurringFrequency' => false, 'recurringProcessingModel' => false, @@ -342,6 +345,7 @@ public function isNullableSetToNull(string $property): bool 'merchantOrderReference' => 'merchantOrderReference', 'metadata' => 'metadata', 'mpiData' => 'mpiData', + 'platformChargebackLogic' => 'platformChargebackLogic', 'recurringExpiry' => 'recurringExpiry', 'recurringFrequency' => 'recurringFrequency', 'recurringProcessingModel' => 'recurringProcessingModel', @@ -404,6 +408,7 @@ public function isNullableSetToNull(string $property): bool 'merchantOrderReference' => 'setMerchantOrderReference', 'metadata' => 'setMetadata', 'mpiData' => 'setMpiData', + 'platformChargebackLogic' => 'setPlatformChargebackLogic', 'recurringExpiry' => 'setRecurringExpiry', 'recurringFrequency' => 'setRecurringFrequency', 'recurringProcessingModel' => 'setRecurringProcessingModel', @@ -466,6 +471,7 @@ public function isNullableSetToNull(string $property): bool 'merchantOrderReference' => 'getMerchantOrderReference', 'metadata' => 'getMetadata', 'mpiData' => 'getMpiData', + 'platformChargebackLogic' => 'getPlatformChargebackLogic', 'recurringExpiry' => 'getRecurringExpiry', 'recurringFrequency' => 'getRecurringFrequency', 'recurringProcessingModel' => 'getRecurringProcessingModel', @@ -645,6 +651,7 @@ public function __construct(array $data = null) $this->setIfExists('merchantOrderReference', $data ?? [], null); $this->setIfExists('metadata', $data ?? [], null); $this->setIfExists('mpiData', $data ?? [], null); + $this->setIfExists('platformChargebackLogic', $data ?? [], null); $this->setIfExists('recurringExpiry', $data ?? [], null); $this->setIfExists('recurringFrequency', $data ?? [], null); $this->setIfExists('recurringProcessingModel', $data ?? [], null); @@ -855,7 +862,7 @@ public function getAllowedPaymentMethods() /** * Sets allowedPaymentMethods * - * @param string[]|null $allowedPaymentMethods List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * @param string[]|null $allowedPaymentMethods List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` * * @return self */ @@ -990,7 +997,7 @@ public function getBlockedPaymentMethods() /** * Sets blockedPaymentMethods * - * @param string[]|null $blockedPaymentMethods List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * @param string[]|null $blockedPaymentMethods List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` * * @return self */ @@ -1579,6 +1586,33 @@ public function setMpiData($mpiData) return $this; } + /** + * Gets platformChargebackLogic + * + * @return \Adyen\Model\Checkout\PlatformChargebackLogic|null + */ + public function getPlatformChargebackLogic() + { + return $this->container['platformChargebackLogic']; + } + + /** + * Sets platformChargebackLogic + * + * @param \Adyen\Model\Checkout\PlatformChargebackLogic|null $platformChargebackLogic platformChargebackLogic + * + * @return self + */ + public function setPlatformChargebackLogic($platformChargebackLogic) + { + if (is_null($platformChargebackLogic)) { + throw new \InvalidArgumentException('non-nullable platformChargebackLogic cannot be null'); + } + $this->container['platformChargebackLogic'] = $platformChargebackLogic; + + return $this; + } + /** * Gets recurringExpiry * @@ -2071,7 +2105,7 @@ public function getSplits() /** * Sets splits * - * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). * * @return self */ @@ -2098,7 +2132,7 @@ public function getStore() /** * Sets store * - * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). * * @return self */ @@ -2207,6 +2241,7 @@ public function setTelephoneNumber($telephoneNumber) * Gets threeDSAuthenticationOnly * * @return bool|null + * @deprecated */ public function getThreeDSAuthenticationOnly() { @@ -2219,6 +2254,7 @@ public function getThreeDSAuthenticationOnly() * @param bool|null $threeDSAuthenticationOnly If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. * * @return self + * @deprecated */ public function setThreeDSAuthenticationOnly($threeDSAuthenticationOnly) { diff --git a/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php b/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php index b7fa54b6c..5927126c1 100644 --- a/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php +++ b/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php @@ -76,6 +76,7 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'metadata' => 'array', 'mode' => 'string', 'mpiData' => '\Adyen\Model\Checkout\ThreeDSecureData', + 'platformChargebackLogic' => '\Adyen\Model\Checkout\PlatformChargebackLogic', 'recurringExpiry' => 'string', 'recurringFrequency' => 'string', 'recurringProcessingModel' => 'string', @@ -124,7 +125,7 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'channel' => null, 'company' => null, 'countryCode' => null, - 'dateOfBirth' => 'date', + 'dateOfBirth' => 'date-time', 'deliverAt' => 'date-time', 'deliveryAddress' => null, 'enableOneClick' => null, @@ -143,6 +144,7 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'metadata' => null, 'mode' => null, 'mpiData' => null, + 'platformChargebackLogic' => null, 'recurringExpiry' => null, 'recurringFrequency' => null, 'recurringProcessingModel' => null, @@ -208,6 +210,7 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'metadata' => false, 'mode' => false, 'mpiData' => false, + 'platformChargebackLogic' => false, 'recurringExpiry' => false, 'recurringFrequency' => false, 'recurringProcessingModel' => false, @@ -353,6 +356,7 @@ public function isNullableSetToNull(string $property): bool 'metadata' => 'metadata', 'mode' => 'mode', 'mpiData' => 'mpiData', + 'platformChargebackLogic' => 'platformChargebackLogic', 'recurringExpiry' => 'recurringExpiry', 'recurringFrequency' => 'recurringFrequency', 'recurringProcessingModel' => 'recurringProcessingModel', @@ -418,6 +422,7 @@ public function isNullableSetToNull(string $property): bool 'metadata' => 'setMetadata', 'mode' => 'setMode', 'mpiData' => 'setMpiData', + 'platformChargebackLogic' => 'setPlatformChargebackLogic', 'recurringExpiry' => 'setRecurringExpiry', 'recurringFrequency' => 'setRecurringFrequency', 'recurringProcessingModel' => 'setRecurringProcessingModel', @@ -483,6 +488,7 @@ public function isNullableSetToNull(string $property): bool 'metadata' => 'getMetadata', 'mode' => 'getMode', 'mpiData' => 'getMpiData', + 'platformChargebackLogic' => 'getPlatformChargebackLogic', 'recurringExpiry' => 'getRecurringExpiry', 'recurringFrequency' => 'getRecurringFrequency', 'recurringProcessingModel' => 'getRecurringProcessingModel', @@ -679,6 +685,7 @@ public function __construct(array $data = null) $this->setIfExists('metadata', $data ?? [], null); $this->setIfExists('mode', $data ?? [], 'embedded'); $this->setIfExists('mpiData', $data ?? [], null); + $this->setIfExists('platformChargebackLogic', $data ?? [], null); $this->setIfExists('recurringExpiry', $data ?? [], null); $this->setIfExists('recurringFrequency', $data ?? [], null); $this->setIfExists('recurringProcessingModel', $data ?? [], null); @@ -905,7 +912,7 @@ public function getAllowedPaymentMethods() /** * Sets allowedPaymentMethods * - * @param string[]|null $allowedPaymentMethods List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * @param string[]|null $allowedPaymentMethods List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` * * @return self */ @@ -1040,7 +1047,7 @@ public function getBlockedPaymentMethods() /** * Sets blockedPaymentMethods * - * @param string[]|null $blockedPaymentMethods List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * @param string[]|null $blockedPaymentMethods List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` * * @return self */ @@ -1183,7 +1190,7 @@ public function getDateOfBirth() /** * Sets dateOfBirth * - * @param \DateTime|null $dateOfBirth The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + * @param \DateTime|null $dateOfBirth The shopper's date of birth in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. * * @return self */ @@ -1693,6 +1700,33 @@ public function setMpiData($mpiData) return $this; } + /** + * Gets platformChargebackLogic + * + * @return \Adyen\Model\Checkout\PlatformChargebackLogic|null + */ + public function getPlatformChargebackLogic() + { + return $this->container['platformChargebackLogic']; + } + + /** + * Sets platformChargebackLogic + * + * @param \Adyen\Model\Checkout\PlatformChargebackLogic|null $platformChargebackLogic platformChargebackLogic + * + * @return self + */ + public function setPlatformChargebackLogic($platformChargebackLogic) + { + if (is_null($platformChargebackLogic)) { + throw new \InvalidArgumentException('non-nullable platformChargebackLogic cannot be null'); + } + $this->container['platformChargebackLogic'] = $platformChargebackLogic; + + return $this; + } + /** * Gets recurringExpiry * @@ -2212,7 +2246,7 @@ public function getSplits() /** * Sets splits * - * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). * * @return self */ @@ -2239,7 +2273,7 @@ public function getStore() /** * Sets store * - * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). * * @return self */ @@ -2348,6 +2382,7 @@ public function setTelephoneNumber($telephoneNumber) * Gets threeDSAuthenticationOnly * * @return bool|null + * @deprecated */ public function getThreeDSAuthenticationOnly() { @@ -2360,6 +2395,7 @@ public function getThreeDSAuthenticationOnly() * @param bool|null $threeDSAuthenticationOnly If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. * * @return self + * @deprecated */ public function setThreeDSAuthenticationOnly($threeDSAuthenticationOnly) { diff --git a/src/Adyen/Model/Checkout/CheckoutCreateOrderRequest.php b/src/Adyen/Model/Checkout/CreateOrderRequest.php similarity index 98% rename from src/Adyen/Model/Checkout/CheckoutCreateOrderRequest.php rename to src/Adyen/Model/Checkout/CreateOrderRequest.php index 590a24801..43774ffba 100644 --- a/src/Adyen/Model/Checkout/CheckoutCreateOrderRequest.php +++ b/src/Adyen/Model/Checkout/CreateOrderRequest.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * CheckoutCreateOrderRequest Class Doc Comment + * CreateOrderRequest Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class CheckoutCreateOrderRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class CreateOrderRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class CheckoutCreateOrderRequest implements ModelInterface, ArrayAccess, \JsonSe * * @var string */ - protected static $openAPIModelName = 'CheckoutCreateOrderRequest'; + protected static $openAPIModelName = 'CreateOrderRequest'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Adyen/Model/Checkout/CheckoutCreateOrderResponse.php b/src/Adyen/Model/Checkout/CreateOrderResponse.php similarity index 98% rename from src/Adyen/Model/Checkout/CheckoutCreateOrderResponse.php rename to src/Adyen/Model/Checkout/CreateOrderResponse.php index fdbbe662e..0ca5629ba 100644 --- a/src/Adyen/Model/Checkout/CheckoutCreateOrderResponse.php +++ b/src/Adyen/Model/Checkout/CreateOrderResponse.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * CheckoutCreateOrderResponse Class Doc Comment + * CreateOrderResponse Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class CheckoutCreateOrderResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class CreateOrderResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class CheckoutCreateOrderResponse implements ModelInterface, ArrayAccess, \JsonS * * @var string */ - protected static $openAPIModelName = 'CheckoutCreateOrderResponse'; + protected static $openAPIModelName = 'CreateOrderResponse'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Adyen/Model/Checkout/PaymentDonationRequest.php b/src/Adyen/Model/Checkout/DonationPaymentRequest.php similarity index 93% rename from src/Adyen/Model/Checkout/PaymentDonationRequest.php rename to src/Adyen/Model/Checkout/DonationPaymentRequest.php index a71f326ec..9ae6de6cc 100644 --- a/src/Adyen/Model/Checkout/PaymentDonationRequest.php +++ b/src/Adyen/Model/Checkout/DonationPaymentRequest.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * PaymentDonationRequest Class Doc Comment + * DonationPaymentRequest Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class PaymentDonationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class DonationPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class PaymentDonationRequest implements ModelInterface, ArrayAccess, \JsonSerial * * @var string */ - protected static $openAPIModelName = 'PaymentDonationRequest'; + protected static $openAPIModelName = 'DonationPaymentRequest'; /** * Array of property to type mappings. Used for (de)serialization @@ -45,6 +45,7 @@ class PaymentDonationRequest implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPITypes = [ 'accountInfo' => '\Adyen\Model\Checkout\AccountInfo', + 'additionalAmount' => '\Adyen\Model\Checkout\Amount', 'additionalData' => 'array', 'amount' => '\Adyen\Model\Checkout\Amount', 'applicationInfo' => '\Adyen\Model\Checkout\ApplicationInfo', @@ -59,6 +60,7 @@ class PaymentDonationRequest implements ModelInterface, ArrayAccess, \JsonSerial 'countryCode' => 'string', 'dateOfBirth' => '\DateTime', 'dccQuote' => '\Adyen\Model\Checkout\ForexQuote', + 'deliverAt' => '\DateTime', 'deliveryAddress' => '\Adyen\Model\Checkout\Address', 'deliveryDate' => '\DateTime', 'deviceFingerprint' => 'string', @@ -70,6 +72,8 @@ class PaymentDonationRequest implements ModelInterface, ArrayAccess, \JsonSerial 'enableRecurring' => 'bool', 'entityType' => 'string', 'fraudOffset' => 'int', + 'fundOrigin' => '\Adyen\Model\Checkout\FundOrigin', + 'fundRecipient' => '\Adyen\Model\Checkout\FundRecipient', 'industryUsage' => 'string', 'installments' => '\Adyen\Model\Checkout\Installments', 'lineItems' => '\Adyen\Model\Checkout\LineItem[]', @@ -81,7 +85,7 @@ class PaymentDonationRequest implements ModelInterface, ArrayAccess, \JsonSerial 'merchantRiskIndicator' => '\Adyen\Model\Checkout\MerchantRiskIndicator', 'metadata' => 'array', 'mpiData' => '\Adyen\Model\Checkout\ThreeDSecureData', - 'order' => '\Adyen\Model\Checkout\CheckoutOrder', + 'order' => '\Adyen\Model\Checkout\EncryptedOrderData', 'orderReference' => 'string', 'origin' => 'string', 'paymentMethod' => '\Adyen\Model\Checkout\CheckoutPaymentMethod', @@ -107,7 +111,7 @@ class PaymentDonationRequest implements ModelInterface, ArrayAccess, \JsonSerial 'store' => 'string', 'storePaymentMethod' => 'bool', 'telephoneNumber' => 'string', - 'threeDS2RequestData' => '\Adyen\Model\Checkout\ThreeDS2RequestData', + 'threeDS2RequestData' => '\Adyen\Model\Checkout\ThreeDS2RequestData2', 'threeDSAuthenticationOnly' => 'bool', 'trustedShopper' => 'bool' ]; @@ -121,6 +125,7 @@ class PaymentDonationRequest implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPIFormats = [ 'accountInfo' => null, + 'additionalAmount' => null, 'additionalData' => null, 'amount' => null, 'applicationInfo' => null, @@ -133,8 +138,9 @@ class PaymentDonationRequest implements ModelInterface, ArrayAccess, \JsonSerial 'company' => null, 'conversionId' => null, 'countryCode' => null, - 'dateOfBirth' => 'date', + 'dateOfBirth' => 'date-time', 'dccQuote' => null, + 'deliverAt' => 'date-time', 'deliveryAddress' => null, 'deliveryDate' => 'date-time', 'deviceFingerprint' => null, @@ -146,6 +152,8 @@ class PaymentDonationRequest implements ModelInterface, ArrayAccess, \JsonSerial 'enableRecurring' => null, 'entityType' => null, 'fraudOffset' => 'int32', + 'fundOrigin' => null, + 'fundRecipient' => null, 'industryUsage' => null, 'installments' => null, 'lineItems' => null, @@ -195,6 +203,7 @@ class PaymentDonationRequest implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPINullables = [ 'accountInfo' => false, + 'additionalAmount' => false, 'additionalData' => false, 'amount' => false, 'applicationInfo' => false, @@ -209,6 +218,7 @@ class PaymentDonationRequest implements ModelInterface, ArrayAccess, \JsonSerial 'countryCode' => false, 'dateOfBirth' => false, 'dccQuote' => false, + 'deliverAt' => false, 'deliveryAddress' => false, 'deliveryDate' => false, 'deviceFingerprint' => false, @@ -220,6 +230,8 @@ class PaymentDonationRequest implements ModelInterface, ArrayAccess, \JsonSerial 'enableRecurring' => false, 'entityType' => false, 'fraudOffset' => true, + 'fundOrigin' => false, + 'fundRecipient' => false, 'industryUsage' => false, 'installments' => false, 'lineItems' => false, @@ -349,6 +361,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountInfo' => 'accountInfo', + 'additionalAmount' => 'additionalAmount', 'additionalData' => 'additionalData', 'amount' => 'amount', 'applicationInfo' => 'applicationInfo', @@ -363,6 +376,7 @@ public function isNullableSetToNull(string $property): bool 'countryCode' => 'countryCode', 'dateOfBirth' => 'dateOfBirth', 'dccQuote' => 'dccQuote', + 'deliverAt' => 'deliverAt', 'deliveryAddress' => 'deliveryAddress', 'deliveryDate' => 'deliveryDate', 'deviceFingerprint' => 'deviceFingerprint', @@ -374,6 +388,8 @@ public function isNullableSetToNull(string $property): bool 'enableRecurring' => 'enableRecurring', 'entityType' => 'entityType', 'fraudOffset' => 'fraudOffset', + 'fundOrigin' => 'fundOrigin', + 'fundRecipient' => 'fundRecipient', 'industryUsage' => 'industryUsage', 'installments' => 'installments', 'lineItems' => 'lineItems', @@ -423,6 +439,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountInfo' => 'setAccountInfo', + 'additionalAmount' => 'setAdditionalAmount', 'additionalData' => 'setAdditionalData', 'amount' => 'setAmount', 'applicationInfo' => 'setApplicationInfo', @@ -437,6 +454,7 @@ public function isNullableSetToNull(string $property): bool 'countryCode' => 'setCountryCode', 'dateOfBirth' => 'setDateOfBirth', 'dccQuote' => 'setDccQuote', + 'deliverAt' => 'setDeliverAt', 'deliveryAddress' => 'setDeliveryAddress', 'deliveryDate' => 'setDeliveryDate', 'deviceFingerprint' => 'setDeviceFingerprint', @@ -448,6 +466,8 @@ public function isNullableSetToNull(string $property): bool 'enableRecurring' => 'setEnableRecurring', 'entityType' => 'setEntityType', 'fraudOffset' => 'setFraudOffset', + 'fundOrigin' => 'setFundOrigin', + 'fundRecipient' => 'setFundRecipient', 'industryUsage' => 'setIndustryUsage', 'installments' => 'setInstallments', 'lineItems' => 'setLineItems', @@ -497,6 +517,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountInfo' => 'getAccountInfo', + 'additionalAmount' => 'getAdditionalAmount', 'additionalData' => 'getAdditionalData', 'amount' => 'getAmount', 'applicationInfo' => 'getApplicationInfo', @@ -511,6 +532,7 @@ public function isNullableSetToNull(string $property): bool 'countryCode' => 'getCountryCode', 'dateOfBirth' => 'getDateOfBirth', 'dccQuote' => 'getDccQuote', + 'deliverAt' => 'getDeliverAt', 'deliveryAddress' => 'getDeliveryAddress', 'deliveryDate' => 'getDeliveryDate', 'deviceFingerprint' => 'getDeviceFingerprint', @@ -522,6 +544,8 @@ public function isNullableSetToNull(string $property): bool 'enableRecurring' => 'getEnableRecurring', 'entityType' => 'getEntityType', 'fraudOffset' => 'getFraudOffset', + 'fundOrigin' => 'getFundOrigin', + 'fundRecipient' => 'getFundRecipient', 'industryUsage' => 'getIndustryUsage', 'installments' => 'getInstallments', 'lineItems' => 'getLineItems', @@ -702,6 +726,7 @@ public function getShopperInteractionAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountInfo', $data ?? [], null); + $this->setIfExists('additionalAmount', $data ?? [], null); $this->setIfExists('additionalData', $data ?? [], null); $this->setIfExists('amount', $data ?? [], null); $this->setIfExists('applicationInfo', $data ?? [], null); @@ -716,6 +741,7 @@ public function __construct(array $data = null) $this->setIfExists('countryCode', $data ?? [], null); $this->setIfExists('dateOfBirth', $data ?? [], null); $this->setIfExists('dccQuote', $data ?? [], null); + $this->setIfExists('deliverAt', $data ?? [], null); $this->setIfExists('deliveryAddress', $data ?? [], null); $this->setIfExists('deliveryDate', $data ?? [], null); $this->setIfExists('deviceFingerprint', $data ?? [], null); @@ -727,6 +753,8 @@ public function __construct(array $data = null) $this->setIfExists('enableRecurring', $data ?? [], null); $this->setIfExists('entityType', $data ?? [], null); $this->setIfExists('fraudOffset', $data ?? [], null); + $this->setIfExists('fundOrigin', $data ?? [], null); + $this->setIfExists('fundRecipient', $data ?? [], null); $this->setIfExists('industryUsage', $data ?? [], null); $this->setIfExists('installments', $data ?? [], null); $this->setIfExists('lineItems', $data ?? [], null); @@ -901,6 +929,33 @@ public function setAccountInfo($accountInfo) return $this; } + /** + * Gets additionalAmount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getAdditionalAmount() + { + return $this->container['additionalAmount']; + } + + /** + * Sets additionalAmount + * + * @param \Adyen\Model\Checkout\Amount|null $additionalAmount additionalAmount + * + * @return self + */ + public function setAdditionalAmount($additionalAmount) + { + if (is_null($additionalAmount)) { + throw new \InvalidArgumentException('non-nullable additionalAmount cannot be null'); + } + $this->container['additionalAmount'] = $additionalAmount; + + return $this; + } + /** * Gets additionalData * @@ -1138,7 +1193,7 @@ public function getCheckoutAttemptId() /** * Sets checkoutAttemptId * - * @param string|null $checkoutAttemptId Checkout attempt ID that corresponds to the Id generated for tracking user payment journey. + * @param string|null $checkoutAttemptId Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. * * @return self */ @@ -1183,6 +1238,7 @@ public function setCompany($company) * Gets conversionId * * @return string|null + * @deprecated */ public function getConversionId() { @@ -1192,9 +1248,10 @@ public function getConversionId() /** * Sets conversionId * - * @param string|null $conversionId Conversion ID that corresponds to the Id generated for tracking user payment journey. + * @param string|null $conversionId Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. * * @return self + * @deprecated */ public function setConversionId($conversionId) { @@ -1287,6 +1344,33 @@ public function setDccQuote($dccQuote) return $this; } + /** + * Gets deliverAt + * + * @return \DateTime|null + */ + public function getDeliverAt() + { + return $this->container['deliverAt']; + } + + /** + * Sets deliverAt + * + * @param \DateTime|null $deliverAt The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + * + * @return self + */ + public function setDeliverAt($deliverAt) + { + if (is_null($deliverAt)) { + throw new \InvalidArgumentException('non-nullable deliverAt cannot be null'); + } + $this->container['deliverAt'] = $deliverAt; + + return $this; + } + /** * Gets deliveryAddress * @@ -1318,6 +1402,7 @@ public function setDeliveryAddress($deliveryAddress) * Gets deliveryDate * * @return \DateTime|null + * @deprecated */ public function getDeliveryDate() { @@ -1330,6 +1415,7 @@ public function getDeliveryDate() * @param \DateTime|null $deliveryDate The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 * * @return self + * @deprecated */ public function setDeliveryDate($deliveryDate) { @@ -1592,6 +1678,60 @@ public function setFraudOffset($fraudOffset) return $this; } + /** + * Gets fundOrigin + * + * @return \Adyen\Model\Checkout\FundOrigin|null + */ + public function getFundOrigin() + { + return $this->container['fundOrigin']; + } + + /** + * Sets fundOrigin + * + * @param \Adyen\Model\Checkout\FundOrigin|null $fundOrigin fundOrigin + * + * @return self + */ + public function setFundOrigin($fundOrigin) + { + if (is_null($fundOrigin)) { + throw new \InvalidArgumentException('non-nullable fundOrigin cannot be null'); + } + $this->container['fundOrigin'] = $fundOrigin; + + return $this; + } + + /** + * Gets fundRecipient + * + * @return \Adyen\Model\Checkout\FundRecipient|null + */ + public function getFundRecipient() + { + return $this->container['fundRecipient']; + } + + /** + * Sets fundRecipient + * + * @param \Adyen\Model\Checkout\FundRecipient|null $fundRecipient fundRecipient + * + * @return self + */ + public function setFundRecipient($fundRecipient) + { + if (is_null($fundRecipient)) { + throw new \InvalidArgumentException('non-nullable fundRecipient cannot be null'); + } + $this->container['fundRecipient'] = $fundRecipient; + + return $this; + } + /** * Gets industryUsage * @@ -1669,7 +1809,7 @@ public function getLineItems() /** * Sets lineItems * - * @param \Adyen\Model\Checkout\LineItem[]|null $lineItems Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * @param \Adyen\Model\Checkout\LineItem[]|null $lineItems Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip. * * @return self */ @@ -1902,7 +2042,7 @@ public function setMpiData($mpiData) /** * Gets order * - * @return \Adyen\Model\Checkout\CheckoutOrder|null + * @return \Adyen\Model\Checkout\EncryptedOrderData|null */ public function getOrder() { @@ -1912,7 +2052,7 @@ public function getOrder() /** * Sets order * - * @param \Adyen\Model\Checkout\CheckoutOrder|null $order order + * @param \Adyen\Model\Checkout\EncryptedOrderData|null $order order * * @return self */ @@ -2101,7 +2241,7 @@ public function getRecurringProcessingModel() /** * Sets recurringProcessingModel * - * @param string|null $recurringProcessingModel Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * @param string|null $recurringProcessingModel Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. * * @return self */ @@ -2526,7 +2666,7 @@ public function getSplits() /** * Sets splits * - * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). * * @return self */ @@ -2553,7 +2693,7 @@ public function getStore() /** * Sets store * - * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). * * @return self */ @@ -2624,7 +2764,7 @@ public function setTelephoneNumber($telephoneNumber) /** * Gets threeDS2RequestData * - * @return \Adyen\Model\Checkout\ThreeDS2RequestData|null + * @return \Adyen\Model\Checkout\ThreeDS2RequestData2|null */ public function getThreeDS2RequestData() { @@ -2634,7 +2774,7 @@ public function getThreeDS2RequestData() /** * Sets threeDS2RequestData * - * @param \Adyen\Model\Checkout\ThreeDS2RequestData|null $threeDS2RequestData threeDS2RequestData + * @param \Adyen\Model\Checkout\ThreeDS2RequestData2|null $threeDS2RequestData threeDS2RequestData * * @return self */ diff --git a/src/Adyen/Model/Checkout/DonationResponse.php b/src/Adyen/Model/Checkout/DonationPaymentResponse.php similarity index 98% rename from src/Adyen/Model/Checkout/DonationResponse.php rename to src/Adyen/Model/Checkout/DonationPaymentResponse.php index 768129a1b..0db2c9b8b 100644 --- a/src/Adyen/Model/Checkout/DonationResponse.php +++ b/src/Adyen/Model/Checkout/DonationPaymentResponse.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * DonationResponse Class Doc Comment + * DonationPaymentResponse Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class DonationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class DonationPaymentResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class DonationResponse implements ModelInterface, ArrayAccess, \JsonSerializable * * @var string */ - protected static $openAPIModelName = 'DonationResponse'; + protected static $openAPIModelName = 'DonationPaymentResponse'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Adyen/Model/Checkout/CheckoutOrder.php b/src/Adyen/Model/Checkout/EncryptedOrderData.php similarity index 98% rename from src/Adyen/Model/Checkout/CheckoutOrder.php rename to src/Adyen/Model/Checkout/EncryptedOrderData.php index 6b8f51c5c..42d09195d 100644 --- a/src/Adyen/Model/Checkout/CheckoutOrder.php +++ b/src/Adyen/Model/Checkout/EncryptedOrderData.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * CheckoutOrder Class Doc Comment + * EncryptedOrderData Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class CheckoutOrder implements ModelInterface, ArrayAccess, \JsonSerializable +class EncryptedOrderData implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class CheckoutOrder implements ModelInterface, ArrayAccess, \JsonSerializable * * @var string */ - protected static $openAPIModelName = 'CheckoutOrder'; + protected static $openAPIModelName = 'EncryptedOrderData'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Adyen/Model/Checkout/LineItem.php b/src/Adyen/Model/Checkout/LineItem.php index a417a2af6..cfc4c450d 100644 --- a/src/Adyen/Model/Checkout/LineItem.php +++ b/src/Adyen/Model/Checkout/LineItem.php @@ -590,7 +590,7 @@ public function getItemCategory() /** * Sets itemCategory * - * @param string|null $itemCategory Item category, used by the RatePay payment method. + * @param string|null $itemCategory Item category, used by the payment methods PayPal and Ratepay. * * @return self */ diff --git a/src/Adyen/Model/Checkout/PayPalDetails.php b/src/Adyen/Model/Checkout/PayPalDetails.php index 62ef54b82..80fc9504c 100644 --- a/src/Adyen/Model/Checkout/PayPalDetails.php +++ b/src/Adyen/Model/Checkout/PayPalDetails.php @@ -46,7 +46,9 @@ class PayPalDetails implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'checkoutAttemptId' => 'string', 'orderID' => 'string', + 'payeePreferred' => 'string', 'payerID' => 'string', + 'payerSelected' => 'string', 'recurringDetailReference' => 'string', 'storedPaymentMethodId' => 'string', 'subtype' => 'string', @@ -63,7 +65,9 @@ class PayPalDetails implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'checkoutAttemptId' => null, 'orderID' => null, + 'payeePreferred' => null, 'payerID' => null, + 'payerSelected' => null, 'recurringDetailReference' => null, 'storedPaymentMethodId' => null, 'subtype' => null, @@ -78,7 +82,9 @@ class PayPalDetails implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPINullables = [ 'checkoutAttemptId' => false, 'orderID' => false, + 'payeePreferred' => false, 'payerID' => false, + 'payerSelected' => false, 'recurringDetailReference' => false, 'storedPaymentMethodId' => false, 'subtype' => false, @@ -173,7 +179,9 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'checkoutAttemptId' => 'checkoutAttemptId', 'orderID' => 'orderID', + 'payeePreferred' => 'payeePreferred', 'payerID' => 'payerID', + 'payerSelected' => 'payerSelected', 'recurringDetailReference' => 'recurringDetailReference', 'storedPaymentMethodId' => 'storedPaymentMethodId', 'subtype' => 'subtype', @@ -188,7 +196,9 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'checkoutAttemptId' => 'setCheckoutAttemptId', 'orderID' => 'setOrderID', + 'payeePreferred' => 'setPayeePreferred', 'payerID' => 'setPayerID', + 'payerSelected' => 'setPayerSelected', 'recurringDetailReference' => 'setRecurringDetailReference', 'storedPaymentMethodId' => 'setStoredPaymentMethodId', 'subtype' => 'setSubtype', @@ -203,7 +213,9 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'checkoutAttemptId' => 'getCheckoutAttemptId', 'orderID' => 'getOrderID', + 'payeePreferred' => 'getPayeePreferred', 'payerID' => 'getPayerID', + 'payerSelected' => 'getPayerSelected', 'recurringDetailReference' => 'getRecurringDetailReference', 'storedPaymentMethodId' => 'getStoredPaymentMethodId', 'subtype' => 'getSubtype', @@ -295,7 +307,9 @@ public function __construct(array $data = null) { $this->setIfExists('checkoutAttemptId', $data ?? [], null); $this->setIfExists('orderID', $data ?? [], null); + $this->setIfExists('payeePreferred', $data ?? [], null); $this->setIfExists('payerID', $data ?? [], null); + $this->setIfExists('payerSelected', $data ?? [], null); $this->setIfExists('recurringDetailReference', $data ?? [], null); $this->setIfExists('storedPaymentMethodId', $data ?? [], null); $this->setIfExists('subtype', $data ?? [], null); @@ -419,6 +433,33 @@ public function setOrderID($orderID) return $this; } + /** + * Gets payeePreferred + * + * @return string|null + */ + public function getPayeePreferred() + { + return $this->container['payeePreferred']; + } + + /** + * Sets payeePreferred + * + * @param string|null $payeePreferred IMMEDIATE_PAYMENT_REQUIRED or UNRESTRICTED + * + * @return self + */ + public function setPayeePreferred($payeePreferred) + { + if (is_null($payeePreferred)) { + throw new \InvalidArgumentException('non-nullable payeePreferred cannot be null'); + } + $this->container['payeePreferred'] = $payeePreferred; + + return $this; + } + /** * Gets payerID * @@ -446,6 +487,33 @@ public function setPayerID($payerID) return $this; } + /** + * Gets payerSelected + * + * @return string|null + */ + public function getPayerSelected() + { + return $this->container['payerSelected']; + } + + /** + * Sets payerSelected + * + * @param string|null $payerSelected PAYPAL or PAYPAL_CREDIT + * + * @return self + */ + public function setPayerSelected($payerSelected) + { + if (is_null($payerSelected)) { + throw new \InvalidArgumentException('non-nullable payerSelected cannot be null'); + } + $this->container['payerSelected'] = $payerSelected; + + return $this; + } + /** * Gets recurringDetailReference * diff --git a/src/Adyen/Model/Checkout/CreatePaymentAmountUpdateRequest.php b/src/Adyen/Model/Checkout/PaymentAmountUpdateRequest.php similarity index 91% rename from src/Adyen/Model/Checkout/CreatePaymentAmountUpdateRequest.php rename to src/Adyen/Model/Checkout/PaymentAmountUpdateRequest.php index 69b6d0f7b..315daaadf 100644 --- a/src/Adyen/Model/Checkout/CreatePaymentAmountUpdateRequest.php +++ b/src/Adyen/Model/Checkout/PaymentAmountUpdateRequest.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * CreatePaymentAmountUpdateRequest Class Doc Comment + * PaymentAmountUpdateRequest Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class CreatePaymentAmountUpdateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class PaymentAmountUpdateRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class CreatePaymentAmountUpdateRequest implements ModelInterface, ArrayAccess, \ * * @var string */ - protected static $openAPIModelName = 'CreatePaymentAmountUpdateRequest'; + protected static $openAPIModelName = 'PaymentAmountUpdateRequest'; /** * Array of property to type mappings. Used for (de)serialization @@ -46,6 +46,7 @@ class CreatePaymentAmountUpdateRequest implements ModelInterface, ArrayAccess, \ protected static $openAPITypes = [ 'amount' => '\Adyen\Model\Checkout\Amount', 'industryUsage' => 'string', + 'lineItems' => '\Adyen\Model\Checkout\LineItem[]', 'merchantAccount' => 'string', 'reference' => 'string', 'splits' => '\Adyen\Model\Checkout\Split[]' @@ -61,6 +62,7 @@ class CreatePaymentAmountUpdateRequest implements ModelInterface, ArrayAccess, \ protected static $openAPIFormats = [ 'amount' => null, 'industryUsage' => null, + 'lineItems' => null, 'merchantAccount' => null, 'reference' => null, 'splits' => null @@ -74,6 +76,7 @@ class CreatePaymentAmountUpdateRequest implements ModelInterface, ArrayAccess, \ protected static $openAPINullables = [ 'amount' => false, 'industryUsage' => false, + 'lineItems' => false, 'merchantAccount' => false, 'reference' => false, 'splits' => false @@ -167,6 +170,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'amount' => 'amount', 'industryUsage' => 'industryUsage', + 'lineItems' => 'lineItems', 'merchantAccount' => 'merchantAccount', 'reference' => 'reference', 'splits' => 'splits' @@ -180,6 +184,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'amount' => 'setAmount', 'industryUsage' => 'setIndustryUsage', + 'lineItems' => 'setLineItems', 'merchantAccount' => 'setMerchantAccount', 'reference' => 'setReference', 'splits' => 'setSplits' @@ -193,6 +198,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'amount' => 'getAmount', 'industryUsage' => 'getIndustryUsage', + 'lineItems' => 'getLineItems', 'merchantAccount' => 'getMerchantAccount', 'reference' => 'getReference', 'splits' => 'getSplits' @@ -273,6 +279,7 @@ public function __construct(array $data = null) { $this->setIfExists('amount', $data ?? [], null); $this->setIfExists('industryUsage', $data ?? [], null); + $this->setIfExists('lineItems', $data ?? [], null); $this->setIfExists('merchantAccount', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('splits', $data ?? [], null); @@ -399,6 +406,33 @@ public function setIndustryUsage($industryUsage) return $this; } + /** + * Gets lineItems + * + * @return \Adyen\Model\Checkout\LineItem[]|null + */ + public function getLineItems() + { + return $this->container['lineItems']; + } + + /** + * Sets lineItems + * + * @param \Adyen\Model\Checkout\LineItem[]|null $lineItems Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + * + * @return self + */ + public function setLineItems($lineItems) + { + if (is_null($lineItems)) { + throw new \InvalidArgumentException('non-nullable lineItems cannot be null'); + } + $this->container['lineItems'] = $lineItems; + + return $this; + } + /** * Gets merchantAccount * diff --git a/src/Adyen/Model/Checkout/PaymentAmountUpdateResource.php b/src/Adyen/Model/Checkout/PaymentAmountUpdateResponse.php similarity index 99% rename from src/Adyen/Model/Checkout/PaymentAmountUpdateResource.php rename to src/Adyen/Model/Checkout/PaymentAmountUpdateResponse.php index ab7809959..60ff51e99 100644 --- a/src/Adyen/Model/Checkout/PaymentAmountUpdateResource.php +++ b/src/Adyen/Model/Checkout/PaymentAmountUpdateResponse.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * PaymentAmountUpdateResource Class Doc Comment + * PaymentAmountUpdateResponse Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class PaymentAmountUpdateResource implements ModelInterface, ArrayAccess, \JsonSerializable +class PaymentAmountUpdateResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class PaymentAmountUpdateResource implements ModelInterface, ArrayAccess, \JsonS * * @var string */ - protected static $openAPIModelName = 'PaymentAmountUpdateResource'; + protected static $openAPIModelName = 'PaymentAmountUpdateResponse'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Adyen/Model/Checkout/CreatePaymentCancelRequest.php b/src/Adyen/Model/Checkout/PaymentCancelRequest.php similarity index 97% rename from src/Adyen/Model/Checkout/CreatePaymentCancelRequest.php rename to src/Adyen/Model/Checkout/PaymentCancelRequest.php index 37a43038c..ccda5f499 100644 --- a/src/Adyen/Model/Checkout/CreatePaymentCancelRequest.php +++ b/src/Adyen/Model/Checkout/PaymentCancelRequest.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * CreatePaymentCancelRequest Class Doc Comment + * PaymentCancelRequest Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class CreatePaymentCancelRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class PaymentCancelRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class CreatePaymentCancelRequest implements ModelInterface, ArrayAccess, \JsonSe * * @var string */ - protected static $openAPIModelName = 'CreatePaymentCancelRequest'; + protected static $openAPIModelName = 'PaymentCancelRequest'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Adyen/Model/Checkout/PaymentCancelResource.php b/src/Adyen/Model/Checkout/PaymentCancelResponse.php similarity index 98% rename from src/Adyen/Model/Checkout/PaymentCancelResource.php rename to src/Adyen/Model/Checkout/PaymentCancelResponse.php index 8348f8593..e57b0b49c 100644 --- a/src/Adyen/Model/Checkout/PaymentCancelResource.php +++ b/src/Adyen/Model/Checkout/PaymentCancelResponse.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * PaymentCancelResource Class Doc Comment + * PaymentCancelResponse Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class PaymentCancelResource implements ModelInterface, ArrayAccess, \JsonSerializable +class PaymentCancelResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class PaymentCancelResource implements ModelInterface, ArrayAccess, \JsonSeriali * * @var string */ - protected static $openAPIModelName = 'PaymentCancelResource'; + protected static $openAPIModelName = 'PaymentCancelResponse'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Adyen/Model/Checkout/CreatePaymentCaptureRequest.php b/src/Adyen/Model/Checkout/PaymentCaptureRequest.php similarity index 81% rename from src/Adyen/Model/Checkout/CreatePaymentCaptureRequest.php rename to src/Adyen/Model/Checkout/PaymentCaptureRequest.php index c99ffffc3..ada5f794f 100644 --- a/src/Adyen/Model/Checkout/CreatePaymentCaptureRequest.php +++ b/src/Adyen/Model/Checkout/PaymentCaptureRequest.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * CreatePaymentCaptureRequest Class Doc Comment + * PaymentCaptureRequest Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class CreatePaymentCaptureRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class PaymentCaptureRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class CreatePaymentCaptureRequest implements ModelInterface, ArrayAccess, \JsonS * * @var string */ - protected static $openAPIModelName = 'CreatePaymentCaptureRequest'; + protected static $openAPIModelName = 'PaymentCaptureRequest'; /** * Array of property to type mappings. Used for (de)serialization @@ -47,8 +47,10 @@ class CreatePaymentCaptureRequest implements ModelInterface, ArrayAccess, \JsonS 'amount' => '\Adyen\Model\Checkout\Amount', 'lineItems' => '\Adyen\Model\Checkout\LineItem[]', 'merchantAccount' => 'string', + 'platformChargebackLogic' => '\Adyen\Model\Checkout\PlatformChargebackLogic', 'reference' => 'string', - 'splits' => '\Adyen\Model\Checkout\Split[]' + 'splits' => '\Adyen\Model\Checkout\Split[]', + 'subMerchants' => '\Adyen\Model\Checkout\SubMerchantInfo[]' ]; /** @@ -62,8 +64,10 @@ class CreatePaymentCaptureRequest implements ModelInterface, ArrayAccess, \JsonS 'amount' => null, 'lineItems' => null, 'merchantAccount' => null, + 'platformChargebackLogic' => null, 'reference' => null, - 'splits' => null + 'splits' => null, + 'subMerchants' => null ]; /** @@ -75,8 +79,10 @@ class CreatePaymentCaptureRequest implements ModelInterface, ArrayAccess, \JsonS 'amount' => false, 'lineItems' => false, 'merchantAccount' => false, + 'platformChargebackLogic' => false, 'reference' => false, - 'splits' => false + 'splits' => false, + 'subMerchants' => false ]; /** @@ -168,8 +174,10 @@ public function isNullableSetToNull(string $property): bool 'amount' => 'amount', 'lineItems' => 'lineItems', 'merchantAccount' => 'merchantAccount', + 'platformChargebackLogic' => 'platformChargebackLogic', 'reference' => 'reference', - 'splits' => 'splits' + 'splits' => 'splits', + 'subMerchants' => 'subMerchants' ]; /** @@ -181,8 +189,10 @@ public function isNullableSetToNull(string $property): bool 'amount' => 'setAmount', 'lineItems' => 'setLineItems', 'merchantAccount' => 'setMerchantAccount', + 'platformChargebackLogic' => 'setPlatformChargebackLogic', 'reference' => 'setReference', - 'splits' => 'setSplits' + 'splits' => 'setSplits', + 'subMerchants' => 'setSubMerchants' ]; /** @@ -194,8 +204,10 @@ public function isNullableSetToNull(string $property): bool 'amount' => 'getAmount', 'lineItems' => 'getLineItems', 'merchantAccount' => 'getMerchantAccount', + 'platformChargebackLogic' => 'getPlatformChargebackLogic', 'reference' => 'getReference', - 'splits' => 'getSplits' + 'splits' => 'getSplits', + 'subMerchants' => 'getSubMerchants' ]; /** @@ -258,8 +270,10 @@ public function __construct(array $data = null) $this->setIfExists('amount', $data ?? [], null); $this->setIfExists('lineItems', $data ?? [], null); $this->setIfExists('merchantAccount', $data ?? [], null); + $this->setIfExists('platformChargebackLogic', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('subMerchants', $data ?? [], null); } /** @@ -350,7 +364,7 @@ public function getLineItems() /** * Sets lineItems * - * @param \Adyen\Model\Checkout\LineItem[]|null $lineItems Price and product information of the captured items, required for [partial captures](https://docs.adyen.com/online-payments/capture#partial-capture). > This field is required for partial captures with 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * @param \Adyen\Model\Checkout\LineItem[]|null $lineItems Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. * * @return self */ @@ -391,6 +405,33 @@ public function setMerchantAccount($merchantAccount) return $this; } + /** + * Gets platformChargebackLogic + * + * @return \Adyen\Model\Checkout\PlatformChargebackLogic|null + */ + public function getPlatformChargebackLogic() + { + return $this->container['platformChargebackLogic']; + } + + /** + * Sets platformChargebackLogic + * + * @param \Adyen\Model\Checkout\PlatformChargebackLogic|null $platformChargebackLogic platformChargebackLogic + * + * @return self + */ + public function setPlatformChargebackLogic($platformChargebackLogic) + { + if (is_null($platformChargebackLogic)) { + throw new \InvalidArgumentException('non-nullable platformChargebackLogic cannot be null'); + } + $this->container['platformChargebackLogic'] = $platformChargebackLogic; + + return $this; + } + /** * Gets reference * @@ -444,6 +485,33 @@ public function setSplits($splits) return $this; } + + /** + * Gets subMerchants + * + * @return \Adyen\Model\Checkout\SubMerchantInfo[]|null + */ + public function getSubMerchants() + { + return $this->container['subMerchants']; + } + + /** + * Sets subMerchants + * + * @param \Adyen\Model\Checkout\SubMerchantInfo[]|null $subMerchants A List of sub-merchants. + * + * @return self + */ + public function setSubMerchants($subMerchants) + { + if (is_null($subMerchants)) { + throw new \InvalidArgumentException('non-nullable subMerchants cannot be null'); + } + $this->container['subMerchants'] = $subMerchants; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Checkout/PaymentCaptureResource.php b/src/Adyen/Model/Checkout/PaymentCaptureResponse.php similarity index 85% rename from src/Adyen/Model/Checkout/PaymentCaptureResource.php rename to src/Adyen/Model/Checkout/PaymentCaptureResponse.php index 1caaffea8..168d6b021 100644 --- a/src/Adyen/Model/Checkout/PaymentCaptureResource.php +++ b/src/Adyen/Model/Checkout/PaymentCaptureResponse.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * PaymentCaptureResource Class Doc Comment + * PaymentCaptureResponse Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class PaymentCaptureResource implements ModelInterface, ArrayAccess, \JsonSerializable +class PaymentCaptureResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class PaymentCaptureResource implements ModelInterface, ArrayAccess, \JsonSerial * * @var string */ - protected static $openAPIModelName = 'PaymentCaptureResource'; + protected static $openAPIModelName = 'PaymentCaptureResponse'; /** * Array of property to type mappings. Used for (de)serialization @@ -48,10 +48,12 @@ class PaymentCaptureResource implements ModelInterface, ArrayAccess, \JsonSerial 'lineItems' => '\Adyen\Model\Checkout\LineItem[]', 'merchantAccount' => 'string', 'paymentPspReference' => 'string', + 'platformChargebackLogic' => '\Adyen\Model\Checkout\PlatformChargebackLogic', 'pspReference' => 'string', 'reference' => 'string', 'splits' => '\Adyen\Model\Checkout\Split[]', - 'status' => 'string' + 'status' => 'string', + 'subMerchants' => '\Adyen\Model\Checkout\SubMerchantInfo[]' ]; /** @@ -66,10 +68,12 @@ class PaymentCaptureResource implements ModelInterface, ArrayAccess, \JsonSerial 'lineItems' => null, 'merchantAccount' => null, 'paymentPspReference' => null, + 'platformChargebackLogic' => null, 'pspReference' => null, 'reference' => null, 'splits' => null, - 'status' => null + 'status' => null, + 'subMerchants' => null ]; /** @@ -82,10 +86,12 @@ class PaymentCaptureResource implements ModelInterface, ArrayAccess, \JsonSerial 'lineItems' => false, 'merchantAccount' => false, 'paymentPspReference' => false, + 'platformChargebackLogic' => false, 'pspReference' => false, 'reference' => false, 'splits' => false, - 'status' => false + 'status' => false, + 'subMerchants' => false ]; /** @@ -178,10 +184,12 @@ public function isNullableSetToNull(string $property): bool 'lineItems' => 'lineItems', 'merchantAccount' => 'merchantAccount', 'paymentPspReference' => 'paymentPspReference', + 'platformChargebackLogic' => 'platformChargebackLogic', 'pspReference' => 'pspReference', 'reference' => 'reference', 'splits' => 'splits', - 'status' => 'status' + 'status' => 'status', + 'subMerchants' => 'subMerchants' ]; /** @@ -194,10 +202,12 @@ public function isNullableSetToNull(string $property): bool 'lineItems' => 'setLineItems', 'merchantAccount' => 'setMerchantAccount', 'paymentPspReference' => 'setPaymentPspReference', + 'platformChargebackLogic' => 'setPlatformChargebackLogic', 'pspReference' => 'setPspReference', 'reference' => 'setReference', 'splits' => 'setSplits', - 'status' => 'setStatus' + 'status' => 'setStatus', + 'subMerchants' => 'setSubMerchants' ]; /** @@ -210,10 +220,12 @@ public function isNullableSetToNull(string $property): bool 'lineItems' => 'getLineItems', 'merchantAccount' => 'getMerchantAccount', 'paymentPspReference' => 'getPaymentPspReference', + 'platformChargebackLogic' => 'getPlatformChargebackLogic', 'pspReference' => 'getPspReference', 'reference' => 'getReference', 'splits' => 'getSplits', - 'status' => 'getStatus' + 'status' => 'getStatus', + 'subMerchants' => 'getSubMerchants' ]; /** @@ -289,10 +301,12 @@ public function __construct(array $data = null) $this->setIfExists('lineItems', $data ?? [], null); $this->setIfExists('merchantAccount', $data ?? [], null); $this->setIfExists('paymentPspReference', $data ?? [], null); + $this->setIfExists('platformChargebackLogic', $data ?? [], null); $this->setIfExists('pspReference', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('splits', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('subMerchants', $data ?? [], null); } /** @@ -401,7 +415,7 @@ public function getLineItems() /** * Sets lineItems * - * @param \Adyen\Model\Checkout\LineItem[]|null $lineItems Price and product information of the captured items, required for [partial captures](https://docs.adyen.com/online-payments/capture#partial-capture). > This field is required for partial captures with 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * @param \Adyen\Model\Checkout\LineItem[]|null $lineItems Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. * * @return self */ @@ -469,6 +483,33 @@ public function setPaymentPspReference($paymentPspReference) return $this; } + /** + * Gets platformChargebackLogic + * + * @return \Adyen\Model\Checkout\PlatformChargebackLogic|null + */ + public function getPlatformChargebackLogic() + { + return $this->container['platformChargebackLogic']; + } + + /** + * Sets platformChargebackLogic + * + * @param \Adyen\Model\Checkout\PlatformChargebackLogic|null $platformChargebackLogic platformChargebackLogic + * + * @return self + */ + public function setPlatformChargebackLogic($platformChargebackLogic) + { + if (is_null($platformChargebackLogic)) { + throw new \InvalidArgumentException('non-nullable platformChargebackLogic cannot be null'); + } + $this->container['platformChargebackLogic'] = $platformChargebackLogic; + + return $this; + } + /** * Gets pspReference * @@ -586,6 +627,33 @@ public function setStatus($status) return $this; } + + /** + * Gets subMerchants + * + * @return \Adyen\Model\Checkout\SubMerchantInfo[]|null + */ + public function getSubMerchants() + { + return $this->container['subMerchants']; + } + + /** + * Sets subMerchants + * + * @param \Adyen\Model\Checkout\SubMerchantInfo[]|null $subMerchants List of sub-merchants. + * + * @return self + */ + public function setSubMerchants($subMerchants) + { + if (is_null($subMerchants)) { + throw new \InvalidArgumentException('non-nullable subMerchants cannot be null'); + } + $this->container['subMerchants'] = $subMerchants; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Checkout/PaymentCompletionDetails.php b/src/Adyen/Model/Checkout/PaymentCompletionDetails.php index d4244533c..756ca783f 100644 --- a/src/Adyen/Model/Checkout/PaymentCompletionDetails.php +++ b/src/Adyen/Model/Checkout/PaymentCompletionDetails.php @@ -47,6 +47,7 @@ class PaymentCompletionDetails implements ModelInterface, ArrayAccess, \JsonSeri 'mD' => 'string', 'paReq' => 'string', 'paRes' => 'string', + 'authorizationToken' => 'string', 'billingToken' => 'string', 'cupsecureplusSmscode' => 'string', 'facilitatorAccessToken' => 'string', @@ -74,6 +75,7 @@ class PaymentCompletionDetails implements ModelInterface, ArrayAccess, \JsonSeri 'mD' => null, 'paReq' => null, 'paRes' => null, + 'authorizationToken' => null, 'billingToken' => null, 'cupsecureplusSmscode' => null, 'facilitatorAccessToken' => null, @@ -99,6 +101,7 @@ class PaymentCompletionDetails implements ModelInterface, ArrayAccess, \JsonSeri 'mD' => false, 'paReq' => false, 'paRes' => false, + 'authorizationToken' => false, 'billingToken' => false, 'cupsecureplusSmscode' => false, 'facilitatorAccessToken' => false, @@ -204,6 +207,7 @@ public function isNullableSetToNull(string $property): bool 'mD' => 'MD', 'paReq' => 'PaReq', 'paRes' => 'PaRes', + 'authorizationToken' => 'authorization_token', 'billingToken' => 'billingToken', 'cupsecureplusSmscode' => 'cupsecureplus.smscode', 'facilitatorAccessToken' => 'facilitatorAccessToken', @@ -229,6 +233,7 @@ public function isNullableSetToNull(string $property): bool 'mD' => 'setMD', 'paReq' => 'setPaReq', 'paRes' => 'setPaRes', + 'authorizationToken' => 'setAuthorizationToken', 'billingToken' => 'setBillingToken', 'cupsecureplusSmscode' => 'setCupsecureplusSmscode', 'facilitatorAccessToken' => 'setFacilitatorAccessToken', @@ -254,6 +259,7 @@ public function isNullableSetToNull(string $property): bool 'mD' => 'getMD', 'paReq' => 'getPaReq', 'paRes' => 'getPaRes', + 'authorizationToken' => 'getAuthorizationToken', 'billingToken' => 'getBillingToken', 'cupsecureplusSmscode' => 'getCupsecureplusSmscode', 'facilitatorAccessToken' => 'getFacilitatorAccessToken', @@ -330,6 +336,7 @@ public function __construct(array $data = null) $this->setIfExists('mD', $data ?? [], null); $this->setIfExists('paReq', $data ?? [], null); $this->setIfExists('paRes', $data ?? [], null); + $this->setIfExists('authorizationToken', $data ?? [], null); $this->setIfExists('billingToken', $data ?? [], null); $this->setIfExists('cupsecureplusSmscode', $data ?? [], null); $this->setIfExists('facilitatorAccessToken', $data ?? [], null); @@ -469,6 +476,33 @@ public function setPaRes($paRes) return $this; } + /** + * Gets authorizationToken + * + * @return string|null + */ + public function getAuthorizationToken() + { + return $this->container['authorizationToken']; + } + + /** + * Sets authorizationToken + * + * @param string|null $authorizationToken authorizationToken + * + * @return self + */ + public function setAuthorizationToken($authorizationToken) + { + if (is_null($authorizationToken)) { + throw new \InvalidArgumentException('non-nullable authorizationToken cannot be null'); + } + $this->container['authorizationToken'] = $authorizationToken; + + return $this; + } + /** * Gets billingToken * diff --git a/src/Adyen/Model/Checkout/PaymentDetails.php b/src/Adyen/Model/Checkout/PaymentDetails.php index 8c36b8fda..aafa58ece 100644 --- a/src/Adyen/Model/Checkout/PaymentDetails.php +++ b/src/Adyen/Model/Checkout/PaymentDetails.php @@ -251,24 +251,20 @@ public function getModelName() public const TYPE_UPI_QR = 'upi_qr'; public const TYPE_PAYTM = 'paytm'; public const TYPE_MOLPAY_EBANKING_VN = 'molpay_ebanking_VN'; - public const TYPE_OPENBANKING_UK = 'openbanking_UK'; public const TYPE_PAYBYBANK = 'paybybank'; public const TYPE_EBANKING_FI = 'ebanking_FI'; public const TYPE_MOLPAY_EBANKING_MY = 'molpay_ebanking_MY'; public const TYPE_MOLPAY_EBANKING_DIRECT_MY = 'molpay_ebanking_direct_MY'; public const TYPE_SWISH = 'swish'; - public const TYPE_TWINT = 'twint'; + public const TYPE_PIX = 'pix'; public const TYPE_WALLEY = 'walley'; public const TYPE_WALLEY_B2B = 'walley_b2b'; - public const TYPE_PIX = 'pix'; - public const TYPE_BIZUM = 'bizum'; public const TYPE_ALMA = 'alma'; public const TYPE_MOLPAY_FPX = 'molpay_fpx'; public const TYPE_KONBINI = 'konbini'; public const TYPE_DIRECT_EBANKING = 'directEbanking'; public const TYPE_BOLETOBANCARIO = 'boletobancario'; public const TYPE_NETELLER = 'neteller'; - public const TYPE_DANA = 'dana'; public const TYPE_PAYSAFECARD = 'paysafecard'; public const TYPE_CASHTICKET = 'cashticket'; public const TYPE_IKANO = 'ikano'; @@ -352,24 +348,20 @@ public function getTypeAllowableValues() self::TYPE_UPI_QR, self::TYPE_PAYTM, self::TYPE_MOLPAY_EBANKING_VN, - self::TYPE_OPENBANKING_UK, self::TYPE_PAYBYBANK, self::TYPE_EBANKING_FI, self::TYPE_MOLPAY_EBANKING_MY, self::TYPE_MOLPAY_EBANKING_DIRECT_MY, self::TYPE_SWISH, - self::TYPE_TWINT, + self::TYPE_PIX, self::TYPE_WALLEY, self::TYPE_WALLEY_B2B, - self::TYPE_PIX, - self::TYPE_BIZUM, self::TYPE_ALMA, self::TYPE_MOLPAY_FPX, self::TYPE_KONBINI, self::TYPE_DIRECT_EBANKING, self::TYPE_BOLETOBANCARIO, self::TYPE_NETELLER, - self::TYPE_DANA, self::TYPE_PAYSAFECARD, self::TYPE_CASHTICKET, self::TYPE_IKANO, diff --git a/src/Adyen/Model/Checkout/DetailsRequest.php b/src/Adyen/Model/Checkout/PaymentDetailsRequest.php similarity index 98% rename from src/Adyen/Model/Checkout/DetailsRequest.php rename to src/Adyen/Model/Checkout/PaymentDetailsRequest.php index 4ea6f33e1..d5b4a4f8d 100644 --- a/src/Adyen/Model/Checkout/DetailsRequest.php +++ b/src/Adyen/Model/Checkout/PaymentDetailsRequest.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * DetailsRequest Class Doc Comment + * PaymentDetailsRequest Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class DetailsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class PaymentDetailsRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class DetailsRequest implements ModelInterface, ArrayAccess, \JsonSerializable * * @var string */ - protected static $openAPIModelName = 'DetailsRequest'; + protected static $openAPIModelName = 'PaymentDetailsRequest'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Adyen/Model/Checkout/PaymentDetailsResponse.php b/src/Adyen/Model/Checkout/PaymentDetailsResponse.php index 034b09c3e..2ff71b86e 100644 --- a/src/Adyen/Model/Checkout/PaymentDetailsResponse.php +++ b/src/Adyen/Model/Checkout/PaymentDetailsResponse.php @@ -306,6 +306,7 @@ public function getModelName() public const RESULT_CODE_CHALLENGE_SHOPPER = 'ChallengeShopper'; public const RESULT_CODE_ERROR = 'Error'; public const RESULT_CODE_IDENTIFY_SHOPPER = 'IdentifyShopper'; + public const RESULT_CODE_PARTIALLY_AUTHORISED = 'PartiallyAuthorised'; public const RESULT_CODE_PENDING = 'Pending'; public const RESULT_CODE_PRESENT_TO_SHOPPER = 'PresentToShopper'; public const RESULT_CODE_RECEIVED = 'Received'; @@ -328,6 +329,7 @@ public function getResultCodeAllowableValues() self::RESULT_CODE_CHALLENGE_SHOPPER, self::RESULT_CODE_ERROR, self::RESULT_CODE_IDENTIFY_SHOPPER, + self::RESULT_CODE_PARTIALLY_AUTHORISED, self::RESULT_CODE_PENDING, self::RESULT_CODE_PRESENT_TO_SHOPPER, self::RESULT_CODE_RECEIVED, @@ -702,7 +704,7 @@ public function getResultCode() /** * Sets resultCode * - * @param string|null $resultCode The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. + * @param string|null $resultCode The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * * @return self */ diff --git a/src/Adyen/Model/Checkout/CreatePaymentLinkRequest.php b/src/Adyen/Model/Checkout/PaymentLinkRequest.php similarity index 94% rename from src/Adyen/Model/Checkout/CreatePaymentLinkRequest.php rename to src/Adyen/Model/Checkout/PaymentLinkRequest.php index 65a0b0667..6c326fe99 100644 --- a/src/Adyen/Model/Checkout/CreatePaymentLinkRequest.php +++ b/src/Adyen/Model/Checkout/PaymentLinkRequest.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * CreatePaymentLinkRequest Class Doc Comment + * PaymentLinkRequest Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class CreatePaymentLinkRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class PaymentLinkRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class CreatePaymentLinkRequest implements ModelInterface, ArrayAccess, \JsonSeri * * @var string */ - protected static $openAPIModelName = 'CreatePaymentLinkRequest'; + protected static $openAPIModelName = 'PaymentLinkRequest'; /** * Array of property to type mappings. Used for (de)serialization @@ -46,6 +46,7 @@ class CreatePaymentLinkRequest implements ModelInterface, ArrayAccess, \JsonSeri protected static $openAPITypes = [ 'allowedPaymentMethods' => 'string[]', 'amount' => '\Adyen\Model\Checkout\Amount', + 'applicationInfo' => '\Adyen\Model\Checkout\ApplicationInfo', 'billingAddress' => '\Adyen\Model\Checkout\Address', 'blockedPaymentMethods' => 'string[]', 'captureDelayHours' => 'int', @@ -93,6 +94,7 @@ class CreatePaymentLinkRequest implements ModelInterface, ArrayAccess, \JsonSeri protected static $openAPIFormats = [ 'allowedPaymentMethods' => null, 'amount' => null, + 'applicationInfo' => null, 'billingAddress' => null, 'blockedPaymentMethods' => null, 'captureDelayHours' => 'int32', @@ -138,6 +140,7 @@ class CreatePaymentLinkRequest implements ModelInterface, ArrayAccess, \JsonSeri protected static $openAPINullables = [ 'allowedPaymentMethods' => false, 'amount' => false, + 'applicationInfo' => false, 'billingAddress' => false, 'blockedPaymentMethods' => false, 'captureDelayHours' => true, @@ -263,6 +266,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'allowedPaymentMethods' => 'allowedPaymentMethods', 'amount' => 'amount', + 'applicationInfo' => 'applicationInfo', 'billingAddress' => 'billingAddress', 'blockedPaymentMethods' => 'blockedPaymentMethods', 'captureDelayHours' => 'captureDelayHours', @@ -308,6 +312,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'allowedPaymentMethods' => 'setAllowedPaymentMethods', 'amount' => 'setAmount', + 'applicationInfo' => 'setApplicationInfo', 'billingAddress' => 'setBillingAddress', 'blockedPaymentMethods' => 'setBlockedPaymentMethods', 'captureDelayHours' => 'setCaptureDelayHours', @@ -353,6 +358,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'allowedPaymentMethods' => 'getAllowedPaymentMethods', 'amount' => 'getAmount', + 'applicationInfo' => 'getApplicationInfo', 'billingAddress' => 'getBillingAddress', 'blockedPaymentMethods' => 'getBlockedPaymentMethods', 'captureDelayHours' => 'getCaptureDelayHours', @@ -501,6 +507,7 @@ public function __construct(array $data = null) { $this->setIfExists('allowedPaymentMethods', $data ?? [], null); $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('applicationInfo', $data ?? [], null); $this->setIfExists('billingAddress', $data ?? [], null); $this->setIfExists('blockedPaymentMethods', $data ?? [], null); $this->setIfExists('captureDelayHours', $data ?? [], null); @@ -620,7 +627,7 @@ public function getAllowedPaymentMethods() /** * Sets allowedPaymentMethods * - * @param string[]|null $allowedPaymentMethods List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * @param string[]|null $allowedPaymentMethods List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` * * @return self */ @@ -661,6 +668,33 @@ public function setAmount($amount) return $this; } + /** + * Gets applicationInfo + * + * @return \Adyen\Model\Checkout\ApplicationInfo|null + */ + public function getApplicationInfo() + { + return $this->container['applicationInfo']; + } + + /** + * Sets applicationInfo + * + * @param \Adyen\Model\Checkout\ApplicationInfo|null $applicationInfo applicationInfo + * + * @return self + */ + public function setApplicationInfo($applicationInfo) + { + if (is_null($applicationInfo)) { + throw new \InvalidArgumentException('non-nullable applicationInfo cannot be null'); + } + $this->container['applicationInfo'] = $applicationInfo; + + return $this; + } + /** * Gets billingAddress * @@ -701,7 +735,7 @@ public function getBlockedPaymentMethods() /** * Sets blockedPaymentMethods * - * @param string[]|null $blockedPaymentMethods List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * @param string[]|null $blockedPaymentMethods List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` * * @return self */ @@ -888,7 +922,7 @@ public function getExpiresAt() /** * Sets expiresAt * - * @param string|null $expiresAt The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. + * @param string|null $expiresAt The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone designator **Z**: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30Z**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. * * @return self */ @@ -1104,7 +1138,7 @@ public function getRecurringProcessingModel() /** * Sets recurringProcessingModel * - * @param string|null $recurringProcessingModel Defines a recurring payment type. Required when creating a token to store payment details. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * @param string|null $recurringProcessingModel Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. * * @return self */ @@ -1501,7 +1535,7 @@ public function getSplits() /** * Sets splits * - * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the payment should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). * * @return self */ @@ -1555,7 +1589,7 @@ public function getStorePaymentMethodMode() /** * Sets storePaymentMethodMode * - * @param string|null $storePaymentMethodMode Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. + * @param string|null $storePaymentMethodMode Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. * * @return self */ diff --git a/src/Adyen/Model/Checkout/PaymentLinkResponse.php b/src/Adyen/Model/Checkout/PaymentLinkResponse.php index beb80bbde..d401c0560 100644 --- a/src/Adyen/Model/Checkout/PaymentLinkResponse.php +++ b/src/Adyen/Model/Checkout/PaymentLinkResponse.php @@ -46,6 +46,7 @@ class PaymentLinkResponse implements ModelInterface, ArrayAccess, \JsonSerializa protected static $openAPITypes = [ 'allowedPaymentMethods' => 'string[]', 'amount' => '\Adyen\Model\Checkout\Amount', + 'applicationInfo' => '\Adyen\Model\Checkout\ApplicationInfo', 'billingAddress' => '\Adyen\Model\Checkout\Address', 'blockedPaymentMethods' => 'string[]', 'captureDelayHours' => 'int', @@ -97,6 +98,7 @@ class PaymentLinkResponse implements ModelInterface, ArrayAccess, \JsonSerializa protected static $openAPIFormats = [ 'allowedPaymentMethods' => null, 'amount' => null, + 'applicationInfo' => null, 'billingAddress' => null, 'blockedPaymentMethods' => null, 'captureDelayHours' => 'int32', @@ -146,6 +148,7 @@ class PaymentLinkResponse implements ModelInterface, ArrayAccess, \JsonSerializa protected static $openAPINullables = [ 'allowedPaymentMethods' => false, 'amount' => false, + 'applicationInfo' => false, 'billingAddress' => false, 'blockedPaymentMethods' => false, 'captureDelayHours' => true, @@ -275,6 +278,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'allowedPaymentMethods' => 'allowedPaymentMethods', 'amount' => 'amount', + 'applicationInfo' => 'applicationInfo', 'billingAddress' => 'billingAddress', 'blockedPaymentMethods' => 'blockedPaymentMethods', 'captureDelayHours' => 'captureDelayHours', @@ -324,6 +328,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'allowedPaymentMethods' => 'setAllowedPaymentMethods', 'amount' => 'setAmount', + 'applicationInfo' => 'setApplicationInfo', 'billingAddress' => 'setBillingAddress', 'blockedPaymentMethods' => 'setBlockedPaymentMethods', 'captureDelayHours' => 'setCaptureDelayHours', @@ -373,6 +378,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'allowedPaymentMethods' => 'getAllowedPaymentMethods', 'amount' => 'getAmount', + 'applicationInfo' => 'getApplicationInfo', 'billingAddress' => 'getBillingAddress', 'blockedPaymentMethods' => 'getBlockedPaymentMethods', 'captureDelayHours' => 'getCaptureDelayHours', @@ -545,6 +551,7 @@ public function __construct(array $data = null) { $this->setIfExists('allowedPaymentMethods', $data ?? [], null); $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('applicationInfo', $data ?? [], null); $this->setIfExists('billingAddress', $data ?? [], null); $this->setIfExists('blockedPaymentMethods', $data ?? [], null); $this->setIfExists('captureDelayHours', $data ?? [], null); @@ -686,7 +693,7 @@ public function getAllowedPaymentMethods() /** * Sets allowedPaymentMethods * - * @param string[]|null $allowedPaymentMethods List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * @param string[]|null $allowedPaymentMethods List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` * * @return self */ @@ -727,6 +734,33 @@ public function setAmount($amount) return $this; } + /** + * Gets applicationInfo + * + * @return \Adyen\Model\Checkout\ApplicationInfo|null + */ + public function getApplicationInfo() + { + return $this->container['applicationInfo']; + } + + /** + * Sets applicationInfo + * + * @param \Adyen\Model\Checkout\ApplicationInfo|null $applicationInfo applicationInfo + * + * @return self + */ + public function setApplicationInfo($applicationInfo) + { + if (is_null($applicationInfo)) { + throw new \InvalidArgumentException('non-nullable applicationInfo cannot be null'); + } + $this->container['applicationInfo'] = $applicationInfo; + + return $this; + } + /** * Gets billingAddress * @@ -767,7 +801,7 @@ public function getBlockedPaymentMethods() /** * Sets blockedPaymentMethods * - * @param string[]|null $blockedPaymentMethods List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * @param string[]|null $blockedPaymentMethods List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` * * @return self */ @@ -954,7 +988,7 @@ public function getExpiresAt() /** * Sets expiresAt * - * @param string|null $expiresAt The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. + * @param string|null $expiresAt The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone designator **Z**: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30Z**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. * * @return self */ @@ -1197,7 +1231,7 @@ public function getRecurringProcessingModel() /** * Sets recurringProcessingModel * - * @param string|null $recurringProcessingModel Defines a recurring payment type. Required when creating a token to store payment details. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * @param string|null $recurringProcessingModel Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. * * @return self */ @@ -1594,7 +1628,7 @@ public function getSplits() /** * Sets splits * - * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the payment should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). * * @return self */ @@ -1685,7 +1719,7 @@ public function getStorePaymentMethodMode() /** * Sets storePaymentMethodMode * - * @param string|null $storePaymentMethodMode Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. + * @param string|null $storePaymentMethodMode Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. * * @return self */ diff --git a/src/Adyen/Model/Checkout/PaymentMethodsRequest.php b/src/Adyen/Model/Checkout/PaymentMethodsRequest.php index ac56122fa..eae4ce236 100644 --- a/src/Adyen/Model/Checkout/PaymentMethodsRequest.php +++ b/src/Adyen/Model/Checkout/PaymentMethodsRequest.php @@ -51,7 +51,7 @@ class PaymentMethodsRequest implements ModelInterface, ArrayAccess, \JsonSeriali 'channel' => 'string', 'countryCode' => 'string', 'merchantAccount' => 'string', - 'order' => '\Adyen\Model\Checkout\CheckoutOrder', + 'order' => '\Adyen\Model\Checkout\EncryptedOrderData', 'shopperLocale' => 'string', 'shopperReference' => 'string', 'splitCardFundingSources' => 'bool', @@ -421,7 +421,7 @@ public function getAllowedPaymentMethods() /** * Sets allowedPaymentMethods * - * @param string[]|null $allowedPaymentMethods List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * @param string[]|null $allowedPaymentMethods List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` * * @return self */ @@ -475,7 +475,7 @@ public function getBlockedPaymentMethods() /** * Sets blockedPaymentMethods * - * @param string[]|null $blockedPaymentMethods List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * @param string[]|null $blockedPaymentMethods List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` * * @return self */ @@ -583,7 +583,7 @@ public function setMerchantAccount($merchantAccount) /** * Gets order * - * @return \Adyen\Model\Checkout\CheckoutOrder|null + * @return \Adyen\Model\Checkout\EncryptedOrderData|null */ public function getOrder() { @@ -593,7 +593,7 @@ public function getOrder() /** * Sets order * - * @param \Adyen\Model\Checkout\CheckoutOrder|null $order order + * @param \Adyen\Model\Checkout\EncryptedOrderData|null $order order * * @return self */ @@ -701,7 +701,7 @@ public function getStore() /** * Sets store * - * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). * * @return self */ diff --git a/src/Adyen/Model/Checkout/CreatePaymentRefundRequest.php b/src/Adyen/Model/Checkout/PaymentRefundRequest.php similarity index 98% rename from src/Adyen/Model/Checkout/CreatePaymentRefundRequest.php rename to src/Adyen/Model/Checkout/PaymentRefundRequest.php index a22a6adfc..656df4ae6 100644 --- a/src/Adyen/Model/Checkout/CreatePaymentRefundRequest.php +++ b/src/Adyen/Model/Checkout/PaymentRefundRequest.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * CreatePaymentRefundRequest Class Doc Comment + * PaymentRefundRequest Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class CreatePaymentRefundRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class PaymentRefundRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class CreatePaymentRefundRequest implements ModelInterface, ArrayAccess, \JsonSe * * @var string */ - protected static $openAPIModelName = 'CreatePaymentRefundRequest'; + protected static $openAPIModelName = 'PaymentRefundRequest'; /** * Array of property to type mappings. Used for (de)serialization @@ -386,7 +386,7 @@ public function getLineItems() /** * Sets lineItems * - * @param \Adyen\Model\Checkout\LineItem[]|null $lineItems Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * @param \Adyen\Model\Checkout\LineItem[]|null $lineItems Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. * * @return self */ diff --git a/src/Adyen/Model/Checkout/PaymentRefundResource.php b/src/Adyen/Model/Checkout/PaymentRefundResponse.php similarity index 98% rename from src/Adyen/Model/Checkout/PaymentRefundResource.php rename to src/Adyen/Model/Checkout/PaymentRefundResponse.php index f21a70859..cd5d3b2a0 100644 --- a/src/Adyen/Model/Checkout/PaymentRefundResource.php +++ b/src/Adyen/Model/Checkout/PaymentRefundResponse.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * PaymentRefundResource Class Doc Comment + * PaymentRefundResponse Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class PaymentRefundResource implements ModelInterface, ArrayAccess, \JsonSerializable +class PaymentRefundResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class PaymentRefundResource implements ModelInterface, ArrayAccess, \JsonSeriali * * @var string */ - protected static $openAPIModelName = 'PaymentRefundResource'; + protected static $openAPIModelName = 'PaymentRefundResponse'; /** * Array of property to type mappings. Used for (de)serialization @@ -437,7 +437,7 @@ public function getLineItems() /** * Sets lineItems * - * @param \Adyen\Model\Checkout\LineItem[]|null $lineItems Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * @param \Adyen\Model\Checkout\LineItem[]|null $lineItems Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. * * @return self */ diff --git a/src/Adyen/Model/Checkout/PaymentRequest.php b/src/Adyen/Model/Checkout/PaymentRequest.php index 9a1a343be..e1818857c 100644 --- a/src/Adyen/Model/Checkout/PaymentRequest.php +++ b/src/Adyen/Model/Checkout/PaymentRequest.php @@ -45,6 +45,7 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'accountInfo' => '\Adyen\Model\Checkout\AccountInfo', + 'additionalAmount' => '\Adyen\Model\Checkout\Amount', 'additionalData' => 'array', 'amount' => '\Adyen\Model\Checkout\Amount', 'applicationInfo' => '\Adyen\Model\Checkout\ApplicationInfo', @@ -59,6 +60,7 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'countryCode' => 'string', 'dateOfBirth' => '\DateTime', 'dccQuote' => '\Adyen\Model\Checkout\ForexQuote', + 'deliverAt' => '\DateTime', 'deliveryAddress' => '\Adyen\Model\Checkout\Address', 'deliveryDate' => '\DateTime', 'deviceFingerprint' => 'string', @@ -67,6 +69,8 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'enableRecurring' => 'bool', 'entityType' => 'string', 'fraudOffset' => 'int', + 'fundOrigin' => '\Adyen\Model\Checkout\FundOrigin', + 'fundRecipient' => '\Adyen\Model\Checkout\FundRecipient', 'industryUsage' => 'string', 'installments' => '\Adyen\Model\Checkout\Installments', 'lineItems' => '\Adyen\Model\Checkout\LineItem[]', @@ -78,7 +82,7 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'merchantRiskIndicator' => '\Adyen\Model\Checkout\MerchantRiskIndicator', 'metadata' => 'array', 'mpiData' => '\Adyen\Model\Checkout\ThreeDSecureData', - 'order' => '\Adyen\Model\Checkout\CheckoutOrder', + 'order' => '\Adyen\Model\Checkout\EncryptedOrderData', 'orderReference' => 'string', 'origin' => 'string', 'paymentMethod' => '\Adyen\Model\Checkout\CheckoutPaymentMethod', @@ -104,7 +108,7 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'store' => 'string', 'storePaymentMethod' => 'bool', 'telephoneNumber' => 'string', - 'threeDS2RequestData' => '\Adyen\Model\Checkout\ThreeDS2RequestData', + 'threeDS2RequestData' => '\Adyen\Model\Checkout\ThreeDS2RequestData2', 'threeDSAuthenticationOnly' => 'bool', 'trustedShopper' => 'bool' ]; @@ -118,6 +122,7 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'accountInfo' => null, + 'additionalAmount' => null, 'additionalData' => null, 'amount' => null, 'applicationInfo' => null, @@ -130,8 +135,9 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'company' => null, 'conversionId' => null, 'countryCode' => null, - 'dateOfBirth' => 'date', + 'dateOfBirth' => 'date-time', 'dccQuote' => null, + 'deliverAt' => 'date-time', 'deliveryAddress' => null, 'deliveryDate' => 'date-time', 'deviceFingerprint' => null, @@ -140,6 +146,8 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'enableRecurring' => null, 'entityType' => null, 'fraudOffset' => 'int32', + 'fundOrigin' => null, + 'fundRecipient' => null, 'industryUsage' => null, 'installments' => null, 'lineItems' => null, @@ -189,6 +197,7 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'accountInfo' => false, + 'additionalAmount' => false, 'additionalData' => false, 'amount' => false, 'applicationInfo' => false, @@ -203,6 +212,7 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'countryCode' => false, 'dateOfBirth' => false, 'dccQuote' => false, + 'deliverAt' => false, 'deliveryAddress' => false, 'deliveryDate' => false, 'deviceFingerprint' => false, @@ -211,6 +221,8 @@ class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'enableRecurring' => false, 'entityType' => false, 'fraudOffset' => true, + 'fundOrigin' => false, + 'fundRecipient' => false, 'industryUsage' => false, 'installments' => false, 'lineItems' => false, @@ -340,6 +352,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountInfo' => 'accountInfo', + 'additionalAmount' => 'additionalAmount', 'additionalData' => 'additionalData', 'amount' => 'amount', 'applicationInfo' => 'applicationInfo', @@ -354,6 +367,7 @@ public function isNullableSetToNull(string $property): bool 'countryCode' => 'countryCode', 'dateOfBirth' => 'dateOfBirth', 'dccQuote' => 'dccQuote', + 'deliverAt' => 'deliverAt', 'deliveryAddress' => 'deliveryAddress', 'deliveryDate' => 'deliveryDate', 'deviceFingerprint' => 'deviceFingerprint', @@ -362,6 +376,8 @@ public function isNullableSetToNull(string $property): bool 'enableRecurring' => 'enableRecurring', 'entityType' => 'entityType', 'fraudOffset' => 'fraudOffset', + 'fundOrigin' => 'fundOrigin', + 'fundRecipient' => 'fundRecipient', 'industryUsage' => 'industryUsage', 'installments' => 'installments', 'lineItems' => 'lineItems', @@ -411,6 +427,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountInfo' => 'setAccountInfo', + 'additionalAmount' => 'setAdditionalAmount', 'additionalData' => 'setAdditionalData', 'amount' => 'setAmount', 'applicationInfo' => 'setApplicationInfo', @@ -425,6 +442,7 @@ public function isNullableSetToNull(string $property): bool 'countryCode' => 'setCountryCode', 'dateOfBirth' => 'setDateOfBirth', 'dccQuote' => 'setDccQuote', + 'deliverAt' => 'setDeliverAt', 'deliveryAddress' => 'setDeliveryAddress', 'deliveryDate' => 'setDeliveryDate', 'deviceFingerprint' => 'setDeviceFingerprint', @@ -433,6 +451,8 @@ public function isNullableSetToNull(string $property): bool 'enableRecurring' => 'setEnableRecurring', 'entityType' => 'setEntityType', 'fraudOffset' => 'setFraudOffset', + 'fundOrigin' => 'setFundOrigin', + 'fundRecipient' => 'setFundRecipient', 'industryUsage' => 'setIndustryUsage', 'installments' => 'setInstallments', 'lineItems' => 'setLineItems', @@ -482,6 +502,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountInfo' => 'getAccountInfo', + 'additionalAmount' => 'getAdditionalAmount', 'additionalData' => 'getAdditionalData', 'amount' => 'getAmount', 'applicationInfo' => 'getApplicationInfo', @@ -496,6 +517,7 @@ public function isNullableSetToNull(string $property): bool 'countryCode' => 'getCountryCode', 'dateOfBirth' => 'getDateOfBirth', 'dccQuote' => 'getDccQuote', + 'deliverAt' => 'getDeliverAt', 'deliveryAddress' => 'getDeliveryAddress', 'deliveryDate' => 'getDeliveryDate', 'deviceFingerprint' => 'getDeviceFingerprint', @@ -504,6 +526,8 @@ public function isNullableSetToNull(string $property): bool 'enableRecurring' => 'getEnableRecurring', 'entityType' => 'getEntityType', 'fraudOffset' => 'getFraudOffset', + 'fundOrigin' => 'getFundOrigin', + 'fundRecipient' => 'getFundRecipient', 'industryUsage' => 'getIndustryUsage', 'installments' => 'getInstallments', 'lineItems' => 'getLineItems', @@ -684,6 +708,7 @@ public function getShopperInteractionAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountInfo', $data ?? [], null); + $this->setIfExists('additionalAmount', $data ?? [], null); $this->setIfExists('additionalData', $data ?? [], null); $this->setIfExists('amount', $data ?? [], null); $this->setIfExists('applicationInfo', $data ?? [], null); @@ -698,6 +723,7 @@ public function __construct(array $data = null) $this->setIfExists('countryCode', $data ?? [], null); $this->setIfExists('dateOfBirth', $data ?? [], null); $this->setIfExists('dccQuote', $data ?? [], null); + $this->setIfExists('deliverAt', $data ?? [], null); $this->setIfExists('deliveryAddress', $data ?? [], null); $this->setIfExists('deliveryDate', $data ?? [], null); $this->setIfExists('deviceFingerprint', $data ?? [], null); @@ -706,6 +732,8 @@ public function __construct(array $data = null) $this->setIfExists('enableRecurring', $data ?? [], null); $this->setIfExists('entityType', $data ?? [], null); $this->setIfExists('fraudOffset', $data ?? [], null); + $this->setIfExists('fundOrigin', $data ?? [], null); + $this->setIfExists('fundRecipient', $data ?? [], null); $this->setIfExists('industryUsage', $data ?? [], null); $this->setIfExists('installments', $data ?? [], null); $this->setIfExists('lineItems', $data ?? [], null); @@ -877,6 +905,33 @@ public function setAccountInfo($accountInfo) return $this; } + /** + * Gets additionalAmount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getAdditionalAmount() + { + return $this->container['additionalAmount']; + } + + /** + * Sets additionalAmount + * + * @param \Adyen\Model\Checkout\Amount|null $additionalAmount additionalAmount + * + * @return self + */ + public function setAdditionalAmount($additionalAmount) + { + if (is_null($additionalAmount)) { + throw new \InvalidArgumentException('non-nullable additionalAmount cannot be null'); + } + $this->container['additionalAmount'] = $additionalAmount; + + return $this; + } + /** * Gets additionalData * @@ -1114,7 +1169,7 @@ public function getCheckoutAttemptId() /** * Sets checkoutAttemptId * - * @param string|null $checkoutAttemptId Checkout attempt ID that corresponds to the Id generated for tracking user payment journey. + * @param string|null $checkoutAttemptId Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. * * @return self */ @@ -1159,6 +1214,7 @@ public function setCompany($company) * Gets conversionId * * @return string|null + * @deprecated */ public function getConversionId() { @@ -1168,9 +1224,10 @@ public function getConversionId() /** * Sets conversionId * - * @param string|null $conversionId Conversion ID that corresponds to the Id generated for tracking user payment journey. + * @param string|null $conversionId Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. * * @return self + * @deprecated */ public function setConversionId($conversionId) { @@ -1263,6 +1320,33 @@ public function setDccQuote($dccQuote) return $this; } + /** + * Gets deliverAt + * + * @return \DateTime|null + */ + public function getDeliverAt() + { + return $this->container['deliverAt']; + } + + /** + * Sets deliverAt + * + * @param \DateTime|null $deliverAt The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + * + * @return self + */ + public function setDeliverAt($deliverAt) + { + if (is_null($deliverAt)) { + throw new \InvalidArgumentException('non-nullable deliverAt cannot be null'); + } + $this->container['deliverAt'] = $deliverAt; + + return $this; + } + /** * Gets deliveryAddress * @@ -1294,6 +1378,7 @@ public function setDeliveryAddress($deliveryAddress) * Gets deliveryDate * * @return \DateTime|null + * @deprecated */ public function getDeliveryDate() { @@ -1306,6 +1391,7 @@ public function getDeliveryDate() * @param \DateTime|null $deliveryDate The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 * * @return self + * @deprecated */ public function setDeliveryDate($deliveryDate) { @@ -1487,6 +1573,60 @@ public function setFraudOffset($fraudOffset) return $this; } + /** + * Gets fundOrigin + * + * @return \Adyen\Model\Checkout\FundOrigin|null + */ + public function getFundOrigin() + { + return $this->container['fundOrigin']; + } + + /** + * Sets fundOrigin + * + * @param \Adyen\Model\Checkout\FundOrigin|null $fundOrigin fundOrigin + * + * @return self + */ + public function setFundOrigin($fundOrigin) + { + if (is_null($fundOrigin)) { + throw new \InvalidArgumentException('non-nullable fundOrigin cannot be null'); + } + $this->container['fundOrigin'] = $fundOrigin; + + return $this; + } + + /** + * Gets fundRecipient + * + * @return \Adyen\Model\Checkout\FundRecipient|null + */ + public function getFundRecipient() + { + return $this->container['fundRecipient']; + } + + /** + * Sets fundRecipient + * + * @param \Adyen\Model\Checkout\FundRecipient|null $fundRecipient fundRecipient + * + * @return self + */ + public function setFundRecipient($fundRecipient) + { + if (is_null($fundRecipient)) { + throw new \InvalidArgumentException('non-nullable fundRecipient cannot be null'); + } + $this->container['fundRecipient'] = $fundRecipient; + + return $this; + } + /** * Gets industryUsage * @@ -1564,7 +1704,7 @@ public function getLineItems() /** * Sets lineItems * - * @param \Adyen\Model\Checkout\LineItem[]|null $lineItems Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * @param \Adyen\Model\Checkout\LineItem[]|null $lineItems Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip. * * @return self */ @@ -1797,7 +1937,7 @@ public function setMpiData($mpiData) /** * Gets order * - * @return \Adyen\Model\Checkout\CheckoutOrder|null + * @return \Adyen\Model\Checkout\EncryptedOrderData|null */ public function getOrder() { @@ -1807,7 +1947,7 @@ public function getOrder() /** * Sets order * - * @param \Adyen\Model\Checkout\CheckoutOrder|null $order order + * @param \Adyen\Model\Checkout\EncryptedOrderData|null $order order * * @return self */ @@ -1996,7 +2136,7 @@ public function getRecurringProcessingModel() /** * Sets recurringProcessingModel * - * @param string|null $recurringProcessingModel Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * @param string|null $recurringProcessingModel Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. * * @return self */ @@ -2421,7 +2561,7 @@ public function getSplits() /** * Sets splits * - * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). * * @return self */ @@ -2448,7 +2588,7 @@ public function getStore() /** * Sets store * - * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). * * @return self */ @@ -2519,7 +2659,7 @@ public function setTelephoneNumber($telephoneNumber) /** * Gets threeDS2RequestData * - * @return \Adyen\Model\Checkout\ThreeDS2RequestData|null + * @return \Adyen\Model\Checkout\ThreeDS2RequestData2|null */ public function getThreeDS2RequestData() { @@ -2529,7 +2669,7 @@ public function getThreeDS2RequestData() /** * Sets threeDS2RequestData * - * @param \Adyen\Model\Checkout\ThreeDS2RequestData|null $threeDS2RequestData threeDS2RequestData + * @param \Adyen\Model\Checkout\ThreeDS2RequestData2|null $threeDS2RequestData threeDS2RequestData * * @return self */ diff --git a/src/Adyen/Model/Checkout/PaymentResponse.php b/src/Adyen/Model/Checkout/PaymentResponse.php index 7ff34ff71..298294231 100644 --- a/src/Adyen/Model/Checkout/PaymentResponse.php +++ b/src/Adyen/Model/Checkout/PaymentResponse.php @@ -306,6 +306,7 @@ public function getModelName() public const RESULT_CODE_CHALLENGE_SHOPPER = 'ChallengeShopper'; public const RESULT_CODE_ERROR = 'Error'; public const RESULT_CODE_IDENTIFY_SHOPPER = 'IdentifyShopper'; + public const RESULT_CODE_PARTIALLY_AUTHORISED = 'PartiallyAuthorised'; public const RESULT_CODE_PENDING = 'Pending'; public const RESULT_CODE_PRESENT_TO_SHOPPER = 'PresentToShopper'; public const RESULT_CODE_RECEIVED = 'Received'; @@ -328,6 +329,7 @@ public function getResultCodeAllowableValues() self::RESULT_CODE_CHALLENGE_SHOPPER, self::RESULT_CODE_ERROR, self::RESULT_CODE_IDENTIFY_SHOPPER, + self::RESULT_CODE_PARTIALLY_AUTHORISED, self::RESULT_CODE_PENDING, self::RESULT_CODE_PRESENT_TO_SHOPPER, self::RESULT_CODE_RECEIVED, @@ -729,7 +731,7 @@ public function getResultCode() /** * Sets resultCode * - * @param string|null $resultCode The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. + * @param string|null $resultCode The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * * @return self */ diff --git a/src/Adyen/Model/Checkout/PaymentResponseAction.php b/src/Adyen/Model/Checkout/PaymentResponseAction.php index 6c7402fa2..f5684dd44 100644 --- a/src/Adyen/Model/Checkout/PaymentResponseAction.php +++ b/src/Adyen/Model/Checkout/PaymentResponseAction.php @@ -49,15 +49,15 @@ class PaymentResponseAction implements ModelInterface, ArrayAccess, \JsonSeriali 'paymentMethodType' => 'string', 'type' => 'string', 'url' => 'string', + 'authorisationToken' => 'string', + 'token' => 'string', 'data' => 'array', 'method' => 'string', 'nativeRedirectData' => 'string', 'expiresAt' => 'string', 'qrCodeData' => 'string', 'sdkData' => 'array', - 'authorisationToken' => 'string', 'subtype' => 'string', - 'token' => 'string', 'alternativeReference' => 'string', 'collectionInstitutionNumber' => 'string', 'downloadUrl' => 'string', @@ -68,6 +68,7 @@ class PaymentResponseAction implements ModelInterface, ArrayAccess, \JsonSeriali 'maskedTelephoneNumber' => 'string', 'merchantName' => 'string', 'merchantReference' => 'string', + 'passCreationToken' => 'string', 'reference' => 'string', 'shopperEmail' => 'string', 'shopperName' => 'string', @@ -87,15 +88,15 @@ class PaymentResponseAction implements ModelInterface, ArrayAccess, \JsonSeriali 'paymentMethodType' => null, 'type' => null, 'url' => null, + 'authorisationToken' => null, + 'token' => null, 'data' => null, 'method' => null, 'nativeRedirectData' => null, 'expiresAt' => null, 'qrCodeData' => null, 'sdkData' => null, - 'authorisationToken' => null, 'subtype' => null, - 'token' => null, 'alternativeReference' => null, 'collectionInstitutionNumber' => null, 'downloadUrl' => null, @@ -106,6 +107,7 @@ class PaymentResponseAction implements ModelInterface, ArrayAccess, \JsonSeriali 'maskedTelephoneNumber' => null, 'merchantName' => null, 'merchantReference' => null, + 'passCreationToken' => null, 'reference' => null, 'shopperEmail' => null, 'shopperName' => null, @@ -123,15 +125,15 @@ class PaymentResponseAction implements ModelInterface, ArrayAccess, \JsonSeriali 'paymentMethodType' => false, 'type' => false, 'url' => false, + 'authorisationToken' => false, + 'token' => false, 'data' => false, 'method' => false, 'nativeRedirectData' => false, 'expiresAt' => false, 'qrCodeData' => false, 'sdkData' => false, - 'authorisationToken' => false, 'subtype' => false, - 'token' => false, 'alternativeReference' => false, 'collectionInstitutionNumber' => false, 'downloadUrl' => false, @@ -142,6 +144,7 @@ class PaymentResponseAction implements ModelInterface, ArrayAccess, \JsonSeriali 'maskedTelephoneNumber' => false, 'merchantName' => false, 'merchantReference' => false, + 'passCreationToken' => false, 'reference' => false, 'shopperEmail' => false, 'shopperName' => false, @@ -239,15 +242,15 @@ public function isNullableSetToNull(string $property): bool 'paymentMethodType' => 'paymentMethodType', 'type' => 'type', 'url' => 'url', + 'authorisationToken' => 'authorisationToken', + 'token' => 'token', 'data' => 'data', 'method' => 'method', 'nativeRedirectData' => 'nativeRedirectData', 'expiresAt' => 'expiresAt', 'qrCodeData' => 'qrCodeData', 'sdkData' => 'sdkData', - 'authorisationToken' => 'authorisationToken', 'subtype' => 'subtype', - 'token' => 'token', 'alternativeReference' => 'alternativeReference', 'collectionInstitutionNumber' => 'collectionInstitutionNumber', 'downloadUrl' => 'downloadUrl', @@ -258,6 +261,7 @@ public function isNullableSetToNull(string $property): bool 'maskedTelephoneNumber' => 'maskedTelephoneNumber', 'merchantName' => 'merchantName', 'merchantReference' => 'merchantReference', + 'passCreationToken' => 'passCreationToken', 'reference' => 'reference', 'shopperEmail' => 'shopperEmail', 'shopperName' => 'shopperName', @@ -275,15 +279,15 @@ public function isNullableSetToNull(string $property): bool 'paymentMethodType' => 'setPaymentMethodType', 'type' => 'setType', 'url' => 'setUrl', + 'authorisationToken' => 'setAuthorisationToken', + 'token' => 'setToken', 'data' => 'setData', 'method' => 'setMethod', 'nativeRedirectData' => 'setNativeRedirectData', 'expiresAt' => 'setExpiresAt', 'qrCodeData' => 'setQrCodeData', 'sdkData' => 'setSdkData', - 'authorisationToken' => 'setAuthorisationToken', 'subtype' => 'setSubtype', - 'token' => 'setToken', 'alternativeReference' => 'setAlternativeReference', 'collectionInstitutionNumber' => 'setCollectionInstitutionNumber', 'downloadUrl' => 'setDownloadUrl', @@ -294,6 +298,7 @@ public function isNullableSetToNull(string $property): bool 'maskedTelephoneNumber' => 'setMaskedTelephoneNumber', 'merchantName' => 'setMerchantName', 'merchantReference' => 'setMerchantReference', + 'passCreationToken' => 'setPassCreationToken', 'reference' => 'setReference', 'shopperEmail' => 'setShopperEmail', 'shopperName' => 'setShopperName', @@ -311,15 +316,15 @@ public function isNullableSetToNull(string $property): bool 'paymentMethodType' => 'getPaymentMethodType', 'type' => 'getType', 'url' => 'getUrl', + 'authorisationToken' => 'getAuthorisationToken', + 'token' => 'getToken', 'data' => 'getData', 'method' => 'getMethod', 'nativeRedirectData' => 'getNativeRedirectData', 'expiresAt' => 'getExpiresAt', 'qrCodeData' => 'getQrCodeData', 'sdkData' => 'getSdkData', - 'authorisationToken' => 'getAuthorisationToken', 'subtype' => 'getSubtype', - 'token' => 'getToken', 'alternativeReference' => 'getAlternativeReference', 'collectionInstitutionNumber' => 'getCollectionInstitutionNumber', 'downloadUrl' => 'getDownloadUrl', @@ -330,6 +335,7 @@ public function isNullableSetToNull(string $property): bool 'maskedTelephoneNumber' => 'getMaskedTelephoneNumber', 'merchantName' => 'getMerchantName', 'merchantReference' => 'getMerchantReference', + 'passCreationToken' => 'getPassCreationToken', 'reference' => 'getReference', 'shopperEmail' => 'getShopperEmail', 'shopperName' => 'getShopperName', @@ -397,15 +403,15 @@ public function __construct(array $data = null) $this->setIfExists('paymentMethodType', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('authorisationToken', $data ?? [], null); + $this->setIfExists('token', $data ?? [], null); $this->setIfExists('data', $data ?? [], null); $this->setIfExists('method', $data ?? [], null); $this->setIfExists('nativeRedirectData', $data ?? [], null); $this->setIfExists('expiresAt', $data ?? [], null); $this->setIfExists('qrCodeData', $data ?? [], null); $this->setIfExists('sdkData', $data ?? [], null); - $this->setIfExists('authorisationToken', $data ?? [], null); $this->setIfExists('subtype', $data ?? [], null); - $this->setIfExists('token', $data ?? [], null); $this->setIfExists('alternativeReference', $data ?? [], null); $this->setIfExists('collectionInstitutionNumber', $data ?? [], null); $this->setIfExists('downloadUrl', $data ?? [], null); @@ -416,6 +422,7 @@ public function __construct(array $data = null) $this->setIfExists('maskedTelephoneNumber', $data ?? [], null); $this->setIfExists('merchantName', $data ?? [], null); $this->setIfExists('merchantReference', $data ?? [], null); + $this->setIfExists('passCreationToken', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('shopperEmail', $data ?? [], null); $this->setIfExists('shopperName', $data ?? [], null); @@ -577,6 +584,60 @@ public function setUrl($url) return $this; } + /** + * Gets authorisationToken + * + * @return string|null + */ + public function getAuthorisationToken() + { + return $this->container['authorisationToken']; + } + + /** + * Sets authorisationToken + * + * @param string|null $authorisationToken A token needed to authorise a payment. + * + * @return self + */ + public function setAuthorisationToken($authorisationToken) + { + if (is_null($authorisationToken)) { + throw new \InvalidArgumentException('non-nullable authorisationToken cannot be null'); + } + $this->container['authorisationToken'] = $authorisationToken; + + return $this; + } + + /** + * Gets token + * + * @return string|null + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * + * @param string|null $token A token to pass to the 3DS2 Component to get the fingerprint. + * + * @return self + */ + public function setToken($token) + { + if (is_null($token)) { + throw new \InvalidArgumentException('non-nullable token cannot be null'); + } + $this->container['token'] = $token; + + return $this; + } + /** * Gets data * @@ -739,33 +800,6 @@ public function setSdkData($sdkData) return $this; } - /** - * Gets authorisationToken - * - * @return string|null - */ - public function getAuthorisationToken() - { - return $this->container['authorisationToken']; - } - - /** - * Sets authorisationToken - * - * @param string|null $authorisationToken A token needed to authorise a payment. - * - * @return self - */ - public function setAuthorisationToken($authorisationToken) - { - if (is_null($authorisationToken)) { - throw new \InvalidArgumentException('non-nullable authorisationToken cannot be null'); - } - $this->container['authorisationToken'] = $authorisationToken; - - return $this; - } - /** * Gets subtype * @@ -793,33 +827,6 @@ public function setSubtype($subtype) return $this; } - /** - * Gets token - * - * @return string|null - */ - public function getToken() - { - return $this->container['token']; - } - - /** - * Sets token - * - * @param string|null $token A token to pass to the 3DS2 Component to get the fingerprint. - * - * @return self - */ - public function setToken($token) - { - if (is_null($token)) { - throw new \InvalidArgumentException('non-nullable token cannot be null'); - } - $this->container['token'] = $token; - - return $this; - } - /** * Gets alternativeReference * @@ -1090,6 +1097,33 @@ public function setMerchantReference($merchantReference) return $this; } + /** + * Gets passCreationToken + * + * @return string|null + */ + public function getPassCreationToken() + { + return $this->container['passCreationToken']; + } + + /** + * Sets passCreationToken + * + * @param string|null $passCreationToken A base64 encoded signature of all properties + * + * @return self + */ + public function setPassCreationToken($passCreationToken) + { + if (is_null($passCreationToken)) { + throw new \InvalidArgumentException('non-nullable passCreationToken cannot be null'); + } + $this->container['passCreationToken'] = $passCreationToken; + + return $this; + } + /** * Gets reference * diff --git a/src/Adyen/Model/Checkout/CreatePaymentReversalRequest.php b/src/Adyen/Model/Checkout/PaymentReversalRequest.php similarity index 97% rename from src/Adyen/Model/Checkout/CreatePaymentReversalRequest.php rename to src/Adyen/Model/Checkout/PaymentReversalRequest.php index c6e323bfd..40773fc49 100644 --- a/src/Adyen/Model/Checkout/CreatePaymentReversalRequest.php +++ b/src/Adyen/Model/Checkout/PaymentReversalRequest.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * CreatePaymentReversalRequest Class Doc Comment + * PaymentReversalRequest Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class CreatePaymentReversalRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class PaymentReversalRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class CreatePaymentReversalRequest implements ModelInterface, ArrayAccess, \Json * * @var string */ - protected static $openAPIModelName = 'CreatePaymentReversalRequest'; + protected static $openAPIModelName = 'PaymentReversalRequest'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Adyen/Model/Checkout/PaymentReversalResource.php b/src/Adyen/Model/Checkout/PaymentReversalResponse.php similarity index 98% rename from src/Adyen/Model/Checkout/PaymentReversalResource.php rename to src/Adyen/Model/Checkout/PaymentReversalResponse.php index 65d87c241..cd1050e5c 100644 --- a/src/Adyen/Model/Checkout/PaymentReversalResource.php +++ b/src/Adyen/Model/Checkout/PaymentReversalResponse.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * PaymentReversalResource Class Doc Comment + * PaymentReversalResponse Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class PaymentReversalResource implements ModelInterface, ArrayAccess, \JsonSerializable +class PaymentReversalResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class PaymentReversalResource implements ModelInterface, ArrayAccess, \JsonSeria * * @var string */ - protected static $openAPIModelName = 'PaymentReversalResource'; + protected static $openAPIModelName = 'PaymentReversalResponse'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Adyen/Model/Checkout/PaymentSetupRequest.php b/src/Adyen/Model/Checkout/PaymentSetupRequest.php index 311ee223a..ff447481c 100644 --- a/src/Adyen/Model/Checkout/PaymentSetupRequest.php +++ b/src/Adyen/Model/Checkout/PaymentSetupRequest.php @@ -44,6 +44,7 @@ class PaymentSetupRequest implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ + 'additionalAmount' => '\Adyen\Model\Checkout\Amount', 'additionalData' => 'array', 'allowedPaymentMethods' => 'string[]', 'amount' => '\Adyen\Model\Checkout\Amount', @@ -109,6 +110,7 @@ class PaymentSetupRequest implements ModelInterface, ArrayAccess, \JsonSerializa * @psalm-var array */ protected static $openAPIFormats = [ + 'additionalAmount' => null, 'additionalData' => null, 'allowedPaymentMethods' => null, 'amount' => null, @@ -172,6 +174,7 @@ class PaymentSetupRequest implements ModelInterface, ArrayAccess, \JsonSerializa * @var boolean[] */ protected static $openAPINullables = [ + 'additionalAmount' => false, 'additionalData' => false, 'allowedPaymentMethods' => false, 'amount' => false, @@ -315,6 +318,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'additionalAmount' => 'additionalAmount', 'additionalData' => 'additionalData', 'allowedPaymentMethods' => 'allowedPaymentMethods', 'amount' => 'amount', @@ -378,6 +382,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'additionalAmount' => 'setAdditionalAmount', 'additionalData' => 'setAdditionalData', 'allowedPaymentMethods' => 'setAllowedPaymentMethods', 'amount' => 'setAmount', @@ -441,6 +446,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'additionalAmount' => 'getAdditionalAmount', 'additionalData' => 'getAdditionalData', 'allowedPaymentMethods' => 'getAllowedPaymentMethods', 'amount' => 'getAmount', @@ -603,6 +609,7 @@ public function getShopperInteractionAllowableValues() */ public function __construct(array $data = null) { + $this->setIfExists('additionalAmount', $data ?? [], null); $this->setIfExists('additionalData', $data ?? [], null); $this->setIfExists('allowedPaymentMethods', $data ?? [], null); $this->setIfExists('amount', $data ?? [], null); @@ -744,6 +751,33 @@ public function valid() } + /** + * Gets additionalAmount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getAdditionalAmount() + { + return $this->container['additionalAmount']; + } + + /** + * Sets additionalAmount + * + * @param \Adyen\Model\Checkout\Amount|null $additionalAmount additionalAmount + * + * @return self + */ + public function setAdditionalAmount($additionalAmount) + { + if (is_null($additionalAmount)) { + throw new \InvalidArgumentException('non-nullable additionalAmount cannot be null'); + } + $this->container['additionalAmount'] = $additionalAmount; + + return $this; + } + /** * Gets additionalData * @@ -784,7 +818,7 @@ public function getAllowedPaymentMethods() /** * Sets allowedPaymentMethods * - * @param string[]|null $allowedPaymentMethods List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * @param string[]|null $allowedPaymentMethods List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` * * @return self */ @@ -892,7 +926,7 @@ public function getBlockedPaymentMethods() /** * Sets blockedPaymentMethods * - * @param string[]|null $blockedPaymentMethods List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * @param string[]|null $blockedPaymentMethods List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` * * @return self */ @@ -981,7 +1015,7 @@ public function getCheckoutAttemptId() /** * Sets checkoutAttemptId * - * @param string|null $checkoutAttemptId Checkout attempt ID that corresponds to the Id generated for tracking user payment journey. + * @param string|null $checkoutAttemptId Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. * * @return self */ @@ -1053,6 +1087,7 @@ public function setConfiguration($configuration) * Gets conversionId * * @return string|null + * @deprecated */ public function getConversionId() { @@ -1062,9 +1097,10 @@ public function getConversionId() /** * Sets conversionId * - * @param string|null $conversionId Conversion ID that corresponds to the Id generated for tracking user payment journey. + * @param string|null $conversionId Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. * * @return self + * @deprecated */ public function setConversionId($conversionId) { @@ -1394,7 +1430,7 @@ public function getLineItems() /** * Sets lineItems * - * @param \Adyen\Model\Checkout\LineItem[]|null $lineItems Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * @param \Adyen\Model\Checkout\LineItem[]|null $lineItems Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. * * @return self */ @@ -1421,7 +1457,7 @@ public function getLocalizedShopperStatement() /** * Sets localizedShopperStatement * - * @param array|null $localizedShopperStatement This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * @param array|null $localizedShopperStatement This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. * * @return self */ @@ -2106,7 +2142,7 @@ public function getStore() /** * Sets store * - * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). * * @return self */ diff --git a/src/Adyen/Model/Checkout/PaymentVerificationResponse.php b/src/Adyen/Model/Checkout/PaymentVerificationResponse.php index 61d4217de..7c79c54ee 100644 --- a/src/Adyen/Model/Checkout/PaymentVerificationResponse.php +++ b/src/Adyen/Model/Checkout/PaymentVerificationResponse.php @@ -276,6 +276,7 @@ public function getModelName() public const RESULT_CODE_CHALLENGE_SHOPPER = 'ChallengeShopper'; public const RESULT_CODE_ERROR = 'Error'; public const RESULT_CODE_IDENTIFY_SHOPPER = 'IdentifyShopper'; + public const RESULT_CODE_PARTIALLY_AUTHORISED = 'PartiallyAuthorised'; public const RESULT_CODE_PENDING = 'Pending'; public const RESULT_CODE_PRESENT_TO_SHOPPER = 'PresentToShopper'; public const RESULT_CODE_RECEIVED = 'Received'; @@ -298,6 +299,7 @@ public function getResultCodeAllowableValues() self::RESULT_CODE_CHALLENGE_SHOPPER, self::RESULT_CODE_ERROR, self::RESULT_CODE_IDENTIFY_SHOPPER, + self::RESULT_CODE_PARTIALLY_AUTHORISED, self::RESULT_CODE_PENDING, self::RESULT_CODE_PRESENT_TO_SHOPPER, self::RESULT_CODE_RECEIVED, @@ -592,7 +594,7 @@ public function getResultCode() /** * Sets resultCode * - * @param string|null $resultCode The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. + * @param string|null $resultCode The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * * @return self */ diff --git a/src/Adyen/Model/Checkout/PlatformChargebackLogic.php b/src/Adyen/Model/Checkout/PlatformChargebackLogic.php index ca4a58488..7d77e96e4 100644 --- a/src/Adyen/Model/Checkout/PlatformChargebackLogic.php +++ b/src/Adyen/Model/Checkout/PlatformChargebackLogic.php @@ -45,6 +45,7 @@ class PlatformChargebackLogic implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPITypes = [ 'behavior' => 'string', + 'costAllocationAccount' => 'string', 'targetAccount' => 'string' ]; @@ -57,6 +58,7 @@ class PlatformChargebackLogic implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPIFormats = [ 'behavior' => null, + 'costAllocationAccount' => null, 'targetAccount' => null ]; @@ -67,6 +69,7 @@ class PlatformChargebackLogic implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPINullables = [ 'behavior' => false, + 'costAllocationAccount' => false, 'targetAccount' => false ]; @@ -157,6 +160,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'behavior' => 'behavior', + 'costAllocationAccount' => 'costAllocationAccount', 'targetAccount' => 'targetAccount' ]; @@ -167,6 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'behavior' => 'setBehavior', + 'costAllocationAccount' => 'setCostAllocationAccount', 'targetAccount' => 'setTargetAccount' ]; @@ -177,6 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'behavior' => 'getBehavior', + 'costAllocationAccount' => 'getCostAllocationAccount', 'targetAccount' => 'getTargetAccount' ]; @@ -254,6 +260,7 @@ public function getBehaviorAllowableValues() public function __construct(array $data = null) { $this->setIfExists('behavior', $data ?? [], null); + $this->setIfExists('costAllocationAccount', $data ?? [], null); $this->setIfExists('targetAccount', $data ?? [], null); } @@ -321,7 +328,7 @@ public function getBehavior() /** * Sets behavior * - * @param string|null $behavior behavior + * @param string|null $behavior The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. * * @return self */ @@ -345,6 +352,33 @@ public function setBehavior($behavior) return $this; } + /** + * Gets costAllocationAccount + * + * @return string|null + */ + public function getCostAllocationAccount() + { + return $this->container['costAllocationAccount']; + } + + /** + * Sets costAllocationAccount + * + * @param string|null $costAllocationAccount The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account. + * + * @return self + */ + public function setCostAllocationAccount($costAllocationAccount) + { + if (is_null($costAllocationAccount)) { + throw new \InvalidArgumentException('non-nullable costAllocationAccount cannot be null'); + } + $this->container['costAllocationAccount'] = $costAllocationAccount; + + return $this; + } + /** * Gets targetAccount * @@ -358,7 +392,7 @@ public function getTargetAccount() /** * Sets targetAccount * - * @param string|null $targetAccount targetAccount + * @param string|null $targetAccount The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**. * * @return self */ diff --git a/src/Adyen/Model/Checkout/SessionResultResponse.php b/src/Adyen/Model/Checkout/SessionResultResponse.php new file mode 100644 index 000000000..58ab652a1 --- /dev/null +++ b/src/Adyen/Model/Checkout/SessionResultResponse.php @@ -0,0 +1,459 @@ + + */ +class SessionResultResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SessionResultResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'status' => 'getStatus' + ]; + + /** + * 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 STATUS_ACTIVE = 'active'; + public const STATUS_CANCELED = 'canceled'; + public const STATUS_COMPLETED = 'completed'; + public const STATUS_EXPIRED = 'expired'; + public const STATUS_PAYMENT_PENDING = 'paymentPending'; + public const STATUS_REFUSED = 'refused'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_CANCELED, + self::STATUS_COMPLETED, + self::STATUS_EXPIRED, + self::STATUS_PAYMENT_PENDING, + self::STATUS_REFUSED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('status', $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->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + 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 id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id A unique identifier of the session. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the session. The status included in the response doesn't get updated. Don't make the request again to check for payment status updates. Possible values: * **completed** – The shopper completed the payment. This means that the payment was authorized. * **paymentPending** – The shopper is in the process of making the payment. This applies to payment methods with an asynchronous flow. * **refused** – The session has been refused, due to too many refused payment attempts. Shoppers can no longer complete the payment with this session. * **canceled** – The shopper canceled the payment. * **active** – The session is still active and can be paid. * **expired** – The session expired (default: 1 hour after session creation). Shoppers can no longer complete the payment with this session. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/Split.php b/src/Adyen/Model/Checkout/Split.php index a68bfbd2d..e4026614a 100644 --- a/src/Adyen/Model/Checkout/Split.php +++ b/src/Adyen/Model/Checkout/Split.php @@ -244,6 +244,12 @@ public function getModelName() public const TYPE__DEFAULT = 'Default'; public const TYPE_MARKET_PLACE = 'MarketPlace'; public const TYPE_PAYMENT_FEE = 'PaymentFee'; + public const TYPE_PAYMENT_FEE_ACQUIRING = 'PaymentFeeAcquiring'; + public const TYPE_PAYMENT_FEE_ADYEN = 'PaymentFeeAdyen'; + public const TYPE_PAYMENT_FEE_ADYEN_COMMISSION = 'PaymentFeeAdyenCommission'; + public const TYPE_PAYMENT_FEE_ADYEN_MARKUP = 'PaymentFeeAdyenMarkup'; + public const TYPE_PAYMENT_FEE_INTERCHANGE = 'PaymentFeeInterchange'; + public const TYPE_PAYMENT_FEE_SCHEME_FEE = 'PaymentFeeSchemeFee'; public const TYPE_REMAINDER = 'Remainder'; public const TYPE_SURCHARGE = 'Surcharge'; public const TYPE_TIP = 'Tip'; @@ -263,6 +269,12 @@ public function getTypeAllowableValues() self::TYPE__DEFAULT, self::TYPE_MARKET_PLACE, self::TYPE_PAYMENT_FEE, + self::TYPE_PAYMENT_FEE_ACQUIRING, + self::TYPE_PAYMENT_FEE_ADYEN, + self::TYPE_PAYMENT_FEE_ADYEN_COMMISSION, + self::TYPE_PAYMENT_FEE_ADYEN_MARKUP, + self::TYPE_PAYMENT_FEE_INTERCHANGE, + self::TYPE_PAYMENT_FEE_SCHEME_FEE, self::TYPE_REMAINDER, self::TYPE_SURCHARGE, self::TYPE_TIP, diff --git a/src/Adyen/Model/Checkout/CreateStandalonePaymentCancelRequest.php b/src/Adyen/Model/Checkout/StandalonePaymentCancelRequest.php similarity index 97% rename from src/Adyen/Model/Checkout/CreateStandalonePaymentCancelRequest.php rename to src/Adyen/Model/Checkout/StandalonePaymentCancelRequest.php index ff8d1d689..422c10704 100644 --- a/src/Adyen/Model/Checkout/CreateStandalonePaymentCancelRequest.php +++ b/src/Adyen/Model/Checkout/StandalonePaymentCancelRequest.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * CreateStandalonePaymentCancelRequest Class Doc Comment + * StandalonePaymentCancelRequest Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class CreateStandalonePaymentCancelRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class StandalonePaymentCancelRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class CreateStandalonePaymentCancelRequest implements ModelInterface, ArrayAcces * * @var string */ - protected static $openAPIModelName = 'CreateStandalonePaymentCancelRequest'; + protected static $openAPIModelName = 'StandalonePaymentCancelRequest'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Adyen/Model/Checkout/StandalonePaymentCancelResource.php b/src/Adyen/Model/Checkout/StandalonePaymentCancelResponse.php similarity index 99% rename from src/Adyen/Model/Checkout/StandalonePaymentCancelResource.php rename to src/Adyen/Model/Checkout/StandalonePaymentCancelResponse.php index 5d88b4f06..36d412b0b 100644 --- a/src/Adyen/Model/Checkout/StandalonePaymentCancelResource.php +++ b/src/Adyen/Model/Checkout/StandalonePaymentCancelResponse.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * StandalonePaymentCancelResource Class Doc Comment + * StandalonePaymentCancelResponse Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class StandalonePaymentCancelResource implements ModelInterface, ArrayAccess, \JsonSerializable +class StandalonePaymentCancelResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class StandalonePaymentCancelResource implements ModelInterface, ArrayAccess, \J * * @var string */ - protected static $openAPIModelName = 'StandalonePaymentCancelResource'; + protected static $openAPIModelName = 'StandalonePaymentCancelResponse'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php b/src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php index ae18b4e69..aafea8888 100644 --- a/src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php +++ b/src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php @@ -238,6 +238,7 @@ public function getModelName() public const TYPE_BCMC_MOBILE_APP = 'bcmc_mobile_app'; public const TYPE_MOMO_WALLET = 'momo_wallet'; public const TYPE_MOMO_WALLET_APP = 'momo_wallet_app'; + public const TYPE_TWINT = 'twint'; public const TYPE_PAYMAYA_WALLET = 'paymaya_wallet'; public const TYPE_GRABPAY_SG = 'grabpay_SG'; public const TYPE_GRABPAY_MY = 'grabpay_MY'; @@ -247,6 +248,7 @@ public function getModelName() public const TYPE_GRABPAY_PH = 'grabpay_PH'; public const TYPE_OXXO = 'oxxo'; public const TYPE_GCASH = 'gcash'; + public const TYPE_DANA = 'dana'; public const TYPE_KAKAOPAY = 'kakaopay'; public const TYPE_TRUEMONEY = 'truemoney'; @@ -263,6 +265,7 @@ public function getTypeAllowableValues() self::TYPE_BCMC_MOBILE_APP, self::TYPE_MOMO_WALLET, self::TYPE_MOMO_WALLET_APP, + self::TYPE_TWINT, self::TYPE_PAYMAYA_WALLET, self::TYPE_GRABPAY_SG, self::TYPE_GRABPAY_MY, @@ -272,6 +275,7 @@ public function getTypeAllowableValues() self::TYPE_GRABPAY_PH, self::TYPE_OXXO, self::TYPE_GCASH, + self::TYPE_DANA, self::TYPE_KAKAOPAY, self::TYPE_TRUEMONEY, ]; diff --git a/src/Adyen/Model/Checkout/SubMerchantInfo.php b/src/Adyen/Model/Checkout/SubMerchantInfo.php new file mode 100644 index 000000000..e41e335da --- /dev/null +++ b/src/Adyen/Model/Checkout/SubMerchantInfo.php @@ -0,0 +1,520 @@ + + */ +class SubMerchantInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubMerchantInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address' => '\Adyen\Model\Checkout\Address', + 'id' => 'string', + 'mcc' => 'string', + 'name' => 'string', + 'taxId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address' => null, + 'id' => null, + 'mcc' => null, + 'name' => null, + 'taxId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'address' => false, + 'id' => false, + 'mcc' => false, + 'name' => false, + 'taxId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'id' => 'id', + 'mcc' => 'mcc', + 'name' => 'name', + 'taxId' => 'taxId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'id' => 'setId', + 'mcc' => 'setMcc', + 'name' => 'setName', + 'taxId' => 'setTaxId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'id' => 'getId', + 'mcc' => 'getMcc', + 'name' => 'getName', + 'taxId' => 'getTaxId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('mcc', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('taxId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Adyen\Model\Checkout\Address|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets mcc + * + * @return string|null + */ + public function getMcc() + { + return $this->container['mcc']; + } + + /** + * Sets mcc + * + * @param string|null $mcc mcc + * + * @return self + */ + public function setMcc($mcc) + { + if (is_null($mcc)) { + throw new \InvalidArgumentException('non-nullable mcc cannot be null'); + } + $this->container['mcc'] = $mcc; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets taxId + * + * @return string|null + */ + public function getTaxId() + { + return $this->container['taxId']; + } + + /** + * Sets taxId + * + * @param string|null $taxId taxId + * + * @return self + */ + public function setTaxId($taxId) + { + if (is_null($taxId)) { + throw new \InvalidArgumentException('non-nullable taxId cannot be null'); + } + $this->container['taxId'] = $taxId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ThreeDS2RequestData.php b/src/Adyen/Model/Checkout/ThreeDS2RequestData.php index 5124e7700..d8211a73c 100644 --- a/src/Adyen/Model/Checkout/ThreeDS2RequestData.php +++ b/src/Adyen/Model/Checkout/ThreeDS2RequestData.php @@ -581,7 +581,7 @@ public function __construct(array $data = null) $this->setIfExists('homePhone', $data ?? [], null); $this->setIfExists('mcc', $data ?? [], null); $this->setIfExists('merchantName', $data ?? [], null); - $this->setIfExists('messageVersion', $data ?? [], '2.1.0'); + $this->setIfExists('messageVersion', $data ?? [], null); $this->setIfExists('mobilePhone', $data ?? [], null); $this->setIfExists('notificationURL', $data ?? [], null); $this->setIfExists('payTokenInd', $data ?? [], null); diff --git a/src/Adyen/Model/Checkout/ThreeDS2RequestData2.php b/src/Adyen/Model/Checkout/ThreeDS2RequestData2.php new file mode 100644 index 000000000..83f1a9ece --- /dev/null +++ b/src/Adyen/Model/Checkout/ThreeDS2RequestData2.php @@ -0,0 +1,1800 @@ + + */ +class ThreeDS2RequestData2 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThreeDS2RequestData-2'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'acctInfo' => '\Adyen\Model\Checkout\AcctInfo', + 'acctType' => 'string', + 'acquirerBIN' => 'string', + 'acquirerMerchantID' => 'string', + 'addrMatch' => 'string', + 'authenticationOnly' => 'bool', + 'challengeIndicator' => 'string', + 'deviceRenderOptions' => '\Adyen\Model\Checkout\DeviceRenderOptions', + 'homePhone' => '\Adyen\Model\Checkout\Phone', + 'mcc' => 'string', + 'merchantName' => 'string', + 'messageVersion' => 'string', + 'mobilePhone' => '\Adyen\Model\Checkout\Phone', + 'notificationURL' => 'string', + 'payTokenInd' => 'bool', + 'paymentAuthenticationUseCase' => 'string', + 'purchaseInstalData' => 'string', + 'recurringExpiry' => 'string', + 'recurringFrequency' => 'string', + 'sdkAppID' => 'string', + 'sdkEphemPubKey' => '\Adyen\Model\Checkout\SDKEphemPubKey', + 'sdkMaxTimeout' => 'int', + 'sdkReferenceNumber' => 'string', + 'sdkTransID' => 'string', + 'threeDSCompInd' => 'string', + 'threeDSRequestorAuthenticationInd' => 'string', + 'threeDSRequestorAuthenticationInfo' => '\Adyen\Model\Checkout\ThreeDSRequestorAuthenticationInfo', + 'threeDSRequestorChallengeInd' => 'string', + 'threeDSRequestorID' => 'string', + 'threeDSRequestorName' => 'string', + 'threeDSRequestorPriorAuthenticationInfo' => '\Adyen\Model\Checkout\ThreeDSRequestorPriorAuthenticationInfo', + 'threeDSRequestorURL' => 'string', + 'transType' => 'string', + 'transactionType' => 'string', + 'whiteListStatus' => 'string', + 'workPhone' => '\Adyen\Model\Checkout\Phone' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'acctInfo' => null, + 'acctType' => null, + 'acquirerBIN' => null, + 'acquirerMerchantID' => null, + 'addrMatch' => null, + 'authenticationOnly' => null, + 'challengeIndicator' => null, + 'deviceRenderOptions' => null, + 'homePhone' => null, + 'mcc' => null, + 'merchantName' => null, + 'messageVersion' => null, + 'mobilePhone' => null, + 'notificationURL' => null, + 'payTokenInd' => null, + 'paymentAuthenticationUseCase' => null, + 'purchaseInstalData' => null, + 'recurringExpiry' => null, + 'recurringFrequency' => null, + 'sdkAppID' => null, + 'sdkEphemPubKey' => null, + 'sdkMaxTimeout' => 'int32', + 'sdkReferenceNumber' => null, + 'sdkTransID' => null, + 'threeDSCompInd' => null, + 'threeDSRequestorAuthenticationInd' => null, + 'threeDSRequestorAuthenticationInfo' => null, + 'threeDSRequestorChallengeInd' => null, + 'threeDSRequestorID' => null, + 'threeDSRequestorName' => null, + 'threeDSRequestorPriorAuthenticationInfo' => null, + 'threeDSRequestorURL' => null, + 'transType' => null, + 'transactionType' => null, + 'whiteListStatus' => null, + 'workPhone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'acctInfo' => false, + 'acctType' => false, + 'acquirerBIN' => false, + 'acquirerMerchantID' => false, + 'addrMatch' => false, + 'authenticationOnly' => false, + 'challengeIndicator' => false, + 'deviceRenderOptions' => false, + 'homePhone' => false, + 'mcc' => false, + 'merchantName' => false, + 'messageVersion' => false, + 'mobilePhone' => false, + 'notificationURL' => false, + 'payTokenInd' => false, + 'paymentAuthenticationUseCase' => false, + 'purchaseInstalData' => false, + 'recurringExpiry' => false, + 'recurringFrequency' => false, + 'sdkAppID' => false, + 'sdkEphemPubKey' => false, + 'sdkMaxTimeout' => true, + 'sdkReferenceNumber' => false, + 'sdkTransID' => false, + 'threeDSCompInd' => false, + 'threeDSRequestorAuthenticationInd' => false, + 'threeDSRequestorAuthenticationInfo' => false, + 'threeDSRequestorChallengeInd' => false, + 'threeDSRequestorID' => false, + 'threeDSRequestorName' => false, + 'threeDSRequestorPriorAuthenticationInfo' => false, + 'threeDSRequestorURL' => false, + 'transType' => false, + 'transactionType' => false, + 'whiteListStatus' => false, + 'workPhone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'acctInfo' => 'acctInfo', + 'acctType' => 'acctType', + 'acquirerBIN' => 'acquirerBIN', + 'acquirerMerchantID' => 'acquirerMerchantID', + 'addrMatch' => 'addrMatch', + 'authenticationOnly' => 'authenticationOnly', + 'challengeIndicator' => 'challengeIndicator', + 'deviceRenderOptions' => 'deviceRenderOptions', + 'homePhone' => 'homePhone', + 'mcc' => 'mcc', + 'merchantName' => 'merchantName', + 'messageVersion' => 'messageVersion', + 'mobilePhone' => 'mobilePhone', + 'notificationURL' => 'notificationURL', + 'payTokenInd' => 'payTokenInd', + 'paymentAuthenticationUseCase' => 'paymentAuthenticationUseCase', + 'purchaseInstalData' => 'purchaseInstalData', + 'recurringExpiry' => 'recurringExpiry', + 'recurringFrequency' => 'recurringFrequency', + 'sdkAppID' => 'sdkAppID', + 'sdkEphemPubKey' => 'sdkEphemPubKey', + 'sdkMaxTimeout' => 'sdkMaxTimeout', + 'sdkReferenceNumber' => 'sdkReferenceNumber', + 'sdkTransID' => 'sdkTransID', + 'threeDSCompInd' => 'threeDSCompInd', + 'threeDSRequestorAuthenticationInd' => 'threeDSRequestorAuthenticationInd', + 'threeDSRequestorAuthenticationInfo' => 'threeDSRequestorAuthenticationInfo', + 'threeDSRequestorChallengeInd' => 'threeDSRequestorChallengeInd', + 'threeDSRequestorID' => 'threeDSRequestorID', + 'threeDSRequestorName' => 'threeDSRequestorName', + 'threeDSRequestorPriorAuthenticationInfo' => 'threeDSRequestorPriorAuthenticationInfo', + 'threeDSRequestorURL' => 'threeDSRequestorURL', + 'transType' => 'transType', + 'transactionType' => 'transactionType', + 'whiteListStatus' => 'whiteListStatus', + 'workPhone' => 'workPhone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'acctInfo' => 'setAcctInfo', + 'acctType' => 'setAcctType', + 'acquirerBIN' => 'setAcquirerBIN', + 'acquirerMerchantID' => 'setAcquirerMerchantID', + 'addrMatch' => 'setAddrMatch', + 'authenticationOnly' => 'setAuthenticationOnly', + 'challengeIndicator' => 'setChallengeIndicator', + 'deviceRenderOptions' => 'setDeviceRenderOptions', + 'homePhone' => 'setHomePhone', + 'mcc' => 'setMcc', + 'merchantName' => 'setMerchantName', + 'messageVersion' => 'setMessageVersion', + 'mobilePhone' => 'setMobilePhone', + 'notificationURL' => 'setNotificationURL', + 'payTokenInd' => 'setPayTokenInd', + 'paymentAuthenticationUseCase' => 'setPaymentAuthenticationUseCase', + 'purchaseInstalData' => 'setPurchaseInstalData', + 'recurringExpiry' => 'setRecurringExpiry', + 'recurringFrequency' => 'setRecurringFrequency', + 'sdkAppID' => 'setSdkAppID', + 'sdkEphemPubKey' => 'setSdkEphemPubKey', + 'sdkMaxTimeout' => 'setSdkMaxTimeout', + 'sdkReferenceNumber' => 'setSdkReferenceNumber', + 'sdkTransID' => 'setSdkTransID', + 'threeDSCompInd' => 'setThreeDSCompInd', + 'threeDSRequestorAuthenticationInd' => 'setThreeDSRequestorAuthenticationInd', + 'threeDSRequestorAuthenticationInfo' => 'setThreeDSRequestorAuthenticationInfo', + 'threeDSRequestorChallengeInd' => 'setThreeDSRequestorChallengeInd', + 'threeDSRequestorID' => 'setThreeDSRequestorID', + 'threeDSRequestorName' => 'setThreeDSRequestorName', + 'threeDSRequestorPriorAuthenticationInfo' => 'setThreeDSRequestorPriorAuthenticationInfo', + 'threeDSRequestorURL' => 'setThreeDSRequestorURL', + 'transType' => 'setTransType', + 'transactionType' => 'setTransactionType', + 'whiteListStatus' => 'setWhiteListStatus', + 'workPhone' => 'setWorkPhone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'acctInfo' => 'getAcctInfo', + 'acctType' => 'getAcctType', + 'acquirerBIN' => 'getAcquirerBIN', + 'acquirerMerchantID' => 'getAcquirerMerchantID', + 'addrMatch' => 'getAddrMatch', + 'authenticationOnly' => 'getAuthenticationOnly', + 'challengeIndicator' => 'getChallengeIndicator', + 'deviceRenderOptions' => 'getDeviceRenderOptions', + 'homePhone' => 'getHomePhone', + 'mcc' => 'getMcc', + 'merchantName' => 'getMerchantName', + 'messageVersion' => 'getMessageVersion', + 'mobilePhone' => 'getMobilePhone', + 'notificationURL' => 'getNotificationURL', + 'payTokenInd' => 'getPayTokenInd', + 'paymentAuthenticationUseCase' => 'getPaymentAuthenticationUseCase', + 'purchaseInstalData' => 'getPurchaseInstalData', + 'recurringExpiry' => 'getRecurringExpiry', + 'recurringFrequency' => 'getRecurringFrequency', + 'sdkAppID' => 'getSdkAppID', + 'sdkEphemPubKey' => 'getSdkEphemPubKey', + 'sdkMaxTimeout' => 'getSdkMaxTimeout', + 'sdkReferenceNumber' => 'getSdkReferenceNumber', + 'sdkTransID' => 'getSdkTransID', + 'threeDSCompInd' => 'getThreeDSCompInd', + 'threeDSRequestorAuthenticationInd' => 'getThreeDSRequestorAuthenticationInd', + 'threeDSRequestorAuthenticationInfo' => 'getThreeDSRequestorAuthenticationInfo', + 'threeDSRequestorChallengeInd' => 'getThreeDSRequestorChallengeInd', + 'threeDSRequestorID' => 'getThreeDSRequestorID', + 'threeDSRequestorName' => 'getThreeDSRequestorName', + 'threeDSRequestorPriorAuthenticationInfo' => 'getThreeDSRequestorPriorAuthenticationInfo', + 'threeDSRequestorURL' => 'getThreeDSRequestorURL', + 'transType' => 'getTransType', + 'transactionType' => 'getTransactionType', + 'whiteListStatus' => 'getWhiteListStatus', + 'workPhone' => 'getWorkPhone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const ACCT_TYPE__01 = '01'; + public const ACCT_TYPE__02 = '02'; + public const ACCT_TYPE__03 = '03'; + public const ADDR_MATCH_Y = 'Y'; + public const ADDR_MATCH_N = 'N'; + public const CHALLENGE_INDICATOR_NO_PREFERENCE = 'noPreference'; + public const CHALLENGE_INDICATOR_REQUEST_NO_CHALLENGE = 'requestNoChallenge'; + public const CHALLENGE_INDICATOR_REQUEST_CHALLENGE = 'requestChallenge'; + public const CHALLENGE_INDICATOR_REQUEST_CHALLENGE_AS_MANDATE = 'requestChallengeAsMandate'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__01 = '01'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__02 = '02'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__03 = '03'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__04 = '04'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__05 = '05'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__06 = '06'; + public const TRANS_TYPE__01 = '01'; + public const TRANS_TYPE__03 = '03'; + public const TRANS_TYPE__10 = '10'; + public const TRANS_TYPE__11 = '11'; + public const TRANS_TYPE__28 = '28'; + public const TRANSACTION_TYPE_GOODS_OR_SERVICE_PURCHASE = 'goodsOrServicePurchase'; + public const TRANSACTION_TYPE_CHECK_ACCEPTANCE = 'checkAcceptance'; + public const TRANSACTION_TYPE_ACCOUNT_FUNDING = 'accountFunding'; + public const TRANSACTION_TYPE_QUASI_CASH_TRANSACTION = 'quasiCashTransaction'; + public const TRANSACTION_TYPE_PREPAID_ACTIVATION_AND_LOAD = 'prepaidActivationAndLoad'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAcctTypeAllowableValues() + { + return [ + self::ACCT_TYPE__01, + self::ACCT_TYPE__02, + self::ACCT_TYPE__03, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAddrMatchAllowableValues() + { + return [ + self::ADDR_MATCH_Y, + self::ADDR_MATCH_N, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChallengeIndicatorAllowableValues() + { + return [ + self::CHALLENGE_INDICATOR_NO_PREFERENCE, + self::CHALLENGE_INDICATOR_REQUEST_NO_CHALLENGE, + self::CHALLENGE_INDICATOR_REQUEST_CHALLENGE, + self::CHALLENGE_INDICATOR_REQUEST_CHALLENGE_AS_MANDATE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getThreeDSRequestorChallengeIndAllowableValues() + { + return [ + self::THREE_DS_REQUESTOR_CHALLENGE_IND__01, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__02, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__03, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__04, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__05, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__06, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTransTypeAllowableValues() + { + return [ + self::TRANS_TYPE__01, + self::TRANS_TYPE__03, + self::TRANS_TYPE__10, + self::TRANS_TYPE__11, + self::TRANS_TYPE__28, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTransactionTypeAllowableValues() + { + return [ + self::TRANSACTION_TYPE_GOODS_OR_SERVICE_PURCHASE, + self::TRANSACTION_TYPE_CHECK_ACCEPTANCE, + self::TRANSACTION_TYPE_ACCOUNT_FUNDING, + self::TRANSACTION_TYPE_QUASI_CASH_TRANSACTION, + self::TRANSACTION_TYPE_PREPAID_ACTIVATION_AND_LOAD, + ]; + } + /** + * 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('acctInfo', $data ?? [], null); + $this->setIfExists('acctType', $data ?? [], null); + $this->setIfExists('acquirerBIN', $data ?? [], null); + $this->setIfExists('acquirerMerchantID', $data ?? [], null); + $this->setIfExists('addrMatch', $data ?? [], null); + $this->setIfExists('authenticationOnly', $data ?? [], false); + $this->setIfExists('challengeIndicator', $data ?? [], null); + $this->setIfExists('deviceRenderOptions', $data ?? [], null); + $this->setIfExists('homePhone', $data ?? [], null); + $this->setIfExists('mcc', $data ?? [], null); + $this->setIfExists('merchantName', $data ?? [], null); + $this->setIfExists('messageVersion', $data ?? [], null); + $this->setIfExists('mobilePhone', $data ?? [], null); + $this->setIfExists('notificationURL', $data ?? [], null); + $this->setIfExists('payTokenInd', $data ?? [], null); + $this->setIfExists('paymentAuthenticationUseCase', $data ?? [], null); + $this->setIfExists('purchaseInstalData', $data ?? [], null); + $this->setIfExists('recurringExpiry', $data ?? [], null); + $this->setIfExists('recurringFrequency', $data ?? [], null); + $this->setIfExists('sdkAppID', $data ?? [], null); + $this->setIfExists('sdkEphemPubKey', $data ?? [], null); + $this->setIfExists('sdkMaxTimeout', $data ?? [], 60); + $this->setIfExists('sdkReferenceNumber', $data ?? [], null); + $this->setIfExists('sdkTransID', $data ?? [], null); + $this->setIfExists('threeDSCompInd', $data ?? [], null); + $this->setIfExists('threeDSRequestorAuthenticationInd', $data ?? [], null); + $this->setIfExists('threeDSRequestorAuthenticationInfo', $data ?? [], null); + $this->setIfExists('threeDSRequestorChallengeInd', $data ?? [], null); + $this->setIfExists('threeDSRequestorID', $data ?? [], null); + $this->setIfExists('threeDSRequestorName', $data ?? [], null); + $this->setIfExists('threeDSRequestorPriorAuthenticationInfo', $data ?? [], null); + $this->setIfExists('threeDSRequestorURL', $data ?? [], null); + $this->setIfExists('transType', $data ?? [], null); + $this->setIfExists('transactionType', $data ?? [], null); + $this->setIfExists('whiteListStatus', $data ?? [], null); + $this->setIfExists('workPhone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getAcctTypeAllowableValues(); + if (!is_null($this->container['acctType']) && !in_array($this->container['acctType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'acctType', must be one of '%s'", + $this->container['acctType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getAddrMatchAllowableValues(); + if (!is_null($this->container['addrMatch']) && !in_array($this->container['addrMatch'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'addrMatch', must be one of '%s'", + $this->container['addrMatch'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getChallengeIndicatorAllowableValues(); + if (!is_null($this->container['challengeIndicator']) && !in_array($this->container['challengeIndicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'challengeIndicator', must be one of '%s'", + $this->container['challengeIndicator'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getThreeDSRequestorChallengeIndAllowableValues(); + if (!is_null($this->container['threeDSRequestorChallengeInd']) && !in_array($this->container['threeDSRequestorChallengeInd'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'threeDSRequestorChallengeInd', must be one of '%s'", + $this->container['threeDSRequestorChallengeInd'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTransTypeAllowableValues(); + if (!is_null($this->container['transType']) && !in_array($this->container['transType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'transType', must be one of '%s'", + $this->container['transType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTransactionTypeAllowableValues(); + if (!is_null($this->container['transactionType']) && !in_array($this->container['transactionType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'transactionType', must be one of '%s'", + $this->container['transactionType'], + 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 acctInfo + * + * @return \Adyen\Model\Checkout\AcctInfo|null + */ + public function getAcctInfo() + { + return $this->container['acctInfo']; + } + + /** + * Sets acctInfo + * + * @param \Adyen\Model\Checkout\AcctInfo|null $acctInfo acctInfo + * + * @return self + */ + public function setAcctInfo($acctInfo) + { + if (is_null($acctInfo)) { + throw new \InvalidArgumentException('non-nullable acctInfo cannot be null'); + } + $this->container['acctInfo'] = $acctInfo; + + return $this; + } + + /** + * Gets acctType + * + * @return string|null + */ + public function getAcctType() + { + return $this->container['acctType']; + } + + /** + * Sets acctType + * + * @param string|null $acctType Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit + * + * @return self + */ + public function setAcctType($acctType) + { + if (is_null($acctType)) { + throw new \InvalidArgumentException('non-nullable acctType cannot be null'); + } + $allowedValues = $this->getAcctTypeAllowableValues(); + if (!in_array($acctType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'acctType', must be one of '%s'", + $acctType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['acctType'] = $acctType; + + return $this; + } + + /** + * Gets acquirerBIN + * + * @return string|null + */ + public function getAcquirerBIN() + { + return $this->container['acquirerBIN']; + } + + /** + * Sets acquirerBIN + * + * @param string|null $acquirerBIN Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. + * + * @return self + */ + public function setAcquirerBIN($acquirerBIN) + { + if (is_null($acquirerBIN)) { + throw new \InvalidArgumentException('non-nullable acquirerBIN cannot be null'); + } + $this->container['acquirerBIN'] = $acquirerBIN; + + return $this; + } + + /** + * Gets acquirerMerchantID + * + * @return string|null + */ + public function getAcquirerMerchantID() + { + return $this->container['acquirerMerchantID']; + } + + /** + * Sets acquirerMerchantID + * + * @param string|null $acquirerMerchantID Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. + * + * @return self + */ + public function setAcquirerMerchantID($acquirerMerchantID) + { + if (is_null($acquirerMerchantID)) { + throw new \InvalidArgumentException('non-nullable acquirerMerchantID cannot be null'); + } + $this->container['acquirerMerchantID'] = $acquirerMerchantID; + + return $this; + } + + /** + * Gets addrMatch + * + * @return string|null + */ + public function getAddrMatch() + { + return $this->container['addrMatch']; + } + + /** + * Sets addrMatch + * + * @param string|null $addrMatch Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. + * + * @return self + */ + public function setAddrMatch($addrMatch) + { + if (is_null($addrMatch)) { + throw new \InvalidArgumentException('non-nullable addrMatch cannot be null'); + } + $allowedValues = $this->getAddrMatchAllowableValues(); + if (!in_array($addrMatch, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'addrMatch', must be one of '%s'", + $addrMatch, + implode("', '", $allowedValues) + ) + ); + } + $this->container['addrMatch'] = $addrMatch; + + return $this; + } + + /** + * Gets authenticationOnly + * + * @return bool|null + * @deprecated + */ + public function getAuthenticationOnly() + { + return $this->container['authenticationOnly']; + } + + /** + * Sets authenticationOnly + * + * @param bool|null $authenticationOnly If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + * + * @return self + * @deprecated + */ + public function setAuthenticationOnly($authenticationOnly) + { + if (is_null($authenticationOnly)) { + throw new \InvalidArgumentException('non-nullable authenticationOnly cannot be null'); + } + $this->container['authenticationOnly'] = $authenticationOnly; + + return $this; + } + + /** + * Gets challengeIndicator + * + * @return string|null + * @deprecated + */ + public function getChallengeIndicator() + { + return $this->container['challengeIndicator']; + } + + /** + * Sets challengeIndicator + * + * @param string|null $challengeIndicator Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + * + * @return self + * @deprecated + */ + public function setChallengeIndicator($challengeIndicator) + { + if (is_null($challengeIndicator)) { + throw new \InvalidArgumentException('non-nullable challengeIndicator cannot be null'); + } + $allowedValues = $this->getChallengeIndicatorAllowableValues(); + if (!in_array($challengeIndicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'challengeIndicator', must be one of '%s'", + $challengeIndicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['challengeIndicator'] = $challengeIndicator; + + return $this; + } + + /** + * Gets deviceRenderOptions + * + * @return \Adyen\Model\Checkout\DeviceRenderOptions|null + */ + public function getDeviceRenderOptions() + { + return $this->container['deviceRenderOptions']; + } + + /** + * Sets deviceRenderOptions + * + * @param \Adyen\Model\Checkout\DeviceRenderOptions|null $deviceRenderOptions deviceRenderOptions + * + * @return self + */ + public function setDeviceRenderOptions($deviceRenderOptions) + { + if (is_null($deviceRenderOptions)) { + throw new \InvalidArgumentException('non-nullable deviceRenderOptions cannot be null'); + } + $this->container['deviceRenderOptions'] = $deviceRenderOptions; + + return $this; + } + + /** + * Gets homePhone + * + * @return \Adyen\Model\Checkout\Phone|null + */ + public function getHomePhone() + { + return $this->container['homePhone']; + } + + /** + * Sets homePhone + * + * @param \Adyen\Model\Checkout\Phone|null $homePhone homePhone + * + * @return self + */ + public function setHomePhone($homePhone) + { + if (is_null($homePhone)) { + throw new \InvalidArgumentException('non-nullable homePhone cannot be null'); + } + $this->container['homePhone'] = $homePhone; + + return $this; + } + + /** + * Gets mcc + * + * @return string|null + */ + public function getMcc() + { + return $this->container['mcc']; + } + + /** + * Sets mcc + * + * @param string|null $mcc Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. + * + * @return self + */ + public function setMcc($mcc) + { + if (is_null($mcc)) { + throw new \InvalidArgumentException('non-nullable mcc cannot be null'); + } + $this->container['mcc'] = $mcc; + + return $this; + } + + /** + * Gets merchantName + * + * @return string|null + */ + public function getMerchantName() + { + return $this->container['merchantName']; + } + + /** + * Sets merchantName + * + * @param string|null $merchantName Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. + * + * @return self + */ + public function setMerchantName($merchantName) + { + if (is_null($merchantName)) { + throw new \InvalidArgumentException('non-nullable merchantName cannot be null'); + } + $this->container['merchantName'] = $merchantName; + + return $this; + } + + /** + * Gets messageVersion + * + * @return string|null + */ + public function getMessageVersion() + { + return $this->container['messageVersion']; + } + + /** + * Sets messageVersion + * + * @param string|null $messageVersion The `messageVersion` value indicating the 3D Secure 2 protocol version. + * + * @return self + */ + public function setMessageVersion($messageVersion) + { + if (is_null($messageVersion)) { + throw new \InvalidArgumentException('non-nullable messageVersion cannot be null'); + } + $this->container['messageVersion'] = $messageVersion; + + return $this; + } + + /** + * Gets mobilePhone + * + * @return \Adyen\Model\Checkout\Phone|null + */ + public function getMobilePhone() + { + return $this->container['mobilePhone']; + } + + /** + * Sets mobilePhone + * + * @param \Adyen\Model\Checkout\Phone|null $mobilePhone mobilePhone + * + * @return self + */ + public function setMobilePhone($mobilePhone) + { + if (is_null($mobilePhone)) { + throw new \InvalidArgumentException('non-nullable mobilePhone cannot be null'); + } + $this->container['mobilePhone'] = $mobilePhone; + + return $this; + } + + /** + * Gets notificationURL + * + * @return string|null + */ + public function getNotificationURL() + { + return $this->container['notificationURL']; + } + + /** + * Sets notificationURL + * + * @param string|null $notificationURL URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. + * + * @return self + */ + public function setNotificationURL($notificationURL) + { + if (is_null($notificationURL)) { + throw new \InvalidArgumentException('non-nullable notificationURL cannot be null'); + } + $this->container['notificationURL'] = $notificationURL; + + return $this; + } + + /** + * Gets payTokenInd + * + * @return bool|null + */ + public function getPayTokenInd() + { + return $this->container['payTokenInd']; + } + + /** + * Sets payTokenInd + * + * @param bool|null $payTokenInd Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. + * + * @return self + */ + public function setPayTokenInd($payTokenInd) + { + if (is_null($payTokenInd)) { + throw new \InvalidArgumentException('non-nullable payTokenInd cannot be null'); + } + $this->container['payTokenInd'] = $payTokenInd; + + return $this; + } + + /** + * Gets paymentAuthenticationUseCase + * + * @return string|null + */ + public function getPaymentAuthenticationUseCase() + { + return $this->container['paymentAuthenticationUseCase']; + } + + /** + * Sets paymentAuthenticationUseCase + * + * @param string|null $paymentAuthenticationUseCase Indicates the type of payment for which an authentication is requested (message extension) + * + * @return self + */ + public function setPaymentAuthenticationUseCase($paymentAuthenticationUseCase) + { + if (is_null($paymentAuthenticationUseCase)) { + throw new \InvalidArgumentException('non-nullable paymentAuthenticationUseCase cannot be null'); + } + $this->container['paymentAuthenticationUseCase'] = $paymentAuthenticationUseCase; + + return $this; + } + + /** + * Gets purchaseInstalData + * + * @return string|null + */ + public function getPurchaseInstalData() + { + return $this->container['purchaseInstalData']; + } + + /** + * Sets purchaseInstalData + * + * @param string|null $purchaseInstalData Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. + * + * @return self + */ + public function setPurchaseInstalData($purchaseInstalData) + { + if (is_null($purchaseInstalData)) { + throw new \InvalidArgumentException('non-nullable purchaseInstalData cannot be null'); + } + $this->container['purchaseInstalData'] = $purchaseInstalData; + + return $this; + } + + /** + * Gets recurringExpiry + * + * @return string|null + */ + public function getRecurringExpiry() + { + return $this->container['recurringExpiry']; + } + + /** + * Sets recurringExpiry + * + * @param string|null $recurringExpiry Date after which no further authorisations shall be performed. Format: YYYYMMDD + * + * @return self + */ + public function setRecurringExpiry($recurringExpiry) + { + if (is_null($recurringExpiry)) { + throw new \InvalidArgumentException('non-nullable recurringExpiry cannot be null'); + } + $this->container['recurringExpiry'] = $recurringExpiry; + + return $this; + } + + /** + * Gets recurringFrequency + * + * @return string|null + */ + public function getRecurringFrequency() + { + return $this->container['recurringFrequency']; + } + + /** + * Sets recurringFrequency + * + * @param string|null $recurringFrequency Indicates the minimum number of days between authorisations. Maximum length: 4 characters. + * + * @return self + */ + public function setRecurringFrequency($recurringFrequency) + { + if (is_null($recurringFrequency)) { + throw new \InvalidArgumentException('non-nullable recurringFrequency cannot be null'); + } + $this->container['recurringFrequency'] = $recurringFrequency; + + return $this; + } + + /** + * Gets sdkAppID + * + * @return string|null + */ + public function getSdkAppID() + { + return $this->container['sdkAppID']; + } + + /** + * Sets sdkAppID + * + * @param string|null $sdkAppID The `sdkAppID` value as received from the 3D Secure 2 SDK. + * + * @return self + */ + public function setSdkAppID($sdkAppID) + { + if (is_null($sdkAppID)) { + throw new \InvalidArgumentException('non-nullable sdkAppID cannot be null'); + } + $this->container['sdkAppID'] = $sdkAppID; + + return $this; + } + + /** + * Gets sdkEphemPubKey + * + * @return \Adyen\Model\Checkout\SDKEphemPubKey|null + */ + public function getSdkEphemPubKey() + { + return $this->container['sdkEphemPubKey']; + } + + /** + * Sets sdkEphemPubKey + * + * @param \Adyen\Model\Checkout\SDKEphemPubKey|null $sdkEphemPubKey sdkEphemPubKey + * + * @return self + */ + public function setSdkEphemPubKey($sdkEphemPubKey) + { + if (is_null($sdkEphemPubKey)) { + throw new \InvalidArgumentException('non-nullable sdkEphemPubKey cannot be null'); + } + $this->container['sdkEphemPubKey'] = $sdkEphemPubKey; + + return $this; + } + + /** + * Gets sdkMaxTimeout + * + * @return int|null + */ + public function getSdkMaxTimeout() + { + return $this->container['sdkMaxTimeout']; + } + + /** + * Sets sdkMaxTimeout + * + * @param int|null $sdkMaxTimeout The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. + * + * @return self + */ + public function setSdkMaxTimeout($sdkMaxTimeout) + { + // Do nothing for nullable integers + $this->container['sdkMaxTimeout'] = $sdkMaxTimeout; + + return $this; + } + + /** + * Gets sdkReferenceNumber + * + * @return string|null + */ + public function getSdkReferenceNumber() + { + return $this->container['sdkReferenceNumber']; + } + + /** + * Sets sdkReferenceNumber + * + * @param string|null $sdkReferenceNumber The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. + * + * @return self + */ + public function setSdkReferenceNumber($sdkReferenceNumber) + { + if (is_null($sdkReferenceNumber)) { + throw new \InvalidArgumentException('non-nullable sdkReferenceNumber cannot be null'); + } + $this->container['sdkReferenceNumber'] = $sdkReferenceNumber; + + return $this; + } + + /** + * Gets sdkTransID + * + * @return string|null + */ + public function getSdkTransID() + { + return $this->container['sdkTransID']; + } + + /** + * Sets sdkTransID + * + * @param string|null $sdkTransID The `sdkTransID` value as received from the 3D Secure 2 SDK. + * + * @return self + */ + public function setSdkTransID($sdkTransID) + { + if (is_null($sdkTransID)) { + throw new \InvalidArgumentException('non-nullable sdkTransID cannot be null'); + } + $this->container['sdkTransID'] = $sdkTransID; + + return $this; + } + + /** + * Gets threeDSCompInd + * + * @return string|null + */ + public function getThreeDSCompInd() + { + return $this->container['threeDSCompInd']; + } + + /** + * Sets threeDSCompInd + * + * @param string|null $threeDSCompInd Completion indicator for the device fingerprinting. + * + * @return self + */ + public function setThreeDSCompInd($threeDSCompInd) + { + if (is_null($threeDSCompInd)) { + throw new \InvalidArgumentException('non-nullable threeDSCompInd cannot be null'); + } + $this->container['threeDSCompInd'] = $threeDSCompInd; + + return $this; + } + + /** + * Gets threeDSRequestorAuthenticationInd + * + * @return string|null + */ + public function getThreeDSRequestorAuthenticationInd() + { + return $this->container['threeDSRequestorAuthenticationInd']; + } + + /** + * Sets threeDSRequestorAuthenticationInd + * + * @param string|null $threeDSRequestorAuthenticationInd Indicates the type of Authentication request. + * + * @return self + */ + public function setThreeDSRequestorAuthenticationInd($threeDSRequestorAuthenticationInd) + { + if (is_null($threeDSRequestorAuthenticationInd)) { + throw new \InvalidArgumentException('non-nullable threeDSRequestorAuthenticationInd cannot be null'); + } + $this->container['threeDSRequestorAuthenticationInd'] = $threeDSRequestorAuthenticationInd; + + return $this; + } + + /** + * Gets threeDSRequestorAuthenticationInfo + * + * @return \Adyen\Model\Checkout\ThreeDSRequestorAuthenticationInfo|null + */ + public function getThreeDSRequestorAuthenticationInfo() + { + return $this->container['threeDSRequestorAuthenticationInfo']; + } + + /** + * Sets threeDSRequestorAuthenticationInfo + * + * @param \Adyen\Model\Checkout\ThreeDSRequestorAuthenticationInfo|null $threeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo + * + * @return self + */ + public function setThreeDSRequestorAuthenticationInfo($threeDSRequestorAuthenticationInfo) + { + if (is_null($threeDSRequestorAuthenticationInfo)) { + throw new \InvalidArgumentException('non-nullable threeDSRequestorAuthenticationInfo cannot be null'); + } + $this->container['threeDSRequestorAuthenticationInfo'] = $threeDSRequestorAuthenticationInfo; + + return $this; + } + + /** + * Gets threeDSRequestorChallengeInd + * + * @return string|null + */ + public function getThreeDSRequestorChallengeInd() + { + return $this->container['threeDSRequestorChallengeInd']; + } + + /** + * Sets threeDSRequestorChallengeInd + * + * @param string|null $threeDSRequestorChallengeInd Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only + * + * @return self + */ + public function setThreeDSRequestorChallengeInd($threeDSRequestorChallengeInd) + { + if (is_null($threeDSRequestorChallengeInd)) { + throw new \InvalidArgumentException('non-nullable threeDSRequestorChallengeInd cannot be null'); + } + $allowedValues = $this->getThreeDSRequestorChallengeIndAllowableValues(); + if (!in_array($threeDSRequestorChallengeInd, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'threeDSRequestorChallengeInd', must be one of '%s'", + $threeDSRequestorChallengeInd, + implode("', '", $allowedValues) + ) + ); + } + $this->container['threeDSRequestorChallengeInd'] = $threeDSRequestorChallengeInd; + + return $this; + } + + /** + * Gets threeDSRequestorID + * + * @return string|null + */ + public function getThreeDSRequestorID() + { + return $this->container['threeDSRequestorID']; + } + + /** + * Sets threeDSRequestorID + * + * @param string|null $threeDSRequestorID Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. + * + * @return self + */ + public function setThreeDSRequestorID($threeDSRequestorID) + { + if (is_null($threeDSRequestorID)) { + throw new \InvalidArgumentException('non-nullable threeDSRequestorID cannot be null'); + } + $this->container['threeDSRequestorID'] = $threeDSRequestorID; + + return $this; + } + + /** + * Gets threeDSRequestorName + * + * @return string|null + */ + public function getThreeDSRequestorName() + { + return $this->container['threeDSRequestorName']; + } + + /** + * Sets threeDSRequestorName + * + * @param string|null $threeDSRequestorName Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. + * + * @return self + */ + public function setThreeDSRequestorName($threeDSRequestorName) + { + if (is_null($threeDSRequestorName)) { + throw new \InvalidArgumentException('non-nullable threeDSRequestorName cannot be null'); + } + $this->container['threeDSRequestorName'] = $threeDSRequestorName; + + return $this; + } + + /** + * Gets threeDSRequestorPriorAuthenticationInfo + * + * @return \Adyen\Model\Checkout\ThreeDSRequestorPriorAuthenticationInfo|null + */ + public function getThreeDSRequestorPriorAuthenticationInfo() + { + return $this->container['threeDSRequestorPriorAuthenticationInfo']; + } + + /** + * Sets threeDSRequestorPriorAuthenticationInfo + * + * @param \Adyen\Model\Checkout\ThreeDSRequestorPriorAuthenticationInfo|null $threeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo + * + * @return self + */ + public function setThreeDSRequestorPriorAuthenticationInfo($threeDSRequestorPriorAuthenticationInfo) + { + if (is_null($threeDSRequestorPriorAuthenticationInfo)) { + throw new \InvalidArgumentException('non-nullable threeDSRequestorPriorAuthenticationInfo cannot be null'); + } + $this->container['threeDSRequestorPriorAuthenticationInfo'] = $threeDSRequestorPriorAuthenticationInfo; + + return $this; + } + + /** + * Gets threeDSRequestorURL + * + * @return string|null + */ + public function getThreeDSRequestorURL() + { + return $this->container['threeDSRequestorURL']; + } + + /** + * Sets threeDSRequestorURL + * + * @param string|null $threeDSRequestorURL URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. + * + * @return self + */ + public function setThreeDSRequestorURL($threeDSRequestorURL) + { + if (is_null($threeDSRequestorURL)) { + throw new \InvalidArgumentException('non-nullable threeDSRequestorURL cannot be null'); + } + $this->container['threeDSRequestorURL'] = $threeDSRequestorURL; + + return $this; + } + + /** + * Gets transType + * + * @return string|null + */ + public function getTransType() + { + return $this->container['transType']; + } + + /** + * Sets transType + * + * @param string|null $transType Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load + * + * @return self + */ + public function setTransType($transType) + { + if (is_null($transType)) { + throw new \InvalidArgumentException('non-nullable transType cannot be null'); + } + $allowedValues = $this->getTransTypeAllowableValues(); + if (!in_array($transType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'transType', must be one of '%s'", + $transType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['transType'] = $transType; + + return $this; + } + + /** + * Gets transactionType + * + * @return string|null + */ + public function getTransactionType() + { + return $this->container['transactionType']; + } + + /** + * Sets transactionType + * + * @param string|null $transactionType Identify the type of the transaction being authenticated. + * + * @return self + */ + public function setTransactionType($transactionType) + { + if (is_null($transactionType)) { + throw new \InvalidArgumentException('non-nullable transactionType cannot be null'); + } + $allowedValues = $this->getTransactionTypeAllowableValues(); + if (!in_array($transactionType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'transactionType', must be one of '%s'", + $transactionType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['transactionType'] = $transactionType; + + return $this; + } + + /** + * Gets whiteListStatus + * + * @return string|null + */ + public function getWhiteListStatus() + { + return $this->container['whiteListStatus']; + } + + /** + * Sets whiteListStatus + * + * @param string|null $whiteListStatus The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. + * + * @return self + */ + public function setWhiteListStatus($whiteListStatus) + { + if (is_null($whiteListStatus)) { + throw new \InvalidArgumentException('non-nullable whiteListStatus cannot be null'); + } + $this->container['whiteListStatus'] = $whiteListStatus; + + return $this; + } + + /** + * Gets workPhone + * + * @return \Adyen\Model\Checkout\Phone|null + */ + public function getWorkPhone() + { + return $this->container['workPhone']; + } + + /** + * Sets workPhone + * + * @param \Adyen\Model\Checkout\Phone|null $workPhone workPhone + * + * @return self + */ + public function setWorkPhone($workPhone) + { + if (is_null($workPhone)) { + throw new \InvalidArgumentException('non-nullable workPhone cannot be null'); + } + $this->container['workPhone'] = $workPhone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ThreeDS2Result.php b/src/Adyen/Model/Checkout/ThreeDS2Result.php index 4fab4aa6e..7e4c19684 100644 --- a/src/Adyen/Model/Checkout/ThreeDS2Result.php +++ b/src/Adyen/Model/Checkout/ThreeDS2Result.php @@ -47,12 +47,12 @@ class ThreeDS2Result implements ModelInterface, ArrayAccess, \JsonSerializable 'authenticationValue' => 'string', 'cavvAlgorithm' => 'string', 'challengeCancel' => 'string', - 'challengeIndicator' => 'string', 'dsTransID' => 'string', 'eci' => 'string', 'exemptionIndicator' => 'string', 'messageVersion' => 'string', 'riskScore' => 'string', + 'threeDSRequestorChallengeInd' => 'string', 'threeDSServerTransID' => 'string', 'timestamp' => 'string', 'transStatus' => 'string', @@ -71,12 +71,12 @@ class ThreeDS2Result implements ModelInterface, ArrayAccess, \JsonSerializable 'authenticationValue' => null, 'cavvAlgorithm' => null, 'challengeCancel' => null, - 'challengeIndicator' => null, 'dsTransID' => null, 'eci' => null, 'exemptionIndicator' => null, 'messageVersion' => null, 'riskScore' => null, + 'threeDSRequestorChallengeInd' => null, 'threeDSServerTransID' => null, 'timestamp' => null, 'transStatus' => null, @@ -93,12 +93,12 @@ class ThreeDS2Result implements ModelInterface, ArrayAccess, \JsonSerializable 'authenticationValue' => false, 'cavvAlgorithm' => false, 'challengeCancel' => false, - 'challengeIndicator' => false, 'dsTransID' => false, 'eci' => false, 'exemptionIndicator' => false, 'messageVersion' => false, 'riskScore' => false, + 'threeDSRequestorChallengeInd' => false, 'threeDSServerTransID' => false, 'timestamp' => false, 'transStatus' => false, @@ -195,12 +195,12 @@ public function isNullableSetToNull(string $property): bool 'authenticationValue' => 'authenticationValue', 'cavvAlgorithm' => 'cavvAlgorithm', 'challengeCancel' => 'challengeCancel', - 'challengeIndicator' => 'challengeIndicator', 'dsTransID' => 'dsTransID', 'eci' => 'eci', 'exemptionIndicator' => 'exemptionIndicator', 'messageVersion' => 'messageVersion', 'riskScore' => 'riskScore', + 'threeDSRequestorChallengeInd' => 'threeDSRequestorChallengeInd', 'threeDSServerTransID' => 'threeDSServerTransID', 'timestamp' => 'timestamp', 'transStatus' => 'transStatus', @@ -217,12 +217,12 @@ public function isNullableSetToNull(string $property): bool 'authenticationValue' => 'setAuthenticationValue', 'cavvAlgorithm' => 'setCavvAlgorithm', 'challengeCancel' => 'setChallengeCancel', - 'challengeIndicator' => 'setChallengeIndicator', 'dsTransID' => 'setDsTransID', 'eci' => 'setEci', 'exemptionIndicator' => 'setExemptionIndicator', 'messageVersion' => 'setMessageVersion', 'riskScore' => 'setRiskScore', + 'threeDSRequestorChallengeInd' => 'setThreeDSRequestorChallengeInd', 'threeDSServerTransID' => 'setThreeDSServerTransID', 'timestamp' => 'setTimestamp', 'transStatus' => 'setTransStatus', @@ -239,12 +239,12 @@ public function isNullableSetToNull(string $property): bool 'authenticationValue' => 'getAuthenticationValue', 'cavvAlgorithm' => 'getCavvAlgorithm', 'challengeCancel' => 'getChallengeCancel', - 'challengeIndicator' => 'getChallengeIndicator', 'dsTransID' => 'getDsTransID', 'eci' => 'getEci', 'exemptionIndicator' => 'getExemptionIndicator', 'messageVersion' => 'getMessageVersion', 'riskScore' => 'getRiskScore', + 'threeDSRequestorChallengeInd' => 'getThreeDSRequestorChallengeInd', 'threeDSServerTransID' => 'getThreeDSServerTransID', 'timestamp' => 'getTimestamp', 'transStatus' => 'getTransStatus', @@ -300,14 +300,16 @@ public function getModelName() public const CHALLENGE_CANCEL__05 = '05'; public const CHALLENGE_CANCEL__06 = '06'; public const CHALLENGE_CANCEL__07 = '07'; - public const CHALLENGE_INDICATOR_NO_PREFERENCE = 'noPreference'; - public const CHALLENGE_INDICATOR_REQUEST_NO_CHALLENGE = 'requestNoChallenge'; - public const CHALLENGE_INDICATOR_REQUEST_CHALLENGE = 'requestChallenge'; - public const CHALLENGE_INDICATOR_REQUEST_CHALLENGE_AS_MANDATE = 'requestChallengeAsMandate'; public const EXEMPTION_INDICATOR_LOW_VALUE = 'lowValue'; public const EXEMPTION_INDICATOR_SECURE_CORPORATE = 'secureCorporate'; public const EXEMPTION_INDICATOR_TRUSTED_BENEFICIARY = 'trustedBeneficiary'; public const EXEMPTION_INDICATOR_TRANSACTION_RISK_ANALYSIS = 'transactionRiskAnalysis'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__01 = '01'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__02 = '02'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__03 = '03'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__04 = '04'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__05 = '05'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__06 = '06'; /** * Gets allowable values of the enum @@ -331,13 +333,13 @@ public function getChallengeCancelAllowableValues() * * @return string[] */ - public function getChallengeIndicatorAllowableValues() + public function getExemptionIndicatorAllowableValues() { return [ - self::CHALLENGE_INDICATOR_NO_PREFERENCE, - self::CHALLENGE_INDICATOR_REQUEST_NO_CHALLENGE, - self::CHALLENGE_INDICATOR_REQUEST_CHALLENGE, - self::CHALLENGE_INDICATOR_REQUEST_CHALLENGE_AS_MANDATE, + self::EXEMPTION_INDICATOR_LOW_VALUE, + self::EXEMPTION_INDICATOR_SECURE_CORPORATE, + self::EXEMPTION_INDICATOR_TRUSTED_BENEFICIARY, + self::EXEMPTION_INDICATOR_TRANSACTION_RISK_ANALYSIS, ]; } /** @@ -345,13 +347,15 @@ public function getChallengeIndicatorAllowableValues() * * @return string[] */ - public function getExemptionIndicatorAllowableValues() + public function getThreeDSRequestorChallengeIndAllowableValues() { return [ - self::EXEMPTION_INDICATOR_LOW_VALUE, - self::EXEMPTION_INDICATOR_SECURE_CORPORATE, - self::EXEMPTION_INDICATOR_TRUSTED_BENEFICIARY, - self::EXEMPTION_INDICATOR_TRANSACTION_RISK_ANALYSIS, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__01, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__02, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__03, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__04, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__05, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__06, ]; } /** @@ -372,12 +376,12 @@ public function __construct(array $data = null) $this->setIfExists('authenticationValue', $data ?? [], null); $this->setIfExists('cavvAlgorithm', $data ?? [], null); $this->setIfExists('challengeCancel', $data ?? [], null); - $this->setIfExists('challengeIndicator', $data ?? [], null); $this->setIfExists('dsTransID', $data ?? [], null); $this->setIfExists('eci', $data ?? [], null); $this->setIfExists('exemptionIndicator', $data ?? [], null); $this->setIfExists('messageVersion', $data ?? [], null); $this->setIfExists('riskScore', $data ?? [], null); + $this->setIfExists('threeDSRequestorChallengeInd', $data ?? [], null); $this->setIfExists('threeDSServerTransID', $data ?? [], null); $this->setIfExists('timestamp', $data ?? [], null); $this->setIfExists('transStatus', $data ?? [], null); @@ -421,20 +425,20 @@ public function listInvalidProperties() ); } - $allowedValues = $this->getChallengeIndicatorAllowableValues(); - if (!is_null($this->container['challengeIndicator']) && !in_array($this->container['challengeIndicator'], $allowedValues, true)) { + $allowedValues = $this->getExemptionIndicatorAllowableValues(); + if (!is_null($this->container['exemptionIndicator']) && !in_array($this->container['exemptionIndicator'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'challengeIndicator', must be one of '%s'", - $this->container['challengeIndicator'], + "invalid value '%s' for 'exemptionIndicator', must be one of '%s'", + $this->container['exemptionIndicator'], implode("', '", $allowedValues) ); } - $allowedValues = $this->getExemptionIndicatorAllowableValues(); - if (!is_null($this->container['exemptionIndicator']) && !in_array($this->container['exemptionIndicator'], $allowedValues, true)) { + $allowedValues = $this->getThreeDSRequestorChallengeIndAllowableValues(); + if (!is_null($this->container['threeDSRequestorChallengeInd']) && !in_array($this->container['threeDSRequestorChallengeInd'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'exemptionIndicator', must be one of '%s'", - $this->container['exemptionIndicator'], + "invalid value '%s' for 'threeDSRequestorChallengeInd', must be one of '%s'", + $this->container['threeDSRequestorChallengeInd'], implode("', '", $allowedValues) ); } @@ -545,43 +549,6 @@ public function setChallengeCancel($challengeCancel) return $this; } - /** - * Gets challengeIndicator - * - * @return string|null - */ - public function getChallengeIndicator() - { - return $this->container['challengeIndicator']; - } - - /** - * Sets challengeIndicator - * - * @param string|null $challengeIndicator Specifies a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` - * - * @return self - */ - public function setChallengeIndicator($challengeIndicator) - { - if (is_null($challengeIndicator)) { - throw new \InvalidArgumentException('non-nullable challengeIndicator cannot be null'); - } - $allowedValues = $this->getChallengeIndicatorAllowableValues(); - if (!in_array($challengeIndicator, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'challengeIndicator', must be one of '%s'", - $challengeIndicator, - implode("', '", $allowedValues) - ) - ); - } - $this->container['challengeIndicator'] = $challengeIndicator; - - return $this; - } - /** * Gets dsTransID * @@ -727,6 +694,43 @@ public function setRiskScore($riskScore) return $this; } + /** + * Gets threeDSRequestorChallengeInd + * + * @return string|null + */ + public function getThreeDSRequestorChallengeInd() + { + return $this->container['threeDSRequestorChallengeInd']; + } + + /** + * Sets threeDSRequestorChallengeInd + * + * @param string|null $threeDSRequestorChallengeInd Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only + * + * @return self + */ + public function setThreeDSRequestorChallengeInd($threeDSRequestorChallengeInd) + { + if (is_null($threeDSRequestorChallengeInd)) { + throw new \InvalidArgumentException('non-nullable threeDSRequestorChallengeInd cannot be null'); + } + $allowedValues = $this->getThreeDSRequestorChallengeIndAllowableValues(); + if (!in_array($threeDSRequestorChallengeInd, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'threeDSRequestorChallengeInd', must be one of '%s'", + $threeDSRequestorChallengeInd, + implode("', '", $allowedValues) + ) + ); + } + $this->container['threeDSRequestorChallengeInd'] = $threeDSRequestorChallengeInd; + + return $this; + } + /** * Gets threeDSServerTransID * diff --git a/src/Adyen/Model/Checkout/ThreeDSRequestData.php b/src/Adyen/Model/Checkout/ThreeDSRequestData.php index 8dafba716..f292fc144 100644 --- a/src/Adyen/Model/Checkout/ThreeDSRequestData.php +++ b/src/Adyen/Model/Checkout/ThreeDSRequestData.php @@ -241,8 +241,8 @@ public function getModelName() public const DATA_ONLY_FALSE = 'false'; public const DATA_ONLY_TRUE = 'true'; public const NATIVE_THREE_DS_PREFERRED = 'preferred'; - public const THREE_DS_VERSION__1_0 = '2.1.0'; - public const THREE_DS_VERSION__2_0 = '2.2.0'; + public const THREE_DS_VERSION__1_0 = 'V_2_1_0'; + public const THREE_DS_VERSION__2_0 = 'V_2_2_0'; /** * Gets allowable values of the enum diff --git a/src/Adyen/Model/Checkout/CheckoutUtilityRequest.php b/src/Adyen/Model/Checkout/UtilityRequest.php similarity index 97% rename from src/Adyen/Model/Checkout/CheckoutUtilityRequest.php rename to src/Adyen/Model/Checkout/UtilityRequest.php index 16cfcc332..aead598cc 100644 --- a/src/Adyen/Model/Checkout/CheckoutUtilityRequest.php +++ b/src/Adyen/Model/Checkout/UtilityRequest.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * CheckoutUtilityRequest Class Doc Comment + * UtilityRequest Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class CheckoutUtilityRequest implements ModelInterface, ArrayAccess, \JsonSerializable +class UtilityRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class CheckoutUtilityRequest implements ModelInterface, ArrayAccess, \JsonSerial * * @var string */ - protected static $openAPIModelName = 'CheckoutUtilityRequest'; + protected static $openAPIModelName = 'UtilityRequest'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Adyen/Model/Checkout/CheckoutUtilityResponse.php b/src/Adyen/Model/Checkout/UtilityResponse.php similarity index 97% rename from src/Adyen/Model/Checkout/CheckoutUtilityResponse.php rename to src/Adyen/Model/Checkout/UtilityResponse.php index 20669014a..a86ad2d0d 100644 --- a/src/Adyen/Model/Checkout/CheckoutUtilityResponse.php +++ b/src/Adyen/Model/Checkout/UtilityResponse.php @@ -19,7 +19,7 @@ use Adyen\Model\Checkout\ObjectSerializer; /** - * CheckoutUtilityResponse Class Doc Comment + * UtilityResponse Class Doc Comment * * @category Class * @package Adyen @@ -27,7 +27,7 @@ * @link https://openapi-generator.tech * @implements \ArrayAccess */ -class CheckoutUtilityResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class UtilityResponse implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class CheckoutUtilityResponse implements ModelInterface, ArrayAccess, \JsonSeria * * @var string */ - protected static $openAPIModelName = 'CheckoutUtilityResponse'; + protected static $openAPIModelName = 'UtilityResponse'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Adyen/Model/ConfigurationWebhooks/AccountHolder.php b/src/Adyen/Model/ConfigurationWebhooks/AccountHolder.php new file mode 100644 index 000000000..d821116b3 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/AccountHolder.php @@ -0,0 +1,767 @@ + + */ +class AccountHolder implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AccountHolder'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balancePlatform' => 'string', + 'capabilities' => 'array', + 'contactDetails' => '\Adyen\Model\ConfigurationWebhooks\ContactDetails', + 'description' => 'string', + 'id' => 'string', + 'legalEntityId' => 'string', + 'metadata' => 'array', + 'primaryBalanceAccount' => 'string', + 'reference' => 'string', + 'status' => 'string', + 'timeZone' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balancePlatform' => null, + 'capabilities' => null, + 'contactDetails' => null, + 'description' => null, + 'id' => null, + 'legalEntityId' => null, + 'metadata' => null, + 'primaryBalanceAccount' => null, + 'reference' => null, + 'status' => null, + 'timeZone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balancePlatform' => false, + 'capabilities' => false, + 'contactDetails' => false, + 'description' => false, + 'id' => false, + 'legalEntityId' => false, + 'metadata' => false, + 'primaryBalanceAccount' => false, + 'reference' => false, + 'status' => false, + 'timeZone' => 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 = [ + 'balancePlatform' => 'balancePlatform', + 'capabilities' => 'capabilities', + 'contactDetails' => 'contactDetails', + 'description' => 'description', + 'id' => 'id', + 'legalEntityId' => 'legalEntityId', + 'metadata' => 'metadata', + 'primaryBalanceAccount' => 'primaryBalanceAccount', + 'reference' => 'reference', + 'status' => 'status', + 'timeZone' => 'timeZone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balancePlatform' => 'setBalancePlatform', + 'capabilities' => 'setCapabilities', + 'contactDetails' => 'setContactDetails', + 'description' => 'setDescription', + 'id' => 'setId', + 'legalEntityId' => 'setLegalEntityId', + 'metadata' => 'setMetadata', + 'primaryBalanceAccount' => 'setPrimaryBalanceAccount', + 'reference' => 'setReference', + 'status' => 'setStatus', + 'timeZone' => 'setTimeZone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balancePlatform' => 'getBalancePlatform', + 'capabilities' => 'getCapabilities', + 'contactDetails' => 'getContactDetails', + 'description' => 'getDescription', + 'id' => 'getId', + 'legalEntityId' => 'getLegalEntityId', + 'metadata' => 'getMetadata', + 'primaryBalanceAccount' => 'getPrimaryBalanceAccount', + 'reference' => 'getReference', + 'status' => 'getStatus', + 'timeZone' => 'getTimeZone' + ]; + + /** + * 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 STATUS_ACTIVE = 'Active'; + public const STATUS_CLOSED = 'Closed'; + public const STATUS_INACTIVE = 'Inactive'; + public const STATUS_SUSPENDED = 'Suspended'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_CLOSED, + self::STATUS_INACTIVE, + self::STATUS_SUSPENDED, + ]; + } + /** + * 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('balancePlatform', $data ?? [], null); + $this->setIfExists('capabilities', $data ?? [], null); + $this->setIfExists('contactDetails', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('legalEntityId', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('primaryBalanceAccount', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('timeZone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['legalEntityId'] === null) { + $invalidProperties[] = "'legalEntityId' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + 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 balancePlatform + * + * @return string|null + */ + public function getBalancePlatform() + { + return $this->container['balancePlatform']; + } + + /** + * Sets balancePlatform + * + * @param string|null $balancePlatform The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms. + * + * @return self + */ + public function setBalancePlatform($balancePlatform) + { + if (is_null($balancePlatform)) { + throw new \InvalidArgumentException('non-nullable balancePlatform cannot be null'); + } + $this->container['balancePlatform'] = $balancePlatform; + + return $this; + } + + /** + * Gets capabilities + * + * @return array|null + */ + public function getCapabilities() + { + return $this->container['capabilities']; + } + + /** + * Sets capabilities + * + * @param array|null $capabilities Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability. + * + * @return self + */ + public function setCapabilities($capabilities) + { + if (is_null($capabilities)) { + throw new \InvalidArgumentException('non-nullable capabilities cannot be null'); + } + $this->container['capabilities'] = $capabilities; + + return $this; + } + + /** + * Gets contactDetails + * + * @return \Adyen\Model\ConfigurationWebhooks\ContactDetails|null + */ + public function getContactDetails() + { + return $this->container['contactDetails']; + } + + /** + * Sets contactDetails + * + * @param \Adyen\Model\ConfigurationWebhooks\ContactDetails|null $contactDetails contactDetails + * + * @return self + */ + public function setContactDetails($contactDetails) + { + if (is_null($contactDetails)) { + throw new \InvalidArgumentException('non-nullable contactDetails cannot be null'); + } + $this->container['contactDetails'] = $contactDetails; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for the account holder, maximum 300 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the account holder. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets legalEntityId + * + * @return string + */ + public function getLegalEntityId() + { + return $this->container['legalEntityId']; + } + + /** + * Sets legalEntityId + * + * @param string $legalEntityId The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder. + * + * @return self + */ + public function setLegalEntityId($legalEntityId) + { + if (is_null($legalEntityId)) { + throw new \InvalidArgumentException('non-nullable legalEntityId cannot be null'); + } + $this->container['legalEntityId'] = $legalEntityId; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets primaryBalanceAccount + * + * @return string|null + */ + public function getPrimaryBalanceAccount() + { + return $this->container['primaryBalanceAccount']; + } + + /** + * Sets primaryBalanceAccount + * + * @param string|null $primaryBalanceAccount The ID of the account holder's primary balance account. By default, this is set to the first balance account that you create for the account holder. To assign a different balance account, send a PATCH request. + * + * @return self + */ + public function setPrimaryBalanceAccount($primaryBalanceAccount) + { + if (is_null($primaryBalanceAccount)) { + throw new \InvalidArgumentException('non-nullable primaryBalanceAccount cannot be null'); + } + $this->container['primaryBalanceAccount'] = $primaryBalanceAccount; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the account holder, maximum 150 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the account holder. Possible values: * **Active**: The account holder is active. This is the default status when creating an account holder. * **Inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **Suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **Closed**: The account holder is permanently deactivated by you. This action cannot be undone. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets timeZone + * + * @return string|null + */ + public function getTimeZone() + { + return $this->container['timeZone']; + } + + /** + * Sets timeZone + * + * @param string|null $timeZone The time zone of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * + * @return self + */ + public function setTimeZone($timeZone) + { + if (is_null($timeZone)) { + throw new \InvalidArgumentException('non-nullable timeZone cannot be null'); + } + $this->container['timeZone'] = $timeZone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.php b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.php new file mode 100644 index 000000000..359e5ec12 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.php @@ -0,0 +1,801 @@ + + */ +class AccountHolderCapability implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AccountHolderCapability'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'allowed' => 'bool', + 'allowedLevel' => 'string', + 'allowedSettings' => '\Adyen\Model\ConfigurationWebhooks\CapabilitySettings', + 'enabled' => 'bool', + 'problems' => 'object[]', + 'requested' => 'bool', + 'requestedLevel' => 'string', + 'requestedSettings' => '\Adyen\Model\ConfigurationWebhooks\CapabilitySettings', + 'transferInstruments' => '\Adyen\Model\ConfigurationWebhooks\AccountSupportingEntityCapability[]', + 'verificationStatus' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'allowed' => null, + 'allowedLevel' => null, + 'allowedSettings' => null, + 'enabled' => null, + 'problems' => null, + 'requested' => null, + 'requestedLevel' => null, + 'requestedSettings' => null, + 'transferInstruments' => null, + 'verificationStatus' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'allowed' => false, + 'allowedLevel' => false, + 'allowedSettings' => false, + 'enabled' => false, + 'problems' => false, + 'requested' => false, + 'requestedLevel' => false, + 'requestedSettings' => false, + 'transferInstruments' => false, + 'verificationStatus' => 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 = [ + 'allowed' => 'allowed', + 'allowedLevel' => 'allowedLevel', + 'allowedSettings' => 'allowedSettings', + 'enabled' => 'enabled', + 'problems' => 'problems', + 'requested' => 'requested', + 'requestedLevel' => 'requestedLevel', + 'requestedSettings' => 'requestedSettings', + 'transferInstruments' => 'transferInstruments', + 'verificationStatus' => 'verificationStatus' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowed' => 'setAllowed', + 'allowedLevel' => 'setAllowedLevel', + 'allowedSettings' => 'setAllowedSettings', + 'enabled' => 'setEnabled', + 'problems' => 'setProblems', + 'requested' => 'setRequested', + 'requestedLevel' => 'setRequestedLevel', + 'requestedSettings' => 'setRequestedSettings', + 'transferInstruments' => 'setTransferInstruments', + 'verificationStatus' => 'setVerificationStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowed' => 'getAllowed', + 'allowedLevel' => 'getAllowedLevel', + 'allowedSettings' => 'getAllowedSettings', + 'enabled' => 'getEnabled', + 'problems' => 'getProblems', + 'requested' => 'getRequested', + 'requestedLevel' => 'getRequestedLevel', + 'requestedSettings' => 'getRequestedSettings', + 'transferInstruments' => 'getTransferInstruments', + 'verificationStatus' => 'getVerificationStatus' + ]; + + /** + * 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 ALLOWED_LEVEL_HIGH = 'high'; + public const ALLOWED_LEVEL_LOW = 'low'; + public const ALLOWED_LEVEL_MEDIUM = 'medium'; + public const ALLOWED_LEVEL_NOT_APPLICABLE = 'notApplicable'; + public const REQUESTED_LEVEL_HIGH = 'high'; + public const REQUESTED_LEVEL_LOW = 'low'; + public const REQUESTED_LEVEL_MEDIUM = 'medium'; + public const REQUESTED_LEVEL_NOT_APPLICABLE = 'notApplicable'; + public const VERIFICATION_STATUS_INVALID = 'invalid'; + public const VERIFICATION_STATUS_PENDING = 'pending'; + public const VERIFICATION_STATUS_REJECTED = 'rejected'; + public const VERIFICATION_STATUS_VALID = 'valid'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAllowedLevelAllowableValues() + { + return [ + self::ALLOWED_LEVEL_HIGH, + self::ALLOWED_LEVEL_LOW, + self::ALLOWED_LEVEL_MEDIUM, + self::ALLOWED_LEVEL_NOT_APPLICABLE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRequestedLevelAllowableValues() + { + return [ + self::REQUESTED_LEVEL_HIGH, + self::REQUESTED_LEVEL_LOW, + self::REQUESTED_LEVEL_MEDIUM, + self::REQUESTED_LEVEL_NOT_APPLICABLE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getVerificationStatusAllowableValues() + { + return [ + self::VERIFICATION_STATUS_INVALID, + self::VERIFICATION_STATUS_PENDING, + self::VERIFICATION_STATUS_REJECTED, + self::VERIFICATION_STATUS_VALID, + ]; + } + /** + * 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('allowed', $data ?? [], null); + $this->setIfExists('allowedLevel', $data ?? [], null); + $this->setIfExists('allowedSettings', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('problems', $data ?? [], null); + $this->setIfExists('requested', $data ?? [], null); + $this->setIfExists('requestedLevel', $data ?? [], null); + $this->setIfExists('requestedSettings', $data ?? [], null); + $this->setIfExists('transferInstruments', $data ?? [], null); + $this->setIfExists('verificationStatus', $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->getAllowedLevelAllowableValues(); + if (!is_null($this->container['allowedLevel']) && !in_array($this->container['allowedLevel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'allowedLevel', must be one of '%s'", + $this->container['allowedLevel'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRequestedLevelAllowableValues(); + if (!is_null($this->container['requestedLevel']) && !in_array($this->container['requestedLevel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'requestedLevel', must be one of '%s'", + $this->container['requestedLevel'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getVerificationStatusAllowableValues(); + if (!is_null($this->container['verificationStatus']) && !in_array($this->container['verificationStatus'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'verificationStatus', must be one of '%s'", + $this->container['verificationStatus'], + 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 allowed + * + * @return bool|null + */ + public function getAllowed() + { + return $this->container['allowed']; + } + + /** + * Sets allowed + * + * @param bool|null $allowed Indicates whether the capability is allowed. Adyen sets this to **true** if the verification is successful and the account holder is permitted to use the capability. + * + * @return self + */ + public function setAllowed($allowed) + { + if (is_null($allowed)) { + throw new \InvalidArgumentException('non-nullable allowed cannot be null'); + } + $this->container['allowed'] = $allowed; + + return $this; + } + + /** + * Gets allowedLevel + * + * @return string|null + */ + public function getAllowedLevel() + { + return $this->container['allowedLevel']; + } + + /** + * Sets allowedLevel + * + * @param string|null $allowedLevel The capability level that is allowed for the account holder. Possible values: **notApplicable**, **low**, **medium**, **high**. + * + * @return self + */ + public function setAllowedLevel($allowedLevel) + { + if (is_null($allowedLevel)) { + throw new \InvalidArgumentException('non-nullable allowedLevel cannot be null'); + } + $allowedValues = $this->getAllowedLevelAllowableValues(); + if (!in_array($allowedLevel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'allowedLevel', must be one of '%s'", + $allowedLevel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['allowedLevel'] = $allowedLevel; + + return $this; + } + + /** + * Gets allowedSettings + * + * @return \Adyen\Model\ConfigurationWebhooks\CapabilitySettings|null + */ + public function getAllowedSettings() + { + return $this->container['allowedSettings']; + } + + /** + * Sets allowedSettings + * + * @param \Adyen\Model\ConfigurationWebhooks\CapabilitySettings|null $allowedSettings allowedSettings + * + * @return self + */ + public function setAllowedSettings($allowedSettings) + { + if (is_null($allowedSettings)) { + throw new \InvalidArgumentException('non-nullable allowedSettings cannot be null'); + } + $this->container['allowedSettings'] = $allowedSettings; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Indicates whether the capability is enabled. If **false**, the capability is temporarily disabled for the account holder. + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets problems + * + * @return object[]|null + */ + public function getProblems() + { + return $this->container['problems']; + } + + /** + * Sets problems + * + * @param object[]|null $problems Contains verification errors and the actions that you can take to resolve them. + * + * @return self + */ + public function setProblems($problems) + { + if (is_null($problems)) { + throw new \InvalidArgumentException('non-nullable problems cannot be null'); + } + $this->container['problems'] = $problems; + + return $this; + } + + /** + * Gets requested + * + * @return bool|null + */ + public function getRequested() + { + return $this->container['requested']; + } + + /** + * Sets requested + * + * @param bool|null $requested Indicates whether the capability is requested. To check whether the account holder is permitted to use the capability, refer to the `allowed` field. + * + * @return self + */ + public function setRequested($requested) + { + if (is_null($requested)) { + throw new \InvalidArgumentException('non-nullable requested cannot be null'); + } + $this->container['requested'] = $requested; + + return $this; + } + + /** + * Gets requestedLevel + * + * @return string|null + */ + public function getRequestedLevel() + { + return $this->container['requestedLevel']; + } + + /** + * Sets requestedLevel + * + * @param string|null $requestedLevel The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**. + * + * @return self + */ + public function setRequestedLevel($requestedLevel) + { + if (is_null($requestedLevel)) { + throw new \InvalidArgumentException('non-nullable requestedLevel cannot be null'); + } + $allowedValues = $this->getRequestedLevelAllowableValues(); + if (!in_array($requestedLevel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'requestedLevel', must be one of '%s'", + $requestedLevel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['requestedLevel'] = $requestedLevel; + + return $this; + } + + /** + * Gets requestedSettings + * + * @return \Adyen\Model\ConfigurationWebhooks\CapabilitySettings|null + */ + public function getRequestedSettings() + { + return $this->container['requestedSettings']; + } + + /** + * Sets requestedSettings + * + * @param \Adyen\Model\ConfigurationWebhooks\CapabilitySettings|null $requestedSettings requestedSettings + * + * @return self + */ + public function setRequestedSettings($requestedSettings) + { + if (is_null($requestedSettings)) { + throw new \InvalidArgumentException('non-nullable requestedSettings cannot be null'); + } + $this->container['requestedSettings'] = $requestedSettings; + + return $this; + } + + /** + * Gets transferInstruments + * + * @return \Adyen\Model\ConfigurationWebhooks\AccountSupportingEntityCapability[]|null + */ + public function getTransferInstruments() + { + return $this->container['transferInstruments']; + } + + /** + * Sets transferInstruments + * + * @param \Adyen\Model\ConfigurationWebhooks\AccountSupportingEntityCapability[]|null $transferInstruments Contains the status of the transfer instruments associated with this capability. + * + * @return self + */ + public function setTransferInstruments($transferInstruments) + { + if (is_null($transferInstruments)) { + throw new \InvalidArgumentException('non-nullable transferInstruments cannot be null'); + } + $this->container['transferInstruments'] = $transferInstruments; + + return $this; + } + + /** + * Gets verificationStatus + * + * @return string|null + */ + public function getVerificationStatus() + { + return $this->container['verificationStatus']; + } + + /** + * Sets verificationStatus + * + * @param string|null $verificationStatus The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. + * + * @return self + */ + public function setVerificationStatus($verificationStatus) + { + if (is_null($verificationStatus)) { + throw new \InvalidArgumentException('non-nullable verificationStatus cannot be null'); + } + $allowedValues = $this->getVerificationStatusAllowableValues(); + if (!in_array($verificationStatus, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'verificationStatus', must be one of '%s'", + $verificationStatus, + implode("', '", $allowedValues) + ) + ); + } + $this->container['verificationStatus'] = $verificationStatus; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.php b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.php new file mode 100644 index 000000000..1d1204803 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.php @@ -0,0 +1,418 @@ + + */ +class AccountHolderNotificationData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AccountHolderNotificationData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountHolder' => '\Adyen\Model\ConfigurationWebhooks\AccountHolder', + 'balancePlatform' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountHolder' => null, + 'balancePlatform' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountHolder' => false, + 'balancePlatform' => 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 = [ + 'accountHolder' => 'accountHolder', + 'balancePlatform' => 'balancePlatform' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountHolder' => 'setAccountHolder', + 'balancePlatform' => 'setBalancePlatform' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountHolder' => 'getAccountHolder', + 'balancePlatform' => 'getBalancePlatform' + ]; + + /** + * 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('accountHolder', $data ?? [], null); + $this->setIfExists('balancePlatform', $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 accountHolder + * + * @return \Adyen\Model\ConfigurationWebhooks\AccountHolder|null + */ + public function getAccountHolder() + { + return $this->container['accountHolder']; + } + + /** + * Sets accountHolder + * + * @param \Adyen\Model\ConfigurationWebhooks\AccountHolder|null $accountHolder accountHolder + * + * @return self + */ + public function setAccountHolder($accountHolder) + { + if (is_null($accountHolder)) { + throw new \InvalidArgumentException('non-nullable accountHolder cannot be null'); + } + $this->container['accountHolder'] = $accountHolder; + + return $this; + } + + /** + * Gets balancePlatform + * + * @return string|null + */ + public function getBalancePlatform() + { + return $this->container['balancePlatform']; + } + + /** + * Sets balancePlatform + * + * @param string|null $balancePlatform The unique identifier of the balance platform. + * + * @return self + */ + public function setBalancePlatform($balancePlatform) + { + if (is_null($balancePlatform)) { + throw new \InvalidArgumentException('non-nullable balancePlatform cannot be null'); + } + $this->container['balancePlatform'] = $balancePlatform; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.php new file mode 100644 index 000000000..5b007974b --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.php @@ -0,0 +1,494 @@ + + */ +class AccountHolderNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AccountHolderNotificationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\ConfigurationWebhooks\AccountHolderNotificationData', + 'environment' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'environment' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false, + 'environment' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'environment' => 'environment', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'environment' => 'setEnvironment', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'environment' => 'getEnvironment', + '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_UPDATED = 'balancePlatform.accountHolder.updated'; + public const TYPE_CREATED = 'balancePlatform.accountHolder.created'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_UPDATED, + self::TYPE_CREATED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['environment'] === null) { + $invalidProperties[] = "'environment' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\ConfigurationWebhooks\AccountHolderNotificationData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\ConfigurationWebhooks\AccountHolderNotificationData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets environment + * + * @return string + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param string $environment The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @return self + */ + public function setEnvironment($environment) + { + if (is_null($environment)) { + throw new \InvalidArgumentException('non-nullable environment cannot be null'); + } + $this->container['environment'] = $environment; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of webhook. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.php b/src/Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.php new file mode 100644 index 000000000..2d02ae5df --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.php @@ -0,0 +1,699 @@ + + */ +class AccountSupportingEntityCapability implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AccountSupportingEntityCapability'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'allowed' => 'bool', + 'allowedLevel' => 'string', + 'enabled' => 'bool', + 'id' => 'string', + 'requested' => 'bool', + 'requestedLevel' => 'string', + 'verificationStatus' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'allowed' => null, + 'allowedLevel' => null, + 'enabled' => null, + 'id' => null, + 'requested' => null, + 'requestedLevel' => null, + 'verificationStatus' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'allowed' => false, + 'allowedLevel' => false, + 'enabled' => false, + 'id' => false, + 'requested' => false, + 'requestedLevel' => false, + 'verificationStatus' => 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 = [ + 'allowed' => 'allowed', + 'allowedLevel' => 'allowedLevel', + 'enabled' => 'enabled', + 'id' => 'id', + 'requested' => 'requested', + 'requestedLevel' => 'requestedLevel', + 'verificationStatus' => 'verificationStatus' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowed' => 'setAllowed', + 'allowedLevel' => 'setAllowedLevel', + 'enabled' => 'setEnabled', + 'id' => 'setId', + 'requested' => 'setRequested', + 'requestedLevel' => 'setRequestedLevel', + 'verificationStatus' => 'setVerificationStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowed' => 'getAllowed', + 'allowedLevel' => 'getAllowedLevel', + 'enabled' => 'getEnabled', + 'id' => 'getId', + 'requested' => 'getRequested', + 'requestedLevel' => 'getRequestedLevel', + 'verificationStatus' => 'getVerificationStatus' + ]; + + /** + * 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 ALLOWED_LEVEL_HIGH = 'high'; + public const ALLOWED_LEVEL_LOW = 'low'; + public const ALLOWED_LEVEL_MEDIUM = 'medium'; + public const ALLOWED_LEVEL_NOT_APPLICABLE = 'notApplicable'; + public const REQUESTED_LEVEL_HIGH = 'high'; + public const REQUESTED_LEVEL_LOW = 'low'; + public const REQUESTED_LEVEL_MEDIUM = 'medium'; + public const REQUESTED_LEVEL_NOT_APPLICABLE = 'notApplicable'; + public const VERIFICATION_STATUS_INVALID = 'invalid'; + public const VERIFICATION_STATUS_PENDING = 'pending'; + public const VERIFICATION_STATUS_REJECTED = 'rejected'; + public const VERIFICATION_STATUS_VALID = 'valid'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAllowedLevelAllowableValues() + { + return [ + self::ALLOWED_LEVEL_HIGH, + self::ALLOWED_LEVEL_LOW, + self::ALLOWED_LEVEL_MEDIUM, + self::ALLOWED_LEVEL_NOT_APPLICABLE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRequestedLevelAllowableValues() + { + return [ + self::REQUESTED_LEVEL_HIGH, + self::REQUESTED_LEVEL_LOW, + self::REQUESTED_LEVEL_MEDIUM, + self::REQUESTED_LEVEL_NOT_APPLICABLE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getVerificationStatusAllowableValues() + { + return [ + self::VERIFICATION_STATUS_INVALID, + self::VERIFICATION_STATUS_PENDING, + self::VERIFICATION_STATUS_REJECTED, + self::VERIFICATION_STATUS_VALID, + ]; + } + /** + * 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('allowed', $data ?? [], null); + $this->setIfExists('allowedLevel', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('requested', $data ?? [], null); + $this->setIfExists('requestedLevel', $data ?? [], null); + $this->setIfExists('verificationStatus', $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->getAllowedLevelAllowableValues(); + if (!is_null($this->container['allowedLevel']) && !in_array($this->container['allowedLevel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'allowedLevel', must be one of '%s'", + $this->container['allowedLevel'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRequestedLevelAllowableValues(); + if (!is_null($this->container['requestedLevel']) && !in_array($this->container['requestedLevel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'requestedLevel', must be one of '%s'", + $this->container['requestedLevel'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getVerificationStatusAllowableValues(); + if (!is_null($this->container['verificationStatus']) && !in_array($this->container['verificationStatus'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'verificationStatus', must be one of '%s'", + $this->container['verificationStatus'], + 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 allowed + * + * @return bool|null + */ + public function getAllowed() + { + return $this->container['allowed']; + } + + /** + * Sets allowed + * + * @param bool|null $allowed Indicates whether the supporting entity capability is allowed. Adyen sets this to **true** if the verification is successful and the account holder is permitted to use the capability. + * + * @return self + */ + public function setAllowed($allowed) + { + if (is_null($allowed)) { + throw new \InvalidArgumentException('non-nullable allowed cannot be null'); + } + $this->container['allowed'] = $allowed; + + return $this; + } + + /** + * Gets allowedLevel + * + * @return string|null + */ + public function getAllowedLevel() + { + return $this->container['allowedLevel']; + } + + /** + * Sets allowedLevel + * + * @param string|null $allowedLevel The capability level that is allowed for the account holder. Possible values: **notApplicable**, **low**, **medium**, **high**. + * + * @return self + */ + public function setAllowedLevel($allowedLevel) + { + if (is_null($allowedLevel)) { + throw new \InvalidArgumentException('non-nullable allowedLevel cannot be null'); + } + $allowedValues = $this->getAllowedLevelAllowableValues(); + if (!in_array($allowedLevel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'allowedLevel', must be one of '%s'", + $allowedLevel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['allowedLevel'] = $allowedLevel; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Indicates whether the capability is enabled. If **false**, the capability is temporarily disabled for the account holder. + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The ID of the supporting entity. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets requested + * + * @return bool|null + */ + public function getRequested() + { + return $this->container['requested']; + } + + /** + * Sets requested + * + * @param bool|null $requested Indicates whether the capability is requested. To check whether the account holder is permitted to use the capability, refer to the `allowed` field. + * + * @return self + */ + public function setRequested($requested) + { + if (is_null($requested)) { + throw new \InvalidArgumentException('non-nullable requested cannot be null'); + } + $this->container['requested'] = $requested; + + return $this; + } + + /** + * Gets requestedLevel + * + * @return string|null + */ + public function getRequestedLevel() + { + return $this->container['requestedLevel']; + } + + /** + * Sets requestedLevel + * + * @param string|null $requestedLevel The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**. + * + * @return self + */ + public function setRequestedLevel($requestedLevel) + { + if (is_null($requestedLevel)) { + throw new \InvalidArgumentException('non-nullable requestedLevel cannot be null'); + } + $allowedValues = $this->getRequestedLevelAllowableValues(); + if (!in_array($requestedLevel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'requestedLevel', must be one of '%s'", + $requestedLevel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['requestedLevel'] = $requestedLevel; + + return $this; + } + + /** + * Gets verificationStatus + * + * @return string|null + */ + public function getVerificationStatus() + { + return $this->container['verificationStatus']; + } + + /** + * Sets verificationStatus + * + * @param string|null $verificationStatus The status of the verification checks for the supporting entity capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. + * + * @return self + */ + public function setVerificationStatus($verificationStatus) + { + if (is_null($verificationStatus)) { + throw new \InvalidArgumentException('non-nullable verificationStatus cannot be null'); + } + $allowedValues = $this->getVerificationStatusAllowableValues(); + if (!in_array($verificationStatus, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'verificationStatus', must be one of '%s'", + $verificationStatus, + implode("', '", $allowedValues) + ) + ); + } + $this->container['verificationStatus'] = $verificationStatus; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/Address.php b/src/Adyen/Model/ConfigurationWebhooks/Address.php new file mode 100644 index 000000000..d936869a6 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/Address.php @@ -0,0 +1,569 @@ + + */ +class Address implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Address'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'country' => 'string', + 'houseNumberOrName' => 'string', + 'postalCode' => 'string', + 'stateOrProvince' => 'string', + 'street' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'city' => null, + 'country' => null, + 'houseNumberOrName' => null, + 'postalCode' => null, + 'stateOrProvince' => null, + 'street' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'city' => false, + 'country' => false, + 'houseNumberOrName' => false, + 'postalCode' => false, + 'stateOrProvince' => false, + 'street' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'country' => 'country', + 'houseNumberOrName' => 'houseNumberOrName', + 'postalCode' => 'postalCode', + 'stateOrProvince' => 'stateOrProvince', + 'street' => 'street' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'houseNumberOrName' => 'setHouseNumberOrName', + 'postalCode' => 'setPostalCode', + 'stateOrProvince' => 'setStateOrProvince', + 'street' => 'setStreet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'houseNumberOrName' => 'getHouseNumberOrName', + 'postalCode' => 'getPostalCode', + 'stateOrProvince' => 'getStateOrProvince', + 'street' => 'getStreet' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('houseNumberOrName', $data ?? [], null); + $this->setIfExists('postalCode', $data ?? [], null); + $this->setIfExists('stateOrProvince', $data ?? [], null); + $this->setIfExists('street', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['city'] === null) { + $invalidProperties[] = "'city' can't be null"; + } + if ($this->container['country'] === null) { + $invalidProperties[] = "'country' can't be null"; + } + if ($this->container['houseNumberOrName'] === null) { + $invalidProperties[] = "'houseNumberOrName' can't be null"; + } + if ($this->container['postalCode'] === null) { + $invalidProperties[] = "'postalCode' can't be null"; + } + if ($this->container['street'] === null) { + $invalidProperties[] = "'street' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city The name of the city. Maximum length: 3000 characters. + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets houseNumberOrName + * + * @return string + */ + public function getHouseNumberOrName() + { + return $this->container['houseNumberOrName']; + } + + /** + * Sets houseNumberOrName + * + * @param string $houseNumberOrName The number or name of the house. Maximum length: 3000 characters. + * + * @return self + */ + public function setHouseNumberOrName($houseNumberOrName) + { + if (is_null($houseNumberOrName)) { + throw new \InvalidArgumentException('non-nullable houseNumberOrName cannot be null'); + } + $this->container['houseNumberOrName'] = $houseNumberOrName; + + return $this; + } + + /** + * Gets postalCode + * + * @return string + */ + public function getPostalCode() + { + return $this->container['postalCode']; + } + + /** + * Sets postalCode + * + * @param string $postalCode A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + * + * @return self + */ + public function setPostalCode($postalCode) + { + if (is_null($postalCode)) { + throw new \InvalidArgumentException('non-nullable postalCode cannot be null'); + } + $this->container['postalCode'] = $postalCode; + + return $this; + } + + /** + * Gets stateOrProvince + * + * @return string|null + */ + public function getStateOrProvince() + { + return $this->container['stateOrProvince']; + } + + /** + * Sets stateOrProvince + * + * @param string|null $stateOrProvince The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + * + * @return self + */ + public function setStateOrProvince($stateOrProvince) + { + if (is_null($stateOrProvince)) { + throw new \InvalidArgumentException('non-nullable stateOrProvince cannot be null'); + } + $this->container['stateOrProvince'] = $stateOrProvince; + + return $this; + } + + /** + * Gets street + * + * @return string + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string $street The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + * + * @return self + */ + public function setStreet($street) + { + if (is_null($street)) { + throw new \InvalidArgumentException('non-nullable street cannot be null'); + } + $this->container['street'] = $street; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/Amount.php b/src/Adyen/Model/ConfigurationWebhooks/Amount.php new file mode 100644 index 000000000..daa12c1cb --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/Amount.php @@ -0,0 +1,424 @@ + + */ +class Amount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Amount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'value' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/Authentication.php b/src/Adyen/Model/ConfigurationWebhooks/Authentication.php new file mode 100644 index 000000000..5582a88b1 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/Authentication.php @@ -0,0 +1,452 @@ + + */ +class Authentication implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Authentication'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'email' => 'string', + 'password' => 'string', + 'phone' => '\Adyen\Model\ConfigurationWebhooks\Phone' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'email' => null, + 'password' => null, + 'phone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'email' => false, + 'password' => false, + 'phone' => 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 = [ + 'email' => 'email', + 'password' => 'password', + 'phone' => 'phone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'password' => 'setPassword', + 'phone' => 'setPhone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'password' => 'getPassword', + 'phone' => 'getPhone' + ]; + + /** + * 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('email', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + $this->setIfExists('phone', $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 email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The email address where the one-time password (OTP) is sent. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets password + * + * @return string|null + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string|null $password The password used for 3D Secure password-based authentication. The value must be between 1 to 30 characters and must only contain the following supported characters. * Characters between **a-z**, **A-Z**, and **0-9** * Special characters: **äöüßÄÖÜ+-*_/ç%()=?!~#'\",;:$&àùòâôûáúó** + * + * @return self + */ + public function setPassword($password) + { + if (is_null($password)) { + throw new \InvalidArgumentException('non-nullable password cannot be null'); + } + $this->container['password'] = $password; + + return $this; + } + + /** + * Gets phone + * + * @return \Adyen\Model\ConfigurationWebhooks\Phone|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param \Adyen\Model\ConfigurationWebhooks\Phone|null $phone phone + * + * @return self + */ + public function setPhone($phone) + { + if (is_null($phone)) { + throw new \InvalidArgumentException('non-nullable phone cannot be null'); + } + $this->container['phone'] = $phone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/Balance.php b/src/Adyen/Model/ConfigurationWebhooks/Balance.php new file mode 100644 index 000000000..2d0530024 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/Balance.php @@ -0,0 +1,498 @@ + + */ +class Balance implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Balance'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'available' => 'int', + 'balance' => 'int', + 'currency' => 'string', + 'reserved' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'available' => 'int64', + 'balance' => 'int64', + 'currency' => null, + 'reserved' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'available' => false, + 'balance' => false, + 'currency' => false, + 'reserved' => 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 = [ + 'available' => 'available', + 'balance' => 'balance', + 'currency' => 'currency', + 'reserved' => 'reserved' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'available' => 'setAvailable', + 'balance' => 'setBalance', + 'currency' => 'setCurrency', + 'reserved' => 'setReserved' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'available' => 'getAvailable', + 'balance' => 'getBalance', + 'currency' => 'getCurrency', + 'reserved' => 'getReserved' + ]; + + /** + * 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('available', $data ?? [], null); + $this->setIfExists('balance', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('reserved', $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['available'] === null) { + $invalidProperties[] = "'available' can't be null"; + } + if ($this->container['balance'] === null) { + $invalidProperties[] = "'balance' can't be null"; + } + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['reserved'] === null) { + $invalidProperties[] = "'reserved' 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 available + * + * @return int + */ + public function getAvailable() + { + return $this->container['available']; + } + + /** + * Sets available + * + * @param int $available The remaining amount available for spending. + * + * @return self + */ + public function setAvailable($available) + { + if (is_null($available)) { + throw new \InvalidArgumentException('non-nullable available cannot be null'); + } + $this->container['available'] = $available; + + return $this; + } + + /** + * Gets balance + * + * @return int + */ + public function getBalance() + { + return $this->container['balance']; + } + + /** + * Sets balance + * + * @param int $balance The total amount in the balance. + * + * @return self + */ + public function setBalance($balance) + { + if (is_null($balance)) { + throw new \InvalidArgumentException('non-nullable balance cannot be null'); + } + $this->container['balance'] = $balance; + + return $this; + } + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance. + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets reserved + * + * @return int + */ + public function getReserved() + { + return $this->container['reserved']; + } + + /** + * Sets reserved + * + * @param int $reserved The amount reserved for payments that have been authorised, but have not been captured yet. + * + * @return self + */ + public function setReserved($reserved) + { + if (is_null($reserved)) { + throw new \InvalidArgumentException('non-nullable reserved cannot be null'); + } + $this->container['reserved'] = $reserved; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/BalanceAccount.php b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccount.php new file mode 100644 index 000000000..99d07bf3d --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccount.php @@ -0,0 +1,767 @@ + + */ +class BalanceAccount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceAccount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountHolderId' => 'string', + 'balances' => '\Adyen\Model\ConfigurationWebhooks\Balance[]', + 'defaultCurrencyCode' => 'string', + 'description' => 'string', + 'id' => 'string', + 'metadata' => 'array', + 'paymentInstruments' => '\Adyen\Model\ConfigurationWebhooks\PaymentInstrumentReference[]', + 'reference' => 'string', + 'status' => 'string', + 'sweepConfigurations' => 'array', + 'timeZone' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountHolderId' => null, + 'balances' => null, + 'defaultCurrencyCode' => null, + 'description' => null, + 'id' => null, + 'metadata' => null, + 'paymentInstruments' => null, + 'reference' => null, + 'status' => null, + 'sweepConfigurations' => null, + 'timeZone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountHolderId' => false, + 'balances' => false, + 'defaultCurrencyCode' => false, + 'description' => false, + 'id' => false, + 'metadata' => false, + 'paymentInstruments' => false, + 'reference' => false, + 'status' => false, + 'sweepConfigurations' => false, + 'timeZone' => 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 = [ + 'accountHolderId' => 'accountHolderId', + 'balances' => 'balances', + 'defaultCurrencyCode' => 'defaultCurrencyCode', + 'description' => 'description', + 'id' => 'id', + 'metadata' => 'metadata', + 'paymentInstruments' => 'paymentInstruments', + 'reference' => 'reference', + 'status' => 'status', + 'sweepConfigurations' => 'sweepConfigurations', + 'timeZone' => 'timeZone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountHolderId' => 'setAccountHolderId', + 'balances' => 'setBalances', + 'defaultCurrencyCode' => 'setDefaultCurrencyCode', + 'description' => 'setDescription', + 'id' => 'setId', + 'metadata' => 'setMetadata', + 'paymentInstruments' => 'setPaymentInstruments', + 'reference' => 'setReference', + 'status' => 'setStatus', + 'sweepConfigurations' => 'setSweepConfigurations', + 'timeZone' => 'setTimeZone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountHolderId' => 'getAccountHolderId', + 'balances' => 'getBalances', + 'defaultCurrencyCode' => 'getDefaultCurrencyCode', + 'description' => 'getDescription', + 'id' => 'getId', + 'metadata' => 'getMetadata', + 'paymentInstruments' => 'getPaymentInstruments', + 'reference' => 'getReference', + 'status' => 'getStatus', + 'sweepConfigurations' => 'getSweepConfigurations', + 'timeZone' => 'getTimeZone' + ]; + + /** + * 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 STATUS_ACTIVE = 'Active'; + public const STATUS_CLOSED = 'Closed'; + public const STATUS_INACTIVE = 'Inactive'; + public const STATUS_SUSPENDED = 'Suspended'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_CLOSED, + self::STATUS_INACTIVE, + self::STATUS_SUSPENDED, + ]; + } + /** + * 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('accountHolderId', $data ?? [], null); + $this->setIfExists('balances', $data ?? [], null); + $this->setIfExists('defaultCurrencyCode', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('paymentInstruments', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('sweepConfigurations', $data ?? [], null); + $this->setIfExists('timeZone', $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['accountHolderId'] === null) { + $invalidProperties[] = "'accountHolderId' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + 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 accountHolderId + * + * @return string + */ + public function getAccountHolderId() + { + return $this->container['accountHolderId']; + } + + /** + * Sets accountHolderId + * + * @param string $accountHolderId The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. + * + * @return self + */ + public function setAccountHolderId($accountHolderId) + { + if (is_null($accountHolderId)) { + throw new \InvalidArgumentException('non-nullable accountHolderId cannot be null'); + } + $this->container['accountHolderId'] = $accountHolderId; + + return $this; + } + + /** + * Gets balances + * + * @return \Adyen\Model\ConfigurationWebhooks\Balance[]|null + */ + public function getBalances() + { + return $this->container['balances']; + } + + /** + * Sets balances + * + * @param \Adyen\Model\ConfigurationWebhooks\Balance[]|null $balances List of balances with the amount and currency. + * + * @return self + */ + public function setBalances($balances) + { + if (is_null($balances)) { + throw new \InvalidArgumentException('non-nullable balances cannot be null'); + } + $this->container['balances'] = $balances; + + return $this; + } + + /** + * Gets defaultCurrencyCode + * + * @return string|null + */ + public function getDefaultCurrencyCode() + { + return $this->container['defaultCurrencyCode']; + } + + /** + * Sets defaultCurrencyCode + * + * @param string|null $defaultCurrencyCode The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. + * + * @return self + */ + public function setDefaultCurrencyCode($defaultCurrencyCode) + { + if (is_null($defaultCurrencyCode)) { + throw new \InvalidArgumentException('non-nullable defaultCurrencyCode cannot be null'); + } + $this->container['defaultCurrencyCode'] = $defaultCurrencyCode; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the balance account. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets paymentInstruments + * + * @return \Adyen\Model\ConfigurationWebhooks\PaymentInstrumentReference[]|null + */ + public function getPaymentInstruments() + { + return $this->container['paymentInstruments']; + } + + /** + * Sets paymentInstruments + * + * @param \Adyen\Model\ConfigurationWebhooks\PaymentInstrumentReference[]|null $paymentInstruments List of [payment instruments](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/paymentInstruments) associated with the balance account. + * + * @return self + */ + public function setPaymentInstruments($paymentInstruments) + { + if (is_null($paymentInstruments)) { + throw new \InvalidArgumentException('non-nullable paymentInstruments cannot be null'); + } + $this->container['paymentInstruments'] = $paymentInstruments; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the balance account, maximum 150 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the balance account, set to **Active** by default. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets sweepConfigurations + * + * @return array|null + */ + public function getSweepConfigurations() + { + return $this->container['sweepConfigurations']; + } + + /** + * Sets sweepConfigurations + * + * @param array|null $sweepConfigurations Contains key-value pairs that specify configurations for balance sweeps per currency code. A sweep pulls in or pushes out funds based on a defined schedule, amount, and a source (for pulling funds) or a destination (for pushing funds). The key must be a three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) in uppercase. For example, **EUR**. The value must be an object containing the sweep configuration. + * + * @return self + */ + public function setSweepConfigurations($sweepConfigurations) + { + if (is_null($sweepConfigurations)) { + throw new \InvalidArgumentException('non-nullable sweepConfigurations cannot be null'); + } + $this->container['sweepConfigurations'] = $sweepConfigurations; + + return $this; + } + + /** + * Gets timeZone + * + * @return string|null + */ + public function getTimeZone() + { + return $this->container['timeZone']; + } + + /** + * Sets timeZone + * + * @param string|null $timeZone The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * + * @return self + */ + public function setTimeZone($timeZone) + { + if (is_null($timeZone)) { + throw new \InvalidArgumentException('non-nullable timeZone cannot be null'); + } + $this->container['timeZone'] = $timeZone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.php b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.php new file mode 100644 index 000000000..7dc1eb02c --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.php @@ -0,0 +1,418 @@ + + */ +class BalanceAccountNotificationData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceAccountNotificationData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balanceAccount' => '\Adyen\Model\ConfigurationWebhooks\BalanceAccount', + 'balancePlatform' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balanceAccount' => null, + 'balancePlatform' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balanceAccount' => false, + 'balancePlatform' => 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 = [ + 'balanceAccount' => 'balanceAccount', + 'balancePlatform' => 'balancePlatform' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balanceAccount' => 'setBalanceAccount', + 'balancePlatform' => 'setBalancePlatform' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balanceAccount' => 'getBalanceAccount', + 'balancePlatform' => 'getBalancePlatform' + ]; + + /** + * 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('balanceAccount', $data ?? [], null); + $this->setIfExists('balancePlatform', $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 balanceAccount + * + * @return \Adyen\Model\ConfigurationWebhooks\BalanceAccount|null + */ + public function getBalanceAccount() + { + return $this->container['balanceAccount']; + } + + /** + * Sets balanceAccount + * + * @param \Adyen\Model\ConfigurationWebhooks\BalanceAccount|null $balanceAccount balanceAccount + * + * @return self + */ + public function setBalanceAccount($balanceAccount) + { + if (is_null($balanceAccount)) { + throw new \InvalidArgumentException('non-nullable balanceAccount cannot be null'); + } + $this->container['balanceAccount'] = $balanceAccount; + + return $this; + } + + /** + * Gets balancePlatform + * + * @return string|null + */ + public function getBalancePlatform() + { + return $this->container['balancePlatform']; + } + + /** + * Sets balancePlatform + * + * @param string|null $balancePlatform The unique identifier of the balance platform. + * + * @return self + */ + public function setBalancePlatform($balancePlatform) + { + if (is_null($balancePlatform)) { + throw new \InvalidArgumentException('non-nullable balancePlatform cannot be null'); + } + $this->container['balancePlatform'] = $balancePlatform; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.php new file mode 100644 index 000000000..35ede4461 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.php @@ -0,0 +1,494 @@ + + */ +class BalanceAccountNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceAccountNotificationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\ConfigurationWebhooks\BalanceAccountNotificationData', + 'environment' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'environment' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false, + 'environment' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'environment' => 'environment', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'environment' => 'setEnvironment', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'environment' => 'getEnvironment', + '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_UPDATED = 'balancePlatform.balanceAccount.updated'; + public const TYPE_CREATED = 'balancePlatform.balanceAccount.created'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_UPDATED, + self::TYPE_CREATED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['environment'] === null) { + $invalidProperties[] = "'environment' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\ConfigurationWebhooks\BalanceAccountNotificationData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\ConfigurationWebhooks\BalanceAccountNotificationData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets environment + * + * @return string + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param string $environment The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @return self + */ + public function setEnvironment($environment) + { + if (is_null($environment)) { + throw new \InvalidArgumentException('non-nullable environment cannot be null'); + } + $this->container['environment'] = $environment; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of webhook. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.php b/src/Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.php new file mode 100644 index 000000000..aefaa488b --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.php @@ -0,0 +1,384 @@ + + */ +class BalancePlatformNotificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalancePlatformNotificationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'notificationResponse' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'notificationResponse' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'notificationResponse' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'notificationResponse' => 'notificationResponse' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'notificationResponse' => 'setNotificationResponse' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'notificationResponse' => 'getNotificationResponse' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('notificationResponse', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets notificationResponse + * + * @return string|null + */ + public function getNotificationResponse() + { + return $this->container['notificationResponse']; + } + + /** + * Sets notificationResponse + * + * @param string|null $notificationResponse Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * + * @return self + */ + public function setNotificationResponse($notificationResponse) + { + if (is_null($notificationResponse)) { + throw new \InvalidArgumentException('non-nullable notificationResponse cannot be null'); + } + $this->container['notificationResponse'] = $notificationResponse; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/BulkAddress.php b/src/Adyen/Model/ConfigurationWebhooks/BulkAddress.php new file mode 100644 index 000000000..e6e0f52a2 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/BulkAddress.php @@ -0,0 +1,659 @@ + + */ +class BulkAddress implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BulkAddress'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'company' => 'string', + 'country' => 'string', + 'email' => 'string', + 'houseNumberOrName' => 'string', + 'mobile' => 'string', + 'postalCode' => 'string', + 'stateOrProvince' => 'string', + 'street' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'city' => null, + 'company' => null, + 'country' => null, + 'email' => null, + 'houseNumberOrName' => null, + 'mobile' => null, + 'postalCode' => null, + 'stateOrProvince' => null, + 'street' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'city' => false, + 'company' => false, + 'country' => false, + 'email' => false, + 'houseNumberOrName' => false, + 'mobile' => false, + 'postalCode' => false, + 'stateOrProvince' => false, + 'street' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'company' => 'company', + 'country' => 'country', + 'email' => 'email', + 'houseNumberOrName' => 'houseNumberOrName', + 'mobile' => 'mobile', + 'postalCode' => 'postalCode', + 'stateOrProvince' => 'stateOrProvince', + 'street' => 'street' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'company' => 'setCompany', + 'country' => 'setCountry', + 'email' => 'setEmail', + 'houseNumberOrName' => 'setHouseNumberOrName', + 'mobile' => 'setMobile', + 'postalCode' => 'setPostalCode', + 'stateOrProvince' => 'setStateOrProvince', + 'street' => 'setStreet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'company' => 'getCompany', + 'country' => 'getCountry', + 'email' => 'getEmail', + 'houseNumberOrName' => 'getHouseNumberOrName', + 'mobile' => 'getMobile', + 'postalCode' => 'getPostalCode', + 'stateOrProvince' => 'getStateOrProvince', + 'street' => 'getStreet' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('company', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('houseNumberOrName', $data ?? [], null); + $this->setIfExists('mobile', $data ?? [], null); + $this->setIfExists('postalCode', $data ?? [], null); + $this->setIfExists('stateOrProvince', $data ?? [], null); + $this->setIfExists('street', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['country'] === null) { + $invalidProperties[] = "'country' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city The name of the city. + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets company + * + * @return string|null + */ + public function getCompany() + { + return $this->container['company']; + } + + /** + * Sets company + * + * @param string|null $company The name of the company. + * + * @return self + */ + public function setCompany($company) + { + if (is_null($company)) { + throw new \InvalidArgumentException('non-nullable company cannot be null'); + } + $this->container['company'] = $company; + + return $this; + } + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country The two-character ISO-3166-1 alpha-2 country code. For example, **US**. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The email address. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets houseNumberOrName + * + * @return string|null + */ + public function getHouseNumberOrName() + { + return $this->container['houseNumberOrName']; + } + + /** + * Sets houseNumberOrName + * + * @param string|null $houseNumberOrName The house number or name. + * + * @return self + */ + public function setHouseNumberOrName($houseNumberOrName) + { + if (is_null($houseNumberOrName)) { + throw new \InvalidArgumentException('non-nullable houseNumberOrName cannot be null'); + } + $this->container['houseNumberOrName'] = $houseNumberOrName; + + return $this; + } + + /** + * Gets mobile + * + * @return string|null + */ + public function getMobile() + { + return $this->container['mobile']; + } + + /** + * Sets mobile + * + * @param string|null $mobile The full telephone number. + * + * @return self + */ + public function setMobile($mobile) + { + if (is_null($mobile)) { + throw new \InvalidArgumentException('non-nullable mobile cannot be null'); + } + $this->container['mobile'] = $mobile; + + return $this; + } + + /** + * Gets postalCode + * + * @return string|null + */ + public function getPostalCode() + { + return $this->container['postalCode']; + } + + /** + * Sets postalCode + * + * @param string|null $postalCode The postal code. Maximum length: * 5 digits for addresses in the US. * 10 characters for all other countries. + * + * @return self + */ + public function setPostalCode($postalCode) + { + if (is_null($postalCode)) { + throw new \InvalidArgumentException('non-nullable postalCode cannot be null'); + } + $this->container['postalCode'] = $postalCode; + + return $this; + } + + /** + * Gets stateOrProvince + * + * @return string|null + */ + public function getStateOrProvince() + { + return $this->container['stateOrProvince']; + } + + /** + * Sets stateOrProvince + * + * @param string|null $stateOrProvince The two-letter ISO 3166-2 state or province code. Maximum length: 2 characters for addresses in the US. + * + * @return self + */ + public function setStateOrProvince($stateOrProvince) + { + if (is_null($stateOrProvince)) { + throw new \InvalidArgumentException('non-nullable stateOrProvince cannot be null'); + } + $this->container['stateOrProvince'] = $stateOrProvince; + + return $this; + } + + /** + * Gets street + * + * @return string|null + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string|null $street The streetname of the house. + * + * @return self + */ + public function setStreet($street) + { + if (is_null($street)) { + throw new \InvalidArgumentException('non-nullable street cannot be null'); + } + $this->container['street'] = $street; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php b/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php new file mode 100644 index 000000000..b97ff5fc9 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.php @@ -0,0 +1,580 @@ + + */ +class CapabilitySettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CapabilitySettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amountPerIndustry' => 'array', + 'authorizedCardUsers' => 'bool', + 'fundingSource' => 'string[]', + 'interval' => 'string', + 'maxAmount' => '\Adyen\Model\ConfigurationWebhooks\Amount' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amountPerIndustry' => null, + 'authorizedCardUsers' => null, + 'fundingSource' => null, + 'interval' => null, + 'maxAmount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amountPerIndustry' => false, + 'authorizedCardUsers' => false, + 'fundingSource' => false, + 'interval' => false, + 'maxAmount' => 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 = [ + 'amountPerIndustry' => 'amountPerIndustry', + 'authorizedCardUsers' => 'authorizedCardUsers', + 'fundingSource' => 'fundingSource', + 'interval' => 'interval', + 'maxAmount' => 'maxAmount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amountPerIndustry' => 'setAmountPerIndustry', + 'authorizedCardUsers' => 'setAuthorizedCardUsers', + 'fundingSource' => 'setFundingSource', + 'interval' => 'setInterval', + 'maxAmount' => 'setMaxAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amountPerIndustry' => 'getAmountPerIndustry', + 'authorizedCardUsers' => 'getAuthorizedCardUsers', + 'fundingSource' => 'getFundingSource', + 'interval' => 'getInterval', + 'maxAmount' => 'getMaxAmount' + ]; + + /** + * 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 FUNDING_SOURCE_CREDIT = 'credit'; + public const FUNDING_SOURCE_DEBIT = 'debit'; + public const FUNDING_SOURCE_PREPAID = 'prepaid'; + public const INTERVAL_DAILY = 'daily'; + public const INTERVAL_MONTHLY = 'monthly'; + public const INTERVAL_WEEKLY = 'weekly'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFundingSourceAllowableValues() + { + return [ + self::FUNDING_SOURCE_CREDIT, + self::FUNDING_SOURCE_DEBIT, + self::FUNDING_SOURCE_PREPAID, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getIntervalAllowableValues() + { + return [ + self::INTERVAL_DAILY, + self::INTERVAL_MONTHLY, + self::INTERVAL_WEEKLY, + ]; + } + /** + * 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('amountPerIndustry', $data ?? [], null); + $this->setIfExists('authorizedCardUsers', $data ?? [], null); + $this->setIfExists('fundingSource', $data ?? [], null); + $this->setIfExists('interval', $data ?? [], null); + $this->setIfExists('maxAmount', $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->getIntervalAllowableValues(); + if (!is_null($this->container['interval']) && !in_array($this->container['interval'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'interval', must be one of '%s'", + $this->container['interval'], + 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 amountPerIndustry + * + * @return array|null + */ + public function getAmountPerIndustry() + { + return $this->container['amountPerIndustry']; + } + + /** + * Sets amountPerIndustry + * + * @param array|null $amountPerIndustry + * + * @return self + */ + public function setAmountPerIndustry($amountPerIndustry) + { + if (is_null($amountPerIndustry)) { + throw new \InvalidArgumentException('non-nullable amountPerIndustry cannot be null'); + } + $this->container['amountPerIndustry'] = $amountPerIndustry; + + return $this; + } + + /** + * Gets authorizedCardUsers + * + * @return bool|null + */ + public function getAuthorizedCardUsers() + { + return $this->container['authorizedCardUsers']; + } + + /** + * Sets authorizedCardUsers + * + * @param bool|null $authorizedCardUsers + * + * @return self + */ + public function setAuthorizedCardUsers($authorizedCardUsers) + { + if (is_null($authorizedCardUsers)) { + throw new \InvalidArgumentException('non-nullable authorizedCardUsers cannot be null'); + } + $this->container['authorizedCardUsers'] = $authorizedCardUsers; + + return $this; + } + + /** + * Gets fundingSource + * + * @return string[]|null + */ + public function getFundingSource() + { + return $this->container['fundingSource']; + } + + /** + * Sets fundingSource + * + * @param string[]|null $fundingSource + * + * @return self + */ + public function setFundingSource($fundingSource) + { + if (is_null($fundingSource)) { + throw new \InvalidArgumentException('non-nullable fundingSource cannot be null'); + } + $allowedValues = $this->getFundingSourceAllowableValues(); + if (array_diff($fundingSource, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'fundingSource', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['fundingSource'] = $fundingSource; + + return $this; + } + + /** + * Gets interval + * + * @return string|null + */ + public function getInterval() + { + return $this->container['interval']; + } + + /** + * Sets interval + * + * @param string|null $interval + * + * @return self + */ + public function setInterval($interval) + { + if (is_null($interval)) { + throw new \InvalidArgumentException('non-nullable interval cannot be null'); + } + $allowedValues = $this->getIntervalAllowableValues(); + if (!in_array($interval, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'interval', must be one of '%s'", + $interval, + implode("', '", $allowedValues) + ) + ); + } + $this->container['interval'] = $interval; + + return $this; + } + + /** + * Gets maxAmount + * + * @return \Adyen\Model\ConfigurationWebhooks\Amount|null + */ + public function getMaxAmount() + { + return $this->container['maxAmount']; + } + + /** + * Sets maxAmount + * + * @param \Adyen\Model\ConfigurationWebhooks\Amount|null $maxAmount maxAmount + * + * @return self + */ + public function setMaxAmount($maxAmount) + { + if (is_null($maxAmount)) { + throw new \InvalidArgumentException('non-nullable maxAmount cannot be null'); + } + $this->container['maxAmount'] = $maxAmount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/Card.php b/src/Adyen/Model/ConfigurationWebhooks/Card.php new file mode 100644 index 000000000..f677486a9 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/Card.php @@ -0,0 +1,808 @@ + + */ +class Card implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Card'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authentication' => '\Adyen\Model\ConfigurationWebhooks\Authentication', + 'bin' => 'string', + 'brand' => 'string', + 'brandVariant' => 'string', + 'cardholderName' => 'string', + 'configuration' => '\Adyen\Model\ConfigurationWebhooks\CardConfiguration', + 'cvc' => 'string', + 'deliveryContact' => '\Adyen\Model\ConfigurationWebhooks\Contact', + 'expiration' => '\Adyen\Model\ConfigurationWebhooks\Expiry', + 'formFactor' => 'string', + 'lastFour' => 'string', + 'number' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authentication' => null, + 'bin' => null, + 'brand' => null, + 'brandVariant' => null, + 'cardholderName' => null, + 'configuration' => null, + 'cvc' => null, + 'deliveryContact' => null, + 'expiration' => null, + 'formFactor' => null, + 'lastFour' => null, + 'number' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authentication' => false, + 'bin' => false, + 'brand' => false, + 'brandVariant' => false, + 'cardholderName' => false, + 'configuration' => false, + 'cvc' => false, + 'deliveryContact' => false, + 'expiration' => false, + 'formFactor' => false, + 'lastFour' => false, + 'number' => 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 = [ + 'authentication' => 'authentication', + 'bin' => 'bin', + 'brand' => 'brand', + 'brandVariant' => 'brandVariant', + 'cardholderName' => 'cardholderName', + 'configuration' => 'configuration', + 'cvc' => 'cvc', + 'deliveryContact' => 'deliveryContact', + 'expiration' => 'expiration', + 'formFactor' => 'formFactor', + 'lastFour' => 'lastFour', + 'number' => 'number' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authentication' => 'setAuthentication', + 'bin' => 'setBin', + 'brand' => 'setBrand', + 'brandVariant' => 'setBrandVariant', + 'cardholderName' => 'setCardholderName', + 'configuration' => 'setConfiguration', + 'cvc' => 'setCvc', + 'deliveryContact' => 'setDeliveryContact', + 'expiration' => 'setExpiration', + 'formFactor' => 'setFormFactor', + 'lastFour' => 'setLastFour', + 'number' => 'setNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authentication' => 'getAuthentication', + 'bin' => 'getBin', + 'brand' => 'getBrand', + 'brandVariant' => 'getBrandVariant', + 'cardholderName' => 'getCardholderName', + 'configuration' => 'getConfiguration', + 'cvc' => 'getCvc', + 'deliveryContact' => 'getDeliveryContact', + 'expiration' => 'getExpiration', + 'formFactor' => 'getFormFactor', + 'lastFour' => 'getLastFour', + 'number' => 'getNumber' + ]; + + /** + * 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 FORM_FACTOR_PHYSICAL = 'physical'; + public const FORM_FACTOR_UNKNOWN = 'unknown'; + public const FORM_FACTOR_VIRTUAL = 'virtual'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFormFactorAllowableValues() + { + return [ + self::FORM_FACTOR_PHYSICAL, + self::FORM_FACTOR_UNKNOWN, + self::FORM_FACTOR_VIRTUAL, + ]; + } + /** + * 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('authentication', $data ?? [], null); + $this->setIfExists('bin', $data ?? [], null); + $this->setIfExists('brand', $data ?? [], null); + $this->setIfExists('brandVariant', $data ?? [], null); + $this->setIfExists('cardholderName', $data ?? [], null); + $this->setIfExists('configuration', $data ?? [], null); + $this->setIfExists('cvc', $data ?? [], null); + $this->setIfExists('deliveryContact', $data ?? [], null); + $this->setIfExists('expiration', $data ?? [], null); + $this->setIfExists('formFactor', $data ?? [], null); + $this->setIfExists('lastFour', $data ?? [], null); + $this->setIfExists('number', $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['brand'] === null) { + $invalidProperties[] = "'brand' can't be null"; + } + if ($this->container['brandVariant'] === null) { + $invalidProperties[] = "'brandVariant' can't be null"; + } + if ($this->container['cardholderName'] === null) { + $invalidProperties[] = "'cardholderName' can't be null"; + } + if ($this->container['formFactor'] === null) { + $invalidProperties[] = "'formFactor' can't be null"; + } + $allowedValues = $this->getFormFactorAllowableValues(); + if (!is_null($this->container['formFactor']) && !in_array($this->container['formFactor'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'formFactor', must be one of '%s'", + $this->container['formFactor'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['number'] === null) { + $invalidProperties[] = "'number' 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 authentication + * + * @return \Adyen\Model\ConfigurationWebhooks\Authentication|null + */ + public function getAuthentication() + { + return $this->container['authentication']; + } + + /** + * Sets authentication + * + * @param \Adyen\Model\ConfigurationWebhooks\Authentication|null $authentication authentication + * + * @return self + */ + public function setAuthentication($authentication) + { + if (is_null($authentication)) { + throw new \InvalidArgumentException('non-nullable authentication cannot be null'); + } + $this->container['authentication'] = $authentication; + + return $this; + } + + /** + * Gets bin + * + * @return string|null + */ + public function getBin() + { + return $this->container['bin']; + } + + /** + * Sets bin + * + * @param string|null $bin The bank identification number (BIN) of the card number. + * + * @return self + */ + public function setBin($bin) + { + if (is_null($bin)) { + throw new \InvalidArgumentException('non-nullable bin cannot be null'); + } + $this->container['bin'] = $bin; + + return $this; + } + + /** + * Gets brand + * + * @return string + */ + public function getBrand() + { + return $this->container['brand']; + } + + /** + * Sets brand + * + * @param string $brand The brand of the physical or the virtual card. Possible values: **visa**, **mc**. + * + * @return self + */ + public function setBrand($brand) + { + if (is_null($brand)) { + throw new \InvalidArgumentException('non-nullable brand cannot be null'); + } + $this->container['brand'] = $brand; + + return $this; + } + + /** + * Gets brandVariant + * + * @return string + */ + public function getBrandVariant() + { + return $this->container['brandVariant']; + } + + /** + * Sets brandVariant + * + * @param string $brandVariant The brand variant of the physical or the virtual card. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**. + * + * @return self + */ + public function setBrandVariant($brandVariant) + { + if (is_null($brandVariant)) { + throw new \InvalidArgumentException('non-nullable brandVariant cannot be null'); + } + $this->container['brandVariant'] = $brandVariant; + + return $this; + } + + /** + * Gets cardholderName + * + * @return string + */ + public function getCardholderName() + { + return $this->container['cardholderName']; + } + + /** + * Sets cardholderName + * + * @param string $cardholderName The name of the cardholder. Maximum length: 26 characters. + * + * @return self + */ + public function setCardholderName($cardholderName) + { + if (is_null($cardholderName)) { + throw new \InvalidArgumentException('non-nullable cardholderName cannot be null'); + } + $this->container['cardholderName'] = $cardholderName; + + return $this; + } + + /** + * Gets configuration + * + * @return \Adyen\Model\ConfigurationWebhooks\CardConfiguration|null + */ + public function getConfiguration() + { + return $this->container['configuration']; + } + + /** + * Sets configuration + * + * @param \Adyen\Model\ConfigurationWebhooks\CardConfiguration|null $configuration configuration + * + * @return self + */ + public function setConfiguration($configuration) + { + if (is_null($configuration)) { + throw new \InvalidArgumentException('non-nullable configuration cannot be null'); + } + $this->container['configuration'] = $configuration; + + return $this; + } + + /** + * Gets cvc + * + * @return string|null + */ + public function getCvc() + { + return $this->container['cvc']; + } + + /** + * Sets cvc + * + * @param string|null $cvc The CVC2 value of the card. > The CVC2 is not sent by default. This is only returned in the `POST` response for single-use virtual cards. + * + * @return self + */ + public function setCvc($cvc) + { + if (is_null($cvc)) { + throw new \InvalidArgumentException('non-nullable cvc cannot be null'); + } + $this->container['cvc'] = $cvc; + + return $this; + } + + /** + * Gets deliveryContact + * + * @return \Adyen\Model\ConfigurationWebhooks\Contact|null + */ + public function getDeliveryContact() + { + return $this->container['deliveryContact']; + } + + /** + * Sets deliveryContact + * + * @param \Adyen\Model\ConfigurationWebhooks\Contact|null $deliveryContact deliveryContact + * + * @return self + */ + public function setDeliveryContact($deliveryContact) + { + if (is_null($deliveryContact)) { + throw new \InvalidArgumentException('non-nullable deliveryContact cannot be null'); + } + $this->container['deliveryContact'] = $deliveryContact; + + return $this; + } + + /** + * Gets expiration + * + * @return \Adyen\Model\ConfigurationWebhooks\Expiry|null + */ + public function getExpiration() + { + return $this->container['expiration']; + } + + /** + * Sets expiration + * + * @param \Adyen\Model\ConfigurationWebhooks\Expiry|null $expiration expiration + * + * @return self + */ + public function setExpiration($expiration) + { + if (is_null($expiration)) { + throw new \InvalidArgumentException('non-nullable expiration cannot be null'); + } + $this->container['expiration'] = $expiration; + + return $this; + } + + /** + * Gets formFactor + * + * @return string + */ + public function getFormFactor() + { + return $this->container['formFactor']; + } + + /** + * Sets formFactor + * + * @param string $formFactor The form factor of the card. Possible values: **virtual**, **physical**. + * + * @return self + */ + public function setFormFactor($formFactor) + { + if (is_null($formFactor)) { + throw new \InvalidArgumentException('non-nullable formFactor cannot be null'); + } + $allowedValues = $this->getFormFactorAllowableValues(); + if (!in_array($formFactor, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'formFactor', must be one of '%s'", + $formFactor, + implode("', '", $allowedValues) + ) + ); + } + $this->container['formFactor'] = $formFactor; + + return $this; + } + + /** + * Gets lastFour + * + * @return string|null + */ + public function getLastFour() + { + return $this->container['lastFour']; + } + + /** + * Sets lastFour + * + * @param string|null $lastFour Last last four digits of the card number. + * + * @return self + */ + public function setLastFour($lastFour) + { + if (is_null($lastFour)) { + throw new \InvalidArgumentException('non-nullable lastFour cannot be null'); + } + $this->container['lastFour'] = $lastFour; + + return $this; + } + + /** + * Gets number + * + * @return string + */ + public function getNumber() + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string $number The primary account number (PAN) of the card. > The PAN is masked by default and returned only for single-use virtual cards. + * + * @return self + */ + public function setNumber($number) + { + if (is_null($number)) { + throw new \InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/CardConfiguration.php b/src/Adyen/Model/ConfigurationWebhooks/CardConfiguration.php new file mode 100644 index 000000000..a051cdcc8 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/CardConfiguration.php @@ -0,0 +1,829 @@ + + */ +class CardConfiguration implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CardConfiguration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'activation' => 'string', + 'activationUrl' => 'string', + 'bulkAddress' => '\Adyen\Model\ConfigurationWebhooks\BulkAddress', + 'cardImageId' => 'string', + 'carrier' => 'string', + 'carrierImageId' => 'string', + 'configurationProfileId' => 'string', + 'currency' => 'string', + 'envelope' => 'string', + 'insert' => 'string', + 'language' => 'string', + 'logoImageId' => 'string', + 'pinMailer' => 'string', + 'shipmentMethod' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'activation' => null, + 'activationUrl' => null, + 'bulkAddress' => null, + 'cardImageId' => null, + 'carrier' => null, + 'carrierImageId' => null, + 'configurationProfileId' => null, + 'currency' => null, + 'envelope' => null, + 'insert' => null, + 'language' => null, + 'logoImageId' => null, + 'pinMailer' => null, + 'shipmentMethod' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'activation' => false, + 'activationUrl' => false, + 'bulkAddress' => false, + 'cardImageId' => false, + 'carrier' => false, + 'carrierImageId' => false, + 'configurationProfileId' => false, + 'currency' => false, + 'envelope' => false, + 'insert' => false, + 'language' => false, + 'logoImageId' => false, + 'pinMailer' => false, + 'shipmentMethod' => 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 = [ + 'activation' => 'activation', + 'activationUrl' => 'activationUrl', + 'bulkAddress' => 'bulkAddress', + 'cardImageId' => 'cardImageId', + 'carrier' => 'carrier', + 'carrierImageId' => 'carrierImageId', + 'configurationProfileId' => 'configurationProfileId', + 'currency' => 'currency', + 'envelope' => 'envelope', + 'insert' => 'insert', + 'language' => 'language', + 'logoImageId' => 'logoImageId', + 'pinMailer' => 'pinMailer', + 'shipmentMethod' => 'shipmentMethod' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'activation' => 'setActivation', + 'activationUrl' => 'setActivationUrl', + 'bulkAddress' => 'setBulkAddress', + 'cardImageId' => 'setCardImageId', + 'carrier' => 'setCarrier', + 'carrierImageId' => 'setCarrierImageId', + 'configurationProfileId' => 'setConfigurationProfileId', + 'currency' => 'setCurrency', + 'envelope' => 'setEnvelope', + 'insert' => 'setInsert', + 'language' => 'setLanguage', + 'logoImageId' => 'setLogoImageId', + 'pinMailer' => 'setPinMailer', + 'shipmentMethod' => 'setShipmentMethod' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'activation' => 'getActivation', + 'activationUrl' => 'getActivationUrl', + 'bulkAddress' => 'getBulkAddress', + 'cardImageId' => 'getCardImageId', + 'carrier' => 'getCarrier', + 'carrierImageId' => 'getCarrierImageId', + 'configurationProfileId' => 'getConfigurationProfileId', + 'currency' => 'getCurrency', + 'envelope' => 'getEnvelope', + 'insert' => 'getInsert', + 'language' => 'getLanguage', + 'logoImageId' => 'getLogoImageId', + 'pinMailer' => 'getPinMailer', + 'shipmentMethod' => 'getShipmentMethod' + ]; + + /** + * 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('activation', $data ?? [], null); + $this->setIfExists('activationUrl', $data ?? [], null); + $this->setIfExists('bulkAddress', $data ?? [], null); + $this->setIfExists('cardImageId', $data ?? [], null); + $this->setIfExists('carrier', $data ?? [], null); + $this->setIfExists('carrierImageId', $data ?? [], null); + $this->setIfExists('configurationProfileId', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('envelope', $data ?? [], null); + $this->setIfExists('insert', $data ?? [], null); + $this->setIfExists('language', $data ?? [], null); + $this->setIfExists('logoImageId', $data ?? [], null); + $this->setIfExists('pinMailer', $data ?? [], null); + $this->setIfExists('shipmentMethod', $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['configurationProfileId'] === null) { + $invalidProperties[] = "'configurationProfileId' 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 activation + * + * @return string|null + */ + public function getActivation() + { + return $this->container['activation']; + } + + /** + * Sets activation + * + * @param string|null $activation Overrides the activation label design ID defined in the `configurationProfileId`. The activation label is attached to the card and contains the activation instructions. + * + * @return self + */ + public function setActivation($activation) + { + if (is_null($activation)) { + throw new \InvalidArgumentException('non-nullable activation cannot be null'); + } + $this->container['activation'] = $activation; + + return $this; + } + + /** + * Gets activationUrl + * + * @return string|null + */ + public function getActivationUrl() + { + return $this->container['activationUrl']; + } + + /** + * Sets activationUrl + * + * @param string|null $activationUrl Your app's URL, if you want to activate cards through your app. For example, **my-app://ref1236a7d**. A QR code is created based on this URL, and is included in the carrier. Before you use this field, reach out to your Adyen contact to set up the QR code process. Maximum length: 255 characters. + * + * @return self + */ + public function setActivationUrl($activationUrl) + { + if (is_null($activationUrl)) { + throw new \InvalidArgumentException('non-nullable activationUrl cannot be null'); + } + $this->container['activationUrl'] = $activationUrl; + + return $this; + } + + /** + * Gets bulkAddress + * + * @return \Adyen\Model\ConfigurationWebhooks\BulkAddress|null + */ + public function getBulkAddress() + { + return $this->container['bulkAddress']; + } + + /** + * Sets bulkAddress + * + * @param \Adyen\Model\ConfigurationWebhooks\BulkAddress|null $bulkAddress bulkAddress + * + * @return self + */ + public function setBulkAddress($bulkAddress) + { + if (is_null($bulkAddress)) { + throw new \InvalidArgumentException('non-nullable bulkAddress cannot be null'); + } + $this->container['bulkAddress'] = $bulkAddress; + + return $this; + } + + /** + * Gets cardImageId + * + * @return string|null + */ + public function getCardImageId() + { + return $this->container['cardImageId']; + } + + /** + * Sets cardImageId + * + * @param string|null $cardImageId The ID of the card image. This is the image that will be printed on the full front of the card. + * + * @return self + */ + public function setCardImageId($cardImageId) + { + if (is_null($cardImageId)) { + throw new \InvalidArgumentException('non-nullable cardImageId cannot be null'); + } + $this->container['cardImageId'] = $cardImageId; + + return $this; + } + + /** + * Gets carrier + * + * @return string|null + */ + public function getCarrier() + { + return $this->container['carrier']; + } + + /** + * Sets carrier + * + * @param string|null $carrier Overrides the carrier design ID defined in the `configurationProfileId`. The carrier is the letter or packaging to which the card is attached. + * + * @return self + */ + public function setCarrier($carrier) + { + if (is_null($carrier)) { + throw new \InvalidArgumentException('non-nullable carrier cannot be null'); + } + $this->container['carrier'] = $carrier; + + return $this; + } + + /** + * Gets carrierImageId + * + * @return string|null + */ + public function getCarrierImageId() + { + return $this->container['carrierImageId']; + } + + /** + * Sets carrierImageId + * + * @param string|null $carrierImageId The ID of the carrier image. This is the image that will printed on the letter to which the card is attached. + * + * @return self + */ + public function setCarrierImageId($carrierImageId) + { + if (is_null($carrierImageId)) { + throw new \InvalidArgumentException('non-nullable carrierImageId cannot be null'); + } + $this->container['carrierImageId'] = $carrierImageId; + + return $this; + } + + /** + * Gets configurationProfileId + * + * @return string + */ + public function getConfigurationProfileId() + { + return $this->container['configurationProfileId']; + } + + /** + * Sets configurationProfileId + * + * @param string $configurationProfileId The ID of the card configuration profile that contains the settings of the card. For example, the envelope and PIN mailer designs or the logistics company handling the shipment. All the settings in the profile are applied to the card, unless you provide other fields to override them. For example, send the `shipmentMethod` to override the logistics company defined in the card configuration profile. + * + * @return self + */ + public function setConfigurationProfileId($configurationProfileId) + { + if (is_null($configurationProfileId)) { + throw new \InvalidArgumentException('non-nullable configurationProfileId cannot be null'); + } + $this->container['configurationProfileId'] = $configurationProfileId; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. For example, **EUR**. + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets envelope + * + * @return string|null + */ + public function getEnvelope() + { + return $this->container['envelope']; + } + + /** + * Sets envelope + * + * @param string|null $envelope Overrides the envelope design ID defined in the `configurationProfileId`. + * + * @return self + */ + public function setEnvelope($envelope) + { + if (is_null($envelope)) { + throw new \InvalidArgumentException('non-nullable envelope cannot be null'); + } + $this->container['envelope'] = $envelope; + + return $this; + } + + /** + * Gets insert + * + * @return string|null + */ + public function getInsert() + { + return $this->container['insert']; + } + + /** + * Sets insert + * + * @param string|null $insert Overrides the insert design ID defined in the `configurationProfileId`. An insert is any additional material, such as marketing materials, that are shipped together with the card. + * + * @return self + */ + public function setInsert($insert) + { + if (is_null($insert)) { + throw new \InvalidArgumentException('non-nullable insert cannot be null'); + } + $this->container['insert'] = $insert; + + return $this; + } + + /** + * Gets language + * + * @return string|null + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string|null $language The two-letter [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code of the card. For example, **en**. + * + * @return self + */ + public function setLanguage($language) + { + if (is_null($language)) { + throw new \InvalidArgumentException('non-nullable language cannot be null'); + } + $this->container['language'] = $language; + + return $this; + } + + /** + * Gets logoImageId + * + * @return string|null + */ + public function getLogoImageId() + { + return $this->container['logoImageId']; + } + + /** + * Sets logoImageId + * + * @param string|null $logoImageId The ID of the logo image. This is the image that will be printed on the partial front of the card, such as a logo on the upper right corner. + * + * @return self + */ + public function setLogoImageId($logoImageId) + { + if (is_null($logoImageId)) { + throw new \InvalidArgumentException('non-nullable logoImageId cannot be null'); + } + $this->container['logoImageId'] = $logoImageId; + + return $this; + } + + /** + * Gets pinMailer + * + * @return string|null + */ + public function getPinMailer() + { + return $this->container['pinMailer']; + } + + /** + * Sets pinMailer + * + * @param string|null $pinMailer Overrides the PIN mailer design ID defined in the `configurationProfileId`. The PIN mailer is the letter on which the PIN is printed. + * + * @return self + */ + public function setPinMailer($pinMailer) + { + if (is_null($pinMailer)) { + throw new \InvalidArgumentException('non-nullable pinMailer cannot be null'); + } + $this->container['pinMailer'] = $pinMailer; + + return $this; + } + + /** + * Gets shipmentMethod + * + * @return string|null + */ + public function getShipmentMethod() + { + return $this->container['shipmentMethod']; + } + + /** + * Sets shipmentMethod + * + * @param string|null $shipmentMethod Overrides the logistics company defined in the `configurationProfileId`. + * + * @return self + */ + public function setShipmentMethod($shipmentMethod) + { + if (is_null($shipmentMethod)) { + throw new \InvalidArgumentException('non-nullable shipmentMethod cannot be null'); + } + $this->container['shipmentMethod'] = $shipmentMethod; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/CardOrderItem.php b/src/Adyen/Model/ConfigurationWebhooks/CardOrderItem.php new file mode 100644 index 000000000..1d432fc03 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/CardOrderItem.php @@ -0,0 +1,622 @@ + + */ +class CardOrderItem implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CardOrderItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balancePlatform' => 'string', + 'card' => '\Adyen\Model\ConfigurationWebhooks\CardOrderItemDeliveryStatus', + 'cardOrderItemId' => 'string', + 'creationDate' => '\DateTime', + 'id' => 'string', + 'paymentInstrumentId' => 'string', + 'pin' => '\Adyen\Model\ConfigurationWebhooks\CardOrderItemDeliveryStatus', + 'shippingMethod' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balancePlatform' => null, + 'card' => null, + 'cardOrderItemId' => null, + 'creationDate' => 'date-time', + 'id' => null, + 'paymentInstrumentId' => null, + 'pin' => null, + 'shippingMethod' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balancePlatform' => false, + 'card' => false, + 'cardOrderItemId' => false, + 'creationDate' => false, + 'id' => false, + 'paymentInstrumentId' => false, + 'pin' => false, + 'shippingMethod' => 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 = [ + 'balancePlatform' => 'balancePlatform', + 'card' => 'card', + 'cardOrderItemId' => 'cardOrderItemId', + 'creationDate' => 'creationDate', + 'id' => 'id', + 'paymentInstrumentId' => 'paymentInstrumentId', + 'pin' => 'pin', + 'shippingMethod' => 'shippingMethod' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balancePlatform' => 'setBalancePlatform', + 'card' => 'setCard', + 'cardOrderItemId' => 'setCardOrderItemId', + 'creationDate' => 'setCreationDate', + 'id' => 'setId', + 'paymentInstrumentId' => 'setPaymentInstrumentId', + 'pin' => 'setPin', + 'shippingMethod' => 'setShippingMethod' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balancePlatform' => 'getBalancePlatform', + 'card' => 'getCard', + 'cardOrderItemId' => 'getCardOrderItemId', + 'creationDate' => 'getCreationDate', + 'id' => 'getId', + 'paymentInstrumentId' => 'getPaymentInstrumentId', + 'pin' => 'getPin', + 'shippingMethod' => 'getShippingMethod' + ]; + + /** + * 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('balancePlatform', $data ?? [], null); + $this->setIfExists('card', $data ?? [], null); + $this->setIfExists('cardOrderItemId', $data ?? [], null); + $this->setIfExists('creationDate', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('paymentInstrumentId', $data ?? [], null); + $this->setIfExists('pin', $data ?? [], null); + $this->setIfExists('shippingMethod', $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 balancePlatform + * + * @return string|null + */ + public function getBalancePlatform() + { + return $this->container['balancePlatform']; + } + + /** + * Sets balancePlatform + * + * @param string|null $balancePlatform The unique identifier of the balance platform. + * + * @return self + */ + public function setBalancePlatform($balancePlatform) + { + if (is_null($balancePlatform)) { + throw new \InvalidArgumentException('non-nullable balancePlatform cannot be null'); + } + $this->container['balancePlatform'] = $balancePlatform; + + return $this; + } + + /** + * Gets card + * + * @return \Adyen\Model\ConfigurationWebhooks\CardOrderItemDeliveryStatus|null + */ + public function getCard() + { + return $this->container['card']; + } + + /** + * Sets card + * + * @param \Adyen\Model\ConfigurationWebhooks\CardOrderItemDeliveryStatus|null $card card + * + * @return self + */ + public function setCard($card) + { + if (is_null($card)) { + throw new \InvalidArgumentException('non-nullable card cannot be null'); + } + $this->container['card'] = $card; + + return $this; + } + + /** + * Gets cardOrderItemId + * + * @return string|null + */ + public function getCardOrderItemId() + { + return $this->container['cardOrderItemId']; + } + + /** + * Sets cardOrderItemId + * + * @param string|null $cardOrderItemId The unique identifier of the card order item. + * + * @return self + */ + public function setCardOrderItemId($cardOrderItemId) + { + if (is_null($cardOrderItemId)) { + throw new \InvalidArgumentException('non-nullable cardOrderItemId cannot be null'); + } + $this->container['cardOrderItemId'] = $cardOrderItemId; + + return $this; + } + + /** + * Gets creationDate + * + * @return \DateTime|null + */ + public function getCreationDate() + { + return $this->container['creationDate']; + } + + /** + * Sets creationDate + * + * @param \DateTime|null $creationDate The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + * + * @return self + */ + public function setCreationDate($creationDate) + { + if (is_null($creationDate)) { + throw new \InvalidArgumentException('non-nullable creationDate cannot be null'); + } + $this->container['creationDate'] = $creationDate; + + 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) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets paymentInstrumentId + * + * @return string|null + */ + public function getPaymentInstrumentId() + { + return $this->container['paymentInstrumentId']; + } + + /** + * Sets paymentInstrumentId + * + * @param string|null $paymentInstrumentId The unique identifier of the payment instrument related to the card order item. + * + * @return self + */ + public function setPaymentInstrumentId($paymentInstrumentId) + { + if (is_null($paymentInstrumentId)) { + throw new \InvalidArgumentException('non-nullable paymentInstrumentId cannot be null'); + } + $this->container['paymentInstrumentId'] = $paymentInstrumentId; + + return $this; + } + + /** + * Gets pin + * + * @return \Adyen\Model\ConfigurationWebhooks\CardOrderItemDeliveryStatus|null + */ + public function getPin() + { + return $this->container['pin']; + } + + /** + * Sets pin + * + * @param \Adyen\Model\ConfigurationWebhooks\CardOrderItemDeliveryStatus|null $pin pin + * + * @return self + */ + public function setPin($pin) + { + if (is_null($pin)) { + throw new \InvalidArgumentException('non-nullable pin cannot be null'); + } + $this->container['pin'] = $pin; + + return $this; + } + + /** + * Gets shippingMethod + * + * @return string|null + */ + public function getShippingMethod() + { + return $this->container['shippingMethod']; + } + + /** + * Sets shippingMethod + * + * @param string|null $shippingMethod Shipping method used to deliver the card or the PIN. + * + * @return self + */ + public function setShippingMethod($shippingMethod) + { + if (is_null($shippingMethod)) { + throw new \InvalidArgumentException('non-nullable shippingMethod cannot be null'); + } + $this->container['shippingMethod'] = $shippingMethod; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.php b/src/Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.php new file mode 100644 index 000000000..57d3f8527 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.php @@ -0,0 +1,529 @@ + + */ +class CardOrderItemDeliveryStatus implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CardOrderItemDeliveryStatus'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'statusError' => 'string', + 'statusErrorMessage' => 'string', + 'trackingNumber' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'statusError' => null, + 'statusErrorMessage' => null, + 'trackingNumber' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'status' => false, + 'statusError' => false, + 'statusErrorMessage' => false, + 'trackingNumber' => 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 = [ + 'status' => 'status', + 'statusError' => 'statusError', + 'statusErrorMessage' => 'statusErrorMessage', + 'trackingNumber' => 'trackingNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'statusError' => 'setStatusError', + 'statusErrorMessage' => 'setStatusErrorMessage', + 'trackingNumber' => 'setTrackingNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'statusError' => 'getStatusError', + 'statusErrorMessage' => 'getStatusErrorMessage', + 'trackingNumber' => 'getTrackingNumber' + ]; + + /** + * 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 STATUS_CREATED = 'created'; + public const STATUS_DELIVERED = 'delivered'; + public const STATUS_PROCESSING = 'processing'; + public const STATUS_PRODUCED = 'produced'; + public const STATUS_REJECTED = 'rejected'; + public const STATUS_SHIPPED = 'shipped'; + public const STATUS_UNKNOWN = 'unknown'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_CREATED, + self::STATUS_DELIVERED, + self::STATUS_PROCESSING, + self::STATUS_PRODUCED, + self::STATUS_REJECTED, + self::STATUS_SHIPPED, + self::STATUS_UNKNOWN, + ]; + } + /** + * 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('status', $data ?? [], null); + $this->setIfExists('statusError', $data ?? [], null); + $this->setIfExists('statusErrorMessage', $data ?? [], null); + $this->setIfExists('trackingNumber', $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->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + 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 status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status Status of the delivery. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets statusError + * + * @return string|null + */ + public function getStatusError() + { + return $this->container['statusError']; + } + + /** + * Sets statusError + * + * @param string|null $statusError Error status, if any. + * + * @return self + */ + public function setStatusError($statusError) + { + if (is_null($statusError)) { + throw new \InvalidArgumentException('non-nullable statusError cannot be null'); + } + $this->container['statusError'] = $statusError; + + return $this; + } + + /** + * Gets statusErrorMessage + * + * @return string|null + */ + public function getStatusErrorMessage() + { + return $this->container['statusErrorMessage']; + } + + /** + * Sets statusErrorMessage + * + * @param string|null $statusErrorMessage Error message, if any. + * + * @return self + */ + public function setStatusErrorMessage($statusErrorMessage) + { + if (is_null($statusErrorMessage)) { + throw new \InvalidArgumentException('non-nullable statusErrorMessage cannot be null'); + } + $this->container['statusErrorMessage'] = $statusErrorMessage; + + return $this; + } + + /** + * Gets trackingNumber + * + * @return string|null + */ + public function getTrackingNumber() + { + return $this->container['trackingNumber']; + } + + /** + * Sets trackingNumber + * + * @param string|null $trackingNumber Tracking number of the delivery. + * + * @return self + */ + public function setTrackingNumber($trackingNumber) + { + if (is_null($trackingNumber)) { + throw new \InvalidArgumentException('non-nullable trackingNumber cannot be null'); + } + $this->container['trackingNumber'] = $trackingNumber; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.php new file mode 100644 index 000000000..f363b8f85 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.php @@ -0,0 +1,494 @@ + + */ +class CardOrderNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CardOrderNotificationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\ConfigurationWebhooks\CardOrderItem', + 'environment' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'environment' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false, + 'environment' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'environment' => 'environment', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'environment' => 'setEnvironment', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'environment' => 'getEnvironment', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_CREATED = 'balancePlatform.cardorder.created'; + public const TYPE_UPDATED = 'balancePlatform.cardorder.updated'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CREATED, + self::TYPE_UPDATED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['environment'] === null) { + $invalidProperties[] = "'environment' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\ConfigurationWebhooks\CardOrderItem + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\ConfigurationWebhooks\CardOrderItem $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets environment + * + * @return string + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param string $environment The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @return self + */ + public function setEnvironment($environment) + { + if (is_null($environment)) { + throw new \InvalidArgumentException('non-nullable environment cannot be null'); + } + $this->container['environment'] = $environment; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of webhook. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/Contact.php b/src/Adyen/Model/ConfigurationWebhooks/Contact.php new file mode 100644 index 000000000..0c9c5a476 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/Contact.php @@ -0,0 +1,588 @@ + + */ +class Contact implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Contact'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address' => '\Adyen\Model\ConfigurationWebhooks\Address', + 'email' => 'string', + 'fullPhoneNumber' => 'string', + 'name' => '\Adyen\Model\ConfigurationWebhooks\Name', + 'personalData' => '\Adyen\Model\ConfigurationWebhooks\PersonalData', + 'phoneNumber' => '\Adyen\Model\ConfigurationWebhooks\PhoneNumber', + 'webAddress' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address' => null, + 'email' => null, + 'fullPhoneNumber' => null, + 'name' => null, + 'personalData' => null, + 'phoneNumber' => null, + 'webAddress' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'address' => false, + 'email' => false, + 'fullPhoneNumber' => false, + 'name' => false, + 'personalData' => false, + 'phoneNumber' => false, + 'webAddress' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'email' => 'email', + 'fullPhoneNumber' => 'fullPhoneNumber', + 'name' => 'name', + 'personalData' => 'personalData', + 'phoneNumber' => 'phoneNumber', + 'webAddress' => 'webAddress' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'email' => 'setEmail', + 'fullPhoneNumber' => 'setFullPhoneNumber', + 'name' => 'setName', + 'personalData' => 'setPersonalData', + 'phoneNumber' => 'setPhoneNumber', + 'webAddress' => 'setWebAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'email' => 'getEmail', + 'fullPhoneNumber' => 'getFullPhoneNumber', + 'name' => 'getName', + 'personalData' => 'getPersonalData', + 'phoneNumber' => 'getPhoneNumber', + 'webAddress' => 'getWebAddress' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('fullPhoneNumber', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('personalData', $data ?? [], null); + $this->setIfExists('phoneNumber', $data ?? [], null); + $this->setIfExists('webAddress', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \Adyen\Model\ConfigurationWebhooks\Address|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Adyen\Model\ConfigurationWebhooks\Address|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The e-mail address of the contact. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets fullPhoneNumber + * + * @return string|null + */ + public function getFullPhoneNumber() + { + return $this->container['fullPhoneNumber']; + } + + /** + * Sets fullPhoneNumber + * + * @param string|null $fullPhoneNumber The phone number of the contact provided as a single string. It will be handled as a landline phone. **Examples:** \"0031 6 11 22 33 44\", \"+316/1122-3344\", \"(0031) 611223344\" + * + * @return self + */ + public function setFullPhoneNumber($fullPhoneNumber) + { + if (is_null($fullPhoneNumber)) { + throw new \InvalidArgumentException('non-nullable fullPhoneNumber cannot be null'); + } + $this->container['fullPhoneNumber'] = $fullPhoneNumber; + + return $this; + } + + /** + * Gets name + * + * @return \Adyen\Model\ConfigurationWebhooks\Name|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Adyen\Model\ConfigurationWebhooks\Name|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets personalData + * + * @return \Adyen\Model\ConfigurationWebhooks\PersonalData|null + */ + public function getPersonalData() + { + return $this->container['personalData']; + } + + /** + * Sets personalData + * + * @param \Adyen\Model\ConfigurationWebhooks\PersonalData|null $personalData personalData + * + * @return self + */ + public function setPersonalData($personalData) + { + if (is_null($personalData)) { + throw new \InvalidArgumentException('non-nullable personalData cannot be null'); + } + $this->container['personalData'] = $personalData; + + return $this; + } + + /** + * Gets phoneNumber + * + * @return \Adyen\Model\ConfigurationWebhooks\PhoneNumber|null + */ + public function getPhoneNumber() + { + return $this->container['phoneNumber']; + } + + /** + * Sets phoneNumber + * + * @param \Adyen\Model\ConfigurationWebhooks\PhoneNumber|null $phoneNumber phoneNumber + * + * @return self + */ + public function setPhoneNumber($phoneNumber) + { + if (is_null($phoneNumber)) { + throw new \InvalidArgumentException('non-nullable phoneNumber cannot be null'); + } + $this->container['phoneNumber'] = $phoneNumber; + + return $this; + } + + /** + * Gets webAddress + * + * @return string|null + */ + public function getWebAddress() + { + return $this->container['webAddress']; + } + + /** + * Sets webAddress + * + * @param string|null $webAddress The URL of the website of the contact. + * + * @return self + */ + public function setWebAddress($webAddress) + { + if (is_null($webAddress)) { + throw new \InvalidArgumentException('non-nullable webAddress cannot be null'); + } + $this->container['webAddress'] = $webAddress; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/ContactDetails.php b/src/Adyen/Model/ConfigurationWebhooks/ContactDetails.php new file mode 100644 index 000000000..dd7381b96 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/ContactDetails.php @@ -0,0 +1,495 @@ + + */ +class ContactDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ContactDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address' => '\Adyen\Model\ConfigurationWebhooks\Address', + 'email' => 'string', + 'phone' => '\Adyen\Model\ConfigurationWebhooks\Phone', + 'webAddress' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address' => null, + 'email' => null, + 'phone' => null, + 'webAddress' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'address' => false, + 'email' => false, + 'phone' => false, + 'webAddress' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'email' => 'email', + 'phone' => 'phone', + 'webAddress' => 'webAddress' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'email' => 'setEmail', + 'phone' => 'setPhone', + 'webAddress' => 'setWebAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'email' => 'getEmail', + 'phone' => 'getPhone', + 'webAddress' => 'getWebAddress' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('phone', $data ?? [], null); + $this->setIfExists('webAddress', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['address'] === null) { + $invalidProperties[] = "'address' can't be null"; + } + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['phone'] === null) { + $invalidProperties[] = "'phone' 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 address + * + * @return \Adyen\Model\ConfigurationWebhooks\Address + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Adyen\Model\ConfigurationWebhooks\Address $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email The email address of the account holder. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets phone + * + * @return \Adyen\Model\ConfigurationWebhooks\Phone + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param \Adyen\Model\ConfigurationWebhooks\Phone $phone phone + * + * @return self + */ + public function setPhone($phone) + { + if (is_null($phone)) { + throw new \InvalidArgumentException('non-nullable phone cannot be null'); + } + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets webAddress + * + * @return string|null + */ + public function getWebAddress() + { + return $this->container['webAddress']; + } + + /** + * Sets webAddress + * + * @param string|null $webAddress The URL of the account holder's website. + * + * @return self + */ + public function setWebAddress($webAddress) + { + if (is_null($webAddress)) { + throw new \InvalidArgumentException('non-nullable webAddress cannot be null'); + } + $this->container['webAddress'] = $webAddress; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/CronSweepSchedule.php b/src/Adyen/Model/ConfigurationWebhooks/CronSweepSchedule.php new file mode 100644 index 000000000..e2a8c4b1d --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/CronSweepSchedule.php @@ -0,0 +1,460 @@ + + */ +class CronSweepSchedule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CronSweepSchedule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cronExpression' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cronExpression' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'cronExpression' => 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 = [ + 'cronExpression' => 'cronExpression', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cronExpression' => 'setCronExpression', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cronExpression' => 'getCronExpression', + '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_DAILY = 'daily'; + public const TYPE_WEEKLY = 'weekly'; + public const TYPE_MONTHLY = 'monthly'; + public const TYPE_BALANCE = 'balance'; + public const TYPE_CRON = 'cron'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DAILY, + self::TYPE_WEEKLY, + self::TYPE_MONTHLY, + self::TYPE_BALANCE, + self::TYPE_CRON, + ]; + } + /** + * 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('cronExpression', $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['cronExpression'] === null) { + $invalidProperties[] = "'cronExpression' 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 cronExpression + * + * @return string + */ + public function getCronExpression() + { + return $this->container['cronExpression']; + } + + /** + * Sets cronExpression + * + * @param string $cronExpression A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: *****, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples. + * + * @return self + */ + public function setCronExpression($cronExpression) + { + if (is_null($cronExpression)) { + throw new \InvalidArgumentException('non-nullable cronExpression cannot be null'); + } + $this->container['cronExpression'] = $cronExpression; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/Expiry.php b/src/Adyen/Model/ConfigurationWebhooks/Expiry.php new file mode 100644 index 000000000..e27afa420 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/Expiry.php @@ -0,0 +1,418 @@ + + */ +class Expiry implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Expiry'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'month' => 'string', + 'year' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'month' => null, + 'year' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'month' => false, + 'year' => 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 = [ + 'month' => 'month', + 'year' => 'year' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'month' => 'setMonth', + 'year' => 'setYear' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'month' => 'getMonth', + 'year' => 'getYear' + ]; + + /** + * 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('month', $data ?? [], null); + $this->setIfExists('year', $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 month + * + * @return string|null + */ + public function getMonth() + { + return $this->container['month']; + } + + /** + * Sets month + * + * @param string|null $month The month in which the card will expire. + * + * @return self + */ + public function setMonth($month) + { + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); + } + $this->container['month'] = $month; + + return $this; + } + + /** + * Gets year + * + * @return string|null + */ + public function getYear() + { + return $this->container['year']; + } + + /** + * Sets year + * + * @param string|null $year The year in which the card will expire. + * + * @return self + */ + public function setYear($year) + { + if (is_null($year)) { + throw new \InvalidArgumentException('non-nullable year cannot be null'); + } + $this->container['year'] = $year; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.php b/src/Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.php new file mode 100644 index 000000000..5b6671181 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.php @@ -0,0 +1,455 @@ + + */ +class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IbanAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'iban' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'iban' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'iban' => 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 = [ + 'iban' => 'iban', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'iban' => 'setIban', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'iban' => 'getIban', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_IBAN = 'iban'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_IBAN, + ]; + } + /** + * 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('iban', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'iban'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['iban'] === null) { + $invalidProperties[] = "'iban' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $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 iban + * + * @return string + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * + * @return self + */ + public function setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **iban** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/ModelInterface.php b/src/Adyen/Model/ConfigurationWebhooks/ModelInterface.php new file mode 100644 index 000000000..7aa2d8db3 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/ModelInterface.php @@ -0,0 +1,92 @@ + + */ +class Name implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Name'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'firstName' => 'string', + 'lastName' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'firstName' => null, + 'lastName' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'firstName' => false, + 'lastName' => 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 = [ + 'firstName' => 'firstName', + 'lastName' => 'lastName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'firstName' => 'setFirstName', + 'lastName' => 'setLastName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'firstName' => 'getFirstName', + 'lastName' => 'getLastName' + ]; + + /** + * 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('firstName', $data ?? [], null); + $this->setIfExists('lastName', $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['firstName'] === null) { + $invalidProperties[] = "'firstName' can't be null"; + } + if ($this->container['lastName'] === null) { + $invalidProperties[] = "'lastName' 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 firstName + * + * @return string + */ + public function getFirstName() + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string $firstName The first name. + * + * @return self + */ + public function setFirstName($firstName) + { + if (is_null($firstName)) { + throw new \InvalidArgumentException('non-nullable firstName cannot be null'); + } + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets lastName + * + * @return string + */ + public function getLastName() + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string $lastName The last name. + * + * @return self + */ + public function setLastName($lastName) + { + if (is_null($lastName)) { + throw new \InvalidArgumentException('non-nullable lastName cannot be null'); + } + $this->container['lastName'] = $lastName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php b/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php new file mode 100644 index 000000000..42a2381de --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/ObjectSerializer.php @@ -0,0 +1,317 @@ +format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach ($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) { + return $timestamp; + } + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if (is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Adyen\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrument.php b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrument.php new file mode 100644 index 000000000..0c6520fab --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrument.php @@ -0,0 +1,782 @@ + + */ +class PaymentInstrument implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentInstrument'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balanceAccountId' => 'string', + 'bankAccount' => '\Adyen\Model\ConfigurationWebhooks\PaymentInstrumentBankAccount', + 'card' => '\Adyen\Model\ConfigurationWebhooks\Card', + 'description' => 'string', + 'id' => 'string', + 'issuingCountryCode' => 'string', + 'paymentInstrumentGroupId' => 'string', + 'reference' => 'string', + 'status' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balanceAccountId' => null, + 'bankAccount' => null, + 'card' => null, + 'description' => null, + 'id' => null, + 'issuingCountryCode' => null, + 'paymentInstrumentGroupId' => null, + 'reference' => null, + 'status' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balanceAccountId' => false, + 'bankAccount' => false, + 'card' => false, + 'description' => false, + 'id' => false, + 'issuingCountryCode' => false, + 'paymentInstrumentGroupId' => false, + 'reference' => false, + 'status' => 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 = [ + 'balanceAccountId' => 'balanceAccountId', + 'bankAccount' => 'bankAccount', + 'card' => 'card', + 'description' => 'description', + 'id' => 'id', + 'issuingCountryCode' => 'issuingCountryCode', + 'paymentInstrumentGroupId' => 'paymentInstrumentGroupId', + 'reference' => 'reference', + 'status' => 'status', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balanceAccountId' => 'setBalanceAccountId', + 'bankAccount' => 'setBankAccount', + 'card' => 'setCard', + 'description' => 'setDescription', + 'id' => 'setId', + 'issuingCountryCode' => 'setIssuingCountryCode', + 'paymentInstrumentGroupId' => 'setPaymentInstrumentGroupId', + 'reference' => 'setReference', + 'status' => 'setStatus', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balanceAccountId' => 'getBalanceAccountId', + 'bankAccount' => 'getBankAccount', + 'card' => 'getCard', + 'description' => 'getDescription', + 'id' => 'getId', + 'issuingCountryCode' => 'getIssuingCountryCode', + 'paymentInstrumentGroupId' => 'getPaymentInstrumentGroupId', + 'reference' => 'getReference', + 'status' => 'getStatus', + '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 STATUS_ACTIVE = 'Active'; + public const STATUS_CLOSED = 'Closed'; + public const STATUS_INACTIVE = 'Inactive'; + public const STATUS_LOST = 'Lost'; + public const STATUS_REQUESTED = 'Requested'; + public const STATUS_STOLEN = 'Stolen'; + public const STATUS_SUSPENDED = 'Suspended'; + public const STATUS_BLOCKED = 'blocked'; + public const STATUS_DISCARDED = 'discarded'; + public const TYPE_BANK_ACCOUNT = 'bankAccount'; + public const TYPE_CARD = 'card'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_CLOSED, + self::STATUS_INACTIVE, + self::STATUS_LOST, + self::STATUS_REQUESTED, + self::STATUS_STOLEN, + self::STATUS_SUSPENDED, + self::STATUS_BLOCKED, + self::STATUS_DISCARDED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BANK_ACCOUNT, + self::TYPE_CARD, + ]; + } + /** + * 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('bankAccount', $data ?? [], null); + $this->setIfExists('card', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('issuingCountryCode', $data ?? [], null); + $this->setIfExists('paymentInstrumentGroupId', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('status', $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['balanceAccountId'] === null) { + $invalidProperties[] = "'balanceAccountId' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['issuingCountryCode'] === null) { + $invalidProperties[] = "'issuingCountryCode' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + 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 balanceAccountId + * + * @return string + */ + public function getBalanceAccountId() + { + return $this->container['balanceAccountId']; + } + + /** + * Sets balanceAccountId + * + * @param string $balanceAccountId The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) associated with the payment instrument. + * + * @return self + */ + public function setBalanceAccountId($balanceAccountId) + { + if (is_null($balanceAccountId)) { + throw new \InvalidArgumentException('non-nullable balanceAccountId cannot be null'); + } + $this->container['balanceAccountId'] = $balanceAccountId; + + return $this; + } + + /** + * Gets bankAccount + * + * @return \Adyen\Model\ConfigurationWebhooks\PaymentInstrumentBankAccount|null + */ + public function getBankAccount() + { + return $this->container['bankAccount']; + } + + /** + * Sets bankAccount + * + * @param \Adyen\Model\ConfigurationWebhooks\PaymentInstrumentBankAccount|null $bankAccount bankAccount + * + * @return self + */ + public function setBankAccount($bankAccount) + { + if (is_null($bankAccount)) { + throw new \InvalidArgumentException('non-nullable bankAccount cannot be null'); + } + $this->container['bankAccount'] = $bankAccount; + + return $this; + } + + /** + * Gets card + * + * @return \Adyen\Model\ConfigurationWebhooks\Card|null + */ + public function getCard() + { + return $this->container['card']; + } + + /** + * Sets card + * + * @param \Adyen\Model\ConfigurationWebhooks\Card|null $card card + * + * @return self + */ + public function setCard($card) + { + if (is_null($card)) { + throw new \InvalidArgumentException('non-nullable card cannot be null'); + } + $this->container['card'] = $card; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for the payment instrument, maximum 300 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the payment instrument. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets issuingCountryCode + * + * @return string + */ + public function getIssuingCountryCode() + { + return $this->container['issuingCountryCode']; + } + + /** + * Sets issuingCountryCode + * + * @param string $issuingCountryCode The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the payment instrument is issued. For example, **NL** or **US**. + * + * @return self + */ + public function setIssuingCountryCode($issuingCountryCode) + { + if (is_null($issuingCountryCode)) { + throw new \InvalidArgumentException('non-nullable issuingCountryCode cannot be null'); + } + $this->container['issuingCountryCode'] = $issuingCountryCode; + + return $this; + } + + /** + * Gets paymentInstrumentGroupId + * + * @return string|null + */ + public function getPaymentInstrumentGroupId() + { + return $this->container['paymentInstrumentGroupId']; + } + + /** + * Sets paymentInstrumentGroupId + * + * @param string|null $paymentInstrumentGroupId The unique identifier of the [payment instrument group](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/paymentInstrumentGroups__resParam_id) to which the payment instrument belongs. + * + * @return self + */ + public function setPaymentInstrumentGroupId($paymentInstrumentGroupId) + { + if (is_null($paymentInstrumentGroupId)) { + throw new \InvalidArgumentException('non-nullable paymentInstrumentGroupId cannot be null'); + } + $this->container['paymentInstrumentGroupId'] = $paymentInstrumentGroupId; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the payment instrument, maximum 150 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **Active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **Requested**. Possible values: * **Active**: The payment instrument is active and can be used to make payments. * **Requested**: The payment instrument has been requested. This state is applicable for physical cards. * **Inactive**: The payment instrument is inactive and cannot be used to make payments. * **Suspended**: The payment instrument is temporarily suspended and cannot be used to make payments. * **Closed**: The payment instrument is permanently closed. This action cannot be undone. * **Stolen** * **Lost** + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of payment instrument. Possible value: **card**, **bankAccount**. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentBankAccount.php b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentBankAccount.php new file mode 100644 index 000000000..a7fe71287 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentBankAccount.php @@ -0,0 +1,534 @@ + + */ +class PaymentInstrumentBankAccount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentInstrument_bankAccount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'iban' => 'string', + 'type' => 'string', + 'accountNumber' => 'string', + 'accountType' => 'string', + 'routingNumber' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'iban' => null, + 'type' => null, + 'accountNumber' => null, + 'accountType' => null, + 'routingNumber' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'iban' => false, + 'type' => false, + 'accountNumber' => false, + 'accountType' => false, + 'routingNumber' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'iban' => 'iban', + 'type' => 'type', + 'accountNumber' => 'accountNumber', + 'accountType' => 'accountType', + 'routingNumber' => 'routingNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'iban' => 'setIban', + 'type' => 'setType', + 'accountNumber' => 'setAccountNumber', + 'accountType' => 'setAccountType', + 'routingNumber' => 'setRoutingNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'iban' => 'getIban', + 'type' => 'getType', + 'accountNumber' => 'getAccountNumber', + 'accountType' => 'getAccountType', + 'routingNumber' => 'getRoutingNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'usLocal'); + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('accountType', $data ?? [], 'checking'); + $this->setIfExists('routingNumber', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['iban'] === null) { + $invalidProperties[] = "'iban' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + + if ($this->container['routingNumber'] === null) { + $invalidProperties[] = "'routingNumber' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets iban + * + * @return string + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * + * @return self + */ + public function setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **usLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets accountType + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['accountType']; + } + + /** + * Sets accountType + * + * @param string|null $accountType The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * + * @return self + */ + public function setAccountType($accountType) + { + if (is_null($accountType)) { + throw new \InvalidArgumentException('non-nullable accountType cannot be null'); + } + $this->container['accountType'] = $accountType; + + return $this; + } + + /** + * Gets routingNumber + * + * @return string + */ + public function getRoutingNumber() + { + return $this->container['routingNumber']; + } + + /** + * Sets routingNumber + * + * @param string $routingNumber The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. + * + * @return self + */ + public function setRoutingNumber($routingNumber) + { + if (is_null($routingNumber)) { + throw new \InvalidArgumentException('non-nullable routingNumber cannot be null'); + } + $this->container['routingNumber'] = $routingNumber; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.php b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.php new file mode 100644 index 000000000..0cf867f67 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.php @@ -0,0 +1,418 @@ + + */ +class PaymentInstrumentNotificationData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentInstrumentNotificationData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balancePlatform' => 'string', + 'paymentInstrument' => '\Adyen\Model\ConfigurationWebhooks\PaymentInstrument' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balancePlatform' => null, + 'paymentInstrument' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balancePlatform' => false, + 'paymentInstrument' => 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 = [ + 'balancePlatform' => 'balancePlatform', + 'paymentInstrument' => 'paymentInstrument' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balancePlatform' => 'setBalancePlatform', + 'paymentInstrument' => 'setPaymentInstrument' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balancePlatform' => 'getBalancePlatform', + 'paymentInstrument' => 'getPaymentInstrument' + ]; + + /** + * 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('balancePlatform', $data ?? [], null); + $this->setIfExists('paymentInstrument', $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 balancePlatform + * + * @return string|null + */ + public function getBalancePlatform() + { + return $this->container['balancePlatform']; + } + + /** + * Sets balancePlatform + * + * @param string|null $balancePlatform The unique identifier of the balance platform. + * + * @return self + */ + public function setBalancePlatform($balancePlatform) + { + if (is_null($balancePlatform)) { + throw new \InvalidArgumentException('non-nullable balancePlatform cannot be null'); + } + $this->container['balancePlatform'] = $balancePlatform; + + return $this; + } + + /** + * Gets paymentInstrument + * + * @return \Adyen\Model\ConfigurationWebhooks\PaymentInstrument|null + */ + public function getPaymentInstrument() + { + return $this->container['paymentInstrument']; + } + + /** + * Sets paymentInstrument + * + * @param \Adyen\Model\ConfigurationWebhooks\PaymentInstrument|null $paymentInstrument paymentInstrument + * + * @return self + */ + public function setPaymentInstrument($paymentInstrument) + { + if (is_null($paymentInstrument)) { + throw new \InvalidArgumentException('non-nullable paymentInstrument cannot be null'); + } + $this->container['paymentInstrument'] = $paymentInstrument; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentReference.php b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentReference.php new file mode 100644 index 000000000..c9db21465 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentReference.php @@ -0,0 +1,387 @@ + + */ +class PaymentInstrumentReference implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentInstrumentReference'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the payment instrument. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.php new file mode 100644 index 000000000..db2ba16eb --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.php @@ -0,0 +1,494 @@ + + */ +class PaymentNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentNotificationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\ConfigurationWebhooks\PaymentInstrumentNotificationData', + 'environment' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'environment' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false, + 'environment' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'environment' => 'environment', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'environment' => 'setEnvironment', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'environment' => 'getEnvironment', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_CREATED = 'balancePlatform.paymentInstrument.created'; + public const TYPE_UPDATED = 'balancePlatform.paymentInstrument.updated'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CREATED, + self::TYPE_UPDATED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['environment'] === null) { + $invalidProperties[] = "'environment' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\ConfigurationWebhooks\PaymentInstrumentNotificationData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\ConfigurationWebhooks\PaymentInstrumentNotificationData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets environment + * + * @return string + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param string $environment The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @return self + */ + public function setEnvironment($environment) + { + if (is_null($environment)) { + throw new \InvalidArgumentException('non-nullable environment cannot be null'); + } + $this->container['environment'] = $environment; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of webhook. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/PersonalData.php b/src/Adyen/Model/ConfigurationWebhooks/PersonalData.php new file mode 100644 index 000000000..62fa189d1 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/PersonalData.php @@ -0,0 +1,452 @@ + + */ +class PersonalData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PersonalData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'dateOfBirth' => 'string', + 'idNumber' => 'string', + 'nationality' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'dateOfBirth' => null, + 'idNumber' => null, + 'nationality' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'dateOfBirth' => false, + 'idNumber' => false, + 'nationality' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'dateOfBirth' => 'dateOfBirth', + 'idNumber' => 'idNumber', + 'nationality' => 'nationality' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'dateOfBirth' => 'setDateOfBirth', + 'idNumber' => 'setIdNumber', + 'nationality' => 'setNationality' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'dateOfBirth' => 'getDateOfBirth', + 'idNumber' => 'getIdNumber', + 'nationality' => 'getNationality' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('dateOfBirth', $data ?? [], null); + $this->setIfExists('idNumber', $data ?? [], null); + $this->setIfExists('nationality', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets dateOfBirth + * + * @return string|null + */ + public function getDateOfBirth() + { + return $this->container['dateOfBirth']; + } + + /** + * Sets dateOfBirth + * + * @param string|null $dateOfBirth The date of birth of the person. The date should be in ISO-8601 format yyyy-mm-dd (e.g. 2000-01-31). + * + * @return self + */ + public function setDateOfBirth($dateOfBirth) + { + if (is_null($dateOfBirth)) { + throw new \InvalidArgumentException('non-nullable dateOfBirth cannot be null'); + } + $this->container['dateOfBirth'] = $dateOfBirth; + + return $this; + } + + /** + * Gets idNumber + * + * @return string|null + */ + public function getIdNumber() + { + return $this->container['idNumber']; + } + + /** + * Sets idNumber + * + * @param string|null $idNumber An ID number of the person. + * + * @return self + */ + public function setIdNumber($idNumber) + { + if (is_null($idNumber)) { + throw new \InvalidArgumentException('non-nullable idNumber cannot be null'); + } + $this->container['idNumber'] = $idNumber; + + return $this; + } + + /** + * Gets nationality + * + * @return string|null + */ + public function getNationality() + { + return $this->container['nationality']; + } + + /** + * Sets nationality + * + * @param string|null $nationality The nationality of the person represented by a two-character country code. >The permitted country codes are defined in ISO-3166-1 alpha-2 (e.g. 'NL'). + * + * @return self + */ + public function setNationality($nationality) + { + if (is_null($nationality)) { + throw new \InvalidArgumentException('non-nullable nationality cannot be null'); + } + $this->container['nationality'] = $nationality; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/Phone.php b/src/Adyen/Model/ConfigurationWebhooks/Phone.php new file mode 100644 index 000000000..970a986f8 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/Phone.php @@ -0,0 +1,457 @@ + + */ +class Phone implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Phone'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'number' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'number' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'number' => 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 = [ + 'number' => 'number', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'number' => 'setNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'number' => 'getNumber', + '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_LANDLINE = 'Landline'; + public const TYPE_MOBILE = 'Mobile'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_LANDLINE, + self::TYPE_MOBILE, + ]; + } + /** + * 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('number', $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['number'] === null) { + $invalidProperties[] = "'number' 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 number + * + * @return string + */ + public function getNumber() + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string $number The full phone number provided as a single string. For example, **\"0031 6 11 22 33 44\"**, **\"+316/1122-3344\"**, or **\"(0031) 611223344\"**. + * + * @return self + */ + public function setNumber($number) + { + if (is_null($number)) { + throw new \InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of phone number. Possible values: **Landline**, **Mobile**. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/PhoneNumber.php b/src/Adyen/Model/ConfigurationWebhooks/PhoneNumber.php new file mode 100644 index 000000000..4dd46d823 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/PhoneNumber.php @@ -0,0 +1,489 @@ + + */ +class PhoneNumber implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PhoneNumber'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'phoneCountryCode' => 'string', + 'phoneNumber' => 'string', + 'phoneType' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'phoneCountryCode' => null, + 'phoneNumber' => null, + 'phoneType' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'phoneCountryCode' => false, + 'phoneNumber' => false, + 'phoneType' => 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 = [ + 'phoneCountryCode' => 'phoneCountryCode', + 'phoneNumber' => 'phoneNumber', + 'phoneType' => 'phoneType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'phoneCountryCode' => 'setPhoneCountryCode', + 'phoneNumber' => 'setPhoneNumber', + 'phoneType' => 'setPhoneType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'phoneCountryCode' => 'getPhoneCountryCode', + 'phoneNumber' => 'getPhoneNumber', + 'phoneType' => 'getPhoneType' + ]; + + /** + * 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 PHONE_TYPE_FAX = 'Fax'; + public const PHONE_TYPE_LANDLINE = 'Landline'; + public const PHONE_TYPE_MOBILE = 'Mobile'; + public const PHONE_TYPE_SIP = 'SIP'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPhoneTypeAllowableValues() + { + return [ + self::PHONE_TYPE_FAX, + self::PHONE_TYPE_LANDLINE, + self::PHONE_TYPE_MOBILE, + self::PHONE_TYPE_SIP, + ]; + } + /** + * 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('phoneCountryCode', $data ?? [], null); + $this->setIfExists('phoneNumber', $data ?? [], null); + $this->setIfExists('phoneType', $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->getPhoneTypeAllowableValues(); + if (!is_null($this->container['phoneType']) && !in_array($this->container['phoneType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'phoneType', must be one of '%s'", + $this->container['phoneType'], + 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 phoneCountryCode + * + * @return string|null + */ + public function getPhoneCountryCode() + { + return $this->container['phoneCountryCode']; + } + + /** + * Sets phoneCountryCode + * + * @param string|null $phoneCountryCode The two-character ISO-3166-1 alpha-2 country code of the phone number. For example, **US** or **NL**. + * + * @return self + */ + public function setPhoneCountryCode($phoneCountryCode) + { + if (is_null($phoneCountryCode)) { + throw new \InvalidArgumentException('non-nullable phoneCountryCode cannot be null'); + } + $this->container['phoneCountryCode'] = $phoneCountryCode; + + return $this; + } + + /** + * Gets phoneNumber + * + * @return string|null + */ + public function getPhoneNumber() + { + return $this->container['phoneNumber']; + } + + /** + * Sets phoneNumber + * + * @param string|null $phoneNumber The phone number. The inclusion of the phone number country code is not necessary. + * + * @return self + */ + public function setPhoneNumber($phoneNumber) + { + if (is_null($phoneNumber)) { + throw new \InvalidArgumentException('non-nullable phoneNumber cannot be null'); + } + $this->container['phoneNumber'] = $phoneNumber; + + return $this; + } + + /** + * Gets phoneType + * + * @return string|null + */ + public function getPhoneType() + { + return $this->container['phoneType']; + } + + /** + * Sets phoneType + * + * @param string|null $phoneType The type of the phone number. Possible values: **Landline**, **Mobile**, **SIP**, **Fax**. + * + * @return self + */ + public function setPhoneType($phoneType) + { + if (is_null($phoneType)) { + throw new \InvalidArgumentException('non-nullable phoneType cannot be null'); + } + $allowedValues = $this->getPhoneTypeAllowableValues(); + if (!in_array($phoneType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'phoneType', must be one of '%s'", + $phoneType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['phoneType'] = $phoneType; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/Resource.php b/src/Adyen/Model/ConfigurationWebhooks/Resource.php new file mode 100644 index 000000000..65e1314df --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/Resource.php @@ -0,0 +1,452 @@ + + */ +class Resource implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Resource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balancePlatform' => 'string', + 'creationDate' => '\DateTime', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balancePlatform' => null, + 'creationDate' => 'date-time', + 'id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balancePlatform' => false, + 'creationDate' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balancePlatform' => 'balancePlatform', + 'creationDate' => 'creationDate', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balancePlatform' => 'setBalancePlatform', + 'creationDate' => 'setCreationDate', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balancePlatform' => 'getBalancePlatform', + 'creationDate' => 'getCreationDate', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('balancePlatform', $data ?? [], null); + $this->setIfExists('creationDate', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 balancePlatform + * + * @return string|null + */ + public function getBalancePlatform() + { + return $this->container['balancePlatform']; + } + + /** + * Sets balancePlatform + * + * @param string|null $balancePlatform The unique identifier of the balance platform. + * + * @return self + */ + public function setBalancePlatform($balancePlatform) + { + if (is_null($balancePlatform)) { + throw new \InvalidArgumentException('non-nullable balancePlatform cannot be null'); + } + $this->container['balancePlatform'] = $balancePlatform; + + return $this; + } + + /** + * Gets creationDate + * + * @return \DateTime|null + */ + public function getCreationDate() + { + return $this->container['creationDate']; + } + + /** + * Sets creationDate + * + * @param \DateTime|null $creationDate The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + * + * @return self + */ + public function setCreationDate($creationDate) + { + if (is_null($creationDate)) { + throw new \InvalidArgumentException('non-nullable creationDate cannot be null'); + } + $this->container['creationDate'] = $creationDate; + + 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) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/SweepConfiguration.php b/src/Adyen/Model/ConfigurationWebhooks/SweepConfiguration.php new file mode 100644 index 000000000..c6bb6a82e --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepConfiguration.php @@ -0,0 +1,762 @@ + + */ +class SweepConfiguration implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SweepConfiguration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balanceAccountId' => 'string', + 'id' => 'string', + 'merchantAccount' => 'string', + 'schedule' => '\Adyen\Model\ConfigurationWebhooks\SweepConfigurationSchedule', + 'status' => 'string', + 'sweepAmount' => '\Adyen\Model\ConfigurationWebhooks\Amount', + 'targetAmount' => '\Adyen\Model\ConfigurationWebhooks\Amount', + 'transferInstrumentId' => 'string', + 'triggerAmount' => '\Adyen\Model\ConfigurationWebhooks\Amount', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balanceAccountId' => null, + 'id' => null, + 'merchantAccount' => null, + 'schedule' => null, + 'status' => null, + 'sweepAmount' => null, + 'targetAmount' => null, + 'transferInstrumentId' => null, + 'triggerAmount' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balanceAccountId' => false, + 'id' => false, + 'merchantAccount' => false, + 'schedule' => false, + 'status' => false, + 'sweepAmount' => false, + 'targetAmount' => false, + 'transferInstrumentId' => false, + 'triggerAmount' => 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 = [ + 'balanceAccountId' => 'balanceAccountId', + 'id' => 'id', + 'merchantAccount' => 'merchantAccount', + 'schedule' => 'schedule', + 'status' => 'status', + 'sweepAmount' => 'sweepAmount', + 'targetAmount' => 'targetAmount', + 'transferInstrumentId' => 'transferInstrumentId', + 'triggerAmount' => 'triggerAmount', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balanceAccountId' => 'setBalanceAccountId', + 'id' => 'setId', + 'merchantAccount' => 'setMerchantAccount', + 'schedule' => 'setSchedule', + 'status' => 'setStatus', + 'sweepAmount' => 'setSweepAmount', + 'targetAmount' => 'setTargetAmount', + 'transferInstrumentId' => 'setTransferInstrumentId', + 'triggerAmount' => 'setTriggerAmount', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balanceAccountId' => 'getBalanceAccountId', + 'id' => 'getId', + 'merchantAccount' => 'getMerchantAccount', + 'schedule' => 'getSchedule', + 'status' => 'getStatus', + 'sweepAmount' => 'getSweepAmount', + 'targetAmount' => 'getTargetAmount', + 'transferInstrumentId' => 'getTransferInstrumentId', + 'triggerAmount' => 'getTriggerAmount', + '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 STATUS_ACTIVE = 'active'; + public const STATUS_INACTIVE = 'inactive'; + public const TYPE_PULL = 'pull'; + public const TYPE_PUSH = 'push'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_PULL, + self::TYPE_PUSH, + ]; + } + /** + * 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('id', $data ?? [], null); + $this->setIfExists('merchantAccount', $data ?? [], null); + $this->setIfExists('schedule', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('sweepAmount', $data ?? [], null); + $this->setIfExists('targetAmount', $data ?? [], null); + $this->setIfExists('transferInstrumentId', $data ?? [], null); + $this->setIfExists('triggerAmount', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'push'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['schedule'] === null) { + $invalidProperties[] = "'schedule' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 unique identifier of the destination or source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). You can only use this for periodic sweep schedules such as `schedule.type` **daily** or **monthly**. + * + * @return self + */ + public function setBalanceAccountId($balanceAccountId) + { + if (is_null($balanceAccountId)) { + throw new \InvalidArgumentException('non-nullable balanceAccountId cannot be null'); + } + $this->container['balanceAccountId'] = $balanceAccountId; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the sweep. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets merchantAccount + * + * @return string|null + */ + public function getMerchantAccount() + { + return $this->container['merchantAccount']; + } + + /** + * Sets merchantAccount + * + * @param string|null $merchantAccount The merchant account that will be the source of funds. You can only use this if you are processing payments with Adyen. This can only be used for sweeps of `type` **pull** and `schedule.type` **balance**. + * + * @return self + */ + public function setMerchantAccount($merchantAccount) + { + if (is_null($merchantAccount)) { + throw new \InvalidArgumentException('non-nullable merchantAccount cannot be null'); + } + $this->container['merchantAccount'] = $merchantAccount; + + return $this; + } + + /** + * Gets schedule + * + * @return \Adyen\Model\ConfigurationWebhooks\SweepConfigurationSchedule + */ + public function getSchedule() + { + return $this->container['schedule']; + } + + /** + * Sets schedule + * + * @param \Adyen\Model\ConfigurationWebhooks\SweepConfigurationSchedule $schedule schedule + * + * @return self + */ + public function setSchedule($schedule) + { + if (is_null($schedule)) { + throw new \InvalidArgumentException('non-nullable schedule cannot be null'); + } + $this->container['schedule'] = $schedule; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets sweepAmount + * + * @return \Adyen\Model\ConfigurationWebhooks\Amount|null + */ + public function getSweepAmount() + { + return $this->container['sweepAmount']; + } + + /** + * Sets sweepAmount + * + * @param \Adyen\Model\ConfigurationWebhooks\Amount|null $sweepAmount sweepAmount + * + * @return self + */ + public function setSweepAmount($sweepAmount) + { + if (is_null($sweepAmount)) { + throw new \InvalidArgumentException('non-nullable sweepAmount cannot be null'); + } + $this->container['sweepAmount'] = $sweepAmount; + + return $this; + } + + /** + * Gets targetAmount + * + * @return \Adyen\Model\ConfigurationWebhooks\Amount|null + */ + public function getTargetAmount() + { + return $this->container['targetAmount']; + } + + /** + * Sets targetAmount + * + * @param \Adyen\Model\ConfigurationWebhooks\Amount|null $targetAmount targetAmount + * + * @return self + */ + public function setTargetAmount($targetAmount) + { + if (is_null($targetAmount)) { + throw new \InvalidArgumentException('non-nullable targetAmount cannot be null'); + } + $this->container['targetAmount'] = $targetAmount; + + return $this; + } + + /** + * Gets transferInstrumentId + * + * @return string|null + */ + public function getTransferInstrumentId() + { + return $this->container['transferInstrumentId']; + } + + /** + * Sets transferInstrumentId + * + * @param string|null $transferInstrumentId The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/transferInstruments__resParam_id). You can also use this in combination with a `merchantAccount` and a `type` **pull** to start a direct debit request from the source transfer instrument. To use this feature, reach out to your Adyen contact. + * + * @return self + */ + public function setTransferInstrumentId($transferInstrumentId) + { + if (is_null($transferInstrumentId)) { + throw new \InvalidArgumentException('non-nullable transferInstrumentId cannot be null'); + } + $this->container['transferInstrumentId'] = $transferInstrumentId; + + return $this; + } + + /** + * Gets triggerAmount + * + * @return \Adyen\Model\ConfigurationWebhooks\Amount|null + */ + public function getTriggerAmount() + { + return $this->container['triggerAmount']; + } + + /** + * Sets triggerAmount + * + * @param \Adyen\Model\ConfigurationWebhooks\Amount|null $triggerAmount triggerAmount + * + * @return self + */ + public function setTriggerAmount($triggerAmount) + { + if (is_null($triggerAmount)) { + throw new \InvalidArgumentException('non-nullable triggerAmount cannot be null'); + } + $this->container['triggerAmount'] = $triggerAmount; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.php b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.php new file mode 100644 index 000000000..4aa173a5f --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.php @@ -0,0 +1,452 @@ + + */ +class SweepConfigurationNotificationData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SweepConfigurationNotificationData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountId' => 'string', + 'balancePlatform' => 'string', + 'sweep' => '\Adyen\Model\ConfigurationWebhooks\SweepConfigurationV2' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountId' => null, + 'balancePlatform' => null, + 'sweep' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountId' => false, + 'balancePlatform' => false, + 'sweep' => 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 = [ + 'accountId' => 'accountId', + 'balancePlatform' => 'balancePlatform', + 'sweep' => 'sweep' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountId' => 'setAccountId', + 'balancePlatform' => 'setBalancePlatform', + 'sweep' => 'setSweep' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountId' => 'getAccountId', + 'balancePlatform' => 'getBalancePlatform', + 'sweep' => 'getSweep' + ]; + + /** + * 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('accountId', $data ?? [], null); + $this->setIfExists('balancePlatform', $data ?? [], null); + $this->setIfExists('sweep', $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 accountId + * + * @return string|null + */ + public function getAccountId() + { + return $this->container['accountId']; + } + + /** + * Sets accountId + * + * @param string|null $accountId The unique identifier of the balance account for which the sweep was configured. + * + * @return self + */ + public function setAccountId($accountId) + { + if (is_null($accountId)) { + throw new \InvalidArgumentException('non-nullable accountId cannot be null'); + } + $this->container['accountId'] = $accountId; + + return $this; + } + + /** + * Gets balancePlatform + * + * @return string|null + */ + public function getBalancePlatform() + { + return $this->container['balancePlatform']; + } + + /** + * Sets balancePlatform + * + * @param string|null $balancePlatform The unique identifier of the balance platform. + * + * @return self + */ + public function setBalancePlatform($balancePlatform) + { + if (is_null($balancePlatform)) { + throw new \InvalidArgumentException('non-nullable balancePlatform cannot be null'); + } + $this->container['balancePlatform'] = $balancePlatform; + + return $this; + } + + /** + * Gets sweep + * + * @return \Adyen\Model\ConfigurationWebhooks\SweepConfigurationV2|null + */ + public function getSweep() + { + return $this->container['sweep']; + } + + /** + * Sets sweep + * + * @param \Adyen\Model\ConfigurationWebhooks\SweepConfigurationV2|null $sweep sweep + * + * @return self + */ + public function setSweep($sweep) + { + if (is_null($sweep)) { + throw new \InvalidArgumentException('non-nullable sweep cannot be null'); + } + $this->container['sweep'] = $sweep; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.php b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.php new file mode 100644 index 000000000..bf7df1474 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.php @@ -0,0 +1,496 @@ + + */ +class SweepConfigurationNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SweepConfigurationNotificationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\ConfigurationWebhooks\SweepConfigurationNotificationData', + 'environment' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'environment' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false, + 'environment' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'environment' => 'environment', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'environment' => 'setEnvironment', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'environment' => 'getEnvironment', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_CREATED = 'balancePlatform.balanceAccountSweep.created'; + public const TYPE_UPDATED = 'balancePlatform.balanceAccountSweep.updated'; + public const TYPE_DELETED = 'balancePlatform.balanceAccountSweep.deleted'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CREATED, + self::TYPE_UPDATED, + self::TYPE_DELETED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['environment'] === null) { + $invalidProperties[] = "'environment' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\ConfigurationWebhooks\SweepConfigurationNotificationData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\ConfigurationWebhooks\SweepConfigurationNotificationData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets environment + * + * @return string + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param string $environment The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @return self + */ + public function setEnvironment($environment) + { + if (is_null($environment)) { + throw new \InvalidArgumentException('non-nullable environment cannot be null'); + } + $this->container['environment'] = $environment; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of webhook. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationSchedule.php b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationSchedule.php new file mode 100644 index 000000000..115ee612b --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationSchedule.php @@ -0,0 +1,422 @@ + + */ +class SweepConfigurationSchedule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SweepConfiguration_schedule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cronExpression' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cronExpression' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'cronExpression' => 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 = [ + 'cronExpression' => 'cronExpression', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cronExpression' => 'setCronExpression', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cronExpression' => 'getCronExpression', + '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('cronExpression', $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['cronExpression'] === null) { + $invalidProperties[] = "'cronExpression' 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 cronExpression + * + * @return string + */ + public function getCronExpression() + { + return $this->container['cronExpression']; + } + + /** + * Sets cronExpression + * + * @param string $cronExpression A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: *****, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples. + * + * @return self + */ + public function setCronExpression($cronExpression) + { + if (is_null($cronExpression)) { + throw new \InvalidArgumentException('non-nullable cronExpression cannot be null'); + } + $this->container['cronExpression'] = $cronExpression; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.php b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.php new file mode 100644 index 000000000..7dc9f6cdd --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.php @@ -0,0 +1,857 @@ + + */ +class SweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SweepConfigurationV2'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'counterparty' => '\Adyen\Model\ConfigurationWebhooks\SweepCounterparty', + 'currency' => 'string', + 'description' => 'string', + 'id' => 'string', + 'reason' => 'string', + 'schedule' => '\Adyen\Model\ConfigurationWebhooks\SweepConfigurationSchedule', + 'status' => 'string', + 'sweepAmount' => '\Adyen\Model\ConfigurationWebhooks\Amount', + 'targetAmount' => '\Adyen\Model\ConfigurationWebhooks\Amount', + 'triggerAmount' => '\Adyen\Model\ConfigurationWebhooks\Amount', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'counterparty' => null, + 'currency' => null, + 'description' => null, + 'id' => null, + 'reason' => null, + 'schedule' => null, + 'status' => null, + 'sweepAmount' => null, + 'targetAmount' => null, + 'triggerAmount' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'counterparty' => false, + 'currency' => false, + 'description' => false, + 'id' => false, + 'reason' => false, + 'schedule' => false, + 'status' => false, + 'sweepAmount' => false, + 'targetAmount' => false, + 'triggerAmount' => 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 = [ + 'counterparty' => 'counterparty', + 'currency' => 'currency', + 'description' => 'description', + 'id' => 'id', + 'reason' => 'reason', + 'schedule' => 'schedule', + 'status' => 'status', + 'sweepAmount' => 'sweepAmount', + 'targetAmount' => 'targetAmount', + 'triggerAmount' => 'triggerAmount', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'counterparty' => 'setCounterparty', + 'currency' => 'setCurrency', + 'description' => 'setDescription', + 'id' => 'setId', + 'reason' => 'setReason', + 'schedule' => 'setSchedule', + 'status' => 'setStatus', + 'sweepAmount' => 'setSweepAmount', + 'targetAmount' => 'setTargetAmount', + 'triggerAmount' => 'setTriggerAmount', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'counterparty' => 'getCounterparty', + 'currency' => 'getCurrency', + 'description' => 'getDescription', + 'id' => 'getId', + 'reason' => 'getReason', + 'schedule' => 'getSchedule', + 'status' => 'getStatus', + 'sweepAmount' => 'getSweepAmount', + 'targetAmount' => 'getTargetAmount', + 'triggerAmount' => 'getTriggerAmount', + '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 REASON_AMOUNT_LIMIT_EXCEEDED = 'amountLimitExceeded'; + public const REASON_APPROVED = 'approved'; + public const REASON_COUNTERPARTY_ACCOUNT_BLOCKED = 'counterpartyAccountBlocked'; + public const REASON_COUNTERPARTY_ACCOUNT_CLOSED = 'counterpartyAccountClosed'; + public const REASON_COUNTERPARTY_ACCOUNT_NOT_FOUND = 'counterpartyAccountNotFound'; + public const REASON_COUNTERPARTY_ADDRESS_REQUIRED = 'counterpartyAddressRequired'; + public const REASON_COUNTERPARTY_BANK_TIMED_OUT = 'counterpartyBankTimedOut'; + public const REASON_COUNTERPARTY_BANK_UNAVAILABLE = 'counterpartyBankUnavailable'; + public const REASON_ERROR = 'error'; + public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; + public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; + public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; + public const REASON_UNKNOWN = 'unknown'; + public const STATUS_ACTIVE = 'active'; + public const STATUS_INACTIVE = 'inactive'; + public const TYPE_PULL = 'pull'; + public const TYPE_PUSH = 'push'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getReasonAllowableValues() + { + return [ + self::REASON_AMOUNT_LIMIT_EXCEEDED, + self::REASON_APPROVED, + self::REASON_COUNTERPARTY_ACCOUNT_BLOCKED, + self::REASON_COUNTERPARTY_ACCOUNT_CLOSED, + self::REASON_COUNTERPARTY_ACCOUNT_NOT_FOUND, + self::REASON_COUNTERPARTY_ADDRESS_REQUIRED, + self::REASON_COUNTERPARTY_BANK_TIMED_OUT, + self::REASON_COUNTERPARTY_BANK_UNAVAILABLE, + self::REASON_ERROR, + self::REASON_NOT_ENOUGH_BALANCE, + self::REASON_REFUSED_BY_COUNTERPARTY_BANK, + self::REASON_ROUTE_NOT_FOUND, + self::REASON_UNKNOWN, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_PULL, + self::TYPE_PUSH, + ]; + } + /** + * 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('counterparty', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('schedule', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('sweepAmount', $data ?? [], null); + $this->setIfExists('targetAmount', $data ?? [], null); + $this->setIfExists('triggerAmount', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'push'); + } + + /** + * 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['counterparty'] === null) { + $invalidProperties[] = "'counterparty' can't be null"; + } + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + $allowedValues = $this->getReasonAllowableValues(); + if (!is_null($this->container['reason']) && !in_array($this->container['reason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'reason', must be one of '%s'", + $this->container['reason'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['schedule'] === null) { + $invalidProperties[] = "'schedule' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 counterparty + * + * @return \Adyen\Model\ConfigurationWebhooks\SweepCounterparty + */ + public function getCounterparty() + { + return $this->container['counterparty']; + } + + /** + * Sets counterparty + * + * @param \Adyen\Model\ConfigurationWebhooks\SweepCounterparty $counterparty counterparty + * + * @return self + */ + public function setCounterparty($counterparty) + { + if (is_null($counterparty)) { + throw new \InvalidArgumentException('non-nullable counterparty cannot be null'); + } + $this->container['counterparty'] = $counterparty; + + return $this; + } + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) in uppercase. For example, **EUR**. The sweep currency must match any of the [balances currencies](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__resParam_balances). + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The message that will be used in the sweep transfer's description body with a maximum length of 140 characters. If the message is longer after replacing placeholders, the message will be cut off at 140 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the sweep. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason The reason for disabling the sweep. + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $allowedValues = $this->getReasonAllowableValues(); + if (!in_array($reason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'reason', must be one of '%s'", + $reason, + implode("', '", $allowedValues) + ) + ); + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets schedule + * + * @return \Adyen\Model\ConfigurationWebhooks\SweepConfigurationSchedule + */ + public function getSchedule() + { + return $this->container['schedule']; + } + + /** + * Sets schedule + * + * @param \Adyen\Model\ConfigurationWebhooks\SweepConfigurationSchedule $schedule schedule + * + * @return self + */ + public function setSchedule($schedule) + { + if (is_null($schedule)) { + throw new \InvalidArgumentException('non-nullable schedule cannot be null'); + } + $this->container['schedule'] = $schedule; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets sweepAmount + * + * @return \Adyen\Model\ConfigurationWebhooks\Amount|null + */ + public function getSweepAmount() + { + return $this->container['sweepAmount']; + } + + /** + * Sets sweepAmount + * + * @param \Adyen\Model\ConfigurationWebhooks\Amount|null $sweepAmount sweepAmount + * + * @return self + */ + public function setSweepAmount($sweepAmount) + { + if (is_null($sweepAmount)) { + throw new \InvalidArgumentException('non-nullable sweepAmount cannot be null'); + } + $this->container['sweepAmount'] = $sweepAmount; + + return $this; + } + + /** + * Gets targetAmount + * + * @return \Adyen\Model\ConfigurationWebhooks\Amount|null + */ + public function getTargetAmount() + { + return $this->container['targetAmount']; + } + + /** + * Sets targetAmount + * + * @param \Adyen\Model\ConfigurationWebhooks\Amount|null $targetAmount targetAmount + * + * @return self + */ + public function setTargetAmount($targetAmount) + { + if (is_null($targetAmount)) { + throw new \InvalidArgumentException('non-nullable targetAmount cannot be null'); + } + $this->container['targetAmount'] = $targetAmount; + + return $this; + } + + /** + * Gets triggerAmount + * + * @return \Adyen\Model\ConfigurationWebhooks\Amount|null + */ + public function getTriggerAmount() + { + return $this->container['triggerAmount']; + } + + /** + * Sets triggerAmount + * + * @param \Adyen\Model\ConfigurationWebhooks\Amount|null $triggerAmount triggerAmount + * + * @return self + */ + public function setTriggerAmount($triggerAmount) + { + if (is_null($triggerAmount)) { + throw new \InvalidArgumentException('non-nullable triggerAmount cannot be null'); + } + $this->container['triggerAmount'] = $triggerAmount; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/SweepCounterparty.php b/src/Adyen/Model/ConfigurationWebhooks/SweepCounterparty.php new file mode 100644 index 000000000..bab870d2d --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepCounterparty.php @@ -0,0 +1,452 @@ + + */ +class SweepCounterparty implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SweepCounterparty'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balanceAccountId' => 'string', + 'merchantAccount' => '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, + 'merchantAccount' => null, + 'transferInstrumentId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balanceAccountId' => false, + 'merchantAccount' => 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', + 'merchantAccount' => 'merchantAccount', + 'transferInstrumentId' => 'transferInstrumentId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balanceAccountId' => 'setBalanceAccountId', + 'merchantAccount' => 'setMerchantAccount', + 'transferInstrumentId' => 'setTransferInstrumentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balanceAccountId' => 'getBalanceAccountId', + 'merchantAccount' => 'getMerchantAccount', + '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('merchantAccount', $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 unique identifier of the destination or source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). You can only use this for periodic sweep schedules such as `schedule.type` **daily** or **monthly**. + * + * @return self + */ + public function setBalanceAccountId($balanceAccountId) + { + if (is_null($balanceAccountId)) { + throw new \InvalidArgumentException('non-nullable balanceAccountId cannot be null'); + } + $this->container['balanceAccountId'] = $balanceAccountId; + + return $this; + } + + /** + * Gets merchantAccount + * + * @return string|null + */ + public function getMerchantAccount() + { + return $this->container['merchantAccount']; + } + + /** + * Sets merchantAccount + * + * @param string|null $merchantAccount The merchant account that will be the source of funds, if you are processing payments with Adyen. You can only use this with sweeps of `type` **pull** and `schedule.type` **balance**. + * + * @return self + */ + public function setMerchantAccount($merchantAccount) + { + if (is_null($merchantAccount)) { + throw new \InvalidArgumentException('non-nullable merchantAccount cannot be null'); + } + $this->container['merchantAccount'] = $merchantAccount; + + return $this; + } + + /** + * Gets transferInstrumentId + * + * @return string|null + */ + public function getTransferInstrumentId() + { + return $this->container['transferInstrumentId']; + } + + /** + * Sets transferInstrumentId + * + * @param string|null $transferInstrumentId The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/transferInstruments__resParam_id). You can also use this in combination with a `merchantAccount` and a `type` **pull** to start a direct debit request from the source transfer instrument. To use this feature, reach out to your Adyen contact. + * + * @return self + */ + public function setTransferInstrumentId($transferInstrumentId) + { + if (is_null($transferInstrumentId)) { + throw new \InvalidArgumentException('non-nullable transferInstrumentId cannot be null'); + } + $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); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/SweepSchedule.php b/src/Adyen/Model/ConfigurationWebhooks/SweepSchedule.php new file mode 100644 index 000000000..dec632e6f --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/SweepSchedule.php @@ -0,0 +1,423 @@ + + */ +class SweepSchedule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SweepSchedule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '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 = [ + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '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_DAILY = 'daily'; + public const TYPE_WEEKLY = 'weekly'; + public const TYPE_MONTHLY = 'monthly'; + public const TYPE_BALANCE = 'balance'; + public const TYPE_CRON = 'cron'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DAILY, + self::TYPE_WEEKLY, + self::TYPE_MONTHLY, + self::TYPE_BALANCE, + self::TYPE_CRON, + ]; + } + /** + * 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('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ConfigurationWebhooks/USLocalAccountIdentification.php b/src/Adyen/Model/ConfigurationWebhooks/USLocalAccountIdentification.php new file mode 100644 index 000000000..a54808c17 --- /dev/null +++ b/src/Adyen/Model/ConfigurationWebhooks/USLocalAccountIdentification.php @@ -0,0 +1,559 @@ + + */ +class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'USLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'accountType' => 'string', + 'routingNumber' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'accountType' => null, + 'routingNumber' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'accountType' => false, + 'routingNumber' => 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 = [ + 'accountNumber' => 'accountNumber', + 'accountType' => 'accountType', + 'routingNumber' => 'routingNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'accountType' => 'setAccountType', + 'routingNumber' => 'setRoutingNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'accountType' => 'getAccountType', + 'routingNumber' => 'getRoutingNumber', + '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 ACCOUNT_TYPE_CHECKING = 'checking'; + public const ACCOUNT_TYPE_SAVINGS = 'savings'; + public const TYPE_US_LOCAL = 'usLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAccountTypeAllowableValues() + { + return [ + self::ACCOUNT_TYPE_CHECKING, + self::ACCOUNT_TYPE_SAVINGS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_US_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('accountType', $data ?? [], 'checking'); + $this->setIfExists('routingNumber', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'usLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + $allowedValues = $this->getAccountTypeAllowableValues(); + if (!is_null($this->container['accountType']) && !in_array($this->container['accountType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'accountType', must be one of '%s'", + $this->container['accountType'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['routingNumber'] === null) { + $invalidProperties[] = "'routingNumber' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets accountType + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['accountType']; + } + + /** + * Sets accountType + * + * @param string|null $accountType The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * + * @return self + */ + public function setAccountType($accountType) + { + if (is_null($accountType)) { + throw new \InvalidArgumentException('non-nullable accountType cannot be null'); + } + $allowedValues = $this->getAccountTypeAllowableValues(); + if (!in_array($accountType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'accountType', must be one of '%s'", + $accountType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['accountType'] = $accountType; + + return $this; + } + + /** + * Gets routingNumber + * + * @return string + */ + public function getRoutingNumber() + { + return $this->container['routingNumber']; + } + + /** + * Sets routingNumber + * + * @param string $routingNumber The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. + * + * @return self + */ + public function setRoutingNumber($routingNumber) + { + if (is_null($routingNumber)) { + throw new \InvalidArgumentException('non-nullable routingNumber cannot be null'); + } + $this->container['routingNumber'] = $routingNumber; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **usLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.php b/src/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.php index 28c363746..1cf176b29 100644 --- a/src/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.php +++ b/src/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.php @@ -268,6 +268,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['acceptedBy'] === null) { + $invalidProperties[] = "'acceptedBy' can't be null"; + } return $invalidProperties; } @@ -286,7 +289,7 @@ public function valid() /** * Gets acceptedBy * - * @return string|null + * @return string */ public function getAcceptedBy() { @@ -296,7 +299,7 @@ public function getAcceptedBy() /** * Sets acceptedBy * - * @param string|null $acceptedBy The unique identifier of the user accepting the Terms of Service. + * @param string $acceptedBy The individual legal entity ID of the user accepting the Terms of Service. This can also be the legal entity ID of the signatory for an organization. * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/Address.php b/src/Adyen/Model/LegalEntityManagement/Address.php index f789fbd1e..f08cb68ee 100644 --- a/src/Adyen/Model/LegalEntityManagement/Address.php +++ b/src/Adyen/Model/LegalEntityManagement/Address.php @@ -408,7 +408,7 @@ public function getStateOrProvince() /** * Sets stateOrProvince * - * @param string|null $stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA** in the US. If you specify the state or province, you must also send `city`, `postalCode`, and `street`. + * @param string|null $stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA** in the US. If you specify the state or province, you must also send `city`, `postalCode`, and `street`. * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/BankAccount.php b/src/Adyen/Model/LegalEntityManagement/BankAccount.php index b2f8c6b6c..449551d4d 100644 --- a/src/Adyen/Model/LegalEntityManagement/BankAccount.php +++ b/src/Adyen/Model/LegalEntityManagement/BankAccount.php @@ -48,6 +48,7 @@ class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable 'accountNumber' => 'string', 'bsbCode' => 'string', 'type' => 'string', + 'accountType' => 'string', 'institutionNumber' => 'string', 'transitNumber' => 'string', 'bankCode' => 'string', @@ -56,7 +57,6 @@ class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable 'bic' => 'string', 'clearingNumber' => 'string', 'sortCode' => 'string', - 'accountType' => 'string', 'routingNumber' => 'string' ]; @@ -71,6 +71,7 @@ class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable 'accountNumber' => null, 'bsbCode' => null, 'type' => null, + 'accountType' => null, 'institutionNumber' => null, 'transitNumber' => null, 'bankCode' => null, @@ -79,7 +80,6 @@ class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable 'bic' => null, 'clearingNumber' => null, 'sortCode' => null, - 'accountType' => null, 'routingNumber' => null ]; @@ -92,6 +92,7 @@ class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable 'accountNumber' => false, 'bsbCode' => false, 'type' => false, + 'accountType' => false, 'institutionNumber' => false, 'transitNumber' => false, 'bankCode' => false, @@ -100,7 +101,6 @@ class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable 'bic' => false, 'clearingNumber' => false, 'sortCode' => false, - 'accountType' => false, 'routingNumber' => false ]; @@ -193,6 +193,7 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'accountNumber', 'bsbCode' => 'bsbCode', 'type' => 'type', + 'accountType' => 'accountType', 'institutionNumber' => 'institutionNumber', 'transitNumber' => 'transitNumber', 'bankCode' => 'bankCode', @@ -201,7 +202,6 @@ public function isNullableSetToNull(string $property): bool 'bic' => 'bic', 'clearingNumber' => 'clearingNumber', 'sortCode' => 'sortCode', - 'accountType' => 'accountType', 'routingNumber' => 'routingNumber' ]; @@ -214,6 +214,7 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'setAccountNumber', 'bsbCode' => 'setBsbCode', 'type' => 'setType', + 'accountType' => 'setAccountType', 'institutionNumber' => 'setInstitutionNumber', 'transitNumber' => 'setTransitNumber', 'bankCode' => 'setBankCode', @@ -222,7 +223,6 @@ public function isNullableSetToNull(string $property): bool 'bic' => 'setBic', 'clearingNumber' => 'setClearingNumber', 'sortCode' => 'setSortCode', - 'accountType' => 'setAccountType', 'routingNumber' => 'setRoutingNumber' ]; @@ -235,6 +235,7 @@ public function isNullableSetToNull(string $property): bool 'accountNumber' => 'getAccountNumber', 'bsbCode' => 'getBsbCode', 'type' => 'getType', + 'accountType' => 'getAccountType', 'institutionNumber' => 'getInstitutionNumber', 'transitNumber' => 'getTransitNumber', 'bankCode' => 'getBankCode', @@ -243,7 +244,6 @@ public function isNullableSetToNull(string $property): bool 'bic' => 'getBic', 'clearingNumber' => 'getClearingNumber', 'sortCode' => 'getSortCode', - 'accountType' => 'getAccountType', 'routingNumber' => 'getRoutingNumber' ]; @@ -306,6 +306,7 @@ public function __construct(array $data = null) $this->setIfExists('accountNumber', $data ?? [], null); $this->setIfExists('bsbCode', $data ?? [], null); $this->setIfExists('type', $data ?? [], 'usLocal'); + $this->setIfExists('accountType', $data ?? [], 'checking'); $this->setIfExists('institutionNumber', $data ?? [], null); $this->setIfExists('transitNumber', $data ?? [], null); $this->setIfExists('bankCode', $data ?? [], null); @@ -314,7 +315,6 @@ public function __construct(array $data = null) $this->setIfExists('bic', $data ?? [], null); $this->setIfExists('clearingNumber', $data ?? [], null); $this->setIfExists('sortCode', $data ?? [], null); - $this->setIfExists('accountType', $data ?? [], 'checking'); $this->setIfExists('routingNumber', $data ?? [], null); } @@ -355,6 +355,7 @@ public function listInvalidProperties() $invalidProperties[] = "'type' can't be null"; } + if ($this->container['institutionNumber'] === null) { $invalidProperties[] = "'institutionNumber' can't be null"; } @@ -376,7 +377,6 @@ public function listInvalidProperties() if ($this->container['sortCode'] === null) { $invalidProperties[] = "'sortCode' can't be null"; } - if ($this->container['routingNumber'] === null) { $invalidProperties[] = "'routingNumber' can't be null"; } @@ -476,6 +476,33 @@ public function setType($type) return $this; } + /** + * Gets accountType + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['accountType']; + } + + /** + * Sets accountType + * + * @param string|null $accountType The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * + * @return self + */ + public function setAccountType($accountType) + { + if (is_null($accountType)) { + throw new \InvalidArgumentException('non-nullable accountType cannot be null'); + } + $this->container['accountType'] = $accountType; + + return $this; + } + /** * Gets institutionNumber * @@ -692,33 +719,6 @@ public function setSortCode($sortCode) return $this; } - /** - * Gets accountType - * - * @return string|null - */ - public function getAccountType() - { - return $this->container['accountType']; - } - - /** - * Sets accountType - * - * @param string|null $accountType The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. - * - * @return self - */ - public function setAccountType($accountType) - { - if (is_null($accountType)) { - throw new \InvalidArgumentException('non-nullable accountType cannot be null'); - } - $this->container['accountType'] = $accountType; - - return $this; - } - /** * Gets routingNumber * diff --git a/src/Adyen/Model/LegalEntityManagement/BankAccountInfo.php b/src/Adyen/Model/LegalEntityManagement/BankAccountInfo.php index 2dd02ccb8..77b637fd6 100644 --- a/src/Adyen/Model/LegalEntityManagement/BankAccountInfo.php +++ b/src/Adyen/Model/LegalEntityManagement/BankAccountInfo.php @@ -46,7 +46,8 @@ class BankAccountInfo implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'accountIdentification' => '\Adyen\Model\LegalEntityManagement\BankAccount', 'accountType' => 'string', - 'countryCode' => 'string' + 'countryCode' => 'string', + 'trustedSource' => 'bool' ]; /** @@ -59,7 +60,8 @@ class BankAccountInfo implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'accountIdentification' => null, 'accountType' => null, - 'countryCode' => null + 'countryCode' => null, + 'trustedSource' => null ]; /** @@ -70,7 +72,8 @@ class BankAccountInfo implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPINullables = [ 'accountIdentification' => false, 'accountType' => false, - 'countryCode' => false + 'countryCode' => false, + 'trustedSource' => false ]; /** @@ -161,7 +164,8 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountIdentification' => 'accountIdentification', 'accountType' => 'accountType', - 'countryCode' => 'countryCode' + 'countryCode' => 'countryCode', + 'trustedSource' => 'trustedSource' ]; /** @@ -172,7 +176,8 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountIdentification' => 'setAccountIdentification', 'accountType' => 'setAccountType', - 'countryCode' => 'setCountryCode' + 'countryCode' => 'setCountryCode', + 'trustedSource' => 'setTrustedSource' ]; /** @@ -183,7 +188,8 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountIdentification' => 'getAccountIdentification', 'accountType' => 'getAccountType', - 'countryCode' => 'getCountryCode' + 'countryCode' => 'getCountryCode', + 'trustedSource' => 'getTrustedSource' ]; /** @@ -246,6 +252,7 @@ public function __construct(array $data = null) $this->setIfExists('accountIdentification', $data ?? [], null); $this->setIfExists('accountType', $data ?? [], null); $this->setIfExists('countryCode', $data ?? [], null); + $this->setIfExists('trustedSource', $data ?? [], null); } /** @@ -372,6 +379,33 @@ public function setCountryCode($countryCode) return $this; } + + /** + * Gets trustedSource + * + * @return bool|null + */ + public function getTrustedSource() + { + return $this->container['trustedSource']; + } + + /** + * Sets trustedSource + * + * @param bool|null $trustedSource Identifies if the bank account was created through [instant bank verification](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-08-hosted-onboarding). + * + * @return self + */ + public function setTrustedSource($trustedSource) + { + if (is_null($trustedSource)) { + throw new \InvalidArgumentException('non-nullable trustedSource cannot be null'); + } + $this->container['trustedSource'] = $trustedSource; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/LegalEntityManagement/BusinessLine.php b/src/Adyen/Model/LegalEntityManagement/BusinessLine.php index 425ba8aff..159ded8ec 100644 --- a/src/Adyen/Model/LegalEntityManagement/BusinessLine.php +++ b/src/Adyen/Model/LegalEntityManagement/BusinessLine.php @@ -269,10 +269,26 @@ public function getModelName() return self::$openAPIModelName; } + public const CAPABILITY_RECEIVE_PAYMENTS = 'receivePayments'; + public const CAPABILITY_RECEIVE_FROM_PLATFORM_PAYMENTS = 'receiveFromPlatformPayments'; + public const CAPABILITY_ISSUE_BANK_ACCOUNT = 'issueBankAccount'; public const SERVICE_PAYMENT_PROCESSING = 'paymentProcessing'; public const SERVICE_ISSUING = 'issuing'; public const SERVICE_BANKING = 'banking'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCapabilityAllowableValues() + { + return [ + self::CAPABILITY_RECEIVE_PAYMENTS, + self::CAPABILITY_RECEIVE_FROM_PLATFORM_PAYMENTS, + self::CAPABILITY_ISSUE_BANK_ACCOUNT, + ]; + } /** * Gets allowable values of the enum * @@ -340,6 +356,15 @@ public function listInvalidProperties() { $invalidProperties = []; + $allowedValues = $this->getCapabilityAllowableValues(); + if (!is_null($this->container['capability']) && !in_array($this->container['capability'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'capability', must be one of '%s'", + $this->container['capability'], + implode("', '", $allowedValues) + ); + } + if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } @@ -390,7 +415,7 @@ public function getCapability() /** * Sets capability * - * @param string|null $capability The capability for which you are creating the business line. For example, **receivePayments**. + * @param string|null $capability The capability for which you are creating the business line. Possible values: **receivePayments**, **receiveFromPlatformPayments**, **issueBankAccount** * * @return self * @deprecated @@ -400,6 +425,16 @@ public function setCapability($capability) if (is_null($capability)) { throw new \InvalidArgumentException('non-nullable capability cannot be null'); } + $allowedValues = $this->getCapabilityAllowableValues(); + if (!in_array($capability, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'capability', must be one of '%s'", + $capability, + implode("', '", $allowedValues) + ) + ); + } $this->container['capability'] = $capability; return $this; @@ -553,7 +588,7 @@ public function getService() /** * Sets service * - * @param string $service The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** + * @param string $service The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/BusinessLineInfo.php b/src/Adyen/Model/LegalEntityManagement/BusinessLineInfo.php index a4c57ddae..e1fef84c8 100644 --- a/src/Adyen/Model/LegalEntityManagement/BusinessLineInfo.php +++ b/src/Adyen/Model/LegalEntityManagement/BusinessLineInfo.php @@ -257,10 +257,26 @@ public function getModelName() return self::$openAPIModelName; } + public const CAPABILITY_RECEIVE_PAYMENTS = 'receivePayments'; + public const CAPABILITY_RECEIVE_FROM_PLATFORM_PAYMENTS = 'receiveFromPlatformPayments'; + public const CAPABILITY_ISSUE_BANK_ACCOUNT = 'issueBankAccount'; public const SERVICE_PAYMENT_PROCESSING = 'paymentProcessing'; public const SERVICE_ISSUING = 'issuing'; public const SERVICE_BANKING = 'banking'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCapabilityAllowableValues() + { + return [ + self::CAPABILITY_RECEIVE_PAYMENTS, + self::CAPABILITY_RECEIVE_FROM_PLATFORM_PAYMENTS, + self::CAPABILITY_ISSUE_BANK_ACCOUNT, + ]; + } /** * Gets allowable values of the enum * @@ -326,6 +342,15 @@ public function listInvalidProperties() { $invalidProperties = []; + $allowedValues = $this->getCapabilityAllowableValues(); + if (!is_null($this->container['capability']) && !in_array($this->container['capability'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'capability', must be one of '%s'", + $this->container['capability'], + implode("', '", $allowedValues) + ); + } + if ($this->container['industryCode'] === null) { $invalidProperties[] = "'industryCode' can't be null"; } @@ -373,7 +398,7 @@ public function getCapability() /** * Sets capability * - * @param string|null $capability The capability for which you are creating the business line. For example, **receivePayments**. + * @param string|null $capability The capability for which you are creating the business line. Possible values: **receivePayments**, **receiveFromPlatformPayments**, **issueBankAccount** * * @return self * @deprecated @@ -383,6 +408,16 @@ public function setCapability($capability) if (is_null($capability)) { throw new \InvalidArgumentException('non-nullable capability cannot be null'); } + $allowedValues = $this->getCapabilityAllowableValues(); + if (!in_array($capability, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'capability', must be one of '%s'", + $capability, + implode("', '", $allowedValues) + ) + ); + } $this->container['capability'] = $capability; return $this; @@ -482,7 +517,7 @@ public function getService() /** * Sets service * - * @param string $service The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** + * @param string $service The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/BusinessLineInfoUpdate.php b/src/Adyen/Model/LegalEntityManagement/BusinessLineInfoUpdate.php index f31318638..97c615c03 100644 --- a/src/Adyen/Model/LegalEntityManagement/BusinessLineInfoUpdate.php +++ b/src/Adyen/Model/LegalEntityManagement/BusinessLineInfoUpdate.php @@ -257,10 +257,26 @@ public function getModelName() return self::$openAPIModelName; } + public const CAPABILITY_RECEIVE_PAYMENTS = 'receivePayments'; + public const CAPABILITY_RECEIVE_FROM_PLATFORM_PAYMENTS = 'receiveFromPlatformPayments'; + public const CAPABILITY_ISSUE_BANK_ACCOUNT = 'issueBankAccount'; public const SERVICE_PAYMENT_PROCESSING = 'paymentProcessing'; public const SERVICE_ISSUING = 'issuing'; public const SERVICE_BANKING = 'banking'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCapabilityAllowableValues() + { + return [ + self::CAPABILITY_RECEIVE_PAYMENTS, + self::CAPABILITY_RECEIVE_FROM_PLATFORM_PAYMENTS, + self::CAPABILITY_ISSUE_BANK_ACCOUNT, + ]; + } /** * Gets allowable values of the enum * @@ -326,9 +342,15 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['service'] === null) { - $invalidProperties[] = "'service' can't be null"; + $allowedValues = $this->getCapabilityAllowableValues(); + if (!is_null($this->container['capability']) && !in_array($this->container['capability'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'capability', must be one of '%s'", + $this->container['capability'], + implode("', '", $allowedValues) + ); } + $allowedValues = $this->getServiceAllowableValues(); if (!is_null($this->container['service']) && !in_array($this->container['service'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -377,6 +399,16 @@ public function setCapability($capability) if (is_null($capability)) { throw new \InvalidArgumentException('non-nullable capability cannot be null'); } + $allowedValues = $this->getCapabilityAllowableValues(); + if (!in_array($capability, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'capability', must be one of '%s'", + $capability, + implode("', '", $allowedValues) + ) + ); + } $this->container['capability'] = $capability; return $this; @@ -466,7 +498,7 @@ public function setSalesChannels($salesChannels) /** * Gets service * - * @return string + * @return string|null */ public function getService() { @@ -476,7 +508,7 @@ public function getService() /** * Sets service * - * @param string $service The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** + * @param string|null $service The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/CALocalAccountIdentification.php b/src/Adyen/Model/LegalEntityManagement/CALocalAccountIdentification.php index 04114e2d6..6b06d1b7b 100644 --- a/src/Adyen/Model/LegalEntityManagement/CALocalAccountIdentification.php +++ b/src/Adyen/Model/LegalEntityManagement/CALocalAccountIdentification.php @@ -45,6 +45,7 @@ class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'accountNumber' => 'string', + 'accountType' => 'string', 'institutionNumber' => 'string', 'transitNumber' => 'string', 'type' => 'string' @@ -59,6 +60,7 @@ class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'accountNumber' => null, + 'accountType' => null, 'institutionNumber' => null, 'transitNumber' => null, 'type' => null @@ -71,6 +73,7 @@ class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'accountNumber' => false, + 'accountType' => false, 'institutionNumber' => false, 'transitNumber' => false, 'type' => false @@ -163,6 +166,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountNumber' => 'accountNumber', + 'accountType' => 'accountType', 'institutionNumber' => 'institutionNumber', 'transitNumber' => 'transitNumber', 'type' => 'type' @@ -175,6 +179,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountNumber' => 'setAccountNumber', + 'accountType' => 'setAccountType', 'institutionNumber' => 'setInstitutionNumber', 'transitNumber' => 'setTransitNumber', 'type' => 'setType' @@ -187,6 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountNumber' => 'getAccountNumber', + 'accountType' => 'getAccountType', 'institutionNumber' => 'getInstitutionNumber', 'transitNumber' => 'getTransitNumber', 'type' => 'getType' @@ -233,8 +239,22 @@ public function getModelName() return self::$openAPIModelName; } + public const ACCOUNT_TYPE_CHECKING = 'checking'; + public const ACCOUNT_TYPE_SAVINGS = 'savings'; public const TYPE_CA_LOCAL = 'caLocal'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAccountTypeAllowableValues() + { + return [ + self::ACCOUNT_TYPE_CHECKING, + self::ACCOUNT_TYPE_SAVINGS, + ]; + } /** * Gets allowable values of the enum * @@ -262,6 +282,7 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('accountType', $data ?? [], 'checking'); $this->setIfExists('institutionNumber', $data ?? [], null); $this->setIfExists('transitNumber', $data ?? [], null); $this->setIfExists('type', $data ?? [], 'caLocal'); @@ -297,6 +318,15 @@ public function listInvalidProperties() if ($this->container['accountNumber'] === null) { $invalidProperties[] = "'accountNumber' can't be null"; } + $allowedValues = $this->getAccountTypeAllowableValues(); + if (!is_null($this->container['accountType']) && !in_array($this->container['accountType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'accountType', must be one of '%s'", + $this->container['accountType'], + implode("', '", $allowedValues) + ); + } + if ($this->container['institutionNumber'] === null) { $invalidProperties[] = "'institutionNumber' can't be null"; } @@ -357,6 +387,43 @@ public function setAccountNumber($accountNumber) return $this; } + /** + * Gets accountType + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['accountType']; + } + + /** + * Sets accountType + * + * @param string|null $accountType The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * + * @return self + */ + public function setAccountType($accountType) + { + if (is_null($accountType)) { + throw new \InvalidArgumentException('non-nullable accountType cannot be null'); + } + $allowedValues = $this->getAccountTypeAllowableValues(); + if (!in_array($accountType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'accountType', must be one of '%s'", + $accountType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['accountType'] = $accountType; + + return $this; + } + /** * Gets institutionNumber * diff --git a/src/Adyen/Model/LegalEntityManagement/CapabilityProblemEntity.php b/src/Adyen/Model/LegalEntityManagement/CapabilityProblemEntity.php index 793750304..ae97db0fd 100644 --- a/src/Adyen/Model/LegalEntityManagement/CapabilityProblemEntity.php +++ b/src/Adyen/Model/LegalEntityManagement/CapabilityProblemEntity.php @@ -236,6 +236,7 @@ public function getModelName() public const TYPE_BANK_ACCOUNT = 'BankAccount'; public const TYPE_DOCUMENT = 'Document'; public const TYPE_LEGAL_ENTITY = 'LegalEntity'; + public const TYPE_PRODUCT = 'product'; /** * Gets allowable values of the enum @@ -248,6 +249,7 @@ public function getTypeAllowableValues() self::TYPE_BANK_ACCOUNT, self::TYPE_DOCUMENT, self::TYPE_LEGAL_ENTITY, + self::TYPE_PRODUCT, ]; } /** @@ -335,7 +337,7 @@ public function getDocuments() /** * Sets documents * - * @param string[]|null $documents documents + * @param string[]|null $documents List of document IDs corresponding to the verification errors from capabilities. * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.php b/src/Adyen/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.php index a6c746c15..f8ddbbc68 100644 --- a/src/Adyen/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.php +++ b/src/Adyen/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.php @@ -230,6 +230,7 @@ public function getModelName() public const TYPE_BANK_ACCOUNT = 'BankAccount'; public const TYPE_DOCUMENT = 'Document'; public const TYPE_LEGAL_ENTITY = 'LegalEntity'; + public const TYPE_PRODUCT = 'product'; /** * Gets allowable values of the enum @@ -242,6 +243,7 @@ public function getTypeAllowableValues() self::TYPE_BANK_ACCOUNT, self::TYPE_DOCUMENT, self::TYPE_LEGAL_ENTITY, + self::TYPE_PRODUCT, ]; } /** @@ -328,7 +330,7 @@ public function getDocuments() /** * Sets documents * - * @param string[]|null $documents documents + * @param string[]|null $documents List of document IDs corresponding to the verification errors from capabilities. * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/Document.php b/src/Adyen/Model/LegalEntityManagement/Document.php index 7ce1199d3..68d4de712 100644 --- a/src/Adyen/Model/LegalEntityManagement/Document.php +++ b/src/Adyen/Model/LegalEntityManagement/Document.php @@ -300,6 +300,7 @@ public function getModelName() public const TYPE_PROOF_OF_ORGANIZATION_TAX_INFO = 'proofOfOrganizationTaxInfo'; public const TYPE_PROOF_OF_INDUSTRY = 'proofOfIndustry'; public const TYPE_CONSTITUTIONAL_DOCUMENT = 'constitutionalDocument'; + public const TYPE_PROOF_OF_FUNDING_OR_WEALTH_SOURCE = 'proofOfFundingOrWealthSource'; /** * Gets allowable values of the enum @@ -322,6 +323,7 @@ public function getTypeAllowableValues() self::TYPE_PROOF_OF_ORGANIZATION_TAX_INFO, self::TYPE_PROOF_OF_INDUSTRY, self::TYPE_CONSTITUTIONAL_DOCUMENT, + self::TYPE_PROOF_OF_FUNDING_OR_WEALTH_SOURCE, ]; } /** @@ -381,15 +383,9 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['attachments'] === null) { - $invalidProperties[] = "'attachments' can't be null"; - } if ($this->container['description'] === null) { $invalidProperties[] = "'description' can't be null"; } - if ($this->container['owner'] === null) { - $invalidProperties[] = "'owner' can't be null"; - } if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } @@ -447,7 +443,7 @@ public function setAttachment($attachment) /** * Gets attachments * - * @return \Adyen\Model\LegalEntityManagement\Attachment[] + * @return \Adyen\Model\LegalEntityManagement\Attachment[]|null */ public function getAttachments() { @@ -457,7 +453,7 @@ public function getAttachments() /** * Sets attachments * - * @param \Adyen\Model\LegalEntityManagement\Attachment[] $attachments Array that contains the document. The array supports multiple attachments for uploading different sides or pages of a document. + * @param \Adyen\Model\LegalEntityManagement\Attachment[]|null $attachments Array that contains the document. The array supports multiple attachments for uploading different sides or pages of a document. * * @return self */ @@ -723,7 +719,7 @@ public function setNumber($number) /** * Gets owner * - * @return \Adyen\Model\LegalEntityManagement\OwnerEntity + * @return \Adyen\Model\LegalEntityManagement\OwnerEntity|null */ public function getOwner() { @@ -733,7 +729,7 @@ public function getOwner() /** * Sets owner * - * @param \Adyen\Model\LegalEntityManagement\OwnerEntity $owner owner + * @param \Adyen\Model\LegalEntityManagement\OwnerEntity|null $owner owner * * @return self */ @@ -760,7 +756,7 @@ public function getType() /** * Sets type * - * @param string $type Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, or **proofOfIndustry**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, or **proofOfIndividualTaxId**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * @param string $type Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, **proofOfIndustry**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, or **proofOfFundingOrWealthSource**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/DocumentPage.php b/src/Adyen/Model/LegalEntityManagement/DocumentPage.php new file mode 100644 index 000000000..bffbfc865 --- /dev/null +++ b/src/Adyen/Model/LegalEntityManagement/DocumentPage.php @@ -0,0 +1,485 @@ + + */ +class DocumentPage implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentPage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'pageName' => 'string', + 'pageNumber' => 'int', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'pageName' => null, + 'pageNumber' => 'int32', + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'pageName' => false, + 'pageNumber' => true, + '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 = [ + 'pageName' => 'pageName', + 'pageNumber' => 'pageNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pageName' => 'setPageName', + 'pageNumber' => 'setPageNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pageName' => 'getPageName', + 'pageNumber' => 'getPageNumber', + '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_BACK = 'BACK'; + public const TYPE_FRONT = 'FRONT'; + public const TYPE_UNDEFINED = 'UNDEFINED'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BACK, + self::TYPE_FRONT, + self::TYPE_UNDEFINED, + ]; + } + /** + * 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('pageName', $data ?? [], null); + $this->setIfExists('pageNumber', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pageName + * + * @return string|null + */ + public function getPageName() + { + return $this->container['pageName']; + } + + /** + * Sets pageName + * + * @param string|null $pageName pageName + * + * @return self + */ + public function setPageName($pageName) + { + if (is_null($pageName)) { + throw new \InvalidArgumentException('non-nullable pageName cannot be null'); + } + $this->container['pageName'] = $pageName; + + return $this; + } + + /** + * Gets pageNumber + * + * @return int|null + */ + public function getPageNumber() + { + return $this->container['pageNumber']; + } + + /** + * Sets pageNumber + * + * @param int|null $pageNumber pageNumber + * + * @return self + */ + public function setPageNumber($pageNumber) + { + // Do nothing for nullable integers + $this->container['pageNumber'] = $pageNumber; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/LegalEntityManagement/DocumentReference.php b/src/Adyen/Model/LegalEntityManagement/DocumentReference.php index 98f0ecfed..5a71d1d70 100644 --- a/src/Adyen/Model/LegalEntityManagement/DocumentReference.php +++ b/src/Adyen/Model/LegalEntityManagement/DocumentReference.php @@ -49,6 +49,7 @@ class DocumentReference implements ModelInterface, ArrayAccess, \JsonSerializabl 'fileName' => 'string', 'id' => 'string', 'modificationDate' => '\DateTime', + 'pages' => '\Adyen\Model\LegalEntityManagement\DocumentPage[]', 'type' => 'string' ]; @@ -65,6 +66,7 @@ class DocumentReference implements ModelInterface, ArrayAccess, \JsonSerializabl 'fileName' => null, 'id' => null, 'modificationDate' => 'date-time', + 'pages' => null, 'type' => null ]; @@ -79,6 +81,7 @@ class DocumentReference implements ModelInterface, ArrayAccess, \JsonSerializabl 'fileName' => false, 'id' => false, 'modificationDate' => false, + 'pages' => false, 'type' => false ]; @@ -173,6 +176,7 @@ public function isNullableSetToNull(string $property): bool 'fileName' => 'fileName', 'id' => 'id', 'modificationDate' => 'modificationDate', + 'pages' => 'pages', 'type' => 'type' ]; @@ -187,6 +191,7 @@ public function isNullableSetToNull(string $property): bool 'fileName' => 'setFileName', 'id' => 'setId', 'modificationDate' => 'setModificationDate', + 'pages' => 'setPages', 'type' => 'setType' ]; @@ -201,6 +206,7 @@ public function isNullableSetToNull(string $property): bool 'fileName' => 'getFileName', 'id' => 'getId', 'modificationDate' => 'getModificationDate', + 'pages' => 'getPages', 'type' => 'getType' ]; @@ -266,6 +272,7 @@ public function __construct(array $data = null) $this->setIfExists('fileName', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('modificationDate', $data ?? [], null); + $this->setIfExists('pages', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -446,6 +453,33 @@ public function setModificationDate($modificationDate) return $this; } + /** + * Gets pages + * + * @return \Adyen\Model\LegalEntityManagement\DocumentPage[]|null + */ + public function getPages() + { + return $this->container['pages']; + } + + /** + * Sets pages + * + * @param \Adyen\Model\LegalEntityManagement\DocumentPage[]|null $pages List of document pages + * + * @return self + */ + public function setPages($pages) + { + if (is_null($pages)) { + throw new \InvalidArgumentException('non-nullable pages cannot be null'); + } + $this->container['pages'] = $pages; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/LegalEntityManagement/GeneratePciDescriptionRequest.php b/src/Adyen/Model/LegalEntityManagement/GeneratePciDescriptionRequest.php new file mode 100644 index 000000000..39906621d --- /dev/null +++ b/src/Adyen/Model/LegalEntityManagement/GeneratePciDescriptionRequest.php @@ -0,0 +1,384 @@ + + */ +class GeneratePciDescriptionRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GeneratePciDescriptionRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'language' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'language' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'language' => 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 = [ + 'language' => 'language' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'language' => 'setLanguage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'language' => 'getLanguage' + ]; + + /** + * 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('language', $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 language + * + * @return string|null + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string|null $language Sets the language of the PCI questionnaire. Its value is a two-character [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code, for example, **en**. + * + * @return self + */ + public function setLanguage($language) + { + if (is_null($language)) { + throw new \InvalidArgumentException('non-nullable language cannot be null'); + } + $this->container['language'] = $language; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/LegalEntityManagement/GeneratePciDescriptionResponse.php b/src/Adyen/Model/LegalEntityManagement/GeneratePciDescriptionResponse.php new file mode 100644 index 000000000..0be96043a --- /dev/null +++ b/src/Adyen/Model/LegalEntityManagement/GeneratePciDescriptionResponse.php @@ -0,0 +1,452 @@ + + */ +class GeneratePciDescriptionResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GeneratePciDescriptionResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'content' => 'string', + 'language' => 'string', + 'pciTemplateReferences' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'content' => 'byte', + 'language' => null, + 'pciTemplateReferences' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'content' => false, + 'language' => false, + 'pciTemplateReferences' => 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 = [ + 'content' => 'content', + 'language' => 'language', + 'pciTemplateReferences' => 'pciTemplateReferences' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent', + 'language' => 'setLanguage', + 'pciTemplateReferences' => 'setPciTemplateReferences' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent', + 'language' => 'getLanguage', + 'pciTemplateReferences' => 'getPciTemplateReferences' + ]; + + /** + * 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('content', $data ?? [], null); + $this->setIfExists('language', $data ?? [], null); + $this->setIfExists('pciTemplateReferences', $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 content + * + * @return string|null + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content The generated questionnaires in a base64 encoded format. + * + * @return self + */ + public function setContent($content) + { + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets language + * + * @return string|null + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string|null $language The two-letter [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code for the questionnaire. For example, **en**. + * + * @return self + */ + public function setLanguage($language) + { + if (is_null($language)) { + throw new \InvalidArgumentException('non-nullable language cannot be null'); + } + $this->container['language'] = $language; + + return $this; + } + + /** + * Gets pciTemplateReferences + * + * @return string[]|null + */ + public function getPciTemplateReferences() + { + return $this->container['pciTemplateReferences']; + } + + /** + * Sets pciTemplateReferences + * + * @param string[]|null $pciTemplateReferences The array of Adyen-generated unique identifiers for the questionnaires. + * + * @return self + */ + public function setPciTemplateReferences($pciTemplateReferences) + { + if (is_null($pciTemplateReferences)) { + throw new \InvalidArgumentException('non-nullable pciTemplateReferences cannot be null'); + } + $this->container['pciTemplateReferences'] = $pciTemplateReferences; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.php b/src/Adyen/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.php new file mode 100644 index 000000000..195331e8e --- /dev/null +++ b/src/Adyen/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.php @@ -0,0 +1,384 @@ + + */ +class GetPciQuestionnaireInfosResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetPciQuestionnaireInfosResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\LegalEntityManagement\PciDocumentInfo[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * 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('data', $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 data + * + * @return \Adyen\Model\LegalEntityManagement\PciDocumentInfo[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\LegalEntityManagement\PciDocumentInfo[]|null $data Information about the signed PCI questionnaires. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/LegalEntityManagement/GetPciQuestionnaireResponse.php b/src/Adyen/Model/LegalEntityManagement/GetPciQuestionnaireResponse.php new file mode 100644 index 000000000..bfd974f30 --- /dev/null +++ b/src/Adyen/Model/LegalEntityManagement/GetPciQuestionnaireResponse.php @@ -0,0 +1,486 @@ + + */ +class GetPciQuestionnaireResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetPciQuestionnaireResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'content' => 'string', + 'createdAt' => '\DateTime', + 'id' => 'string', + 'validUntil' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'content' => 'byte', + 'createdAt' => 'date-time', + 'id' => null, + 'validUntil' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'content' => false, + 'createdAt' => false, + 'id' => false, + 'validUntil' => 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 = [ + 'content' => 'content', + 'createdAt' => 'createdAt', + 'id' => 'id', + 'validUntil' => 'validUntil' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent', + 'createdAt' => 'setCreatedAt', + 'id' => 'setId', + 'validUntil' => 'setValidUntil' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent', + 'createdAt' => 'getCreatedAt', + 'id' => 'getId', + 'validUntil' => 'getValidUntil' + ]; + + /** + * 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('content', $data ?? [], null); + $this->setIfExists('createdAt', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('validUntil', $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 content + * + * @return string|null + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content The generated questionnaire in a base64 encoded format. + * + * @return self + */ + public function setContent($content) + { + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime|null + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime|null $createdAt The date the questionnaire was created, in ISO 8601 extended format. For example, 2022-12-18T10:15:30+01:00 + * + * @return self + */ + public function setCreatedAt($createdAt) + { + if (is_null($createdAt)) { + throw new \InvalidArgumentException('non-nullable createdAt cannot be null'); + } + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the signed questionnaire. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets validUntil + * + * @return \DateTime|null + */ + public function getValidUntil() + { + return $this->container['validUntil']; + } + + /** + * Sets validUntil + * + * @param \DateTime|null $validUntil The expiration date of the questionnaire, in ISO 8601 extended format. For example, 2022-12-18T10:15:30+01:00 + * + * @return self + */ + public function setValidUntil($validUntil) + { + if (is_null($validUntil)) { + throw new \InvalidArgumentException('non-nullable validUntil cannot be null'); + } + $this->container['validUntil'] = $validUntil; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/LegalEntityManagement/IdentificationData.php b/src/Adyen/Model/LegalEntityManagement/IdentificationData.php index 47db1b652..8791221cb 100644 --- a/src/Adyen/Model/LegalEntityManagement/IdentificationData.php +++ b/src/Adyen/Model/LegalEntityManagement/IdentificationData.php @@ -264,6 +264,7 @@ public function getModelName() public const TYPE_PROOF_OF_ORGANIZATION_TAX_INFO = 'proofOfOrganizationTaxInfo'; public const TYPE_PROOF_OF_INDUSTRY = 'proofOfIndustry'; public const TYPE_CONSTITUTIONAL_DOCUMENT = 'constitutionalDocument'; + public const TYPE_PROOF_OF_FUNDING_OR_WEALTH_SOURCE = 'proofOfFundingOrWealthSource'; /** * Gets allowable values of the enum @@ -286,6 +287,7 @@ public function getTypeAllowableValues() self::TYPE_PROOF_OF_ORGANIZATION_TAX_INFO, self::TYPE_PROOF_OF_INDUSTRY, self::TYPE_CONSTITUTIONAL_DOCUMENT, + self::TYPE_PROOF_OF_FUNDING_OR_WEALTH_SOURCE, ]; } /** @@ -545,7 +547,7 @@ public function getType() /** * Sets type * - * @param string $type Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, or **proofOfIndustry**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, or **proofOfIndividualTaxId**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * @param string $type Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, **proofOfIndustry**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, or **proofOfFundingOrWealthSource**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/LegalEntity.php b/src/Adyen/Model/LegalEntityManagement/LegalEntity.php index 38c41fae1..6e5fd33a6 100644 --- a/src/Adyen/Model/LegalEntityManagement/LegalEntity.php +++ b/src/Adyen/Model/LegalEntityManagement/LegalEntity.php @@ -55,7 +55,8 @@ class LegalEntity implements ModelInterface, ArrayAccess, \JsonSerializable 'reference' => 'string', 'soleProprietorship' => '\Adyen\Model\LegalEntityManagement\SoleProprietorship', 'transferInstruments' => '\Adyen\Model\LegalEntityManagement\TransferInstrumentReference[]', - 'type' => 'string' + 'type' => 'string', + 'verificationDeadlines' => '\Adyen\Model\LegalEntityManagement\VerificationDeadline[]' ]; /** @@ -77,7 +78,8 @@ class LegalEntity implements ModelInterface, ArrayAccess, \JsonSerializable 'reference' => null, 'soleProprietorship' => null, 'transferInstruments' => null, - 'type' => null + 'type' => null, + 'verificationDeadlines' => null ]; /** @@ -97,7 +99,8 @@ class LegalEntity implements ModelInterface, ArrayAccess, \JsonSerializable 'reference' => false, 'soleProprietorship' => false, 'transferInstruments' => false, - 'type' => false + 'type' => false, + 'verificationDeadlines' => false ]; /** @@ -197,7 +200,8 @@ public function isNullableSetToNull(string $property): bool 'reference' => 'reference', 'soleProprietorship' => 'soleProprietorship', 'transferInstruments' => 'transferInstruments', - 'type' => 'type' + 'type' => 'type', + 'verificationDeadlines' => 'verificationDeadlines' ]; /** @@ -217,7 +221,8 @@ public function isNullableSetToNull(string $property): bool 'reference' => 'setReference', 'soleProprietorship' => 'setSoleProprietorship', 'transferInstruments' => 'setTransferInstruments', - 'type' => 'setType' + 'type' => 'setType', + 'verificationDeadlines' => 'setVerificationDeadlines' ]; /** @@ -237,7 +242,8 @@ public function isNullableSetToNull(string $property): bool 'reference' => 'getReference', 'soleProprietorship' => 'getSoleProprietorship', 'transferInstruments' => 'getTransferInstruments', - 'type' => 'getType' + 'type' => 'getType', + 'verificationDeadlines' => 'getVerificationDeadlines' ]; /** @@ -329,6 +335,7 @@ public function __construct(array $data = null) $this->setIfExists('soleProprietorship', $data ?? [], null); $this->setIfExists('transferInstruments', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('verificationDeadlines', $data ?? [], null); } /** @@ -720,6 +727,33 @@ public function setType($type) return $this; } + + /** + * Gets verificationDeadlines + * + * @return \Adyen\Model\LegalEntityManagement\VerificationDeadline[]|null + */ + public function getVerificationDeadlines() + { + return $this->container['verificationDeadlines']; + } + + /** + * Sets verificationDeadlines + * + * @param \Adyen\Model\LegalEntityManagement\VerificationDeadline[]|null $verificationDeadlines List of verification deadlines and the capabilities that will be disallowed if verification errors are not resolved. + * + * @return self + */ + public function setVerificationDeadlines($verificationDeadlines) + { + if (is_null($verificationDeadlines)) { + throw new \InvalidArgumentException('non-nullable verificationDeadlines cannot be null'); + } + $this->container['verificationDeadlines'] = $verificationDeadlines; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.php b/src/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.php index 58c973242..012921e27 100644 --- a/src/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.php +++ b/src/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.php @@ -388,7 +388,7 @@ public function getEntityType() /** * Sets entityType * - * @param string|null $entityType The legal entity type of associated legal entity. For example, **organization**, **soleProprietorship** or **individual**. + * @param string|null $entityType The legal entity type of associated legal entity. For example, **organization**, **soleProprietorship** or **individual**. * * @return self */ @@ -496,7 +496,7 @@ public function getType() /** * Sets type * - * @param string $type Defines the relationship of the legal entity to the current legal entity. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. + * @param string $type Defines the relationship of the legal entity to the current legal entity. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **director**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/OnboardingLinkInfo.php b/src/Adyen/Model/LegalEntityManagement/OnboardingLinkInfo.php index e8b527cdb..146f08123 100644 --- a/src/Adyen/Model/LegalEntityManagement/OnboardingLinkInfo.php +++ b/src/Adyen/Model/LegalEntityManagement/OnboardingLinkInfo.php @@ -364,7 +364,7 @@ public function getSettings() /** * Sets settings * - * @param array|null $settings Boolean key-value pairs indicating the settings for the hosted onboarding page. The keys are the settings. By default, the values are set to **true**. Set to **false** to not allow the action. Possible keys: - **changeLegalEntityType**: The user can change their legal entity type. - **editPrefilledCountry**: The user can change the country of their legal entity's address, for example the registered address of an organization. + * @param array|null $settings Boolean key-value pairs indicating the settings for the hosted onboarding page. The keys are the settings. Possible keys: By default, these values are set to **true**. Set to **false** to not allow the action. - **changeLegalEntityType**: The user can change their legal entity type. - **editPrefilledCountry**: The user can change the country of their legal entity's address, for example the registered address of an organization. By default, this value is set to **false**. Set to **true** to allow the action. - **allowIntraRegionCrossBorderPayout**: The user can select a payout account in a different EU/EEA country than the country of their legal entity. * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/Organization.php b/src/Adyen/Model/LegalEntityManagement/Organization.php index d0a7b4191..329d5ba48 100644 --- a/src/Adyen/Model/LegalEntityManagement/Organization.php +++ b/src/Adyen/Model/LegalEntityManagement/Organization.php @@ -778,7 +778,7 @@ public function getType() /** * Sets type * - * @param string|null $type Type of organization. Possible values: **associationIncorporated**, **governmentalOrganization**, **listedPublicCompany**, **nonProfit**, **partnershipIncorporated**, **privateCompany**. + * @param string|null $type Type of organization. Possible values: **associationIncorporated**, **governmentalOrganization**, **listedPublicCompany**, **nonProfit**, **partnershipIncorporated**, **privateCompany**. * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/PciDocumentInfo.php b/src/Adyen/Model/LegalEntityManagement/PciDocumentInfo.php new file mode 100644 index 000000000..b25e235f4 --- /dev/null +++ b/src/Adyen/Model/LegalEntityManagement/PciDocumentInfo.php @@ -0,0 +1,452 @@ + + */ +class PciDocumentInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PciDocumentInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'createdAt' => '\DateTime', + 'id' => 'string', + 'validUntil' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'createdAt' => 'date-time', + 'id' => null, + 'validUntil' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'createdAt' => false, + 'id' => false, + 'validUntil' => 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 = [ + 'createdAt' => 'createdAt', + 'id' => 'id', + 'validUntil' => 'validUntil' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'createdAt' => 'setCreatedAt', + 'id' => 'setId', + 'validUntil' => 'setValidUntil' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'createdAt' => 'getCreatedAt', + 'id' => 'getId', + 'validUntil' => 'getValidUntil' + ]; + + /** + * 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('createdAt', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('validUntil', $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 createdAt + * + * @return \DateTime|null + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime|null $createdAt The date the questionnaire was created, in ISO 8601 extended format. For example, 2022-12-18T10:15:30+01:00 + * + * @return self + */ + public function setCreatedAt($createdAt) + { + if (is_null($createdAt)) { + throw new \InvalidArgumentException('non-nullable createdAt cannot be null'); + } + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the signed questionnaire. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets validUntil + * + * @return \DateTime|null + */ + public function getValidUntil() + { + return $this->container['validUntil']; + } + + /** + * Sets validUntil + * + * @param \DateTime|null $validUntil The expiration date of the questionnaire, in ISO 8601 extended format. For example, 2022-12-18T10:15:30+01:00 + * + * @return self + */ + public function setValidUntil($validUntil) + { + if (is_null($validUntil)) { + throw new \InvalidArgumentException('non-nullable validUntil cannot be null'); + } + $this->container['validUntil'] = $validUntil; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/LegalEntityManagement/PciSigningRequest.php b/src/Adyen/Model/LegalEntityManagement/PciSigningRequest.php new file mode 100644 index 000000000..9a5dd9acc --- /dev/null +++ b/src/Adyen/Model/LegalEntityManagement/PciSigningRequest.php @@ -0,0 +1,424 @@ + + */ +class PciSigningRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PciSigningRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'pciTemplateReferences' => 'string[]', + 'signedBy' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'pciTemplateReferences' => null, + 'signedBy' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'pciTemplateReferences' => false, + 'signedBy' => 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 = [ + 'pciTemplateReferences' => 'pciTemplateReferences', + 'signedBy' => 'signedBy' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pciTemplateReferences' => 'setPciTemplateReferences', + 'signedBy' => 'setSignedBy' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pciTemplateReferences' => 'getPciTemplateReferences', + 'signedBy' => 'getSignedBy' + ]; + + /** + * 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('pciTemplateReferences', $data ?? [], null); + $this->setIfExists('signedBy', $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['pciTemplateReferences'] === null) { + $invalidProperties[] = "'pciTemplateReferences' can't be null"; + } + if ($this->container['signedBy'] === null) { + $invalidProperties[] = "'signedBy' 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 pciTemplateReferences + * + * @return string[] + */ + public function getPciTemplateReferences() + { + return $this->container['pciTemplateReferences']; + } + + /** + * Sets pciTemplateReferences + * + * @param string[] $pciTemplateReferences The array of Adyen-generated unique identifiers for the questionnaires. + * + * @return self + */ + public function setPciTemplateReferences($pciTemplateReferences) + { + if (is_null($pciTemplateReferences)) { + throw new \InvalidArgumentException('non-nullable pciTemplateReferences cannot be null'); + } + $this->container['pciTemplateReferences'] = $pciTemplateReferences; + + return $this; + } + + /** + * Gets signedBy + * + * @return string + */ + public function getSignedBy() + { + return $this->container['signedBy']; + } + + /** + * Sets signedBy + * + * @param string $signedBy The [legal entity ID](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities__resParam_id) of the individual who signs the PCI questionnaire. + * + * @return self + */ + public function setSignedBy($signedBy) + { + if (is_null($signedBy)) { + throw new \InvalidArgumentException('non-nullable signedBy cannot be null'); + } + $this->container['signedBy'] = $signedBy; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/LegalEntityManagement/PciSigningResponse.php b/src/Adyen/Model/LegalEntityManagement/PciSigningResponse.php new file mode 100644 index 000000000..17d94a0a0 --- /dev/null +++ b/src/Adyen/Model/LegalEntityManagement/PciSigningResponse.php @@ -0,0 +1,418 @@ + + */ +class PciSigningResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PciSigningResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'pciQuestionnaireIds' => 'string[]', + 'signedBy' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'pciQuestionnaireIds' => null, + 'signedBy' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'pciQuestionnaireIds' => false, + 'signedBy' => 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 = [ + 'pciQuestionnaireIds' => 'pciQuestionnaireIds', + 'signedBy' => 'signedBy' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pciQuestionnaireIds' => 'setPciQuestionnaireIds', + 'signedBy' => 'setSignedBy' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pciQuestionnaireIds' => 'getPciQuestionnaireIds', + 'signedBy' => 'getSignedBy' + ]; + + /** + * 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('pciQuestionnaireIds', $data ?? [], null); + $this->setIfExists('signedBy', $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 pciQuestionnaireIds + * + * @return string[]|null + */ + public function getPciQuestionnaireIds() + { + return $this->container['pciQuestionnaireIds']; + } + + /** + * Sets pciQuestionnaireIds + * + * @param string[]|null $pciQuestionnaireIds The unique identifiers of the signed PCI documents. + * + * @return self + */ + public function setPciQuestionnaireIds($pciQuestionnaireIds) + { + if (is_null($pciQuestionnaireIds)) { + throw new \InvalidArgumentException('non-nullable pciQuestionnaireIds cannot be null'); + } + $this->container['pciQuestionnaireIds'] = $pciQuestionnaireIds; + + return $this; + } + + /** + * Gets signedBy + * + * @return string|null + */ + public function getSignedBy() + { + return $this->container['signedBy']; + } + + /** + * Sets signedBy + * + * @param string|null $signedBy The [legal entity ID](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities__resParam_id) of the individual who signed the PCI questionnaire. + * + * @return self + */ + public function setSignedBy($signedBy) + { + if (is_null($signedBy)) { + throw new \InvalidArgumentException('non-nullable signedBy cannot be null'); + } + $this->container['signedBy'] = $signedBy; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/LegalEntityManagement/SGLocalAccountIdentification.php b/src/Adyen/Model/LegalEntityManagement/SGLocalAccountIdentification.php new file mode 100644 index 000000000..bf7536380 --- /dev/null +++ b/src/Adyen/Model/LegalEntityManagement/SGLocalAccountIdentification.php @@ -0,0 +1,489 @@ + + */ +class SGLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SGLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'bic' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'bic' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'bic' => 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 = [ + 'accountNumber' => 'accountNumber', + 'bic' => 'bic', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'bic' => 'setBic', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'bic' => 'getBic', + '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_SG_LOCAL = 'sgLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_SG_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('bic', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'sgLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['bic'] === null) { + $invalidProperties[] = "'bic' 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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The 4- to 19-digit bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets bic + * + * @return string + */ + public function getBic() + { + return $this->container['bic']; + } + + /** + * Sets bic + * + * @param string $bic The bank's 8- or 11-character BIC or SWIFT code. + * + * @return self + */ + public function setBic($bic) + { + if (is_null($bic)) { + throw new \InvalidArgumentException('non-nullable bic cannot be null'); + } + $this->container['bic'] = $bic; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **sgLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/LegalEntityManagement/TaxReportingClassification.php b/src/Adyen/Model/LegalEntityManagement/TaxReportingClassification.php index 0284f7a8c..fec5b48ea 100644 --- a/src/Adyen/Model/LegalEntityManagement/TaxReportingClassification.php +++ b/src/Adyen/Model/LegalEntityManagement/TaxReportingClassification.php @@ -434,7 +434,7 @@ public function getFinancialInstitutionNumber() /** * Sets financialInstitutionNumber * - * @param string|null $financialInstitutionNumber The Global Intermediary Identification Number (GIIN) required for FATCA. + * @param string|null $financialInstitutionNumber The Global Intermediary Identification Number (GIIN) required for FATCA. Only required if the organization is a US financial institution and the `businessType` is **financialInstitution**. * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/TransferInstrumentReference.php b/src/Adyen/Model/LegalEntityManagement/TransferInstrumentReference.php index 54649cfd7..45c3b7437 100644 --- a/src/Adyen/Model/LegalEntityManagement/TransferInstrumentReference.php +++ b/src/Adyen/Model/LegalEntityManagement/TransferInstrumentReference.php @@ -46,7 +46,8 @@ class TransferInstrumentReference implements ModelInterface, ArrayAccess, \JsonS protected static $openAPITypes = [ 'accountIdentifier' => 'string', 'id' => 'string', - 'realLastFour' => 'string' + 'realLastFour' => 'string', + 'trustedSource' => 'bool' ]; /** @@ -59,7 +60,8 @@ class TransferInstrumentReference implements ModelInterface, ArrayAccess, \JsonS protected static $openAPIFormats = [ 'accountIdentifier' => null, 'id' => null, - 'realLastFour' => null + 'realLastFour' => null, + 'trustedSource' => null ]; /** @@ -70,7 +72,8 @@ class TransferInstrumentReference implements ModelInterface, ArrayAccess, \JsonS protected static $openAPINullables = [ 'accountIdentifier' => false, 'id' => false, - 'realLastFour' => false + 'realLastFour' => false, + 'trustedSource' => false ]; /** @@ -161,7 +164,8 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountIdentifier' => 'accountIdentifier', 'id' => 'id', - 'realLastFour' => 'realLastFour' + 'realLastFour' => 'realLastFour', + 'trustedSource' => 'trustedSource' ]; /** @@ -172,7 +176,8 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountIdentifier' => 'setAccountIdentifier', 'id' => 'setId', - 'realLastFour' => 'setRealLastFour' + 'realLastFour' => 'setRealLastFour', + 'trustedSource' => 'setTrustedSource' ]; /** @@ -183,7 +188,8 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountIdentifier' => 'getAccountIdentifier', 'id' => 'getId', - 'realLastFour' => 'getRealLastFour' + 'realLastFour' => 'getRealLastFour', + 'trustedSource' => 'getTrustedSource' ]; /** @@ -246,6 +252,7 @@ public function __construct(array $data = null) $this->setIfExists('accountIdentifier', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('realLastFour', $data ?? [], null); + $this->setIfExists('trustedSource', $data ?? [], null); } /** @@ -376,6 +383,33 @@ public function setRealLastFour($realLastFour) return $this; } + + /** + * Gets trustedSource + * + * @return bool|null + */ + public function getTrustedSource() + { + return $this->container['trustedSource']; + } + + /** + * Sets trustedSource + * + * @param bool|null $trustedSource Identifies if the bank account was created through [instant bank verification](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-08-hosted-onboarding). + * + * @return self + */ + public function setTrustedSource($trustedSource) + { + if (is_null($trustedSource)) { + throw new \InvalidArgumentException('non-nullable trustedSource cannot be null'); + } + $this->container['trustedSource'] = $trustedSource; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/LegalEntityManagement/VerificationDeadline.php b/src/Adyen/Model/LegalEntityManagement/VerificationDeadline.php new file mode 100644 index 000000000..6beca55c7 --- /dev/null +++ b/src/Adyen/Model/LegalEntityManagement/VerificationDeadline.php @@ -0,0 +1,543 @@ + + */ +class VerificationDeadline implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'VerificationDeadline'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'capabilities' => 'string[]', + 'expiresAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'capabilities' => null, + 'expiresAt' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'capabilities' => false, + 'expiresAt' => 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 = [ + 'capabilities' => 'capabilities', + 'expiresAt' => 'expiresAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'capabilities' => 'setCapabilities', + 'expiresAt' => 'setExpiresAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'capabilities' => 'getCapabilities', + 'expiresAt' => 'getExpiresAt' + ]; + + /** + * 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 CAPABILITIES_ACCEPT_EXTERNAL_FUNDING = 'acceptExternalFunding'; + public const CAPABILITIES_ACCEPT_PSP_FUNDING = 'acceptPspFunding'; + public const CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_COUNTRIES = 'acceptTransactionInRestrictedCountries'; + public const CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_COUNTRIES_COMMERCIAL = 'acceptTransactionInRestrictedCountriesCommercial'; + public const CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_COUNTRIES_CONSUMER = 'acceptTransactionInRestrictedCountriesConsumer'; + public const CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_INDUSTRIES = 'acceptTransactionInRestrictedIndustries'; + public const CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_INDUSTRIES_COMMERCIAL = 'acceptTransactionInRestrictedIndustriesCommercial'; + public const CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_INDUSTRIES_CONSUMER = 'acceptTransactionInRestrictedIndustriesConsumer'; + public const CAPABILITIES_ACQUIRING = 'acquiring'; + public const CAPABILITIES_ATM_WITHDRAWAL = 'atmWithdrawal'; + public const CAPABILITIES_ATM_WITHDRAWAL_COMMERCIAL = 'atmWithdrawalCommercial'; + public const CAPABILITIES_ATM_WITHDRAWAL_CONSUMER = 'atmWithdrawalConsumer'; + public const CAPABILITIES_ATM_WITHDRAWAL_IN_RESTRICTED_COUNTRIES = 'atmWithdrawalInRestrictedCountries'; + public const CAPABILITIES_ATM_WITHDRAWAL_IN_RESTRICTED_COUNTRIES_COMMERCIAL = 'atmWithdrawalInRestrictedCountriesCommercial'; + public const CAPABILITIES_ATM_WITHDRAWAL_IN_RESTRICTED_COUNTRIES_CONSUMER = 'atmWithdrawalInRestrictedCountriesConsumer'; + public const CAPABILITIES_AUTHORISED_PAYMENT_INSTRUMENT_USER = 'authorisedPaymentInstrumentUser'; + public const CAPABILITIES_GET_GRANT_OFFERS = 'getGrantOffers'; + public const CAPABILITIES_ISSUE_BANK_ACCOUNT = 'issueBankAccount'; + public const CAPABILITIES_ISSUE_CARD = 'issueCard'; + public const CAPABILITIES_ISSUE_CARD_COMMERCIAL = 'issueCardCommercial'; + public const CAPABILITIES_ISSUE_CARD_CONSUMER = 'issueCardConsumer'; + public const CAPABILITIES_LOCAL_ACCEPTANCE = 'localAcceptance'; + public const CAPABILITIES_PAYOUT = 'payout'; + public const CAPABILITIES_PAYOUT_TO_TRANSFER_INSTRUMENT = 'payoutToTransferInstrument'; + public const CAPABILITIES_PROCESSING = 'processing'; + public const CAPABILITIES_RECEIVE_FROM_BALANCE_ACCOUNT = 'receiveFromBalanceAccount'; + public const CAPABILITIES_RECEIVE_FROM_PLATFORM_PAYMENTS = 'receiveFromPlatformPayments'; + public const CAPABILITIES_RECEIVE_FROM_THIRD_PARTY = 'receiveFromThirdParty'; + public const CAPABILITIES_RECEIVE_FROM_TRANSFER_INSTRUMENT = 'receiveFromTransferInstrument'; + public const CAPABILITIES_RECEIVE_GRANTS = 'receiveGrants'; + public const CAPABILITIES_RECEIVE_PAYMENTS = 'receivePayments'; + public const CAPABILITIES_SEND_TO_BALANCE_ACCOUNT = 'sendToBalanceAccount'; + public const CAPABILITIES_SEND_TO_THIRD_PARTY = 'sendToThirdParty'; + public const CAPABILITIES_SEND_TO_TRANSFER_INSTRUMENT = 'sendToTransferInstrument'; + public const CAPABILITIES_THIRD_PARTY_FUNDING = 'thirdPartyFunding'; + public const CAPABILITIES_USE_CARD = 'useCard'; + public const CAPABILITIES_USE_CARD_COMMERCIAL = 'useCardCommercial'; + public const CAPABILITIES_USE_CARD_CONSUMER = 'useCardConsumer'; + public const CAPABILITIES_USE_CARD_IN_RESTRICTED_COUNTRIES = 'useCardInRestrictedCountries'; + public const CAPABILITIES_USE_CARD_IN_RESTRICTED_COUNTRIES_COMMERCIAL = 'useCardInRestrictedCountriesCommercial'; + public const CAPABILITIES_USE_CARD_IN_RESTRICTED_COUNTRIES_CONSUMER = 'useCardInRestrictedCountriesConsumer'; + public const CAPABILITIES_USE_CARD_IN_RESTRICTED_INDUSTRIES = 'useCardInRestrictedIndustries'; + public const CAPABILITIES_USE_CARD_IN_RESTRICTED_INDUSTRIES_COMMERCIAL = 'useCardInRestrictedIndustriesCommercial'; + public const CAPABILITIES_USE_CARD_IN_RESTRICTED_INDUSTRIES_CONSUMER = 'useCardInRestrictedIndustriesConsumer'; + public const CAPABILITIES_WITHDRAW_FROM_ATM = 'withdrawFromAtm'; + public const CAPABILITIES_WITHDRAW_FROM_ATM_COMMERCIAL = 'withdrawFromAtmCommercial'; + public const CAPABILITIES_WITHDRAW_FROM_ATM_CONSUMER = 'withdrawFromAtmConsumer'; + public const CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES = 'withdrawFromAtmInRestrictedCountries'; + public const CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES_COMMERCIAL = 'withdrawFromAtmInRestrictedCountriesCommercial'; + public const CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES_CONSUMER = 'withdrawFromAtmInRestrictedCountriesConsumer'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCapabilitiesAllowableValues() + { + return [ + self::CAPABILITIES_ACCEPT_EXTERNAL_FUNDING, + self::CAPABILITIES_ACCEPT_PSP_FUNDING, + self::CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_COUNTRIES, + self::CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_COUNTRIES_COMMERCIAL, + self::CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_COUNTRIES_CONSUMER, + self::CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_INDUSTRIES, + self::CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_INDUSTRIES_COMMERCIAL, + self::CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_INDUSTRIES_CONSUMER, + self::CAPABILITIES_ACQUIRING, + self::CAPABILITIES_ATM_WITHDRAWAL, + self::CAPABILITIES_ATM_WITHDRAWAL_COMMERCIAL, + self::CAPABILITIES_ATM_WITHDRAWAL_CONSUMER, + self::CAPABILITIES_ATM_WITHDRAWAL_IN_RESTRICTED_COUNTRIES, + self::CAPABILITIES_ATM_WITHDRAWAL_IN_RESTRICTED_COUNTRIES_COMMERCIAL, + self::CAPABILITIES_ATM_WITHDRAWAL_IN_RESTRICTED_COUNTRIES_CONSUMER, + self::CAPABILITIES_AUTHORISED_PAYMENT_INSTRUMENT_USER, + self::CAPABILITIES_GET_GRANT_OFFERS, + self::CAPABILITIES_ISSUE_BANK_ACCOUNT, + self::CAPABILITIES_ISSUE_CARD, + self::CAPABILITIES_ISSUE_CARD_COMMERCIAL, + self::CAPABILITIES_ISSUE_CARD_CONSUMER, + self::CAPABILITIES_LOCAL_ACCEPTANCE, + self::CAPABILITIES_PAYOUT, + self::CAPABILITIES_PAYOUT_TO_TRANSFER_INSTRUMENT, + self::CAPABILITIES_PROCESSING, + self::CAPABILITIES_RECEIVE_FROM_BALANCE_ACCOUNT, + self::CAPABILITIES_RECEIVE_FROM_PLATFORM_PAYMENTS, + self::CAPABILITIES_RECEIVE_FROM_THIRD_PARTY, + self::CAPABILITIES_RECEIVE_FROM_TRANSFER_INSTRUMENT, + self::CAPABILITIES_RECEIVE_GRANTS, + self::CAPABILITIES_RECEIVE_PAYMENTS, + self::CAPABILITIES_SEND_TO_BALANCE_ACCOUNT, + self::CAPABILITIES_SEND_TO_THIRD_PARTY, + self::CAPABILITIES_SEND_TO_TRANSFER_INSTRUMENT, + self::CAPABILITIES_THIRD_PARTY_FUNDING, + self::CAPABILITIES_USE_CARD, + self::CAPABILITIES_USE_CARD_COMMERCIAL, + self::CAPABILITIES_USE_CARD_CONSUMER, + self::CAPABILITIES_USE_CARD_IN_RESTRICTED_COUNTRIES, + self::CAPABILITIES_USE_CARD_IN_RESTRICTED_COUNTRIES_COMMERCIAL, + self::CAPABILITIES_USE_CARD_IN_RESTRICTED_COUNTRIES_CONSUMER, + self::CAPABILITIES_USE_CARD_IN_RESTRICTED_INDUSTRIES, + self::CAPABILITIES_USE_CARD_IN_RESTRICTED_INDUSTRIES_COMMERCIAL, + self::CAPABILITIES_USE_CARD_IN_RESTRICTED_INDUSTRIES_CONSUMER, + self::CAPABILITIES_WITHDRAW_FROM_ATM, + self::CAPABILITIES_WITHDRAW_FROM_ATM_COMMERCIAL, + self::CAPABILITIES_WITHDRAW_FROM_ATM_CONSUMER, + self::CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES, + self::CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES_COMMERCIAL, + self::CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES_CONSUMER, + ]; + } + /** + * 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('capabilities', $data ?? [], null); + $this->setIfExists('expiresAt', $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['capabilities'] === null) { + $invalidProperties[] = "'capabilities' can't be null"; + } + if ($this->container['expiresAt'] === null) { + $invalidProperties[] = "'expiresAt' 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 capabilities + * + * @return string[] + */ + public function getCapabilities() + { + return $this->container['capabilities']; + } + + /** + * Sets capabilities + * + * @param string[] $capabilities The names of the capabilities to be disallowed. + * + * @return self + */ + public function setCapabilities($capabilities) + { + if (is_null($capabilities)) { + throw new \InvalidArgumentException('non-nullable capabilities cannot be null'); + } + $allowedValues = $this->getCapabilitiesAllowableValues(); + if (array_diff($capabilities, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'capabilities', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['capabilities'] = $capabilities; + + return $this; + } + + /** + * Gets expiresAt + * + * @return \DateTime + */ + public function getExpiresAt() + { + return $this->container['expiresAt']; + } + + /** + * Sets expiresAt + * + * @param \DateTime $expiresAt The date that verification is due by before capabilities are disallowed. + * + * @return self + */ + public function setExpiresAt($expiresAt) + { + if (is_null($expiresAt)) { + throw new \InvalidArgumentException('non-nullable expiresAt cannot be null'); + } + $this->container['expiresAt'] = $expiresAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/LegalEntityManagement/VerificationError.php b/src/Adyen/Model/LegalEntityManagement/VerificationError.php index 5c1b6b8f3..886494472 100644 --- a/src/Adyen/Model/LegalEntityManagement/VerificationError.php +++ b/src/Adyen/Model/LegalEntityManagement/VerificationError.php @@ -296,8 +296,10 @@ public function getModelName() public const CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES_COMMERCIAL = 'withdrawFromAtmInRestrictedCountriesCommercial'; public const CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES_CONSUMER = 'withdrawFromAtmInRestrictedCountriesConsumer'; public const TYPE_DATA_MISSING = 'dataMissing'; + public const TYPE_DATA_REVIEW = 'dataReview'; public const TYPE_INVALID_INPUT = 'invalidInput'; public const TYPE_PENDING_STATUS = 'pendingStatus'; + public const TYPE_REJECTED = 'rejected'; /** * Gets allowable values of the enum @@ -368,8 +370,10 @@ public function getTypeAllowableValues() { return [ self::TYPE_DATA_MISSING, + self::TYPE_DATA_REVIEW, self::TYPE_INVALID_INPUT, self::TYPE_PENDING_STATUS, + self::TYPE_REJECTED, ]; } /** diff --git a/src/Adyen/Model/LegalEntityManagement/VerificationErrorRecursive.php b/src/Adyen/Model/LegalEntityManagement/VerificationErrorRecursive.php index 443b6b3c9..2029f9c9d 100644 --- a/src/Adyen/Model/LegalEntityManagement/VerificationErrorRecursive.php +++ b/src/Adyen/Model/LegalEntityManagement/VerificationErrorRecursive.php @@ -290,8 +290,10 @@ public function getModelName() public const CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES_COMMERCIAL = 'withdrawFromAtmInRestrictedCountriesCommercial'; public const CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES_CONSUMER = 'withdrawFromAtmInRestrictedCountriesConsumer'; public const TYPE_DATA_MISSING = 'dataMissing'; + public const TYPE_DATA_REVIEW = 'dataReview'; public const TYPE_INVALID_INPUT = 'invalidInput'; public const TYPE_PENDING_STATUS = 'pendingStatus'; + public const TYPE_REJECTED = 'rejected'; /** * Gets allowable values of the enum @@ -362,8 +364,10 @@ public function getTypeAllowableValues() { return [ self::TYPE_DATA_MISSING, + self::TYPE_DATA_REVIEW, self::TYPE_INVALID_INPUT, self::TYPE_PENDING_STATUS, + self::TYPE_REJECTED, ]; } /** diff --git a/src/Adyen/Model/LegalEntityManagement/WebDataExemption.php b/src/Adyen/Model/LegalEntityManagement/WebDataExemption.php index 7db4b08d0..205d2bc5e 100644 --- a/src/Adyen/Model/LegalEntityManagement/WebDataExemption.php +++ b/src/Adyen/Model/LegalEntityManagement/WebDataExemption.php @@ -216,6 +216,7 @@ public function getModelName() } public const REASON_NO_ONLINE_PRESENCE = 'noOnlinePresence'; + public const REASON_NOT_COLLECTED_DURING_ONBOARDING = 'notCollectedDuringOnboarding'; /** * Gets allowable values of the enum @@ -226,6 +227,7 @@ public function getReasonAllowableValues() { return [ self::REASON_NO_ONLINE_PRESENCE, + self::REASON_NOT_COLLECTED_DURING_ONBOARDING, ]; } /** diff --git a/src/Adyen/Model/Management/AdditionalCommission.php b/src/Adyen/Model/Management/AdditionalCommission.php new file mode 100644 index 000000000..7a8bc05a6 --- /dev/null +++ b/src/Adyen/Model/Management/AdditionalCommission.php @@ -0,0 +1,452 @@ + + */ +class AdditionalCommission implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalCommission'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balanceAccountId' => 'string', + 'fixedAmount' => 'int', + 'variablePercentage' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balanceAccountId' => null, + 'fixedAmount' => 'int64', + 'variablePercentage' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balanceAccountId' => false, + 'fixedAmount' => false, + 'variablePercentage' => 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', + 'fixedAmount' => 'fixedAmount', + 'variablePercentage' => 'variablePercentage' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balanceAccountId' => 'setBalanceAccountId', + 'fixedAmount' => 'setFixedAmount', + 'variablePercentage' => 'setVariablePercentage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balanceAccountId' => 'getBalanceAccountId', + 'fixedAmount' => 'getFixedAmount', + 'variablePercentage' => 'getVariablePercentage' + ]; + + /** + * 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('fixedAmount', $data ?? [], null); + $this->setIfExists('variablePercentage', $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 Unique identifier of the balance account to which the additional commission is booked. + * + * @return self + */ + public function setBalanceAccountId($balanceAccountId) + { + if (is_null($balanceAccountId)) { + throw new \InvalidArgumentException('non-nullable balanceAccountId cannot be null'); + } + $this->container['balanceAccountId'] = $balanceAccountId; + + return $this; + } + + /** + * Gets fixedAmount + * + * @return int|null + */ + public function getFixedAmount() + { + return $this->container['fixedAmount']; + } + + /** + * Sets fixedAmount + * + * @param int|null $fixedAmount A fixed commission fee, in minor units. + * + * @return self + */ + public function setFixedAmount($fixedAmount) + { + if (is_null($fixedAmount)) { + throw new \InvalidArgumentException('non-nullable fixedAmount cannot be null'); + } + $this->container['fixedAmount'] = $fixedAmount; + + return $this; + } + + /** + * Gets variablePercentage + * + * @return int|null + */ + public function getVariablePercentage() + { + return $this->container['variablePercentage']; + } + + /** + * Sets variablePercentage + * + * @param int|null $variablePercentage A variable commission fee, in basis points. + * + * @return self + */ + public function setVariablePercentage($variablePercentage) + { + if (is_null($variablePercentage)) { + throw new \InvalidArgumentException('non-nullable variablePercentage cannot be null'); + } + $this->container['variablePercentage'] = $variablePercentage; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/AfterpayTouchInfo.php b/src/Adyen/Model/Management/AfterpayTouchInfo.php new file mode 100644 index 000000000..57591d5bf --- /dev/null +++ b/src/Adyen/Model/Management/AfterpayTouchInfo.php @@ -0,0 +1,387 @@ + + */ +class AfterpayTouchInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AfterpayTouchInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'supportUrl' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'supportUrl' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'supportUrl' => 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 = [ + 'supportUrl' => 'supportUrl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'supportUrl' => 'setSupportUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'supportUrl' => 'getSupportUrl' + ]; + + /** + * 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('supportUrl', $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['supportUrl'] === null) { + $invalidProperties[] = "'supportUrl' 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 supportUrl + * + * @return string + */ + public function getSupportUrl() + { + return $this->container['supportUrl']; + } + + /** + * Sets supportUrl + * + * @param string $supportUrl Support Url + * + * @return self + */ + public function setSupportUrl($supportUrl) + { + if (is_null($supportUrl)) { + throw new \InvalidArgumentException('non-nullable supportUrl cannot be null'); + } + $this->container['supportUrl'] = $supportUrl; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/AndroidApp.php b/src/Adyen/Model/Management/AndroidApp.php index 525eafe29..52361f9c4 100644 --- a/src/Adyen/Model/Management/AndroidApp.php +++ b/src/Adyen/Model/Management/AndroidApp.php @@ -418,7 +418,7 @@ public function getPackageName() /** * Sets packageName * - * @param string|null $packageName The package name of the app. + * @param string|null $packageName The package name that uniquely identifies the Android app. * * @return self */ @@ -472,7 +472,7 @@ public function getVersionCode() /** * Sets versionCode * - * @param int|null $versionCode The internal version number of the app. + * @param int|null $versionCode The version number of the app. * * @return self */ diff --git a/src/Adyen/Model/Management/ClearpayInfo.php b/src/Adyen/Model/Management/ClearpayInfo.php new file mode 100644 index 000000000..107e4072c --- /dev/null +++ b/src/Adyen/Model/Management/ClearpayInfo.php @@ -0,0 +1,387 @@ + + */ +class ClearpayInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ClearpayInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'supportUrl' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'supportUrl' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'supportUrl' => 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 = [ + 'supportUrl' => 'supportUrl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'supportUrl' => 'setSupportUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'supportUrl' => 'getSupportUrl' + ]; + + /** + * 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('supportUrl', $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['supportUrl'] === null) { + $invalidProperties[] = "'supportUrl' 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 supportUrl + * + * @return string + */ + public function getSupportUrl() + { + return $this->container['supportUrl']; + } + + /** + * Sets supportUrl + * + * @param string $supportUrl Support Url + * + * @return self + */ + public function setSupportUrl($supportUrl) + { + if (is_null($supportUrl)) { + throw new \InvalidArgumentException('non-nullable supportUrl cannot be null'); + } + $this->container['supportUrl'] = $supportUrl; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Commission.php b/src/Adyen/Model/Management/Commission.php new file mode 100644 index 000000000..772378455 --- /dev/null +++ b/src/Adyen/Model/Management/Commission.php @@ -0,0 +1,418 @@ + + */ +class Commission implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Commission'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'fixedAmount' => 'int', + 'variablePercentage' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'fixedAmount' => 'int64', + 'variablePercentage' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'fixedAmount' => false, + 'variablePercentage' => 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 = [ + 'fixedAmount' => 'fixedAmount', + 'variablePercentage' => 'variablePercentage' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'fixedAmount' => 'setFixedAmount', + 'variablePercentage' => 'setVariablePercentage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'fixedAmount' => 'getFixedAmount', + 'variablePercentage' => 'getVariablePercentage' + ]; + + /** + * 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('fixedAmount', $data ?? [], null); + $this->setIfExists('variablePercentage', $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 fixedAmount + * + * @return int|null + */ + public function getFixedAmount() + { + return $this->container['fixedAmount']; + } + + /** + * Sets fixedAmount + * + * @param int|null $fixedAmount A fixed commission fee, in minor units. + * + * @return self + */ + public function setFixedAmount($fixedAmount) + { + if (is_null($fixedAmount)) { + throw new \InvalidArgumentException('non-nullable fixedAmount cannot be null'); + } + $this->container['fixedAmount'] = $fixedAmount; + + return $this; + } + + /** + * Gets variablePercentage + * + * @return int|null + */ + public function getVariablePercentage() + { + return $this->container['variablePercentage']; + } + + /** + * Sets variablePercentage + * + * @param int|null $variablePercentage A variable commission fee, in basis points. + * + * @return self + */ + public function setVariablePercentage($variablePercentage) + { + if (is_null($variablePercentage)) { + throw new \InvalidArgumentException('non-nullable variablePercentage cannot be null'); + } + $this->container['variablePercentage'] = $variablePercentage; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CompanyUser.php b/src/Adyen/Model/Management/CompanyUser.php index 43309e5b6..e571929f9 100644 --- a/src/Adyen/Model/Management/CompanyUser.php +++ b/src/Adyen/Model/Management/CompanyUser.php @@ -47,8 +47,8 @@ class CompanyUser implements ModelInterface, ArrayAccess, \JsonSerializable 'links' => '\Adyen\Model\Management\Links', 'accountGroups' => 'string[]', 'active' => 'bool', + 'apps' => 'string[]', 'associatedMerchantAccounts' => 'string[]', - 'authnApps' => 'string[]', 'email' => 'string', 'id' => 'string', 'name' => '\Adyen\Model\Management\Name', @@ -68,8 +68,8 @@ class CompanyUser implements ModelInterface, ArrayAccess, \JsonSerializable 'links' => null, 'accountGroups' => null, 'active' => null, + 'apps' => null, 'associatedMerchantAccounts' => null, - 'authnApps' => null, 'email' => null, 'id' => null, 'name' => null, @@ -87,8 +87,8 @@ class CompanyUser implements ModelInterface, ArrayAccess, \JsonSerializable 'links' => false, 'accountGroups' => false, 'active' => false, + 'apps' => false, 'associatedMerchantAccounts' => false, - 'authnApps' => false, 'email' => false, 'id' => false, 'name' => false, @@ -186,8 +186,8 @@ public function isNullableSetToNull(string $property): bool 'links' => '_links', 'accountGroups' => 'accountGroups', 'active' => 'active', + 'apps' => 'apps', 'associatedMerchantAccounts' => 'associatedMerchantAccounts', - 'authnApps' => 'authnApps', 'email' => 'email', 'id' => 'id', 'name' => 'name', @@ -205,8 +205,8 @@ public function isNullableSetToNull(string $property): bool 'links' => 'setLinks', 'accountGroups' => 'setAccountGroups', 'active' => 'setActive', + 'apps' => 'setApps', 'associatedMerchantAccounts' => 'setAssociatedMerchantAccounts', - 'authnApps' => 'setAuthnApps', 'email' => 'setEmail', 'id' => 'setId', 'name' => 'setName', @@ -224,8 +224,8 @@ public function isNullableSetToNull(string $property): bool 'links' => 'getLinks', 'accountGroups' => 'getAccountGroups', 'active' => 'getActive', + 'apps' => 'getApps', 'associatedMerchantAccounts' => 'getAssociatedMerchantAccounts', - 'authnApps' => 'getAuthnApps', 'email' => 'getEmail', 'id' => 'getId', 'name' => 'getName', @@ -294,8 +294,8 @@ public function __construct(array $data = null) $this->setIfExists('links', $data ?? [], null); $this->setIfExists('accountGroups', $data ?? [], null); $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('apps', $data ?? [], null); $this->setIfExists('associatedMerchantAccounts', $data ?? [], null); - $this->setIfExists('authnApps', $data ?? [], null); $this->setIfExists('email', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -443,55 +443,55 @@ public function setActive($active) } /** - * Gets associatedMerchantAccounts + * Gets apps * * @return string[]|null */ - public function getAssociatedMerchantAccounts() + public function getApps() { - return $this->container['associatedMerchantAccounts']; + return $this->container['apps']; } /** - * Sets associatedMerchantAccounts + * Sets apps * - * @param string[]|null $associatedMerchantAccounts The list of [merchant accounts](https://docs.adyen.com/account/account-structure#merchant-accounts) associated with this user. + * @param string[]|null $apps Set of apps available to this user * * @return self */ - public function setAssociatedMerchantAccounts($associatedMerchantAccounts) + public function setApps($apps) { - if (is_null($associatedMerchantAccounts)) { - throw new \InvalidArgumentException('non-nullable associatedMerchantAccounts cannot be null'); + if (is_null($apps)) { + throw new \InvalidArgumentException('non-nullable apps cannot be null'); } - $this->container['associatedMerchantAccounts'] = $associatedMerchantAccounts; + $this->container['apps'] = $apps; return $this; } /** - * Gets authnApps + * Gets associatedMerchantAccounts * * @return string[]|null */ - public function getAuthnApps() + public function getAssociatedMerchantAccounts() { - return $this->container['authnApps']; + return $this->container['associatedMerchantAccounts']; } /** - * Sets authnApps + * Sets associatedMerchantAccounts * - * @param string[]|null $authnApps Set of authn apps available to this user + * @param string[]|null $associatedMerchantAccounts The list of [merchant accounts](https://docs.adyen.com/account/account-structure#merchant-accounts) associated with this user. * * @return self */ - public function setAuthnApps($authnApps) + public function setAssociatedMerchantAccounts($associatedMerchantAccounts) { - if (is_null($authnApps)) { - throw new \InvalidArgumentException('non-nullable authnApps cannot be null'); + if (is_null($associatedMerchantAccounts)) { + throw new \InvalidArgumentException('non-nullable associatedMerchantAccounts cannot be null'); } - $this->container['authnApps'] = $authnApps; + $this->container['associatedMerchantAccounts'] = $associatedMerchantAccounts; return $this; } diff --git a/src/Adyen/Model/Management/CreateCompanyApiCredentialRequest.php b/src/Adyen/Model/Management/CreateCompanyApiCredentialRequest.php index 541298707..3afcb43b2 100644 --- a/src/Adyen/Model/Management/CreateCompanyApiCredentialRequest.php +++ b/src/Adyen/Model/Management/CreateCompanyApiCredentialRequest.php @@ -391,7 +391,7 @@ public function getRoles() /** * Sets roles * - * @param string[]|null $roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) of the API credential. + * @param string[]|null $roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. Only roles assigned to 'ws@Company.' can be assigned to other API credentials. * * @return self */ diff --git a/src/Adyen/Model/Management/CreateCompanyUserRequest.php b/src/Adyen/Model/Management/CreateCompanyUserRequest.php index 5cf133c68..c6990b649 100644 --- a/src/Adyen/Model/Management/CreateCompanyUserRequest.php +++ b/src/Adyen/Model/Management/CreateCompanyUserRequest.php @@ -46,7 +46,6 @@ class CreateCompanyUserRequest implements ModelInterface, ArrayAccess, \JsonSeri protected static $openAPITypes = [ 'accountGroups' => 'string[]', 'associatedMerchantAccounts' => 'string[]', - 'authnApps' => 'string[]', 'email' => 'string', 'name' => '\Adyen\Model\Management\Name', 'roles' => 'string[]', @@ -64,7 +63,6 @@ class CreateCompanyUserRequest implements ModelInterface, ArrayAccess, \JsonSeri protected static $openAPIFormats = [ 'accountGroups' => null, 'associatedMerchantAccounts' => null, - 'authnApps' => null, 'email' => null, 'name' => null, 'roles' => null, @@ -80,7 +78,6 @@ class CreateCompanyUserRequest implements ModelInterface, ArrayAccess, \JsonSeri protected static $openAPINullables = [ 'accountGroups' => false, 'associatedMerchantAccounts' => false, - 'authnApps' => false, 'email' => false, 'name' => false, 'roles' => false, @@ -176,7 +173,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountGroups' => 'accountGroups', 'associatedMerchantAccounts' => 'associatedMerchantAccounts', - 'authnApps' => 'authnApps', 'email' => 'email', 'name' => 'name', 'roles' => 'roles', @@ -192,7 +188,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountGroups' => 'setAccountGroups', 'associatedMerchantAccounts' => 'setAssociatedMerchantAccounts', - 'authnApps' => 'setAuthnApps', 'email' => 'setEmail', 'name' => 'setName', 'roles' => 'setRoles', @@ -208,7 +203,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountGroups' => 'getAccountGroups', 'associatedMerchantAccounts' => 'getAssociatedMerchantAccounts', - 'authnApps' => 'getAuthnApps', 'email' => 'getEmail', 'name' => 'getName', 'roles' => 'getRoles', @@ -275,7 +269,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountGroups', $data ?? [], null); $this->setIfExists('associatedMerchantAccounts', $data ?? [], null); - $this->setIfExists('authnApps', $data ?? [], null); $this->setIfExists('email', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); $this->setIfExists('roles', $data ?? [], null); @@ -388,33 +381,6 @@ public function setAssociatedMerchantAccounts($associatedMerchantAccounts) return $this; } - /** - * Gets authnApps - * - * @return string[]|null - */ - public function getAuthnApps() - { - return $this->container['authnApps']; - } - - /** - * Sets authnApps - * - * @param string[]|null $authnApps Set of authn apps to add to this user - * - * @return self - */ - public function setAuthnApps($authnApps) - { - if (is_null($authnApps)) { - throw new \InvalidArgumentException('non-nullable authnApps cannot be null'); - } - $this->container['authnApps'] = $authnApps; - - return $this; - } - /** * Gets email * @@ -536,7 +502,7 @@ public function getUsername() /** * Sets username * - * @param string $username The username for this user. Allowed length: 255 alphanumeric characters. + * @param string $username The user's email address that will be their username. Must be the same as the one in the `email` field. * * @return self */ diff --git a/src/Adyen/Model/Management/CreateCompanyUserResponse.php b/src/Adyen/Model/Management/CreateCompanyUserResponse.php index 72fe184af..e568db7d6 100644 --- a/src/Adyen/Model/Management/CreateCompanyUserResponse.php +++ b/src/Adyen/Model/Management/CreateCompanyUserResponse.php @@ -47,8 +47,8 @@ class CreateCompanyUserResponse implements ModelInterface, ArrayAccess, \JsonSer 'links' => '\Adyen\Model\Management\Links', 'accountGroups' => 'string[]', 'active' => 'bool', + 'apps' => 'string[]', 'associatedMerchantAccounts' => 'string[]', - 'authnApps' => 'string[]', 'email' => 'string', 'id' => 'string', 'name' => '\Adyen\Model\Management\Name', @@ -68,8 +68,8 @@ class CreateCompanyUserResponse implements ModelInterface, ArrayAccess, \JsonSer 'links' => null, 'accountGroups' => null, 'active' => null, + 'apps' => null, 'associatedMerchantAccounts' => null, - 'authnApps' => null, 'email' => null, 'id' => null, 'name' => null, @@ -87,8 +87,8 @@ class CreateCompanyUserResponse implements ModelInterface, ArrayAccess, \JsonSer 'links' => false, 'accountGroups' => false, 'active' => false, + 'apps' => false, 'associatedMerchantAccounts' => false, - 'authnApps' => false, 'email' => false, 'id' => false, 'name' => false, @@ -186,8 +186,8 @@ public function isNullableSetToNull(string $property): bool 'links' => '_links', 'accountGroups' => 'accountGroups', 'active' => 'active', + 'apps' => 'apps', 'associatedMerchantAccounts' => 'associatedMerchantAccounts', - 'authnApps' => 'authnApps', 'email' => 'email', 'id' => 'id', 'name' => 'name', @@ -205,8 +205,8 @@ public function isNullableSetToNull(string $property): bool 'links' => 'setLinks', 'accountGroups' => 'setAccountGroups', 'active' => 'setActive', + 'apps' => 'setApps', 'associatedMerchantAccounts' => 'setAssociatedMerchantAccounts', - 'authnApps' => 'setAuthnApps', 'email' => 'setEmail', 'id' => 'setId', 'name' => 'setName', @@ -224,8 +224,8 @@ public function isNullableSetToNull(string $property): bool 'links' => 'getLinks', 'accountGroups' => 'getAccountGroups', 'active' => 'getActive', + 'apps' => 'getApps', 'associatedMerchantAccounts' => 'getAssociatedMerchantAccounts', - 'authnApps' => 'getAuthnApps', 'email' => 'getEmail', 'id' => 'getId', 'name' => 'getName', @@ -294,8 +294,8 @@ public function __construct(array $data = null) $this->setIfExists('links', $data ?? [], null); $this->setIfExists('accountGroups', $data ?? [], null); $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('apps', $data ?? [], null); $this->setIfExists('associatedMerchantAccounts', $data ?? [], null); - $this->setIfExists('authnApps', $data ?? [], null); $this->setIfExists('email', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -443,55 +443,55 @@ public function setActive($active) } /** - * Gets associatedMerchantAccounts + * Gets apps * * @return string[]|null */ - public function getAssociatedMerchantAccounts() + public function getApps() { - return $this->container['associatedMerchantAccounts']; + return $this->container['apps']; } /** - * Sets associatedMerchantAccounts + * Sets apps * - * @param string[]|null $associatedMerchantAccounts The list of [merchant accounts](https://docs.adyen.com/account/account-structure#merchant-accounts) associated with this user. + * @param string[]|null $apps Set of apps available to this user * * @return self */ - public function setAssociatedMerchantAccounts($associatedMerchantAccounts) + public function setApps($apps) { - if (is_null($associatedMerchantAccounts)) { - throw new \InvalidArgumentException('non-nullable associatedMerchantAccounts cannot be null'); + if (is_null($apps)) { + throw new \InvalidArgumentException('non-nullable apps cannot be null'); } - $this->container['associatedMerchantAccounts'] = $associatedMerchantAccounts; + $this->container['apps'] = $apps; return $this; } /** - * Gets authnApps + * Gets associatedMerchantAccounts * * @return string[]|null */ - public function getAuthnApps() + public function getAssociatedMerchantAccounts() { - return $this->container['authnApps']; + return $this->container['associatedMerchantAccounts']; } /** - * Sets authnApps + * Sets associatedMerchantAccounts * - * @param string[]|null $authnApps Set of authn apps available to this user + * @param string[]|null $associatedMerchantAccounts The list of [merchant accounts](https://docs.adyen.com/account/account-structure#merchant-accounts) associated with this user. * * @return self */ - public function setAuthnApps($authnApps) + public function setAssociatedMerchantAccounts($associatedMerchantAccounts) { - if (is_null($authnApps)) { - throw new \InvalidArgumentException('non-nullable authnApps cannot be null'); + if (is_null($associatedMerchantAccounts)) { + throw new \InvalidArgumentException('non-nullable associatedMerchantAccounts cannot be null'); } - $this->container['authnApps'] = $authnApps; + $this->container['associatedMerchantAccounts'] = $associatedMerchantAccounts; return $this; } diff --git a/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php b/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php index 4d96317bf..79cfe809b 100644 --- a/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php +++ b/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php @@ -311,14 +311,9 @@ public function getModelName() public const FILTER_MERCHANT_ACCOUNT_TYPE_ALL_ACCOUNTS = 'allAccounts'; public const FILTER_MERCHANT_ACCOUNT_TYPE_EXCLUDE_ACCOUNTS = 'excludeAccounts'; public const FILTER_MERCHANT_ACCOUNT_TYPE_INCLUDE_ACCOUNTS = 'includeAccounts'; - public const NETWORK_TYPE_LOCAL = 'LOCAL'; - public const NETWORK_TYPE__PUBLIC = 'PUBLIC'; + public const NETWORK_TYPE_LOCAL = 'local'; + public const NETWORK_TYPE__PUBLIC = 'public'; public const SSL_VERSION_HTTP = 'HTTP'; - public const SSL_VERSION_SSL = 'SSL'; - public const SSL_VERSION_SSLV3 = 'SSLv3'; - public const SSL_VERSION_TLS = 'TLS'; - public const SSL_VERSION_TLSV1 = 'TLSv1'; - public const SSL_VERSION_TLSV1_1 = 'TLSv1.1'; public const SSL_VERSION_TLSV1_2 = 'TLSv1.2'; public const SSL_VERSION_TLSV1_3 = 'TLSv1.3'; @@ -369,11 +364,6 @@ public function getSslVersionAllowableValues() { return [ self::SSL_VERSION_HTTP, - self::SSL_VERSION_SSL, - self::SSL_VERSION_SSLV3, - self::SSL_VERSION_TLS, - self::SSL_VERSION_TLSV1, - self::SSL_VERSION_TLSV1_1, self::SSL_VERSION_TLSV1_2, self::SSL_VERSION_TLSV1_3, ]; diff --git a/src/Adyen/Model/Management/CreateMerchantApiCredentialRequest.php b/src/Adyen/Model/Management/CreateMerchantApiCredentialRequest.php index 09914a2f5..ad5531baf 100644 --- a/src/Adyen/Model/Management/CreateMerchantApiCredentialRequest.php +++ b/src/Adyen/Model/Management/CreateMerchantApiCredentialRequest.php @@ -357,7 +357,7 @@ public function getRoles() /** * Sets roles * - * @param string[]|null $roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. + * @param string[]|null $roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. Only roles assigned to 'ws@Company.' can be assigned to other API credentials. * * @return self */ diff --git a/src/Adyen/Model/Management/CreateMerchantUserRequest.php b/src/Adyen/Model/Management/CreateMerchantUserRequest.php index 64a68f32b..deee403e0 100644 --- a/src/Adyen/Model/Management/CreateMerchantUserRequest.php +++ b/src/Adyen/Model/Management/CreateMerchantUserRequest.php @@ -45,7 +45,6 @@ class CreateMerchantUserRequest implements ModelInterface, ArrayAccess, \JsonSer */ protected static $openAPITypes = [ 'accountGroups' => 'string[]', - 'authnApps' => 'string[]', 'email' => 'string', 'name' => '\Adyen\Model\Management\Name', 'roles' => 'string[]', @@ -62,7 +61,6 @@ class CreateMerchantUserRequest implements ModelInterface, ArrayAccess, \JsonSer */ protected static $openAPIFormats = [ 'accountGroups' => null, - 'authnApps' => null, 'email' => null, 'name' => null, 'roles' => null, @@ -77,7 +75,6 @@ class CreateMerchantUserRequest implements ModelInterface, ArrayAccess, \JsonSer */ protected static $openAPINullables = [ 'accountGroups' => false, - 'authnApps' => false, 'email' => false, 'name' => false, 'roles' => false, @@ -172,7 +169,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountGroups' => 'accountGroups', - 'authnApps' => 'authnApps', 'email' => 'email', 'name' => 'name', 'roles' => 'roles', @@ -187,7 +183,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountGroups' => 'setAccountGroups', - 'authnApps' => 'setAuthnApps', 'email' => 'setEmail', 'name' => 'setName', 'roles' => 'setRoles', @@ -202,7 +197,6 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountGroups' => 'getAccountGroups', - 'authnApps' => 'getAuthnApps', 'email' => 'getEmail', 'name' => 'getName', 'roles' => 'getRoles', @@ -268,7 +262,6 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('accountGroups', $data ?? [], null); - $this->setIfExists('authnApps', $data ?? [], null); $this->setIfExists('email', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); $this->setIfExists('roles', $data ?? [], null); @@ -354,33 +347,6 @@ public function setAccountGroups($accountGroups) return $this; } - /** - * Gets authnApps - * - * @return string[]|null - */ - public function getAuthnApps() - { - return $this->container['authnApps']; - } - - /** - * Sets authnApps - * - * @param string[]|null $authnApps Set of authn apps to add to this user - * - * @return self - */ - public function setAuthnApps($authnApps) - { - if (is_null($authnApps)) { - throw new \InvalidArgumentException('non-nullable authnApps cannot be null'); - } - $this->container['authnApps'] = $authnApps; - - return $this; - } - /** * Gets email * @@ -502,7 +468,7 @@ public function getUsername() /** * Sets username * - * @param string $username The username for this user. Allowed length: 255 alphanumeric characters. + * @param string $username The user's email address that will be their username. Must be the same as the one in the `email` field. * * @return self */ diff --git a/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php b/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php index 62710d681..b96274e96 100644 --- a/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php +++ b/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php @@ -296,14 +296,9 @@ public function getModelName() public const COMMUNICATION_FORMAT_HTTP = 'http'; public const COMMUNICATION_FORMAT_JSON = 'json'; public const COMMUNICATION_FORMAT_SOAP = 'soap'; - public const NETWORK_TYPE_LOCAL = 'LOCAL'; - public const NETWORK_TYPE__PUBLIC = 'PUBLIC'; + public const NETWORK_TYPE_LOCAL = 'local'; + public const NETWORK_TYPE__PUBLIC = 'public'; public const SSL_VERSION_HTTP = 'HTTP'; - public const SSL_VERSION_SSL = 'SSL'; - public const SSL_VERSION_SSLV3 = 'SSLv3'; - public const SSL_VERSION_TLS = 'TLS'; - public const SSL_VERSION_TLSV1 = 'TLSv1'; - public const SSL_VERSION_TLSV1_1 = 'TLSv1.1'; public const SSL_VERSION_TLSV1_2 = 'TLSv1.2'; public const SSL_VERSION_TLSV1_3 = 'TLSv1.3'; @@ -341,11 +336,6 @@ public function getSslVersionAllowableValues() { return [ self::SSL_VERSION_HTTP, - self::SSL_VERSION_SSL, - self::SSL_VERSION_SSLV3, - self::SSL_VERSION_TLS, - self::SSL_VERSION_TLSV1, - self::SSL_VERSION_TLSV1_1, self::SSL_VERSION_TLSV1_2, self::SSL_VERSION_TLSV1_3, ]; diff --git a/src/Adyen/Model/Management/CreateUserResponse.php b/src/Adyen/Model/Management/CreateUserResponse.php index 152d3817f..60ebde706 100644 --- a/src/Adyen/Model/Management/CreateUserResponse.php +++ b/src/Adyen/Model/Management/CreateUserResponse.php @@ -47,7 +47,7 @@ class CreateUserResponse implements ModelInterface, ArrayAccess, \JsonSerializab 'links' => '\Adyen\Model\Management\Links', 'accountGroups' => 'string[]', 'active' => 'bool', - 'authnApps' => 'string[]', + 'apps' => 'string[]', 'email' => 'string', 'id' => 'string', 'name' => '\Adyen\Model\Management\Name', @@ -67,7 +67,7 @@ class CreateUserResponse implements ModelInterface, ArrayAccess, \JsonSerializab 'links' => null, 'accountGroups' => null, 'active' => null, - 'authnApps' => null, + 'apps' => null, 'email' => null, 'id' => null, 'name' => null, @@ -85,7 +85,7 @@ class CreateUserResponse implements ModelInterface, ArrayAccess, \JsonSerializab 'links' => false, 'accountGroups' => false, 'active' => false, - 'authnApps' => false, + 'apps' => false, 'email' => false, 'id' => false, 'name' => false, @@ -183,7 +183,7 @@ public function isNullableSetToNull(string $property): bool 'links' => '_links', 'accountGroups' => 'accountGroups', 'active' => 'active', - 'authnApps' => 'authnApps', + 'apps' => 'apps', 'email' => 'email', 'id' => 'id', 'name' => 'name', @@ -201,7 +201,7 @@ public function isNullableSetToNull(string $property): bool 'links' => 'setLinks', 'accountGroups' => 'setAccountGroups', 'active' => 'setActive', - 'authnApps' => 'setAuthnApps', + 'apps' => 'setApps', 'email' => 'setEmail', 'id' => 'setId', 'name' => 'setName', @@ -219,7 +219,7 @@ public function isNullableSetToNull(string $property): bool 'links' => 'getLinks', 'accountGroups' => 'getAccountGroups', 'active' => 'getActive', - 'authnApps' => 'getAuthnApps', + 'apps' => 'getApps', 'email' => 'getEmail', 'id' => 'getId', 'name' => 'getName', @@ -288,7 +288,7 @@ public function __construct(array $data = null) $this->setIfExists('links', $data ?? [], null); $this->setIfExists('accountGroups', $data ?? [], null); $this->setIfExists('active', $data ?? [], null); - $this->setIfExists('authnApps', $data ?? [], null); + $this->setIfExists('apps', $data ?? [], null); $this->setIfExists('email', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -436,28 +436,28 @@ public function setActive($active) } /** - * Gets authnApps + * Gets apps * * @return string[]|null */ - public function getAuthnApps() + public function getApps() { - return $this->container['authnApps']; + return $this->container['apps']; } /** - * Sets authnApps + * Sets apps * - * @param string[]|null $authnApps Set of authn apps available to this user + * @param string[]|null $apps Set of apps available to this user * * @return self */ - public function setAuthnApps($authnApps) + public function setApps($apps) { - if (is_null($authnApps)) { - throw new \InvalidArgumentException('non-nullable authnApps cannot be null'); + if (is_null($apps)) { + throw new \InvalidArgumentException('non-nullable apps cannot be null'); } - $this->container['authnApps'] = $authnApps; + $this->container['apps'] = $apps; return $this; } diff --git a/src/Adyen/Model/Management/Currency.php b/src/Adyen/Model/Management/Currency.php index 1596b5a97..ec66db7b8 100644 --- a/src/Adyen/Model/Management/Currency.php +++ b/src/Adyen/Model/Management/Currency.php @@ -46,7 +46,7 @@ class Currency implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'amount' => 'int', 'currencyCode' => 'string', - 'percentage' => 'object' + 'percentage' => 'float' ]; /** @@ -59,7 +59,7 @@ class Currency implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'amount' => 'int32', 'currencyCode' => null, - 'percentage' => null + 'percentage' => 'double' ]; /** @@ -348,7 +348,7 @@ public function setCurrencyCode($currencyCode) /** * Gets percentage * - * @return object|null + * @return float|null */ public function getPercentage() { @@ -358,7 +358,7 @@ public function getPercentage() /** * Sets percentage * - * @param object|null $percentage percentage + * @param float|null $percentage Surcharge percentage per transaction. The maximum number of decimal places is two. For example, **1%** or **2.27%**. * * @return self */ diff --git a/src/Adyen/Model/Management/Hardware.php b/src/Adyen/Model/Management/Hardware.php index 709fc0db0..f2dfa3b9f 100644 --- a/src/Adyen/Model/Management/Hardware.php +++ b/src/Adyen/Model/Management/Hardware.php @@ -44,7 +44,8 @@ class Hardware implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'displayMaximumBackLight' => 'int' + 'displayMaximumBackLight' => 'int', + 'restartHour' => 'int' ]; /** @@ -55,7 +56,8 @@ class Hardware implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'displayMaximumBackLight' => 'int32' + 'displayMaximumBackLight' => 'int32', + 'restartHour' => 'int32' ]; /** @@ -64,7 +66,8 @@ class Hardware implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ - 'displayMaximumBackLight' => true + 'displayMaximumBackLight' => true, + 'restartHour' => true ]; /** @@ -153,7 +156,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'displayMaximumBackLight' => 'displayMaximumBackLight' + 'displayMaximumBackLight' => 'displayMaximumBackLight', + 'restartHour' => 'restartHour' ]; /** @@ -162,7 +166,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'displayMaximumBackLight' => 'setDisplayMaximumBackLight' + 'displayMaximumBackLight' => 'setDisplayMaximumBackLight', + 'restartHour' => 'setRestartHour' ]; /** @@ -171,7 +176,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'displayMaximumBackLight' => 'getDisplayMaximumBackLight' + 'displayMaximumBackLight' => 'getDisplayMaximumBackLight', + 'restartHour' => 'getRestartHour' ]; /** @@ -232,6 +238,7 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('displayMaximumBackLight', $data ?? [], null); + $this->setIfExists('restartHour', $data ?? [], null); } /** @@ -300,6 +307,31 @@ public function setDisplayMaximumBackLight($displayMaximumBackLight) return $this; } + + /** + * Gets restartHour + * + * @return int|null + */ + public function getRestartHour() + { + return $this->container['restartHour']; + } + + /** + * Sets restartHour + * + * @param int|null $restartHour The hour (0 - 23) in which the device will reboot, reboot will happen in the timezone of the device + * + * @return self + */ + public function setRestartHour($restartHour) + { + // Do nothing for nullable integers + $this->container['restartHour'] = $restartHour; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Management/InvalidFieldWrapper.php b/src/Adyen/Model/Management/InvalidFieldWrapper.php new file mode 100644 index 000000000..357145df7 --- /dev/null +++ b/src/Adyen/Model/Management/InvalidFieldWrapper.php @@ -0,0 +1,384 @@ + + */ +class InvalidFieldWrapper implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InvalidFieldWrapper'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'invalidField' => '\Adyen\Model\Management\InvalidField' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'invalidField' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'invalidField' => 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 = [ + 'invalidField' => 'InvalidField' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'invalidField' => 'setInvalidField' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'invalidField' => 'getInvalidField' + ]; + + /** + * 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('invalidField', $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 invalidField + * + * @return \Adyen\Model\Management\InvalidField|null + */ + public function getInvalidField() + { + return $this->container['invalidField']; + } + + /** + * Sets invalidField + * + * @param \Adyen\Model\Management\InvalidField|null $invalidField invalidField + * + * @return self + */ + public function setInvalidField($invalidField) + { + if (is_null($invalidField)) { + throw new \InvalidArgumentException('non-nullable invalidField cannot be null'); + } + $this->container['invalidField'] = $invalidField; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/JSONObject.php b/src/Adyen/Model/Management/JSONObject.php index 32df5be45..de992412f 100644 --- a/src/Adyen/Model/Management/JSONObject.php +++ b/src/Adyen/Model/Management/JSONObject.php @@ -44,7 +44,7 @@ class JSONObject implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'paths' => '\Adyen\Model\Management\JSONPath[]', + 'paths' => '\Adyen\Model\Management\JSONPathWrapper[]', 'rootPath' => '\Adyen\Model\Management\JSONPath' ]; @@ -286,7 +286,7 @@ public function valid() /** * Gets paths * - * @return \Adyen\Model\Management\JSONPath[]|null + * @return \Adyen\Model\Management\JSONPathWrapper[]|null */ public function getPaths() { @@ -296,7 +296,7 @@ public function getPaths() /** * Sets paths * - * @param \Adyen\Model\Management\JSONPath[]|null $paths paths + * @param \Adyen\Model\Management\JSONPathWrapper[]|null $paths paths * * @return self */ diff --git a/src/Adyen/Model/Management/JSONPathWrapper.php b/src/Adyen/Model/Management/JSONPathWrapper.php new file mode 100644 index 000000000..595430c9a --- /dev/null +++ b/src/Adyen/Model/Management/JSONPathWrapper.php @@ -0,0 +1,384 @@ + + */ +class JSONPathWrapper implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'JSONPathWrapper'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'jSONPath' => '\Adyen\Model\Management\JSONPath' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'jSONPath' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'jSONPath' => 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 = [ + 'jSONPath' => 'JSONPath' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'jSONPath' => 'setJSONPath' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'jSONPath' => 'getJSONPath' + ]; + + /** + * 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('jSONPath', $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 jSONPath + * + * @return \Adyen\Model\Management\JSONPath|null + */ + public function getJSONPath() + { + return $this->container['jSONPath']; + } + + /** + * Sets jSONPath + * + * @param \Adyen\Model\Management\JSONPath|null $jSONPath jSONPath + * + * @return self + */ + public function setJSONPath($jSONPath) + { + if (is_null($jSONPath)) { + throw new \InvalidArgumentException('non-nullable jSONPath cannot be null'); + } + $this->container['jSONPath'] = $jSONPath; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ListTerminalsResponse.php b/src/Adyen/Model/Management/ListTerminalsResponse.php index 7eacf4a0a..a05328ddb 100644 --- a/src/Adyen/Model/Management/ListTerminalsResponse.php +++ b/src/Adyen/Model/Management/ListTerminalsResponse.php @@ -44,7 +44,10 @@ class ListTerminalsResponse implements ModelInterface, ArrayAccess, \JsonSeriali * @var string[] */ protected static $openAPITypes = [ - 'data' => '\Adyen\Model\Management\Terminal[]' + 'links' => '\Adyen\Model\Management\PaginationLinks', + 'data' => '\Adyen\Model\Management\Terminal[]', + 'itemsTotal' => 'int', + 'pagesTotal' => 'int' ]; /** @@ -55,7 +58,10 @@ class ListTerminalsResponse implements ModelInterface, ArrayAccess, \JsonSeriali * @psalm-var array */ protected static $openAPIFormats = [ - 'data' => null + 'links' => null, + 'data' => null, + 'itemsTotal' => 'int32', + 'pagesTotal' => 'int32' ]; /** @@ -64,7 +70,10 @@ class ListTerminalsResponse implements ModelInterface, ArrayAccess, \JsonSeriali * @var boolean[] */ protected static $openAPINullables = [ - 'data' => false + 'links' => false, + 'data' => false, + 'itemsTotal' => true, + 'pagesTotal' => true ]; /** @@ -153,7 +162,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'data' => 'data' + 'links' => '_links', + 'data' => 'data', + 'itemsTotal' => 'itemsTotal', + 'pagesTotal' => 'pagesTotal' ]; /** @@ -162,7 +174,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'data' => 'setData' + 'links' => 'setLinks', + 'data' => 'setData', + 'itemsTotal' => 'setItemsTotal', + 'pagesTotal' => 'setPagesTotal' ]; /** @@ -171,7 +186,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'data' => 'getData' + 'links' => 'getLinks', + 'data' => 'getData', + 'itemsTotal' => 'getItemsTotal', + 'pagesTotal' => 'getPagesTotal' ]; /** @@ -231,7 +249,10 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('links', $data ?? [], null); $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('itemsTotal', $data ?? [], null); + $this->setIfExists('pagesTotal', $data ?? [], null); } /** @@ -261,6 +282,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['itemsTotal'] === null) { + $invalidProperties[] = "'itemsTotal' can't be null"; + } + if ($this->container['pagesTotal'] === null) { + $invalidProperties[] = "'pagesTotal' can't be null"; + } return $invalidProperties; } @@ -276,6 +303,33 @@ public function valid() } + /** + * Gets links + * + * @return \Adyen\Model\Management\PaginationLinks|null + */ + public function getLinks() + { + return $this->container['links']; + } + + /** + * Sets links + * + * @param \Adyen\Model\Management\PaginationLinks|null $links links + * + * @return self + */ + public function setLinks($links) + { + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); + } + $this->container['links'] = $links; + + return $this; + } + /** * Gets data * @@ -302,6 +356,56 @@ public function setData($data) return $this; } + + /** + * Gets itemsTotal + * + * @return int + */ + public function getItemsTotal() + { + return $this->container['itemsTotal']; + } + + /** + * Sets itemsTotal + * + * @param int $itemsTotal Total number of items. + * + * @return self + */ + public function setItemsTotal($itemsTotal) + { + // Do nothing for nullable integers + $this->container['itemsTotal'] = $itemsTotal; + + return $this; + } + + /** + * Gets pagesTotal + * + * @return int + */ + public function getPagesTotal() + { + return $this->container['pagesTotal']; + } + + /** + * Sets pagesTotal + * + * @param int $pagesTotal Total number of pages. + * + * @return self + */ + public function setPagesTotal($pagesTotal) + { + // Do nothing for nullable integers + $this->container['pagesTotal'] = $pagesTotal; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Management/Nexo.php b/src/Adyen/Model/Management/Nexo.php index 044140bb4..5304b117e 100644 --- a/src/Adyen/Model/Management/Nexo.php +++ b/src/Adyen/Model/Management/Nexo.php @@ -47,7 +47,8 @@ class Nexo implements ModelInterface, ArrayAccess, \JsonSerializable 'displayUrls' => '\Adyen\Model\Management\NotificationUrl', 'encryptionKey' => '\Adyen\Model\Management\Key', 'eventUrls' => '\Adyen\Model\Management\EventUrl', - 'nexoEventUrls' => 'string[]' + 'nexoEventUrls' => 'string[]', + 'notification' => '\Adyen\Model\Management\Notification' ]; /** @@ -61,7 +62,8 @@ class Nexo implements ModelInterface, ArrayAccess, \JsonSerializable 'displayUrls' => null, 'encryptionKey' => null, 'eventUrls' => null, - 'nexoEventUrls' => null + 'nexoEventUrls' => null, + 'notification' => null ]; /** @@ -73,7 +75,8 @@ class Nexo implements ModelInterface, ArrayAccess, \JsonSerializable 'displayUrls' => false, 'encryptionKey' => false, 'eventUrls' => false, - 'nexoEventUrls' => false + 'nexoEventUrls' => false, + 'notification' => false ]; /** @@ -165,7 +168,8 @@ public function isNullableSetToNull(string $property): bool 'displayUrls' => 'displayUrls', 'encryptionKey' => 'encryptionKey', 'eventUrls' => 'eventUrls', - 'nexoEventUrls' => 'nexoEventUrls' + 'nexoEventUrls' => 'nexoEventUrls', + 'notification' => 'notification' ]; /** @@ -177,7 +181,8 @@ public function isNullableSetToNull(string $property): bool 'displayUrls' => 'setDisplayUrls', 'encryptionKey' => 'setEncryptionKey', 'eventUrls' => 'setEventUrls', - 'nexoEventUrls' => 'setNexoEventUrls' + 'nexoEventUrls' => 'setNexoEventUrls', + 'notification' => 'setNotification' ]; /** @@ -189,7 +194,8 @@ public function isNullableSetToNull(string $property): bool 'displayUrls' => 'getDisplayUrls', 'encryptionKey' => 'getEncryptionKey', 'eventUrls' => 'getEventUrls', - 'nexoEventUrls' => 'getNexoEventUrls' + 'nexoEventUrls' => 'getNexoEventUrls', + 'notification' => 'getNotification' ]; /** @@ -253,6 +259,7 @@ public function __construct(array $data = null) $this->setIfExists('encryptionKey', $data ?? [], null); $this->setIfExists('eventUrls', $data ?? [], null); $this->setIfExists('nexoEventUrls', $data ?? [], null); + $this->setIfExists('notification', $data ?? [], null); } /** @@ -406,6 +413,33 @@ public function setNexoEventUrls($nexoEventUrls) return $this; } + + /** + * Gets notification + * + * @return \Adyen\Model\Management\Notification|null + */ + public function getNotification() + { + return $this->container['notification']; + } + + /** + * Sets notification + * + * @param \Adyen\Model\Management\Notification|null $notification notification + * + * @return self + */ + public function setNotification($notification) + { + if (is_null($notification)) { + throw new \InvalidArgumentException('non-nullable notification cannot be null'); + } + $this->container['notification'] = $notification; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Management/Notification.php b/src/Adyen/Model/Management/Notification.php new file mode 100644 index 000000000..8c60d6807 --- /dev/null +++ b/src/Adyen/Model/Management/Notification.php @@ -0,0 +1,384 @@ + + */ +class Notification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Notification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'showButton' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'showButton' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'showButton' => 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 = [ + 'showButton' => 'showButton' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'showButton' => 'setShowButton' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'showButton' => 'getShowButton' + ]; + + /** + * 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('showButton', $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 showButton + * + * @return bool|null + */ + public function getShowButton() + { + return $this->container['showButton']; + } + + /** + * Sets showButton + * + * @param bool|null $showButton Toggle to show or hide Notification button on the terminal + * + * @return self + */ + public function setShowButton($showButton) + { + if (is_null($showButton)) { + throw new \InvalidArgumentException('non-nullable showButton cannot be null'); + } + $this->container['showButton'] = $showButton; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/PaymentMethod.php b/src/Adyen/Model/Management/PaymentMethod.php index adbb66acc..ec629a823 100644 --- a/src/Adyen/Model/Management/PaymentMethod.php +++ b/src/Adyen/Model/Management/PaymentMethod.php @@ -44,11 +44,13 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'afterpayTouch' => '\Adyen\Model\Management\AfterpayTouchInfo', 'allowed' => 'bool', 'applePay' => '\Adyen\Model\Management\ApplePayInfo', 'bcmc' => '\Adyen\Model\Management\BcmcInfo', 'businessLineId' => 'string', 'cartesBancaires' => '\Adyen\Model\Management\CartesBancairesInfo', + 'clearpay' => '\Adyen\Model\Management\ClearpayInfo', 'countries' => 'string[]', 'currencies' => 'string[]', 'customRoutingFlags' => 'string[]', @@ -64,6 +66,7 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'sofort' => '\Adyen\Model\Management\SofortInfo', 'storeId' => 'string', 'swish' => '\Adyen\Model\Management\SwishInfo', + 'twint' => '\Adyen\Model\Management\TwintInfo', 'type' => 'string', 'verificationStatus' => 'string', 'vipps' => '\Adyen\Model\Management\VippsInfo' @@ -77,11 +80,13 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'afterpayTouch' => null, 'allowed' => null, 'applePay' => null, 'bcmc' => null, 'businessLineId' => null, 'cartesBancaires' => null, + 'clearpay' => null, 'countries' => null, 'currencies' => null, 'customRoutingFlags' => null, @@ -97,6 +102,7 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'sofort' => null, 'storeId' => null, 'swish' => null, + 'twint' => null, 'type' => null, 'verificationStatus' => null, 'vipps' => null @@ -108,11 +114,13 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ + 'afterpayTouch' => false, 'allowed' => false, 'applePay' => false, 'bcmc' => false, 'businessLineId' => false, 'cartesBancaires' => false, + 'clearpay' => false, 'countries' => false, 'currencies' => false, 'customRoutingFlags' => false, @@ -128,6 +136,7 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'sofort' => false, 'storeId' => false, 'swish' => false, + 'twint' => false, 'type' => false, 'verificationStatus' => false, 'vipps' => false @@ -219,11 +228,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'afterpayTouch' => 'afterpayTouch', 'allowed' => 'allowed', 'applePay' => 'applePay', 'bcmc' => 'bcmc', 'businessLineId' => 'businessLineId', 'cartesBancaires' => 'cartesBancaires', + 'clearpay' => 'clearpay', 'countries' => 'countries', 'currencies' => 'currencies', 'customRoutingFlags' => 'customRoutingFlags', @@ -239,6 +250,7 @@ public function isNullableSetToNull(string $property): bool 'sofort' => 'sofort', 'storeId' => 'storeId', 'swish' => 'swish', + 'twint' => 'twint', 'type' => 'type', 'verificationStatus' => 'verificationStatus', 'vipps' => 'vipps' @@ -250,11 +262,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'afterpayTouch' => 'setAfterpayTouch', 'allowed' => 'setAllowed', 'applePay' => 'setApplePay', 'bcmc' => 'setBcmc', 'businessLineId' => 'setBusinessLineId', 'cartesBancaires' => 'setCartesBancaires', + 'clearpay' => 'setClearpay', 'countries' => 'setCountries', 'currencies' => 'setCurrencies', 'customRoutingFlags' => 'setCustomRoutingFlags', @@ -270,6 +284,7 @@ public function isNullableSetToNull(string $property): bool 'sofort' => 'setSofort', 'storeId' => 'setStoreId', 'swish' => 'setSwish', + 'twint' => 'setTwint', 'type' => 'setType', 'verificationStatus' => 'setVerificationStatus', 'vipps' => 'setVipps' @@ -281,11 +296,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'afterpayTouch' => 'getAfterpayTouch', 'allowed' => 'getAllowed', 'applePay' => 'getApplePay', 'bcmc' => 'getBcmc', 'businessLineId' => 'getBusinessLineId', 'cartesBancaires' => 'getCartesBancaires', + 'clearpay' => 'getClearpay', 'countries' => 'getCountries', 'currencies' => 'getCurrencies', 'customRoutingFlags' => 'getCustomRoutingFlags', @@ -301,6 +318,7 @@ public function isNullableSetToNull(string $property): bool 'sofort' => 'getSofort', 'storeId' => 'getStoreId', 'swish' => 'getSwish', + 'twint' => 'getTwint', 'type' => 'getType', 'verificationStatus' => 'getVerificationStatus', 'vipps' => 'getVipps' @@ -381,11 +399,13 @@ public function getVerificationStatusAllowableValues() */ public function __construct(array $data = null) { + $this->setIfExists('afterpayTouch', $data ?? [], null); $this->setIfExists('allowed', $data ?? [], null); $this->setIfExists('applePay', $data ?? [], null); $this->setIfExists('bcmc', $data ?? [], null); $this->setIfExists('businessLineId', $data ?? [], null); $this->setIfExists('cartesBancaires', $data ?? [], null); + $this->setIfExists('clearpay', $data ?? [], null); $this->setIfExists('countries', $data ?? [], null); $this->setIfExists('currencies', $data ?? [], null); $this->setIfExists('customRoutingFlags', $data ?? [], null); @@ -401,6 +421,7 @@ public function __construct(array $data = null) $this->setIfExists('sofort', $data ?? [], null); $this->setIfExists('storeId', $data ?? [], null); $this->setIfExists('swish', $data ?? [], null); + $this->setIfExists('twint', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('verificationStatus', $data ?? [], null); $this->setIfExists('vipps', $data ?? [], null); @@ -460,6 +481,33 @@ public function valid() } + /** + * Gets afterpayTouch + * + * @return \Adyen\Model\Management\AfterpayTouchInfo|null + */ + public function getAfterpayTouch() + { + return $this->container['afterpayTouch']; + } + + /** + * Sets afterpayTouch + * + * @param \Adyen\Model\Management\AfterpayTouchInfo|null $afterpayTouch afterpayTouch + * + * @return self + */ + public function setAfterpayTouch($afterpayTouch) + { + if (is_null($afterpayTouch)) { + throw new \InvalidArgumentException('non-nullable afterpayTouch cannot be null'); + } + $this->container['afterpayTouch'] = $afterpayTouch; + + return $this; + } + /** * Gets allowed * @@ -595,6 +643,33 @@ public function setCartesBancaires($cartesBancaires) return $this; } + /** + * Gets clearpay + * + * @return \Adyen\Model\Management\ClearpayInfo|null + */ + public function getClearpay() + { + return $this->container['clearpay']; + } + + /** + * Sets clearpay + * + * @param \Adyen\Model\Management\ClearpayInfo|null $clearpay clearpay + * + * @return self + */ + public function setClearpay($clearpay) + { + if (is_null($clearpay)) { + throw new \InvalidArgumentException('non-nullable clearpay cannot be null'); + } + $this->container['clearpay'] = $clearpay; + + return $this; + } + /** * Gets countries * @@ -1000,6 +1075,33 @@ public function setSwish($swish) return $this; } + /** + * Gets twint + * + * @return \Adyen\Model\Management\TwintInfo|null + */ + public function getTwint() + { + return $this->container['twint']; + } + + /** + * Sets twint + * + * @param \Adyen\Model\Management\TwintInfo|null $twint twint + * + * @return self + */ + public function setTwint($twint) + { + if (is_null($twint)) { + throw new \InvalidArgumentException('non-nullable twint cannot be null'); + } + $this->container['twint'] = $twint; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/Management/PaymentMethodResponse.php b/src/Adyen/Model/Management/PaymentMethodResponse.php index a46973265..5733869b4 100644 --- a/src/Adyen/Model/Management/PaymentMethodResponse.php +++ b/src/Adyen/Model/Management/PaymentMethodResponse.php @@ -45,7 +45,7 @@ class PaymentMethodResponse implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPITypes = [ 'links' => '\Adyen\Model\Management\PaginationLinks', - 'data' => '\Adyen\Model\Management\PaymentMethod[]', + 'data' => '\Adyen\Model\Management\PaymentMethodWrapper[]', 'itemsTotal' => 'int', 'pagesTotal' => 'int', 'typesWithErrors' => 'string[]' @@ -259,7 +259,6 @@ public function getModelName() public const TYPES_WITH_ERRORS_ELOCREDIT = 'elocredit'; public const TYPES_WITH_ERRORS_ELODEBIT = 'elodebit'; public const TYPES_WITH_ERRORS_GIROCARD = 'girocard'; - public const TYPES_WITH_ERRORS_GIROPAY = 'giropay'; public const TYPES_WITH_ERRORS_GOOGLEPAY = 'googlepay'; public const TYPES_WITH_ERRORS_HIPER = 'hiper'; public const TYPES_WITH_ERRORS_HIPERCARD = 'hipercard'; @@ -277,10 +276,13 @@ public function getModelName() public const TYPES_WITH_ERRORS_MOBILEPAY = 'mobilepay'; public const TYPES_WITH_ERRORS_MULTIBANCO = 'multibanco'; public const TYPES_WITH_ERRORS_ONLINE_BANKING_PL = 'onlineBanking_PL'; + public const TYPES_WITH_ERRORS_PAYBYBANK = 'paybybank'; public const TYPES_WITH_ERRORS_PAYPAL = 'paypal'; public const TYPES_WITH_ERRORS_PAYSHOP = 'payshop'; public const TYPES_WITH_ERRORS_SWISH = 'swish'; public const TYPES_WITH_ERRORS_TRUSTLY = 'trustly'; + public const TYPES_WITH_ERRORS_TWINT = 'twint'; + public const TYPES_WITH_ERRORS_TWINT_POS = 'twint_pos'; public const TYPES_WITH_ERRORS_VIPPS = 'vipps'; public const TYPES_WITH_ERRORS_VISA = 'visa'; public const TYPES_WITH_ERRORS_VISADEBIT = 'visadebit'; @@ -316,7 +318,6 @@ public function getTypesWithErrorsAllowableValues() self::TYPES_WITH_ERRORS_ELOCREDIT, self::TYPES_WITH_ERRORS_ELODEBIT, self::TYPES_WITH_ERRORS_GIROCARD, - self::TYPES_WITH_ERRORS_GIROPAY, self::TYPES_WITH_ERRORS_GOOGLEPAY, self::TYPES_WITH_ERRORS_HIPER, self::TYPES_WITH_ERRORS_HIPERCARD, @@ -334,10 +335,13 @@ public function getTypesWithErrorsAllowableValues() self::TYPES_WITH_ERRORS_MOBILEPAY, self::TYPES_WITH_ERRORS_MULTIBANCO, self::TYPES_WITH_ERRORS_ONLINE_BANKING_PL, + self::TYPES_WITH_ERRORS_PAYBYBANK, self::TYPES_WITH_ERRORS_PAYPAL, self::TYPES_WITH_ERRORS_PAYSHOP, self::TYPES_WITH_ERRORS_SWISH, self::TYPES_WITH_ERRORS_TRUSTLY, + self::TYPES_WITH_ERRORS_TWINT, + self::TYPES_WITH_ERRORS_TWINT_POS, self::TYPES_WITH_ERRORS_VIPPS, self::TYPES_WITH_ERRORS_VISA, self::TYPES_WITH_ERRORS_VISADEBIT, @@ -446,7 +450,7 @@ public function setLinks($links) /** * Gets data * - * @return \Adyen\Model\Management\PaymentMethod[]|null + * @return \Adyen\Model\Management\PaymentMethodWrapper[]|null */ public function getData() { @@ -456,7 +460,7 @@ public function getData() /** * Sets data * - * @param \Adyen\Model\Management\PaymentMethod[]|null $data Payment methods details. + * @param \Adyen\Model\Management\PaymentMethodWrapper[]|null $data Payment methods details. * * @return self */ diff --git a/src/Adyen/Model/Management/PaymentMethodSetupInfo.php b/src/Adyen/Model/Management/PaymentMethodSetupInfo.php index 142a6529f..8a4dd4bf3 100644 --- a/src/Adyen/Model/Management/PaymentMethodSetupInfo.php +++ b/src/Adyen/Model/Management/PaymentMethodSetupInfo.php @@ -44,10 +44,12 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $openAPITypes = [ + 'afterpayTouch' => '\Adyen\Model\Management\AfterpayTouchInfo', 'applePay' => '\Adyen\Model\Management\ApplePayInfo', 'bcmc' => '\Adyen\Model\Management\BcmcInfo', 'businessLineId' => 'string', 'cartesBancaires' => '\Adyen\Model\Management\CartesBancairesInfo', + 'clearpay' => '\Adyen\Model\Management\ClearpayInfo', 'countries' => 'string[]', 'currencies' => 'string[]', 'customRoutingFlags' => 'string[]', @@ -61,6 +63,7 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'sofort' => '\Adyen\Model\Management\SofortInfo', 'storeId' => 'string', 'swish' => '\Adyen\Model\Management\SwishInfo', + 'twint' => '\Adyen\Model\Management\TwintInfo', 'type' => 'string', 'vipps' => '\Adyen\Model\Management\VippsInfo' ]; @@ -73,10 +76,12 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial * @psalm-var array */ protected static $openAPIFormats = [ + 'afterpayTouch' => null, 'applePay' => null, 'bcmc' => null, 'businessLineId' => null, 'cartesBancaires' => null, + 'clearpay' => null, 'countries' => null, 'currencies' => null, 'customRoutingFlags' => null, @@ -90,6 +95,7 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'sofort' => null, 'storeId' => null, 'swish' => null, + 'twint' => null, 'type' => null, 'vipps' => null ]; @@ -100,10 +106,12 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial * @var boolean[] */ protected static $openAPINullables = [ + 'afterpayTouch' => false, 'applePay' => false, 'bcmc' => false, 'businessLineId' => false, 'cartesBancaires' => false, + 'clearpay' => false, 'countries' => false, 'currencies' => false, 'customRoutingFlags' => false, @@ -117,6 +125,7 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'sofort' => false, 'storeId' => false, 'swish' => false, + 'twint' => false, 'type' => false, 'vipps' => false ]; @@ -207,10 +216,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'afterpayTouch' => 'afterpayTouch', 'applePay' => 'applePay', 'bcmc' => 'bcmc', 'businessLineId' => 'businessLineId', 'cartesBancaires' => 'cartesBancaires', + 'clearpay' => 'clearpay', 'countries' => 'countries', 'currencies' => 'currencies', 'customRoutingFlags' => 'customRoutingFlags', @@ -224,6 +235,7 @@ public function isNullableSetToNull(string $property): bool 'sofort' => 'sofort', 'storeId' => 'storeId', 'swish' => 'swish', + 'twint' => 'twint', 'type' => 'type', 'vipps' => 'vipps' ]; @@ -234,10 +246,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'afterpayTouch' => 'setAfterpayTouch', 'applePay' => 'setApplePay', 'bcmc' => 'setBcmc', 'businessLineId' => 'setBusinessLineId', 'cartesBancaires' => 'setCartesBancaires', + 'clearpay' => 'setClearpay', 'countries' => 'setCountries', 'currencies' => 'setCurrencies', 'customRoutingFlags' => 'setCustomRoutingFlags', @@ -251,6 +265,7 @@ public function isNullableSetToNull(string $property): bool 'sofort' => 'setSofort', 'storeId' => 'setStoreId', 'swish' => 'setSwish', + 'twint' => 'setTwint', 'type' => 'setType', 'vipps' => 'setVipps' ]; @@ -261,10 +276,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'afterpayTouch' => 'getAfterpayTouch', 'applePay' => 'getApplePay', 'bcmc' => 'getBcmc', 'businessLineId' => 'getBusinessLineId', 'cartesBancaires' => 'getCartesBancaires', + 'clearpay' => 'getClearpay', 'countries' => 'getCountries', 'currencies' => 'getCurrencies', 'customRoutingFlags' => 'getCustomRoutingFlags', @@ -278,6 +295,7 @@ public function isNullableSetToNull(string $property): bool 'sofort' => 'getSofort', 'storeId' => 'getStoreId', 'swish' => 'getSwish', + 'twint' => 'getTwint', 'type' => 'getType', 'vipps' => 'getVipps' ]; @@ -347,7 +365,6 @@ public function getModelName() public const TYPE_ELOCREDIT = 'elocredit'; public const TYPE_ELODEBIT = 'elodebit'; public const TYPE_GIROCARD = 'girocard'; - public const TYPE_GIROPAY = 'giropay'; public const TYPE_GOOGLEPAY = 'googlepay'; public const TYPE_HIPER = 'hiper'; public const TYPE_HIPERCARD = 'hipercard'; @@ -365,10 +382,13 @@ public function getModelName() public const TYPE_MOBILEPAY = 'mobilepay'; public const TYPE_MULTIBANCO = 'multibanco'; public const TYPE_ONLINE_BANKING_PL = 'onlineBanking_PL'; + public const TYPE_PAYBYBANK = 'paybybank'; public const TYPE_PAYPAL = 'paypal'; public const TYPE_PAYSHOP = 'payshop'; public const TYPE_SWISH = 'swish'; public const TYPE_TRUSTLY = 'trustly'; + public const TYPE_TWINT = 'twint'; + public const TYPE_TWINT_POS = 'twint_pos'; public const TYPE_VIPPS = 'vipps'; public const TYPE_VISA = 'visa'; public const TYPE_VISADEBIT = 'visadebit'; @@ -418,7 +438,6 @@ public function getTypeAllowableValues() self::TYPE_ELOCREDIT, self::TYPE_ELODEBIT, self::TYPE_GIROCARD, - self::TYPE_GIROPAY, self::TYPE_GOOGLEPAY, self::TYPE_HIPER, self::TYPE_HIPERCARD, @@ -436,10 +455,13 @@ public function getTypeAllowableValues() self::TYPE_MOBILEPAY, self::TYPE_MULTIBANCO, self::TYPE_ONLINE_BANKING_PL, + self::TYPE_PAYBYBANK, self::TYPE_PAYPAL, self::TYPE_PAYSHOP, self::TYPE_SWISH, self::TYPE_TRUSTLY, + self::TYPE_TWINT, + self::TYPE_TWINT_POS, self::TYPE_VIPPS, self::TYPE_VISA, self::TYPE_VISADEBIT, @@ -463,10 +485,12 @@ public function getTypeAllowableValues() */ public function __construct(array $data = null) { + $this->setIfExists('afterpayTouch', $data ?? [], null); $this->setIfExists('applePay', $data ?? [], null); $this->setIfExists('bcmc', $data ?? [], null); $this->setIfExists('businessLineId', $data ?? [], null); $this->setIfExists('cartesBancaires', $data ?? [], null); + $this->setIfExists('clearpay', $data ?? [], null); $this->setIfExists('countries', $data ?? [], null); $this->setIfExists('currencies', $data ?? [], null); $this->setIfExists('customRoutingFlags', $data ?? [], null); @@ -480,6 +504,7 @@ public function __construct(array $data = null) $this->setIfExists('sofort', $data ?? [], null); $this->setIfExists('storeId', $data ?? [], null); $this->setIfExists('swish', $data ?? [], null); + $this->setIfExists('twint', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('vipps', $data ?? [], null); } @@ -544,6 +569,33 @@ public function valid() } + /** + * Gets afterpayTouch + * + * @return \Adyen\Model\Management\AfterpayTouchInfo|null + */ + public function getAfterpayTouch() + { + return $this->container['afterpayTouch']; + } + + /** + * Sets afterpayTouch + * + * @param \Adyen\Model\Management\AfterpayTouchInfo|null $afterpayTouch afterpayTouch + * + * @return self + */ + public function setAfterpayTouch($afterpayTouch) + { + if (is_null($afterpayTouch)) { + throw new \InvalidArgumentException('non-nullable afterpayTouch cannot be null'); + } + $this->container['afterpayTouch'] = $afterpayTouch; + + return $this; + } + /** * Gets applePay * @@ -652,6 +704,33 @@ public function setCartesBancaires($cartesBancaires) return $this; } + /** + * Gets clearpay + * + * @return \Adyen\Model\Management\ClearpayInfo|null + */ + public function getClearpay() + { + return $this->container['clearpay']; + } + + /** + * Sets clearpay + * + * @param \Adyen\Model\Management\ClearpayInfo|null $clearpay clearpay + * + * @return self + */ + public function setClearpay($clearpay) + { + if (is_null($clearpay)) { + throw new \InvalidArgumentException('non-nullable clearpay cannot be null'); + } + $this->container['clearpay'] = $clearpay; + + return $this; + } + /** * Gets countries * @@ -1013,6 +1092,33 @@ public function setSwish($swish) return $this; } + /** + * Gets twint + * + * @return \Adyen\Model\Management\TwintInfo|null + */ + public function getTwint() + { + return $this->container['twint']; + } + + /** + * Sets twint + * + * @param \Adyen\Model\Management\TwintInfo|null $twint twint + * + * @return self + */ + public function setTwint($twint) + { + if (is_null($twint)) { + throw new \InvalidArgumentException('non-nullable twint cannot be null'); + } + $this->container['twint'] = $twint; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/Management/PaymentMethodWrapper.php b/src/Adyen/Model/Management/PaymentMethodWrapper.php new file mode 100644 index 000000000..fe06ccc8e --- /dev/null +++ b/src/Adyen/Model/Management/PaymentMethodWrapper.php @@ -0,0 +1,384 @@ + + */ +class PaymentMethodWrapper implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentMethodWrapper'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'paymentMethod' => '\Adyen\Model\Management\PaymentMethod' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'paymentMethod' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'paymentMethod' => 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 = [ + 'paymentMethod' => 'PaymentMethod' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'paymentMethod' => 'setPaymentMethod' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'paymentMethod' => 'getPaymentMethod' + ]; + + /** + * 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('paymentMethod', $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 paymentMethod + * + * @return \Adyen\Model\Management\PaymentMethod|null + */ + public function getPaymentMethod() + { + return $this->container['paymentMethod']; + } + + /** + * Sets paymentMethod + * + * @param \Adyen\Model\Management\PaymentMethod|null $paymentMethod paymentMethod + * + * @return self + */ + public function setPaymentMethod($paymentMethod) + { + if (is_null($paymentMethod)) { + throw new \InvalidArgumentException('non-nullable paymentMethod cannot be null'); + } + $this->container['paymentMethod'] = $paymentMethod; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/RestServiceError.php b/src/Adyen/Model/Management/RestServiceError.php index a66ee465d..acf97d1ca 100644 --- a/src/Adyen/Model/Management/RestServiceError.php +++ b/src/Adyen/Model/Management/RestServiceError.php @@ -47,7 +47,7 @@ class RestServiceError implements ModelInterface, ArrayAccess, \JsonSerializable 'detail' => 'string', 'errorCode' => 'string', 'instance' => 'string', - 'invalidFields' => '\Adyen\Model\Management\InvalidField[]', + 'invalidFields' => '\Adyen\Model\Management\InvalidFieldWrapper[]', 'requestId' => 'string', 'response' => '\Adyen\Model\Management\JSONObject', 'status' => 'int', @@ -431,7 +431,7 @@ public function setInstance($instance) /** * Gets invalidFields * - * @return \Adyen\Model\Management\InvalidField[]|null + * @return \Adyen\Model\Management\InvalidFieldWrapper[]|null */ public function getInvalidFields() { @@ -441,7 +441,7 @@ public function getInvalidFields() /** * Sets invalidFields * - * @param \Adyen\Model\Management\InvalidField[]|null $invalidFields Detailed explanation of each validation error, when applicable. + * @param \Adyen\Model\Management\InvalidFieldWrapper[]|null $invalidFields Detailed explanation of each validation error, when applicable. * * @return self */ diff --git a/src/Adyen/Model/Management/SplitConfiguration.php b/src/Adyen/Model/Management/SplitConfiguration.php new file mode 100644 index 000000000..037b20009 --- /dev/null +++ b/src/Adyen/Model/Management/SplitConfiguration.php @@ -0,0 +1,492 @@ + + */ +class SplitConfiguration implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SplitConfiguration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'rules' => '\Adyen\Model\Management\SplitConfigurationRule[]', + 'splitConfigurationId' => 'string', + 'stores' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'rules' => null, + 'splitConfigurationId' => null, + 'stores' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'rules' => false, + 'splitConfigurationId' => false, + 'stores' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'rules' => 'rules', + 'splitConfigurationId' => 'splitConfigurationId', + 'stores' => 'stores' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'rules' => 'setRules', + 'splitConfigurationId' => 'setSplitConfigurationId', + 'stores' => 'setStores' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'rules' => 'getRules', + 'splitConfigurationId' => 'getSplitConfigurationId', + 'stores' => 'getStores' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('rules', $data ?? [], null); + $this->setIfExists('splitConfigurationId', $data ?? [], null); + $this->setIfExists('stores', $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['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['rules'] === null) { + $invalidProperties[] = "'rules' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description Your description for the split configuration. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets rules + * + * @return \Adyen\Model\Management\SplitConfigurationRule[] + */ + public function getRules() + { + return $this->container['rules']; + } + + /** + * Sets rules + * + * @param \Adyen\Model\Management\SplitConfigurationRule[] $rules Array of rules that define the split configuration behavior. + * + * @return self + */ + public function setRules($rules) + { + if (is_null($rules)) { + throw new \InvalidArgumentException('non-nullable rules cannot be null'); + } + $this->container['rules'] = $rules; + + return $this; + } + + /** + * Gets splitConfigurationId + * + * @return string|null + */ + public function getSplitConfigurationId() + { + return $this->container['splitConfigurationId']; + } + + /** + * Sets splitConfigurationId + * + * @param string|null $splitConfigurationId Unique identifier of the split configuration. + * + * @return self + */ + public function setSplitConfigurationId($splitConfigurationId) + { + if (is_null($splitConfigurationId)) { + throw new \InvalidArgumentException('non-nullable splitConfigurationId cannot be null'); + } + $this->container['splitConfigurationId'] = $splitConfigurationId; + + return $this; + } + + /** + * Gets stores + * + * @return string[]|null + */ + public function getStores() + { + return $this->container['stores']; + } + + /** + * Sets stores + * + * @param string[]|null $stores List of stores to which the split configuration applies. + * + * @return self + */ + public function setStores($stores) + { + if (is_null($stores)) { + throw new \InvalidArgumentException('non-nullable stores cannot be null'); + } + $this->container['stores'] = $stores; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/SplitConfigurationList.php b/src/Adyen/Model/Management/SplitConfigurationList.php new file mode 100644 index 000000000..044b9ac46 --- /dev/null +++ b/src/Adyen/Model/Management/SplitConfigurationList.php @@ -0,0 +1,384 @@ + + */ +class SplitConfigurationList implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SplitConfigurationList'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\Management\SplitConfiguration[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * 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('data', $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 data + * + * @return \Adyen\Model\Management\SplitConfiguration[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\SplitConfiguration[]|null $data List of split configurations applied to the stores under the merchant account. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/SplitConfigurationLogic.php b/src/Adyen/Model/Management/SplitConfigurationLogic.php new file mode 100644 index 000000000..9667ea2bb --- /dev/null +++ b/src/Adyen/Model/Management/SplitConfigurationLogic.php @@ -0,0 +1,795 @@ + + */ +class SplitConfigurationLogic implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SplitConfigurationLogic'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additionalCommission' => '\Adyen\Model\Management\AdditionalCommission', + 'chargeback' => 'string', + 'commission' => '\Adyen\Model\Management\Commission', + 'paymentFee' => 'string', + 'remainder' => 'string', + 'splitLogicId' => 'string', + 'surcharge' => 'string', + 'tip' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additionalCommission' => null, + 'chargeback' => null, + 'commission' => null, + 'paymentFee' => null, + 'remainder' => null, + 'splitLogicId' => null, + 'surcharge' => null, + 'tip' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additionalCommission' => false, + 'chargeback' => false, + 'commission' => false, + 'paymentFee' => false, + 'remainder' => false, + 'splitLogicId' => false, + 'surcharge' => false, + 'tip' => 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 = [ + 'additionalCommission' => 'additionalCommission', + 'chargeback' => 'chargeback', + 'commission' => 'commission', + 'paymentFee' => 'paymentFee', + 'remainder' => 'remainder', + 'splitLogicId' => 'splitLogicId', + 'surcharge' => 'surcharge', + 'tip' => 'tip' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additionalCommission' => 'setAdditionalCommission', + 'chargeback' => 'setChargeback', + 'commission' => 'setCommission', + 'paymentFee' => 'setPaymentFee', + 'remainder' => 'setRemainder', + 'splitLogicId' => 'setSplitLogicId', + 'surcharge' => 'setSurcharge', + 'tip' => 'setTip' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additionalCommission' => 'getAdditionalCommission', + 'chargeback' => 'getChargeback', + 'commission' => 'getCommission', + 'paymentFee' => 'getPaymentFee', + 'remainder' => 'getRemainder', + 'splitLogicId' => 'getSplitLogicId', + 'surcharge' => 'getSurcharge', + 'tip' => 'getTip' + ]; + + /** + * 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 CHARGEBACK_DEDUCT_FROM_LIABLE_ACCOUNT = 'deductFromLiableAccount'; + public const CHARGEBACK_DEDUCT_FROM_ONE_BALANCE_ACCOUNT = 'deductFromOneBalanceAccount'; + public const CHARGEBACK_DEDUCT_ACCORDING_TO_SPLIT_RATIO = 'deductAccordingToSplitRatio'; + public const PAYMENT_FEE_DEDUCT_FROM_LIABLE_ACCOUNT = 'deductFromLiableAccount'; + public const PAYMENT_FEE_DEDUCT_FROM_ONE_BALANCE_ACCOUNT = 'deductFromOneBalanceAccount'; + public const REMAINDER_ADD_TO_LIABLE_ACCOUNT = 'addToLiableAccount'; + public const REMAINDER_ADD_TO_ONE_BALANCE_ACCOUNT = 'addToOneBalanceAccount'; + public const SURCHARGE_ADD_TO_LIABLE_ACCOUNT = 'addToLiableAccount'; + public const SURCHARGE_ADD_TO_ONE_BALANCE_ACCOUNT = 'addToOneBalanceAccount'; + public const TIP_ADD_TO_LIABLE_ACCOUNT = 'addToLiableAccount'; + public const TIP_ADD_TO_ONE_BALANCE_ACCOUNT = 'addToOneBalanceAccount'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChargebackAllowableValues() + { + return [ + self::CHARGEBACK_DEDUCT_FROM_LIABLE_ACCOUNT, + self::CHARGEBACK_DEDUCT_FROM_ONE_BALANCE_ACCOUNT, + self::CHARGEBACK_DEDUCT_ACCORDING_TO_SPLIT_RATIO, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPaymentFeeAllowableValues() + { + return [ + self::PAYMENT_FEE_DEDUCT_FROM_LIABLE_ACCOUNT, + self::PAYMENT_FEE_DEDUCT_FROM_ONE_BALANCE_ACCOUNT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRemainderAllowableValues() + { + return [ + self::REMAINDER_ADD_TO_LIABLE_ACCOUNT, + self::REMAINDER_ADD_TO_ONE_BALANCE_ACCOUNT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSurchargeAllowableValues() + { + return [ + self::SURCHARGE_ADD_TO_LIABLE_ACCOUNT, + self::SURCHARGE_ADD_TO_ONE_BALANCE_ACCOUNT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTipAllowableValues() + { + return [ + self::TIP_ADD_TO_LIABLE_ACCOUNT, + self::TIP_ADD_TO_ONE_BALANCE_ACCOUNT, + ]; + } + /** + * 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('additionalCommission', $data ?? [], null); + $this->setIfExists('chargeback', $data ?? [], null); + $this->setIfExists('commission', $data ?? [], null); + $this->setIfExists('paymentFee', $data ?? [], null); + $this->setIfExists('remainder', $data ?? [], null); + $this->setIfExists('splitLogicId', $data ?? [], null); + $this->setIfExists('surcharge', $data ?? [], null); + $this->setIfExists('tip', $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->getChargebackAllowableValues(); + if (!is_null($this->container['chargeback']) && !in_array($this->container['chargeback'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'chargeback', must be one of '%s'", + $this->container['chargeback'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['commission'] === null) { + $invalidProperties[] = "'commission' can't be null"; + } + if ($this->container['paymentFee'] === null) { + $invalidProperties[] = "'paymentFee' can't be null"; + } + $allowedValues = $this->getPaymentFeeAllowableValues(); + if (!is_null($this->container['paymentFee']) && !in_array($this->container['paymentFee'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'paymentFee', must be one of '%s'", + $this->container['paymentFee'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRemainderAllowableValues(); + if (!is_null($this->container['remainder']) && !in_array($this->container['remainder'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'remainder', must be one of '%s'", + $this->container['remainder'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getSurchargeAllowableValues(); + if (!is_null($this->container['surcharge']) && !in_array($this->container['surcharge'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'surcharge', must be one of '%s'", + $this->container['surcharge'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTipAllowableValues(); + if (!is_null($this->container['tip']) && !in_array($this->container['tip'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'tip', must be one of '%s'", + $this->container['tip'], + 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 additionalCommission + * + * @return \Adyen\Model\Management\AdditionalCommission|null + */ + public function getAdditionalCommission() + { + return $this->container['additionalCommission']; + } + + /** + * Sets additionalCommission + * + * @param \Adyen\Model\Management\AdditionalCommission|null $additionalCommission additionalCommission + * + * @return self + */ + public function setAdditionalCommission($additionalCommission) + { + if (is_null($additionalCommission)) { + throw new \InvalidArgumentException('non-nullable additionalCommission cannot be null'); + } + $this->container['additionalCommission'] = $additionalCommission; + + return $this; + } + + /** + * Gets chargeback + * + * @return string|null + */ + public function getChargeback() + { + return $this->container['chargeback']; + } + + /** + * Sets chargeback + * + * @param string|null $chargeback Specifies the logic to apply when booking the chargeback amount. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. + * + * @return self + */ + public function setChargeback($chargeback) + { + if (is_null($chargeback)) { + throw new \InvalidArgumentException('non-nullable chargeback cannot be null'); + } + $allowedValues = $this->getChargebackAllowableValues(); + if (!in_array($chargeback, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'chargeback', must be one of '%s'", + $chargeback, + implode("', '", $allowedValues) + ) + ); + } + $this->container['chargeback'] = $chargeback; + + return $this; + } + + /** + * Gets commission + * + * @return \Adyen\Model\Management\Commission + */ + public function getCommission() + { + return $this->container['commission']; + } + + /** + * Sets commission + * + * @param \Adyen\Model\Management\Commission $commission commission + * + * @return self + */ + public function setCommission($commission) + { + if (is_null($commission)) { + throw new \InvalidArgumentException('non-nullable commission cannot be null'); + } + $this->container['commission'] = $commission; + + return $this; + } + + /** + * Gets paymentFee + * + * @return string + */ + public function getPaymentFee() + { + return $this->container['paymentFee']; + } + + /** + * Sets paymentFee + * + * @param string $paymentFee Specifies the logic to apply when booking the transaction fees. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. + * + * @return self + */ + public function setPaymentFee($paymentFee) + { + if (is_null($paymentFee)) { + throw new \InvalidArgumentException('non-nullable paymentFee cannot be null'); + } + $allowedValues = $this->getPaymentFeeAllowableValues(); + if (!in_array($paymentFee, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'paymentFee', must be one of '%s'", + $paymentFee, + implode("', '", $allowedValues) + ) + ); + } + $this->container['paymentFee'] = $paymentFee; + + return $this; + } + + /** + * Gets remainder + * + * @return string|null + */ + public function getRemainder() + { + return $this->container['remainder']; + } + + /** + * Sets remainder + * + * @param string|null $remainder Specifies the logic to apply when booking the amount left over after currency conversion. Possible values: **addToLiableAccount**, **addToOneBalanceAccount**. + * + * @return self + */ + public function setRemainder($remainder) + { + if (is_null($remainder)) { + throw new \InvalidArgumentException('non-nullable remainder cannot be null'); + } + $allowedValues = $this->getRemainderAllowableValues(); + if (!in_array($remainder, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'remainder', must be one of '%s'", + $remainder, + implode("', '", $allowedValues) + ) + ); + } + $this->container['remainder'] = $remainder; + + return $this; + } + + /** + * Gets splitLogicId + * + * @return string|null + */ + public function getSplitLogicId() + { + return $this->container['splitLogicId']; + } + + /** + * Sets splitLogicId + * + * @param string|null $splitLogicId Unique identifier of the split logic that is applied when the split configuration conditions are met. + * + * @return self + */ + public function setSplitLogicId($splitLogicId) + { + if (is_null($splitLogicId)) { + throw new \InvalidArgumentException('non-nullable splitLogicId cannot be null'); + } + $this->container['splitLogicId'] = $splitLogicId; + + return $this; + } + + /** + * Gets surcharge + * + * @return string|null + */ + public function getSurcharge() + { + return $this->container['surcharge']; + } + + /** + * Sets surcharge + * + * @param string|null $surcharge Specifies the logic to apply when booking the surcharge amount. Possible values: **addToLiableAccount**, **addToOneBalanceAccount** + * + * @return self + */ + public function setSurcharge($surcharge) + { + if (is_null($surcharge)) { + throw new \InvalidArgumentException('non-nullable surcharge cannot be null'); + } + $allowedValues = $this->getSurchargeAllowableValues(); + if (!in_array($surcharge, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'surcharge', must be one of '%s'", + $surcharge, + implode("', '", $allowedValues) + ) + ); + } + $this->container['surcharge'] = $surcharge; + + return $this; + } + + /** + * Gets tip + * + * @return string|null + */ + public function getTip() + { + return $this->container['tip']; + } + + /** + * Sets tip + * + * @param string|null $tip Specifies the logic to apply when booking tips (gratuity). Possible values: **addToLiableAccount**, **addToOneBalanceAccount**. + * + * @return self + */ + public function setTip($tip) + { + if (is_null($tip)) { + throw new \InvalidArgumentException('non-nullable tip cannot be null'); + } + $allowedValues = $this->getTipAllowableValues(); + if (!in_array($tip, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'tip', must be one of '%s'", + $tip, + implode("', '", $allowedValues) + ) + ); + } + $this->container['tip'] = $tip; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/SplitConfigurationRule.php b/src/Adyen/Model/Management/SplitConfigurationRule.php new file mode 100644 index 000000000..c2d8335cb --- /dev/null +++ b/src/Adyen/Model/Management/SplitConfigurationRule.php @@ -0,0 +1,640 @@ + + */ +class SplitConfigurationRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SplitConfigurationRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'fundingSource' => 'string', + 'paymentMethod' => 'string', + 'ruleId' => 'string', + 'shopperInteraction' => 'string', + 'splitLogic' => '\Adyen\Model\Management\SplitConfigurationLogic' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'fundingSource' => null, + 'paymentMethod' => null, + 'ruleId' => null, + 'shopperInteraction' => null, + 'splitLogic' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'fundingSource' => false, + 'paymentMethod' => false, + 'ruleId' => false, + 'shopperInteraction' => false, + 'splitLogic' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'fundingSource' => 'fundingSource', + 'paymentMethod' => 'paymentMethod', + 'ruleId' => 'ruleId', + 'shopperInteraction' => 'shopperInteraction', + 'splitLogic' => 'splitLogic' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'fundingSource' => 'setFundingSource', + 'paymentMethod' => 'setPaymentMethod', + 'ruleId' => 'setRuleId', + 'shopperInteraction' => 'setShopperInteraction', + 'splitLogic' => 'setSplitLogic' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'fundingSource' => 'getFundingSource', + 'paymentMethod' => 'getPaymentMethod', + 'ruleId' => 'getRuleId', + 'shopperInteraction' => 'getShopperInteraction', + 'splitLogic' => 'getSplitLogic' + ]; + + /** + * 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 FUNDING_SOURCE_CREDIT = 'credit'; + public const FUNDING_SOURCE_DEBIT = 'debit'; + public const FUNDING_SOURCE_ANY = 'ANY'; + public const SHOPPER_INTERACTION_ECOMMERCE = 'Ecommerce'; + public const SHOPPER_INTERACTION_CONT_AUTH = 'ContAuth'; + public const SHOPPER_INTERACTION_MOTO = 'Moto'; + public const SHOPPER_INTERACTION_POS = 'POS'; + public const SHOPPER_INTERACTION_ANY = 'ANY'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFundingSourceAllowableValues() + { + return [ + self::FUNDING_SOURCE_CREDIT, + self::FUNDING_SOURCE_DEBIT, + self::FUNDING_SOURCE_ANY, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShopperInteractionAllowableValues() + { + return [ + self::SHOPPER_INTERACTION_ECOMMERCE, + self::SHOPPER_INTERACTION_CONT_AUTH, + self::SHOPPER_INTERACTION_MOTO, + self::SHOPPER_INTERACTION_POS, + self::SHOPPER_INTERACTION_ANY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('fundingSource', $data ?? [], null); + $this->setIfExists('paymentMethod', $data ?? [], null); + $this->setIfExists('ruleId', $data ?? [], null); + $this->setIfExists('shopperInteraction', $data ?? [], null); + $this->setIfExists('splitLogic', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!is_null($this->container['fundingSource']) && !in_array($this->container['fundingSource'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'fundingSource', must be one of '%s'", + $this->container['fundingSource'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['paymentMethod'] === null) { + $invalidProperties[] = "'paymentMethod' can't be null"; + } + if ($this->container['shopperInteraction'] === null) { + $invalidProperties[] = "'shopperInteraction' can't be null"; + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!is_null($this->container['shopperInteraction']) && !in_array($this->container['shopperInteraction'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'shopperInteraction', must be one of '%s'", + $this->container['shopperInteraction'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['splitLogic'] === null) { + $invalidProperties[] = "'splitLogic' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The currency condition that defines whether the split logic applies. Its value must be a three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets fundingSource + * + * @return string|null + */ + public function getFundingSource() + { + return $this->container['fundingSource']; + } + + /** + * Sets fundingSource + * + * @param string|null $fundingSource The funding source condition of the payment method (only for cards). Possible values: **credit**, **debit**, or **ANY**. + * + * @return self + */ + public function setFundingSource($fundingSource) + { + if (is_null($fundingSource)) { + throw new \InvalidArgumentException('non-nullable fundingSource cannot be null'); + } + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!in_array($fundingSource, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'fundingSource', must be one of '%s'", + $fundingSource, + implode("', '", $allowedValues) + ) + ); + } + $this->container['fundingSource'] = $fundingSource; + + return $this; + } + + /** + * Gets paymentMethod + * + * @return string + */ + public function getPaymentMethod() + { + return $this->container['paymentMethod']; + } + + /** + * Sets paymentMethod + * + * @param string $paymentMethod The payment method condition that defines whether the split logic applies. Possible values: * [Payment method variant](https://docs.adyen.com/development-resources/paymentmethodvariant): Apply the split logic for a specific payment method. * **ANY**: Apply the split logic for all available payment methods. + * + * @return self + */ + public function setPaymentMethod($paymentMethod) + { + if (is_null($paymentMethod)) { + throw new \InvalidArgumentException('non-nullable paymentMethod cannot be null'); + } + $this->container['paymentMethod'] = $paymentMethod; + + return $this; + } + + /** + * Gets ruleId + * + * @return string|null + */ + public function getRuleId() + { + return $this->container['ruleId']; + } + + /** + * Sets ruleId + * + * @param string|null $ruleId The unique identifier of the split configuration rule. + * + * @return self + */ + public function setRuleId($ruleId) + { + if (is_null($ruleId)) { + throw new \InvalidArgumentException('non-nullable ruleId cannot be null'); + } + $this->container['ruleId'] = $ruleId; + + return $this; + } + + /** + * Gets shopperInteraction + * + * @return string + */ + public function getShopperInteraction() + { + return $this->container['shopperInteraction']; + } + + /** + * Sets shopperInteraction + * + * @param string $shopperInteraction The sales channel condition that defines whether the split logic applies. Possible values: * **Ecommerce**: Online transactions where the cardholder is present. * **ContAuth**: Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). * **Moto**: Mail-order and telephone-order transactions where the customer is in contact with the merchant via email or telephone. * **POS**: Point-of-sale transactions where the customer is physically present to make a payment using a secure payment terminal. * **ANY**: All sales channels. + * + * @return self + */ + public function setShopperInteraction($shopperInteraction) + { + if (is_null($shopperInteraction)) { + throw new \InvalidArgumentException('non-nullable shopperInteraction cannot be null'); + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!in_array($shopperInteraction, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'shopperInteraction', must be one of '%s'", + $shopperInteraction, + implode("', '", $allowedValues) + ) + ); + } + $this->container['shopperInteraction'] = $shopperInteraction; + + return $this; + } + + /** + * Gets splitLogic + * + * @return \Adyen\Model\Management\SplitConfigurationLogic + */ + public function getSplitLogic() + { + return $this->container['splitLogic']; + } + + /** + * Sets splitLogic + * + * @param \Adyen\Model\Management\SplitConfigurationLogic $splitLogic splitLogic + * + * @return self + */ + public function setSplitLogic($splitLogic) + { + if (is_null($splitLogic)) { + throw new \InvalidArgumentException('non-nullable splitLogic cannot be null'); + } + $this->container['splitLogic'] = $splitLogic; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/StoreCreationRequest.php b/src/Adyen/Model/Management/StoreCreationRequest.php index 1392056e8..75f9987c4 100644 --- a/src/Adyen/Model/Management/StoreCreationRequest.php +++ b/src/Adyen/Model/Management/StoreCreationRequest.php @@ -377,7 +377,7 @@ public function getBusinessLineIds() /** * Sets businessLineIds * - * @param string[]|null $businessLineIds The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businesslines__resParam_id) that the store is associated with. If not specified, the business line of the merchant account is used. Required when there are multiple business lines under the merchant account. + * @param string[]|null $businessLineIds The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/legalentity/latest/post/businessLines#responses-200-id) that the store is associated with. If not specified, the business line of the merchant account is used. Required when there are multiple business lines under the merchant account. * * @return self */ @@ -431,7 +431,7 @@ public function getExternalReferenceId() /** * Sets externalReferenceId * - * @param string|null $externalReferenceId When using the Zip payment method: The location ID that Zip has assigned to your store. + * @param string|null $externalReferenceId Used by certain payment methods and tax authorities to uniquely identify the store. For CNPJ in Brazil, ZIP in Australia and SIRET in France. This field is conditionally required if the store is in Brazil, Australia or France. For CNPJ the format is 00.000.000/0000-00, can be submitted as just digits, or with dots, slash & hyphen. For Australian stores ZIP an optional field used by the Zip payment method. For SIRET the format is 14 digits. * * @return self */ @@ -485,7 +485,7 @@ public function getReference() /** * Sets reference * - * @param string|null $reference Your reference to recognize the store by. Also known as the store code. Allowed characters: Lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_). + * @param string|null $reference Your reference to recognize the store by. Also known as the store code. Allowed characters: lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_). If you do not provide a reference in your POST request, it is populated with the Adyen-generated [id](https://docs.adyen.com/api-explorer/Management/latest/post/stores#responses-200-id). * * @return self */ diff --git a/src/Adyen/Model/Management/StoreCreationWithMerchantCodeRequest.php b/src/Adyen/Model/Management/StoreCreationWithMerchantCodeRequest.php index 26bdb04fc..588c51c91 100644 --- a/src/Adyen/Model/Management/StoreCreationWithMerchantCodeRequest.php +++ b/src/Adyen/Model/Management/StoreCreationWithMerchantCodeRequest.php @@ -387,7 +387,7 @@ public function getBusinessLineIds() /** * Sets businessLineIds * - * @param string[]|null $businessLineIds The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businesslines__resParam_id) that the store is associated with. If not specified, the business line of the merchant account is used. Required when there are multiple business lines under the merchant account. + * @param string[]|null $businessLineIds The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/legalentity/latest/post/businessLines#responses-200-id) that the store is associated with. If not specified, the business line of the merchant account is used. Required when there are multiple business lines under the merchant account. * * @return self */ @@ -441,7 +441,7 @@ public function getExternalReferenceId() /** * Sets externalReferenceId * - * @param string|null $externalReferenceId When using the Zip payment method: The location ID that Zip has assigned to your store. + * @param string|null $externalReferenceId Used by certain payment methods and tax authorities to uniquely identify the store. For CNPJ in Brazil, ZIP in Australia and SIRET in France. This field is conditionally required if the store is in Brazil, Australia or France. For CNPJ the format is 00.000.000/0000-00, can be submitted as just digits, or with dots, slash & hyphen. For Australian stores ZIP an optional field used by the Zip payment method. For SIRET the format is 14 digits. * * @return self */ @@ -522,7 +522,7 @@ public function getReference() /** * Sets reference * - * @param string|null $reference Your reference to recognize the store by. Also known as the store code. Allowed characters: Lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_). + * @param string|null $reference Your reference to recognize the store by. Also known as the store code. Allowed characters: lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_). If you do not provide a reference in your POST request, it is populated with the Adyen-generated [id](https://docs.adyen.com/api-explorer/Management/latest/post/stores#responses-200-id). * * @return self */ diff --git a/src/Adyen/Model/Management/TerminalOrderRequest.php b/src/Adyen/Model/Management/TerminalOrderRequest.php index 7e3f2e98b..baee03954 100644 --- a/src/Adyen/Model/Management/TerminalOrderRequest.php +++ b/src/Adyen/Model/Management/TerminalOrderRequest.php @@ -47,6 +47,7 @@ class TerminalOrderRequest implements ModelInterface, ArrayAccess, \JsonSerializ 'billingEntityId' => 'string', 'customerOrderReference' => 'string', 'items' => '\Adyen\Model\Management\OrderItem[]', + 'orderType' => 'string', 'shippingLocationId' => 'string', 'taxId' => 'string' ]; @@ -62,6 +63,7 @@ class TerminalOrderRequest implements ModelInterface, ArrayAccess, \JsonSerializ 'billingEntityId' => null, 'customerOrderReference' => null, 'items' => null, + 'orderType' => null, 'shippingLocationId' => null, 'taxId' => null ]; @@ -75,6 +77,7 @@ class TerminalOrderRequest implements ModelInterface, ArrayAccess, \JsonSerializ 'billingEntityId' => false, 'customerOrderReference' => false, 'items' => false, + 'orderType' => false, 'shippingLocationId' => false, 'taxId' => false ]; @@ -168,6 +171,7 @@ public function isNullableSetToNull(string $property): bool 'billingEntityId' => 'billingEntityId', 'customerOrderReference' => 'customerOrderReference', 'items' => 'items', + 'orderType' => 'orderType', 'shippingLocationId' => 'shippingLocationId', 'taxId' => 'taxId' ]; @@ -181,6 +185,7 @@ public function isNullableSetToNull(string $property): bool 'billingEntityId' => 'setBillingEntityId', 'customerOrderReference' => 'setCustomerOrderReference', 'items' => 'setItems', + 'orderType' => 'setOrderType', 'shippingLocationId' => 'setShippingLocationId', 'taxId' => 'setTaxId' ]; @@ -194,6 +199,7 @@ public function isNullableSetToNull(string $property): bool 'billingEntityId' => 'getBillingEntityId', 'customerOrderReference' => 'getCustomerOrderReference', 'items' => 'getItems', + 'orderType' => 'getOrderType', 'shippingLocationId' => 'getShippingLocationId', 'taxId' => 'getTaxId' ]; @@ -258,6 +264,7 @@ public function __construct(array $data = null) $this->setIfExists('billingEntityId', $data ?? [], null); $this->setIfExists('customerOrderReference', $data ?? [], null); $this->setIfExists('items', $data ?? [], null); + $this->setIfExists('orderType', $data ?? [], null); $this->setIfExists('shippingLocationId', $data ?? [], null); $this->setIfExists('taxId', $data ?? [], null); } @@ -385,6 +392,33 @@ public function setItems($items) return $this; } + /** + * Gets orderType + * + * @return string|null + */ + public function getOrderType() + { + return $this->container['orderType']; + } + + /** + * Sets orderType + * + * @param string|null $orderType Type of order + * + * @return self + */ + public function setOrderType($orderType) + { + if (is_null($orderType)) { + throw new \InvalidArgumentException('non-nullable orderType cannot be null'); + } + $this->container['orderType'] = $orderType; + + return $this; + } + /** * Gets shippingLocationId * diff --git a/src/Adyen/Model/Management/TerminalProductPrice.php b/src/Adyen/Model/Management/TerminalProductPrice.php index 3fbeb8fbc..aa5dee09c 100644 --- a/src/Adyen/Model/Management/TerminalProductPrice.php +++ b/src/Adyen/Model/Management/TerminalProductPrice.php @@ -45,7 +45,7 @@ class TerminalProductPrice implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPITypes = [ 'currency' => 'string', - 'value' => 'object' + 'value' => 'float' ]; /** @@ -57,7 +57,7 @@ class TerminalProductPrice implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPIFormats = [ 'currency' => null, - 'value' => null + 'value' => 'double' ]; /** @@ -313,7 +313,7 @@ public function setCurrency($currency) /** * Gets value * - * @return object|null + * @return float|null */ public function getValue() { @@ -323,7 +323,7 @@ public function getValue() /** * Sets value * - * @param object|null $value value + * @param float|null $value The price of the item. * * @return self */ diff --git a/src/Adyen/Model/Management/TwintInfo.php b/src/Adyen/Model/Management/TwintInfo.php new file mode 100644 index 000000000..31b53cf05 --- /dev/null +++ b/src/Adyen/Model/Management/TwintInfo.php @@ -0,0 +1,387 @@ + + */ +class TwintInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TwintInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'logo' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'logo' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'logo' => 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 = [ + 'logo' => 'logo' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'logo' => 'setLogo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'logo' => 'getLogo' + ]; + + /** + * 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('logo', $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['logo'] === null) { + $invalidProperties[] = "'logo' 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 logo + * + * @return string + */ + public function getLogo() + { + return $this->container['logo']; + } + + /** + * Sets logo + * + * @param string $logo Twint logo. Format: Base64-encoded string. + * + * @return self + */ + public function setLogo($logo) + { + if (is_null($logo)) { + throw new \InvalidArgumentException('non-nullable logo cannot be null'); + } + $this->container['logo'] = $logo; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/UpdateCompanyApiCredentialRequest.php b/src/Adyen/Model/Management/UpdateCompanyApiCredentialRequest.php index cc776cee5..89fbe4412 100644 --- a/src/Adyen/Model/Management/UpdateCompanyApiCredentialRequest.php +++ b/src/Adyen/Model/Management/UpdateCompanyApiCredentialRequest.php @@ -425,7 +425,7 @@ public function getRoles() /** * Sets roles * - * @param string[]|null $roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) of the API credential. + * @param string[]|null $roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. Only roles assigned to 'ws@Company.' can be assigned to other API credentials. * * @return self */ diff --git a/src/Adyen/Model/Management/UpdateCompanyUserRequest.php b/src/Adyen/Model/Management/UpdateCompanyUserRequest.php index 7d5e8e14d..0cf79d24f 100644 --- a/src/Adyen/Model/Management/UpdateCompanyUserRequest.php +++ b/src/Adyen/Model/Management/UpdateCompanyUserRequest.php @@ -47,8 +47,6 @@ class UpdateCompanyUserRequest implements ModelInterface, ArrayAccess, \JsonSeri 'accountGroups' => 'string[]', 'active' => 'bool', 'associatedMerchantAccounts' => 'string[]', - 'authnAppsToAdd' => 'string[]', - 'authnAppsToRemove' => 'string[]', 'email' => 'string', 'name' => '\Adyen\Model\Management\Name2', 'roles' => 'string[]', @@ -66,8 +64,6 @@ class UpdateCompanyUserRequest implements ModelInterface, ArrayAccess, \JsonSeri 'accountGroups' => null, 'active' => null, 'associatedMerchantAccounts' => null, - 'authnAppsToAdd' => null, - 'authnAppsToRemove' => null, 'email' => null, 'name' => null, 'roles' => null, @@ -83,8 +79,6 @@ class UpdateCompanyUserRequest implements ModelInterface, ArrayAccess, \JsonSeri 'accountGroups' => false, 'active' => false, 'associatedMerchantAccounts' => false, - 'authnAppsToAdd' => false, - 'authnAppsToRemove' => false, 'email' => false, 'name' => false, 'roles' => false, @@ -180,8 +174,6 @@ public function isNullableSetToNull(string $property): bool 'accountGroups' => 'accountGroups', 'active' => 'active', 'associatedMerchantAccounts' => 'associatedMerchantAccounts', - 'authnAppsToAdd' => 'authnAppsToAdd', - 'authnAppsToRemove' => 'authnAppsToRemove', 'email' => 'email', 'name' => 'name', 'roles' => 'roles', @@ -197,8 +189,6 @@ public function isNullableSetToNull(string $property): bool 'accountGroups' => 'setAccountGroups', 'active' => 'setActive', 'associatedMerchantAccounts' => 'setAssociatedMerchantAccounts', - 'authnAppsToAdd' => 'setAuthnAppsToAdd', - 'authnAppsToRemove' => 'setAuthnAppsToRemove', 'email' => 'setEmail', 'name' => 'setName', 'roles' => 'setRoles', @@ -214,8 +204,6 @@ public function isNullableSetToNull(string $property): bool 'accountGroups' => 'getAccountGroups', 'active' => 'getActive', 'associatedMerchantAccounts' => 'getAssociatedMerchantAccounts', - 'authnAppsToAdd' => 'getAuthnAppsToAdd', - 'authnAppsToRemove' => 'getAuthnAppsToRemove', 'email' => 'getEmail', 'name' => 'getName', 'roles' => 'getRoles', @@ -282,8 +270,6 @@ public function __construct(array $data = null) $this->setIfExists('accountGroups', $data ?? [], null); $this->setIfExists('active', $data ?? [], null); $this->setIfExists('associatedMerchantAccounts', $data ?? [], null); - $this->setIfExists('authnAppsToAdd', $data ?? [], null); - $this->setIfExists('authnAppsToRemove', $data ?? [], null); $this->setIfExists('email', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); $this->setIfExists('roles', $data ?? [], null); @@ -413,60 +399,6 @@ public function setAssociatedMerchantAccounts($associatedMerchantAccounts) return $this; } - /** - * Gets authnAppsToAdd - * - * @return string[]|null - */ - public function getAuthnAppsToAdd() - { - return $this->container['authnAppsToAdd']; - } - - /** - * Sets authnAppsToAdd - * - * @param string[]|null $authnAppsToAdd Set of authn apps to add to this user - * - * @return self - */ - public function setAuthnAppsToAdd($authnAppsToAdd) - { - if (is_null($authnAppsToAdd)) { - throw new \InvalidArgumentException('non-nullable authnAppsToAdd cannot be null'); - } - $this->container['authnAppsToAdd'] = $authnAppsToAdd; - - return $this; - } - - /** - * Gets authnAppsToRemove - * - * @return string[]|null - */ - public function getAuthnAppsToRemove() - { - return $this->container['authnAppsToRemove']; - } - - /** - * Sets authnAppsToRemove - * - * @param string[]|null $authnAppsToRemove Set of authn apps to remove from this user - * - * @return self - */ - public function setAuthnAppsToRemove($authnAppsToRemove) - { - if (is_null($authnAppsToRemove)) { - throw new \InvalidArgumentException('non-nullable authnAppsToRemove cannot be null'); - } - $this->container['authnAppsToRemove'] = $authnAppsToRemove; - - return $this; - } - /** * Gets email * diff --git a/src/Adyen/Model/Management/UpdateCompanyWebhookRequest.php b/src/Adyen/Model/Management/UpdateCompanyWebhookRequest.php index c196df617..7791e64ba 100644 --- a/src/Adyen/Model/Management/UpdateCompanyWebhookRequest.php +++ b/src/Adyen/Model/Management/UpdateCompanyWebhookRequest.php @@ -305,14 +305,9 @@ public function getModelName() public const FILTER_MERCHANT_ACCOUNT_TYPE_ALL_ACCOUNTS = 'allAccounts'; public const FILTER_MERCHANT_ACCOUNT_TYPE_EXCLUDE_ACCOUNTS = 'excludeAccounts'; public const FILTER_MERCHANT_ACCOUNT_TYPE_INCLUDE_ACCOUNTS = 'includeAccounts'; - public const NETWORK_TYPE_LOCAL = 'LOCAL'; - public const NETWORK_TYPE__PUBLIC = 'PUBLIC'; + public const NETWORK_TYPE_LOCAL = 'local'; + public const NETWORK_TYPE__PUBLIC = 'public'; public const SSL_VERSION_HTTP = 'HTTP'; - public const SSL_VERSION_SSL = 'SSL'; - public const SSL_VERSION_SSLV3 = 'SSLv3'; - public const SSL_VERSION_TLS = 'TLS'; - public const SSL_VERSION_TLSV1 = 'TLSv1'; - public const SSL_VERSION_TLSV1_1 = 'TLSv1.1'; public const SSL_VERSION_TLSV1_2 = 'TLSv1.2'; public const SSL_VERSION_TLSV1_3 = 'TLSv1.3'; @@ -363,11 +358,6 @@ public function getSslVersionAllowableValues() { return [ self::SSL_VERSION_HTTP, - self::SSL_VERSION_SSL, - self::SSL_VERSION_SSLV3, - self::SSL_VERSION_TLS, - self::SSL_VERSION_TLSV1, - self::SSL_VERSION_TLSV1_1, self::SSL_VERSION_TLSV1_2, self::SSL_VERSION_TLSV1_3, ]; diff --git a/src/Adyen/Model/Management/UpdateMerchantApiCredentialRequest.php b/src/Adyen/Model/Management/UpdateMerchantApiCredentialRequest.php index 415c96399..6b2fecd93 100644 --- a/src/Adyen/Model/Management/UpdateMerchantApiCredentialRequest.php +++ b/src/Adyen/Model/Management/UpdateMerchantApiCredentialRequest.php @@ -391,7 +391,7 @@ public function getRoles() /** * Sets roles * - * @param string[]|null $roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. + * @param string[]|null $roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. Only roles assigned to 'ws@Company.' can be assigned to other API credentials. * * @return self */ diff --git a/src/Adyen/Model/Management/UpdateMerchantUserRequest.php b/src/Adyen/Model/Management/UpdateMerchantUserRequest.php index 85d8f7975..a4f582b77 100644 --- a/src/Adyen/Model/Management/UpdateMerchantUserRequest.php +++ b/src/Adyen/Model/Management/UpdateMerchantUserRequest.php @@ -46,8 +46,6 @@ class UpdateMerchantUserRequest implements ModelInterface, ArrayAccess, \JsonSer protected static $openAPITypes = [ 'accountGroups' => 'string[]', 'active' => 'bool', - 'authnAppsToAdd' => 'string[]', - 'authnAppsToRemove' => 'string[]', 'email' => 'string', 'name' => '\Adyen\Model\Management\Name2', 'roles' => 'string[]', @@ -64,8 +62,6 @@ class UpdateMerchantUserRequest implements ModelInterface, ArrayAccess, \JsonSer protected static $openAPIFormats = [ 'accountGroups' => null, 'active' => null, - 'authnAppsToAdd' => null, - 'authnAppsToRemove' => null, 'email' => null, 'name' => null, 'roles' => null, @@ -80,8 +76,6 @@ class UpdateMerchantUserRequest implements ModelInterface, ArrayAccess, \JsonSer protected static $openAPINullables = [ 'accountGroups' => false, 'active' => false, - 'authnAppsToAdd' => false, - 'authnAppsToRemove' => false, 'email' => false, 'name' => false, 'roles' => false, @@ -176,8 +170,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountGroups' => 'accountGroups', 'active' => 'active', - 'authnAppsToAdd' => 'authnAppsToAdd', - 'authnAppsToRemove' => 'authnAppsToRemove', 'email' => 'email', 'name' => 'name', 'roles' => 'roles', @@ -192,8 +184,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountGroups' => 'setAccountGroups', 'active' => 'setActive', - 'authnAppsToAdd' => 'setAuthnAppsToAdd', - 'authnAppsToRemove' => 'setAuthnAppsToRemove', 'email' => 'setEmail', 'name' => 'setName', 'roles' => 'setRoles', @@ -208,8 +198,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountGroups' => 'getAccountGroups', 'active' => 'getActive', - 'authnAppsToAdd' => 'getAuthnAppsToAdd', - 'authnAppsToRemove' => 'getAuthnAppsToRemove', 'email' => 'getEmail', 'name' => 'getName', 'roles' => 'getRoles', @@ -275,8 +263,6 @@ public function __construct(array $data = null) { $this->setIfExists('accountGroups', $data ?? [], null); $this->setIfExists('active', $data ?? [], null); - $this->setIfExists('authnAppsToAdd', $data ?? [], null); - $this->setIfExists('authnAppsToRemove', $data ?? [], null); $this->setIfExists('email', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); $this->setIfExists('roles', $data ?? [], null); @@ -379,60 +365,6 @@ public function setActive($active) return $this; } - /** - * Gets authnAppsToAdd - * - * @return string[]|null - */ - public function getAuthnAppsToAdd() - { - return $this->container['authnAppsToAdd']; - } - - /** - * Sets authnAppsToAdd - * - * @param string[]|null $authnAppsToAdd Set of authn apps to add to this user - * - * @return self - */ - public function setAuthnAppsToAdd($authnAppsToAdd) - { - if (is_null($authnAppsToAdd)) { - throw new \InvalidArgumentException('non-nullable authnAppsToAdd cannot be null'); - } - $this->container['authnAppsToAdd'] = $authnAppsToAdd; - - return $this; - } - - /** - * Gets authnAppsToRemove - * - * @return string[]|null - */ - public function getAuthnAppsToRemove() - { - return $this->container['authnAppsToRemove']; - } - - /** - * Sets authnAppsToRemove - * - * @param string[]|null $authnAppsToRemove Set of authn apps to remove from this user - * - * @return self - */ - public function setAuthnAppsToRemove($authnAppsToRemove) - { - if (is_null($authnAppsToRemove)) { - throw new \InvalidArgumentException('non-nullable authnAppsToRemove cannot be null'); - } - $this->container['authnAppsToRemove'] = $authnAppsToRemove; - - return $this; - } - /** * Gets email * diff --git a/src/Adyen/Model/Management/UpdateMerchantWebhookRequest.php b/src/Adyen/Model/Management/UpdateMerchantWebhookRequest.php index fc5b14204..1a9a59a3e 100644 --- a/src/Adyen/Model/Management/UpdateMerchantWebhookRequest.php +++ b/src/Adyen/Model/Management/UpdateMerchantWebhookRequest.php @@ -290,14 +290,9 @@ public function getModelName() public const COMMUNICATION_FORMAT_HTTP = 'http'; public const COMMUNICATION_FORMAT_JSON = 'json'; public const COMMUNICATION_FORMAT_SOAP = 'soap'; - public const NETWORK_TYPE_LOCAL = 'LOCAL'; - public const NETWORK_TYPE__PUBLIC = 'PUBLIC'; + public const NETWORK_TYPE_LOCAL = 'local'; + public const NETWORK_TYPE__PUBLIC = 'public'; public const SSL_VERSION_HTTP = 'HTTP'; - public const SSL_VERSION_SSL = 'SSL'; - public const SSL_VERSION_SSLV3 = 'SSLv3'; - public const SSL_VERSION_TLS = 'TLS'; - public const SSL_VERSION_TLSV1 = 'TLSv1'; - public const SSL_VERSION_TLSV1_1 = 'TLSv1.1'; public const SSL_VERSION_TLSV1_2 = 'TLSv1.2'; public const SSL_VERSION_TLSV1_3 = 'TLSv1.3'; @@ -335,11 +330,6 @@ public function getSslVersionAllowableValues() { return [ self::SSL_VERSION_HTTP, - self::SSL_VERSION_SSL, - self::SSL_VERSION_SSLV3, - self::SSL_VERSION_TLS, - self::SSL_VERSION_TLSV1, - self::SSL_VERSION_TLSV1_1, self::SSL_VERSION_TLSV1_2, self::SSL_VERSION_TLSV1_3, ]; diff --git a/src/Adyen/Model/Management/UpdatePaymentMethodInfo.php b/src/Adyen/Model/Management/UpdatePaymentMethodInfo.php index 0d53a3277..a5d23c0e7 100644 --- a/src/Adyen/Model/Management/UpdatePaymentMethodInfo.php +++ b/src/Adyen/Model/Management/UpdatePaymentMethodInfo.php @@ -44,11 +44,11 @@ class UpdatePaymentMethodInfo implements ModelInterface, ArrayAccess, \JsonSeria * @var string[] */ protected static $openAPITypes = [ + 'bcmc' => '\Adyen\Model\Management\BcmcInfo', + 'cartesBancaires' => '\Adyen\Model\Management\CartesBancairesInfo', 'countries' => 'string[]', 'currencies' => 'string[]', - 'customRoutingFlags' => 'string[]', 'enabled' => 'bool', - 'shopperStatement' => '\Adyen\Model\Management\ShopperStatement', 'storeIds' => 'string[]' ]; @@ -60,11 +60,11 @@ class UpdatePaymentMethodInfo implements ModelInterface, ArrayAccess, \JsonSeria * @psalm-var array */ protected static $openAPIFormats = [ + 'bcmc' => null, + 'cartesBancaires' => null, 'countries' => null, 'currencies' => null, - 'customRoutingFlags' => null, 'enabled' => null, - 'shopperStatement' => null, 'storeIds' => null ]; @@ -74,11 +74,11 @@ class UpdatePaymentMethodInfo implements ModelInterface, ArrayAccess, \JsonSeria * @var boolean[] */ protected static $openAPINullables = [ + 'bcmc' => false, + 'cartesBancaires' => false, 'countries' => false, 'currencies' => false, - 'customRoutingFlags' => false, 'enabled' => false, - 'shopperStatement' => false, 'storeIds' => false ]; @@ -168,11 +168,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'bcmc' => 'bcmc', + 'cartesBancaires' => 'cartesBancaires', 'countries' => 'countries', 'currencies' => 'currencies', - 'customRoutingFlags' => 'customRoutingFlags', 'enabled' => 'enabled', - 'shopperStatement' => 'shopperStatement', 'storeIds' => 'storeIds' ]; @@ -182,11 +182,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'bcmc' => 'setBcmc', + 'cartesBancaires' => 'setCartesBancaires', 'countries' => 'setCountries', 'currencies' => 'setCurrencies', - 'customRoutingFlags' => 'setCustomRoutingFlags', 'enabled' => 'setEnabled', - 'shopperStatement' => 'setShopperStatement', 'storeIds' => 'setStoreIds' ]; @@ -196,11 +196,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'bcmc' => 'getBcmc', + 'cartesBancaires' => 'getCartesBancaires', 'countries' => 'getCountries', 'currencies' => 'getCurrencies', - 'customRoutingFlags' => 'getCustomRoutingFlags', 'enabled' => 'getEnabled', - 'shopperStatement' => 'getShopperStatement', 'storeIds' => 'getStoreIds' ]; @@ -261,11 +261,11 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('bcmc', $data ?? [], null); + $this->setIfExists('cartesBancaires', $data ?? [], null); $this->setIfExists('countries', $data ?? [], null); $this->setIfExists('currencies', $data ?? [], null); - $this->setIfExists('customRoutingFlags', $data ?? [], null); $this->setIfExists('enabled', $data ?? [], null); - $this->setIfExists('shopperStatement', $data ?? [], null); $this->setIfExists('storeIds', $data ?? [], null); } @@ -312,136 +312,136 @@ public function valid() /** - * Gets countries + * Gets bcmc * - * @return string[]|null + * @return \Adyen\Model\Management\BcmcInfo|null */ - public function getCountries() + public function getBcmc() { - return $this->container['countries']; + return $this->container['bcmc']; } /** - * Sets countries + * Sets bcmc * - * @param string[]|null $countries The list of countries where a payment method is available. By default, all countries supported by the payment method. + * @param \Adyen\Model\Management\BcmcInfo|null $bcmc bcmc * * @return self */ - public function setCountries($countries) + public function setBcmc($bcmc) { - if (is_null($countries)) { - throw new \InvalidArgumentException('non-nullable countries cannot be null'); + if (is_null($bcmc)) { + throw new \InvalidArgumentException('non-nullable bcmc cannot be null'); } - $this->container['countries'] = $countries; + $this->container['bcmc'] = $bcmc; return $this; } /** - * Gets currencies + * Gets cartesBancaires * - * @return string[]|null + * @return \Adyen\Model\Management\CartesBancairesInfo|null */ - public function getCurrencies() + public function getCartesBancaires() { - return $this->container['currencies']; + return $this->container['cartesBancaires']; } /** - * Sets currencies + * Sets cartesBancaires * - * @param string[]|null $currencies The list of currencies that a payment method supports. By default, all currencies supported by the payment method. + * @param \Adyen\Model\Management\CartesBancairesInfo|null $cartesBancaires cartesBancaires * * @return self */ - public function setCurrencies($currencies) + public function setCartesBancaires($cartesBancaires) { - if (is_null($currencies)) { - throw new \InvalidArgumentException('non-nullable currencies cannot be null'); + if (is_null($cartesBancaires)) { + throw new \InvalidArgumentException('non-nullable cartesBancaires cannot be null'); } - $this->container['currencies'] = $currencies; + $this->container['cartesBancaires'] = $cartesBancaires; return $this; } /** - * Gets customRoutingFlags + * Gets countries * * @return string[]|null */ - public function getCustomRoutingFlags() + public function getCountries() { - return $this->container['customRoutingFlags']; + return $this->container['countries']; } /** - * Sets customRoutingFlags + * Sets countries * - * @param string[]|null $customRoutingFlags Custom routing flags for acquirer routing. + * @param string[]|null $countries The list of countries where a payment method is available. By default, all countries supported by the payment method. * * @return self */ - public function setCustomRoutingFlags($customRoutingFlags) + public function setCountries($countries) { - if (is_null($customRoutingFlags)) { - throw new \InvalidArgumentException('non-nullable customRoutingFlags cannot be null'); + if (is_null($countries)) { + throw new \InvalidArgumentException('non-nullable countries cannot be null'); } - $this->container['customRoutingFlags'] = $customRoutingFlags; + $this->container['countries'] = $countries; return $this; } /** - * Gets enabled + * Gets currencies * - * @return bool|null + * @return string[]|null */ - public function getEnabled() + public function getCurrencies() { - return $this->container['enabled']; + return $this->container['currencies']; } /** - * Sets enabled + * Sets currencies * - * @param bool|null $enabled Indicates whether the payment method is enabled (**true**) or disabled (**false**). + * @param string[]|null $currencies The list of currencies that a payment method supports. By default, all currencies supported by the payment method. * * @return self */ - public function setEnabled($enabled) + public function setCurrencies($currencies) { - if (is_null($enabled)) { - throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + if (is_null($currencies)) { + throw new \InvalidArgumentException('non-nullable currencies cannot be null'); } - $this->container['enabled'] = $enabled; + $this->container['currencies'] = $currencies; return $this; } /** - * Gets shopperStatement + * Gets enabled * - * @return \Adyen\Model\Management\ShopperStatement|null + * @return bool|null */ - public function getShopperStatement() + public function getEnabled() { - return $this->container['shopperStatement']; + return $this->container['enabled']; } /** - * Sets shopperStatement + * Sets enabled * - * @param \Adyen\Model\Management\ShopperStatement|null $shopperStatement shopperStatement + * @param bool|null $enabled Indicates whether the payment method is enabled (**true**) or disabled (**false**). * * @return self */ - public function setShopperStatement($shopperStatement) + public function setEnabled($enabled) { - if (is_null($shopperStatement)) { - throw new \InvalidArgumentException('non-nullable shopperStatement cannot be null'); + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); } - $this->container['shopperStatement'] = $shopperStatement; + $this->container['enabled'] = $enabled; return $this; } diff --git a/src/Adyen/Model/Management/UpdateSplitConfigurationLogicRequest.php b/src/Adyen/Model/Management/UpdateSplitConfigurationLogicRequest.php new file mode 100644 index 000000000..8e4f3b2e7 --- /dev/null +++ b/src/Adyen/Model/Management/UpdateSplitConfigurationLogicRequest.php @@ -0,0 +1,795 @@ + + */ +class UpdateSplitConfigurationLogicRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateSplitConfigurationLogicRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additionalCommission' => '\Adyen\Model\Management\AdditionalCommission', + 'chargeback' => 'string', + 'commission' => '\Adyen\Model\Management\Commission', + 'paymentFee' => 'string', + 'remainder' => 'string', + 'splitLogicId' => 'string', + 'surcharge' => 'string', + 'tip' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additionalCommission' => null, + 'chargeback' => null, + 'commission' => null, + 'paymentFee' => null, + 'remainder' => null, + 'splitLogicId' => null, + 'surcharge' => null, + 'tip' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additionalCommission' => false, + 'chargeback' => false, + 'commission' => false, + 'paymentFee' => false, + 'remainder' => false, + 'splitLogicId' => false, + 'surcharge' => false, + 'tip' => 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 = [ + 'additionalCommission' => 'additionalCommission', + 'chargeback' => 'chargeback', + 'commission' => 'commission', + 'paymentFee' => 'paymentFee', + 'remainder' => 'remainder', + 'splitLogicId' => 'splitLogicId', + 'surcharge' => 'surcharge', + 'tip' => 'tip' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additionalCommission' => 'setAdditionalCommission', + 'chargeback' => 'setChargeback', + 'commission' => 'setCommission', + 'paymentFee' => 'setPaymentFee', + 'remainder' => 'setRemainder', + 'splitLogicId' => 'setSplitLogicId', + 'surcharge' => 'setSurcharge', + 'tip' => 'setTip' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additionalCommission' => 'getAdditionalCommission', + 'chargeback' => 'getChargeback', + 'commission' => 'getCommission', + 'paymentFee' => 'getPaymentFee', + 'remainder' => 'getRemainder', + 'splitLogicId' => 'getSplitLogicId', + 'surcharge' => 'getSurcharge', + 'tip' => 'getTip' + ]; + + /** + * 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 CHARGEBACK_DEDUCT_FROM_LIABLE_ACCOUNT = 'deductFromLiableAccount'; + public const CHARGEBACK_DEDUCT_FROM_ONE_BALANCE_ACCOUNT = 'deductFromOneBalanceAccount'; + public const CHARGEBACK_DEDUCT_ACCORDING_TO_SPLIT_RATIO = 'deductAccordingToSplitRatio'; + public const PAYMENT_FEE_DEDUCT_FROM_LIABLE_ACCOUNT = 'deductFromLiableAccount'; + public const PAYMENT_FEE_DEDUCT_FROM_ONE_BALANCE_ACCOUNT = 'deductFromOneBalanceAccount'; + public const REMAINDER_ADD_TO_LIABLE_ACCOUNT = 'addToLiableAccount'; + public const REMAINDER_ADD_TO_ONE_BALANCE_ACCOUNT = 'addToOneBalanceAccount'; + public const SURCHARGE_ADD_TO_LIABLE_ACCOUNT = 'addToLiableAccount'; + public const SURCHARGE_ADD_TO_ONE_BALANCE_ACCOUNT = 'addToOneBalanceAccount'; + public const TIP_ADD_TO_LIABLE_ACCOUNT = 'addToLiableAccount'; + public const TIP_ADD_TO_ONE_BALANCE_ACCOUNT = 'addToOneBalanceAccount'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChargebackAllowableValues() + { + return [ + self::CHARGEBACK_DEDUCT_FROM_LIABLE_ACCOUNT, + self::CHARGEBACK_DEDUCT_FROM_ONE_BALANCE_ACCOUNT, + self::CHARGEBACK_DEDUCT_ACCORDING_TO_SPLIT_RATIO, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPaymentFeeAllowableValues() + { + return [ + self::PAYMENT_FEE_DEDUCT_FROM_LIABLE_ACCOUNT, + self::PAYMENT_FEE_DEDUCT_FROM_ONE_BALANCE_ACCOUNT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRemainderAllowableValues() + { + return [ + self::REMAINDER_ADD_TO_LIABLE_ACCOUNT, + self::REMAINDER_ADD_TO_ONE_BALANCE_ACCOUNT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSurchargeAllowableValues() + { + return [ + self::SURCHARGE_ADD_TO_LIABLE_ACCOUNT, + self::SURCHARGE_ADD_TO_ONE_BALANCE_ACCOUNT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTipAllowableValues() + { + return [ + self::TIP_ADD_TO_LIABLE_ACCOUNT, + self::TIP_ADD_TO_ONE_BALANCE_ACCOUNT, + ]; + } + /** + * 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('additionalCommission', $data ?? [], null); + $this->setIfExists('chargeback', $data ?? [], null); + $this->setIfExists('commission', $data ?? [], null); + $this->setIfExists('paymentFee', $data ?? [], null); + $this->setIfExists('remainder', $data ?? [], null); + $this->setIfExists('splitLogicId', $data ?? [], null); + $this->setIfExists('surcharge', $data ?? [], null); + $this->setIfExists('tip', $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->getChargebackAllowableValues(); + if (!is_null($this->container['chargeback']) && !in_array($this->container['chargeback'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'chargeback', must be one of '%s'", + $this->container['chargeback'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['commission'] === null) { + $invalidProperties[] = "'commission' can't be null"; + } + if ($this->container['paymentFee'] === null) { + $invalidProperties[] = "'paymentFee' can't be null"; + } + $allowedValues = $this->getPaymentFeeAllowableValues(); + if (!is_null($this->container['paymentFee']) && !in_array($this->container['paymentFee'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'paymentFee', must be one of '%s'", + $this->container['paymentFee'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRemainderAllowableValues(); + if (!is_null($this->container['remainder']) && !in_array($this->container['remainder'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'remainder', must be one of '%s'", + $this->container['remainder'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getSurchargeAllowableValues(); + if (!is_null($this->container['surcharge']) && !in_array($this->container['surcharge'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'surcharge', must be one of '%s'", + $this->container['surcharge'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTipAllowableValues(); + if (!is_null($this->container['tip']) && !in_array($this->container['tip'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'tip', must be one of '%s'", + $this->container['tip'], + 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 additionalCommission + * + * @return \Adyen\Model\Management\AdditionalCommission|null + */ + public function getAdditionalCommission() + { + return $this->container['additionalCommission']; + } + + /** + * Sets additionalCommission + * + * @param \Adyen\Model\Management\AdditionalCommission|null $additionalCommission additionalCommission + * + * @return self + */ + public function setAdditionalCommission($additionalCommission) + { + if (is_null($additionalCommission)) { + throw new \InvalidArgumentException('non-nullable additionalCommission cannot be null'); + } + $this->container['additionalCommission'] = $additionalCommission; + + return $this; + } + + /** + * Gets chargeback + * + * @return string|null + */ + public function getChargeback() + { + return $this->container['chargeback']; + } + + /** + * Sets chargeback + * + * @param string|null $chargeback Specifies the logic to apply when booking the chargeback amount. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. + * + * @return self + */ + public function setChargeback($chargeback) + { + if (is_null($chargeback)) { + throw new \InvalidArgumentException('non-nullable chargeback cannot be null'); + } + $allowedValues = $this->getChargebackAllowableValues(); + if (!in_array($chargeback, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'chargeback', must be one of '%s'", + $chargeback, + implode("', '", $allowedValues) + ) + ); + } + $this->container['chargeback'] = $chargeback; + + return $this; + } + + /** + * Gets commission + * + * @return \Adyen\Model\Management\Commission + */ + public function getCommission() + { + return $this->container['commission']; + } + + /** + * Sets commission + * + * @param \Adyen\Model\Management\Commission $commission commission + * + * @return self + */ + public function setCommission($commission) + { + if (is_null($commission)) { + throw new \InvalidArgumentException('non-nullable commission cannot be null'); + } + $this->container['commission'] = $commission; + + return $this; + } + + /** + * Gets paymentFee + * + * @return string + */ + public function getPaymentFee() + { + return $this->container['paymentFee']; + } + + /** + * Sets paymentFee + * + * @param string $paymentFee Specifies the logic to apply when booking the transaction fees. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. + * + * @return self + */ + public function setPaymentFee($paymentFee) + { + if (is_null($paymentFee)) { + throw new \InvalidArgumentException('non-nullable paymentFee cannot be null'); + } + $allowedValues = $this->getPaymentFeeAllowableValues(); + if (!in_array($paymentFee, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'paymentFee', must be one of '%s'", + $paymentFee, + implode("', '", $allowedValues) + ) + ); + } + $this->container['paymentFee'] = $paymentFee; + + return $this; + } + + /** + * Gets remainder + * + * @return string|null + */ + public function getRemainder() + { + return $this->container['remainder']; + } + + /** + * Sets remainder + * + * @param string|null $remainder Specifies the logic to apply when booking the amount left over after currency conversion. Possible values: **addToLiableAccount**, **addToOneBalanceAccount**. + * + * @return self + */ + public function setRemainder($remainder) + { + if (is_null($remainder)) { + throw new \InvalidArgumentException('non-nullable remainder cannot be null'); + } + $allowedValues = $this->getRemainderAllowableValues(); + if (!in_array($remainder, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'remainder', must be one of '%s'", + $remainder, + implode("', '", $allowedValues) + ) + ); + } + $this->container['remainder'] = $remainder; + + return $this; + } + + /** + * Gets splitLogicId + * + * @return string|null + */ + public function getSplitLogicId() + { + return $this->container['splitLogicId']; + } + + /** + * Sets splitLogicId + * + * @param string|null $splitLogicId Unique identifier of the split logic that is applied when the split configuration conditions are met. + * + * @return self + */ + public function setSplitLogicId($splitLogicId) + { + if (is_null($splitLogicId)) { + throw new \InvalidArgumentException('non-nullable splitLogicId cannot be null'); + } + $this->container['splitLogicId'] = $splitLogicId; + + return $this; + } + + /** + * Gets surcharge + * + * @return string|null + */ + public function getSurcharge() + { + return $this->container['surcharge']; + } + + /** + * Sets surcharge + * + * @param string|null $surcharge Specifies the logic to apply when booking the surcharge amount. Possible values: **addToLiableAccount**, **addToOneBalanceAccount** + * + * @return self + */ + public function setSurcharge($surcharge) + { + if (is_null($surcharge)) { + throw new \InvalidArgumentException('non-nullable surcharge cannot be null'); + } + $allowedValues = $this->getSurchargeAllowableValues(); + if (!in_array($surcharge, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'surcharge', must be one of '%s'", + $surcharge, + implode("', '", $allowedValues) + ) + ); + } + $this->container['surcharge'] = $surcharge; + + return $this; + } + + /** + * Gets tip + * + * @return string|null + */ + public function getTip() + { + return $this->container['tip']; + } + + /** + * Sets tip + * + * @param string|null $tip Specifies the logic to apply when booking tips (gratuity). Possible values: **addToLiableAccount**, **addToOneBalanceAccount**. + * + * @return self + */ + public function setTip($tip) + { + if (is_null($tip)) { + throw new \InvalidArgumentException('non-nullable tip cannot be null'); + } + $allowedValues = $this->getTipAllowableValues(); + if (!in_array($tip, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'tip', must be one of '%s'", + $tip, + implode("', '", $allowedValues) + ) + ); + } + $this->container['tip'] = $tip; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/UpdateSplitConfigurationRequest.php b/src/Adyen/Model/Management/UpdateSplitConfigurationRequest.php new file mode 100644 index 000000000..a1cded6a2 --- /dev/null +++ b/src/Adyen/Model/Management/UpdateSplitConfigurationRequest.php @@ -0,0 +1,387 @@ + + */ +class UpdateSplitConfigurationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateSplitConfigurationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('description', $data ?? [], null); + } + + /** + * 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['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description Your description for the split configuration. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/UpdateSplitConfigurationRuleRequest.php b/src/Adyen/Model/Management/UpdateSplitConfigurationRuleRequest.php new file mode 100644 index 000000000..8252c0134 --- /dev/null +++ b/src/Adyen/Model/Management/UpdateSplitConfigurationRuleRequest.php @@ -0,0 +1,495 @@ + + */ +class UpdateSplitConfigurationRuleRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateSplitConfigurationRuleRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'fundingSource' => 'string', + 'paymentMethod' => 'string', + 'shopperInteraction' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'fundingSource' => null, + 'paymentMethod' => null, + 'shopperInteraction' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'fundingSource' => false, + 'paymentMethod' => false, + 'shopperInteraction' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'fundingSource' => 'fundingSource', + 'paymentMethod' => 'paymentMethod', + 'shopperInteraction' => 'shopperInteraction' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'fundingSource' => 'setFundingSource', + 'paymentMethod' => 'setPaymentMethod', + 'shopperInteraction' => 'setShopperInteraction' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'fundingSource' => 'getFundingSource', + 'paymentMethod' => 'getPaymentMethod', + 'shopperInteraction' => 'getShopperInteraction' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('fundingSource', $data ?? [], null); + $this->setIfExists('paymentMethod', $data ?? [], null); + $this->setIfExists('shopperInteraction', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['paymentMethod'] === null) { + $invalidProperties[] = "'paymentMethod' can't be null"; + } + if ($this->container['shopperInteraction'] === null) { + $invalidProperties[] = "'shopperInteraction' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The currency condition that defines whether the split logic applies. Its value must be a three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets fundingSource + * + * @return string|null + */ + public function getFundingSource() + { + return $this->container['fundingSource']; + } + + /** + * Sets fundingSource + * + * @param string|null $fundingSource The funding source condition of the payment method (only for cards). Possible values: **credit**, **debit**, or **ANY**. + * + * @return self + */ + public function setFundingSource($fundingSource) + { + if (is_null($fundingSource)) { + throw new \InvalidArgumentException('non-nullable fundingSource cannot be null'); + } + $this->container['fundingSource'] = $fundingSource; + + return $this; + } + + /** + * Gets paymentMethod + * + * @return string + */ + public function getPaymentMethod() + { + return $this->container['paymentMethod']; + } + + /** + * Sets paymentMethod + * + * @param string $paymentMethod The payment method condition that defines whether the split logic applies. Possible values: * [Payment method variant](https://docs.adyen.com/development-resources/paymentmethodvariant): Apply the split logic for a specific payment method. * **ANY**: Apply the split logic for all available payment methods. + * + * @return self + */ + public function setPaymentMethod($paymentMethod) + { + if (is_null($paymentMethod)) { + throw new \InvalidArgumentException('non-nullable paymentMethod cannot be null'); + } + $this->container['paymentMethod'] = $paymentMethod; + + return $this; + } + + /** + * Gets shopperInteraction + * + * @return string + */ + public function getShopperInteraction() + { + return $this->container['shopperInteraction']; + } + + /** + * Sets shopperInteraction + * + * @param string $shopperInteraction The sales channel condition that defines whether the split logic applies. Possible values: * **Ecommerce**: Online transactions where the cardholder is present. * **ContAuth**: Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). * **Moto**: Mail-order and telephone-order transactions where the customer is in contact with the merchant via email or telephone. * **POS**: Point-of-sale transactions where the customer is physically present to make a payment using a secure payment terminal. * **ANY**: All sales channels. + * + * @return self + */ + public function setShopperInteraction($shopperInteraction) + { + if (is_null($shopperInteraction)) { + throw new \InvalidArgumentException('non-nullable shopperInteraction cannot be null'); + } + $this->container['shopperInteraction'] = $shopperInteraction; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/User.php b/src/Adyen/Model/Management/User.php index f31b7e45b..d198a75e6 100644 --- a/src/Adyen/Model/Management/User.php +++ b/src/Adyen/Model/Management/User.php @@ -47,7 +47,7 @@ class User implements ModelInterface, ArrayAccess, \JsonSerializable 'links' => '\Adyen\Model\Management\Links', 'accountGroups' => 'string[]', 'active' => 'bool', - 'authnApps' => 'string[]', + 'apps' => 'string[]', 'email' => 'string', 'id' => 'string', 'name' => '\Adyen\Model\Management\Name', @@ -67,7 +67,7 @@ class User implements ModelInterface, ArrayAccess, \JsonSerializable 'links' => null, 'accountGroups' => null, 'active' => null, - 'authnApps' => null, + 'apps' => null, 'email' => null, 'id' => null, 'name' => null, @@ -85,7 +85,7 @@ class User implements ModelInterface, ArrayAccess, \JsonSerializable 'links' => false, 'accountGroups' => false, 'active' => false, - 'authnApps' => false, + 'apps' => false, 'email' => false, 'id' => false, 'name' => false, @@ -183,7 +183,7 @@ public function isNullableSetToNull(string $property): bool 'links' => '_links', 'accountGroups' => 'accountGroups', 'active' => 'active', - 'authnApps' => 'authnApps', + 'apps' => 'apps', 'email' => 'email', 'id' => 'id', 'name' => 'name', @@ -201,7 +201,7 @@ public function isNullableSetToNull(string $property): bool 'links' => 'setLinks', 'accountGroups' => 'setAccountGroups', 'active' => 'setActive', - 'authnApps' => 'setAuthnApps', + 'apps' => 'setApps', 'email' => 'setEmail', 'id' => 'setId', 'name' => 'setName', @@ -219,7 +219,7 @@ public function isNullableSetToNull(string $property): bool 'links' => 'getLinks', 'accountGroups' => 'getAccountGroups', 'active' => 'getActive', - 'authnApps' => 'getAuthnApps', + 'apps' => 'getApps', 'email' => 'getEmail', 'id' => 'getId', 'name' => 'getName', @@ -288,7 +288,7 @@ public function __construct(array $data = null) $this->setIfExists('links', $data ?? [], null); $this->setIfExists('accountGroups', $data ?? [], null); $this->setIfExists('active', $data ?? [], null); - $this->setIfExists('authnApps', $data ?? [], null); + $this->setIfExists('apps', $data ?? [], null); $this->setIfExists('email', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -436,28 +436,28 @@ public function setActive($active) } /** - * Gets authnApps + * Gets apps * * @return string[]|null */ - public function getAuthnApps() + public function getApps() { - return $this->container['authnApps']; + return $this->container['apps']; } /** - * Sets authnApps + * Sets apps * - * @param string[]|null $authnApps Set of authn apps available to this user + * @param string[]|null $apps Set of apps available to this user * * @return self */ - public function setAuthnApps($authnApps) + public function setApps($apps) { - if (is_null($authnApps)) { - throw new \InvalidArgumentException('non-nullable authnApps cannot be null'); + if (is_null($apps)) { + throw new \InvalidArgumentException('non-nullable apps cannot be null'); } - $this->container['authnApps'] = $authnApps; + $this->container['apps'] = $apps; return $this; } diff --git a/src/Adyen/Model/Management/VippsInfo.php b/src/Adyen/Model/Management/VippsInfo.php index 824fba5f6..e7824dc92 100644 --- a/src/Adyen/Model/Management/VippsInfo.php +++ b/src/Adyen/Model/Management/VippsInfo.php @@ -326,7 +326,7 @@ public function getSubscriptionCancelUrl() /** * Sets subscriptionCancelUrl * - * @param string|null $subscriptionCancelUrl Vipps subscription cancel url + * @param string|null $subscriptionCancelUrl Vipps subscription cancel url (required in case of [recurring payments](https://docs.adyen.com/online-payments/tokenization)) * * @return self */ diff --git a/src/Adyen/Model/Management/Webhook.php b/src/Adyen/Model/Management/Webhook.php index 7039541ed..20e793fe4 100644 --- a/src/Adyen/Model/Management/Webhook.php +++ b/src/Adyen/Model/Management/Webhook.php @@ -347,14 +347,9 @@ public function getModelName() public const FILTER_MERCHANT_ACCOUNT_TYPE_ALL_ACCOUNTS = 'allAccounts'; public const FILTER_MERCHANT_ACCOUNT_TYPE_EXCLUDE_ACCOUNTS = 'excludeAccounts'; public const FILTER_MERCHANT_ACCOUNT_TYPE_INCLUDE_ACCOUNTS = 'includeAccounts'; - public const NETWORK_TYPE_LOCAL = 'LOCAL'; - public const NETWORK_TYPE__PUBLIC = 'PUBLIC'; + public const NETWORK_TYPE_LOCAL = 'local'; + public const NETWORK_TYPE__PUBLIC = 'public'; public const SSL_VERSION_HTTP = 'HTTP'; - public const SSL_VERSION_SSL = 'SSL'; - public const SSL_VERSION_SSLV3 = 'SSLv3'; - public const SSL_VERSION_TLS = 'TLS'; - public const SSL_VERSION_TLSV1 = 'TLSv1'; - public const SSL_VERSION_TLSV1_1 = 'TLSv1.1'; public const SSL_VERSION_TLSV1_2 = 'TLSv1.2'; public const SSL_VERSION_TLSV1_3 = 'TLSv1.3'; @@ -405,11 +400,6 @@ public function getSslVersionAllowableValues() { return [ self::SSL_VERSION_HTTP, - self::SSL_VERSION_SSL, - self::SSL_VERSION_SSLV3, - self::SSL_VERSION_TLS, - self::SSL_VERSION_TLSV1, - self::SSL_VERSION_TLSV1_1, self::SSL_VERSION_TLSV1_2, self::SSL_VERSION_TLSV1_3, ]; diff --git a/src/Adyen/Model/Payments/AdditionalDataAirline.php b/src/Adyen/Model/Payments/AdditionalDataAirline.php index 35f8d727b..71b161bf5 100644 --- a/src/Adyen/Model/Payments/AdditionalDataAirline.php +++ b/src/Adyen/Model/Payments/AdditionalDataAirline.php @@ -481,7 +481,7 @@ public function getAirlineAgencyInvoiceNumber() /** * Sets airlineAgencyInvoiceNumber * - * @param string|null $airlineAgencyInvoiceNumber Reference number for the invoice, issued by the agency. * minLength: 1 * maxLength: 6 + * @param string|null $airlineAgencyInvoiceNumber The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters * * @return self */ @@ -508,7 +508,7 @@ public function getAirlineAgencyPlanName() /** * Sets airlineAgencyPlanName * - * @param string|null $airlineAgencyPlanName 2-letter agency plan identifier; alphabetical. * minLength: 2 * maxLength: 2 + * @param string|null $airlineAgencyPlanName The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters * * @return self */ @@ -535,7 +535,7 @@ public function getAirlineAirlineCode() /** * Sets airlineAirlineCode * - * @param string|null $airlineAirlineCode [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX); numeric. It identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 * maxLength: 3 + * @param string|null $airlineAirlineCode The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros * * @return self */ @@ -562,7 +562,7 @@ public function getAirlineAirlineDesignatorCode() /** * Sets airlineAirlineDesignatorCode * - * @param string|null $airlineAirlineDesignatorCode [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX); alphabetical. It identifies the carrier. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter airline code * Example: KLM = KL * minLength: 2 * maxLength: 2 + * @param string|null $airlineAirlineDesignatorCode The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros * * @return self */ @@ -589,7 +589,7 @@ public function getAirlineBoardingFee() /** * Sets airlineBoardingFee * - * @param string|null $airlineBoardingFee Chargeable amount for boarding the plane. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). * minLength: 1 * maxLength: 18 + * @param string|null $airlineBoardingFee The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 18 characters * * @return self */ @@ -616,7 +616,7 @@ public function getAirlineComputerizedReservationSystem() /** * Sets airlineComputerizedReservationSystem * - * @param string|null $airlineComputerizedReservationSystem The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Format: alphanumeric. * minLength: 4 * maxLength: 4 + * @param string|null $airlineComputerizedReservationSystem The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters * * @return self */ @@ -643,7 +643,7 @@ public function getAirlineCustomerReferenceNumber() /** * Sets airlineCustomerReferenceNumber * - * @param string|null $airlineCustomerReferenceNumber Reference number; alphanumeric. * minLength: 0 * maxLength: 20 + * @param string|null $airlineCustomerReferenceNumber The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not be all spaces * * @return self */ @@ -670,7 +670,7 @@ public function getAirlineDocumentType() /** * Sets airlineDocumentType * - * @param string|null $airlineDocumentType Optional 2-digit code; alphanumeric. It identifies the type of product of the transaction. The description of the code may appear on credit card statements. * Format: 2-digit code * Example: Passenger ticket = 01 * minLength: 2 * maxLength: 2 + * @param string|null $airlineDocumentType A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters * * @return self */ @@ -697,7 +697,7 @@ public function getAirlineFlightDate() /** * Sets airlineFlightDate * - * @param string|null $airlineFlightDate Flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 * maxLength: 16 + * @param string|null $airlineFlightDate The flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 characters * maxLength: 16 characters * * @return self */ @@ -724,7 +724,7 @@ public function getAirlineLegCarrierCode() /** * Sets airlineLegCarrierCode * - * @param string|null $airlineLegCarrierCode [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX); alphabetical. It identifies the carrier. This field is required/mandatory if the airline data includes leg details. * Format: IATA 2-letter airline code * Example: KLM = KL * minLength: 2 * maxLength: 2 + * @param string|null $airlineLegCarrierCode The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros * * @return self */ @@ -751,7 +751,7 @@ public function getAirlineLegClassOfTravel() /** * Sets airlineLegClassOfTravel * - * @param string|null $airlineLegClassOfTravel 1-letter travel class identifier; alphabetical. There is no standard; however, the following codes are used rather consistently: * F: first class * J: business class * Y: economy class * W: premium economy Limitations: * minLength: 1 * maxLength: 1 + * @param string|null $airlineLegClassOfTravel A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces * Must not be all zeros * * @return self */ @@ -778,7 +778,7 @@ public function getAirlineLegDateOfTravel() /** * Sets airlineLegDateOfTravel * - * @param string|null $airlineLegDateOfTravel Date and time of travel. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)-compliant. * Format: `yyyy-MM-dd HH:mm` * minLength: 16 * maxLength: 16 + * @param string|null $airlineLegDateOfTravel Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters * * @return self */ @@ -805,7 +805,7 @@ public function getAirlineLegDepartAirport() /** * Sets airlineLegDepartAirport * - * @param string|null $airlineLegDepartAirport Alphabetical identifier of the departure airport. This field is required if the airline data includes leg details. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code. * Example: Amsterdam = AMS * minLength: 3 * maxLength: 3 + * @param string|null $airlineLegDepartAirport The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros * * @return self */ @@ -832,7 +832,7 @@ public function getAirlineLegDepartTax() /** * Sets airlineLegDepartTax * - * @param string|null $airlineLegDepartTax [Departure tax](https://en.wikipedia.org/wiki/Departure_tax). Amount charged by a country to an individual upon their leaving. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). * minLength: 1 * maxLength: 12 + * @param string|null $airlineLegDepartTax The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 * Must not be all zeros * * @return self */ @@ -859,7 +859,7 @@ public function getAirlineLegDestinationCode() /** * Sets airlineLegDestinationCode * - * @param string|null $airlineLegDestinationCode Alphabetical identifier of the destination/arrival airport. This field is required/mandatory if the airline data includes leg details. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code. * Example: Amsterdam = AMS * minLength: 3 * maxLength: 3 + * @param string|null $airlineLegDestinationCode The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros * * @return self */ @@ -886,7 +886,7 @@ public function getAirlineLegFareBaseCode() /** * Sets airlineLegFareBaseCode * - * @param string|null $airlineLegFareBaseCode [Fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code); alphanumeric. * minLength: 1 * maxLength: 7 + * @param string|null $airlineLegFareBaseCode The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces * Must not be all zeros * * @return self */ @@ -913,7 +913,7 @@ public function getAirlineLegFlightNumber() /** * Sets airlineLegFlightNumber * - * @param string|null $airlineLegFlightNumber The flight identifier. * minLength: 1 * maxLength: 5 + * @param string|null $airlineLegFlightNumber The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros * * @return self */ @@ -940,7 +940,7 @@ public function getAirlineLegStopOverCode() /** * Sets airlineLegStopOverCode * - * @param string|null $airlineLegStopOverCode 1-letter code that indicates whether the passenger is entitled to make a stopover. Only two types of characters are allowed: * O: Stopover allowed * X: Stopover not allowed Limitations: * minLength: 1 * maxLength: 1 + * @param string|null $airlineLegStopOverCode A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * * @return self */ @@ -967,7 +967,7 @@ public function getAirlinePassengerDateOfBirth() /** * Sets airlinePassengerDateOfBirth * - * @param string|null $airlinePassengerDateOfBirth Date of birth of the passenger. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 + * @param string|null $airlinePassengerDateOfBirth The passenger's date of birth. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 * * @return self */ @@ -994,7 +994,7 @@ public function getAirlinePassengerFirstName() /** * Sets airlinePassengerFirstName * - * @param string|null $airlinePassengerFirstName Passenger first name/given name. > This field is required/mandatory if the airline data includes passenger details or leg details. + * @param string|null $airlinePassengerFirstName The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII * * @return self */ @@ -1021,7 +1021,7 @@ public function getAirlinePassengerLastName() /** * Sets airlinePassengerLastName * - * @param string|null $airlinePassengerLastName Passenger last name/family name. > This field is required/mandatory if the airline data includes passenger details or leg details. + * @param string|null $airlinePassengerLastName The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII * * @return self */ @@ -1048,7 +1048,7 @@ public function getAirlinePassengerTelephoneNumber() /** * Sets airlinePassengerTelephoneNumber * - * @param string|null $airlinePassengerTelephoneNumber Telephone number of the passenger, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * minLength: 3 * maxLength: 30 + * @param string|null $airlinePassengerTelephoneNumber The passenger's telephone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters * * @return self */ @@ -1075,7 +1075,7 @@ public function getAirlinePassengerTravellerType() /** * Sets airlinePassengerTravellerType * - * @param string|null $airlinePassengerTravellerType Passenger type code (PTC). IATA PTC values are 3-letter alphabetical. Example: ADT, SRC, CNN, INS. However, several carriers use non-standard codes that can be up to 5 alphanumeric characters. * minLength: 3 * maxLength: 6 + * @param string|null $airlinePassengerTravellerType The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters * * @return self */ @@ -1102,7 +1102,7 @@ public function getAirlinePassengerName() /** * Sets airlinePassengerName * - * @param string $airlinePassengerName Passenger name, initials, and a title. * Format: last name + first name or initials + title. * Example: *FLYER / MARY MS*. * minLength: 1 * maxLength: 49 + * @param string $airlinePassengerName The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros * * @return self */ @@ -1129,7 +1129,7 @@ public function getAirlineTicketIssueAddress() /** * Sets airlineTicketIssueAddress * - * @param string|null $airlineTicketIssueAddress Address of the place/agency that issued the ticket. * minLength: 0 * maxLength: 16 + * @param string|null $airlineTicketIssueAddress The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters * * @return self */ @@ -1156,7 +1156,7 @@ public function getAirlineTicketNumber() /** * Sets airlineTicketNumber * - * @param string|null $airlineTicketNumber The ticket's unique identifier. * minLength: 1 * maxLength: 150 + * @param string|null $airlineTicketNumber The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros * * @return self */ @@ -1183,7 +1183,7 @@ public function getAirlineTravelAgencyCode() /** * Sets airlineTravelAgencyCode * - * @param string|null $airlineTravelAgencyCode IATA number, also ARC number or ARC/IATA number. Unique identifier number for travel agencies. * minLength: 1 * maxLength: 8 + * @param string|null $airlineTravelAgencyCode The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces * Must not be all zeros * * @return self */ @@ -1210,7 +1210,7 @@ public function getAirlineTravelAgencyName() /** * Sets airlineTravelAgencyName * - * @param string|null $airlineTravelAgencyName The name of the travel agency. * minLength: 1 * maxLength: 25 + * @param string|null $airlineTravelAgencyName The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros * * @return self */ diff --git a/src/Adyen/Model/Payments/AdditionalDataCarRental.php b/src/Adyen/Model/Payments/AdditionalDataCarRental.php index 5e1708390..66376f9ff 100644 --- a/src/Adyen/Model/Payments/AdditionalDataCarRental.php +++ b/src/Adyen/Model/Payments/AdditionalDataCarRental.php @@ -443,7 +443,7 @@ public function getCarRentalCheckOutDate() /** * Sets carRentalCheckOutDate * - * @param string|null $carRentalCheckOutDate Pick-up date. * Date format: `yyyyMMdd` + * @param string|null $carRentalCheckOutDate The pick-up date. * Date format: `yyyyMMdd` * * @return self */ @@ -470,7 +470,7 @@ public function getCarRentalCustomerServiceTollFreeNumber() /** * Sets carRentalCustomerServiceTollFreeNumber * - * @param string|null $carRentalCustomerServiceTollFreeNumber The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 + * @param string|null $carRentalCustomerServiceTollFreeNumber The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - * * @return self */ @@ -497,7 +497,7 @@ public function getCarRentalDaysRented() /** * Sets carRentalDaysRented * - * @param string|null $carRentalDaysRented Number of days for which the car is being rented. * Format: Numeric * maxLength: 19 + * @param string|null $carRentalDaysRented Number of days for which the car is being rented. * Format: Numeric * maxLength: 2 * Must not be all spaces * * @return self */ @@ -524,7 +524,7 @@ public function getCarRentalFuelCharges() /** * Sets carRentalFuelCharges * - * @param string|null $carRentalFuelCharges Any fuel charges associated with the rental. * Format: Numeric * maxLength: 12 + * @param string|null $carRentalFuelCharges Any fuel charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * * @return self */ @@ -551,7 +551,7 @@ public function getCarRentalInsuranceCharges() /** * Sets carRentalInsuranceCharges * - * @param string|null $carRentalInsuranceCharges Any insurance charges associated with the rental. * Format: Numeric * maxLength: 12 + * @param string|null $carRentalInsuranceCharges Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces * Must not be all zeros * * @return self */ @@ -578,7 +578,7 @@ public function getCarRentalLocationCity() /** * Sets carRentalLocationCity * - * @param string|null $carRentalLocationCity The city from which the car is rented. * Format: Alphanumeric * maxLength: 18 + * @param string|null $carRentalLocationCity The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros * * @return self */ @@ -605,7 +605,7 @@ public function getCarRentalLocationCountry() /** * Sets carRentalLocationCountry * - * @param string|null $carRentalLocationCountry The country from which the car is rented. * Format: Alphanumeric * maxLength: 2 + * @param string|null $carRentalLocationCountry The country where the car is rented, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 * * @return self */ @@ -632,7 +632,7 @@ public function getCarRentalLocationStateProvince() /** * Sets carRentalLocationStateProvince * - * @param string|null $carRentalLocationStateProvince The state or province from where the car is rented. * Format: Alphanumeric * maxLength: 3 + * @param string|null $carRentalLocationStateProvince The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces * Must not be all zeros * * @return self */ @@ -659,7 +659,7 @@ public function getCarRentalNoShowIndicator() /** * Sets carRentalNoShowIndicator * - * @param string|null $carRentalNoShowIndicator Indicates if the customer was a \"no-show\" (neither keeps nor cancels their booking). * Y - Customer was a no show. * N - Not applicable. + * @param string|null $carRentalNoShowIndicator Indicates if the customer didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable * * @return self */ @@ -686,7 +686,7 @@ public function getCarRentalOneWayDropOffCharges() /** * Sets carRentalOneWayDropOffCharges * - * @param string|null $carRentalOneWayDropOffCharges Charge associated with not returning a vehicle to the original rental location. + * @param string|null $carRentalOneWayDropOffCharges The charge for not returning a car to the original rental location, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 12 * * @return self */ @@ -713,7 +713,7 @@ public function getCarRentalRate() /** * Sets carRentalRate * - * @param string|null $carRentalRate Daily rental rate. * Format: Alphanumeric * maxLength: 12 + * @param string|null $carRentalRate The daily rental rate, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Alphanumeric * maxLength: 12 * * @return self */ @@ -740,7 +740,7 @@ public function getCarRentalRateIndicator() /** * Sets carRentalRateIndicator * - * @param string|null $carRentalRateIndicator Specifies whether the given rate is applied daily or weekly. * D - Daily rate. * W - Weekly rate. + * @param string|null $carRentalRateIndicator Specifies whether the given rate is applied daily or weekly. * D - Daily rate * W - Weekly rate * * @return self */ @@ -767,7 +767,7 @@ public function getCarRentalRentalAgreementNumber() /** * Sets carRentalRentalAgreementNumber * - * @param string|null $carRentalRentalAgreementNumber The rental agreement number associated with this car rental. * Format: Alphanumeric * maxLength: 9 + * @param string|null $carRentalRentalAgreementNumber The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces * Must not be all zeros * * @return self */ @@ -794,7 +794,7 @@ public function getCarRentalRentalClassId() /** * Sets carRentalRentalClassId * - * @param string|null $carRentalRentalClassId Daily rental rate. * Format: Alphanumeric * maxLength: 12 + * @param string|null $carRentalRentalClassId The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces * Must not be all zeros * * @return self */ @@ -821,7 +821,7 @@ public function getCarRentalRenterName() /** * Sets carRentalRenterName * - * @param string|null $carRentalRenterName The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 + * @param string|null $carRentalRenterName The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces * Must not be all zeros * * @return self */ @@ -848,7 +848,7 @@ public function getCarRentalReturnCity() /** * Sets carRentalReturnCity * - * @param string|null $carRentalReturnCity The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 + * @param string|null $carRentalReturnCity The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros * * @return self */ @@ -875,7 +875,7 @@ public function getCarRentalReturnCountry() /** * Sets carRentalReturnCountry * - * @param string|null $carRentalReturnCountry The country where the car must be returned. * Format: Alphanumeric * maxLength: 2 + * @param string|null $carRentalReturnCountry The country where the car must be returned, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 * * @return self */ @@ -902,7 +902,7 @@ public function getCarRentalReturnDate() /** * Sets carRentalReturnDate * - * @param string|null $carRentalReturnDate The last date to return the car by. * Date format: `yyyyMMdd` + * @param string|null $carRentalReturnDate The last date to return the car by. * Date format: `yyyyMMdd` * maxLength: 8 * * @return self */ @@ -929,7 +929,7 @@ public function getCarRentalReturnLocationId() /** * Sets carRentalReturnLocationId * - * @param string|null $carRentalReturnLocationId Agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 + * @param string|null $carRentalReturnLocationId The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces * Must not be all zeros * * @return self */ @@ -956,7 +956,7 @@ public function getCarRentalReturnStateProvince() /** * Sets carRentalReturnStateProvince * - * @param string|null $carRentalReturnStateProvince The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 + * @param string|null $carRentalReturnStateProvince The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces * Must not be all zeros * * @return self */ @@ -983,7 +983,7 @@ public function getCarRentalTaxExemptIndicator() /** * Sets carRentalTaxExemptIndicator * - * @param string|null $carRentalTaxExemptIndicator Indicates whether the goods or services were tax-exempt, or tax was not collected. Values: * Y - Goods or services were tax exempt * N - Tax was not collected + * @param string|null $carRentalTaxExemptIndicator Indicates if the goods or services were tax-exempt, or if tax was not paid on them. Values: * Y - Goods or services were tax exempt * N - Tax was not collected * * @return self */ @@ -1010,7 +1010,7 @@ public function getTravelEntertainmentAuthDataDuration() /** * Sets travelEntertainmentAuthDataDuration * - * @param string|null $travelEntertainmentAuthDataDuration Number of nights. This should be included in the auth message. * Format: Numeric * maxLength: 2 + * @param string|null $travelEntertainmentAuthDataDuration Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 2 * * @return self */ @@ -1037,7 +1037,7 @@ public function getTravelEntertainmentAuthDataMarket() /** * Sets travelEntertainmentAuthDataMarket * - * @param string|null $travelEntertainmentAuthDataMarket Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"A\" for Car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 + * @param string|null $travelEntertainmentAuthDataMarket Indicates what market-specific dataset will be submitted or is being submitted. Value should be 'A' for car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 * * @return self */ diff --git a/src/Adyen/Model/Payments/AdditionalDataLevel23.php b/src/Adyen/Model/Payments/AdditionalDataLevel23.php index 3cda5a5b5..545a4f30f 100644 --- a/src/Adyen/Model/Payments/AdditionalDataLevel23.php +++ b/src/Adyen/Model/Payments/AdditionalDataLevel23.php @@ -401,7 +401,7 @@ public function getEnhancedSchemeDataCustomerReference() /** * Sets enhancedSchemeDataCustomerReference * - * @param string|null $enhancedSchemeDataCustomerReference Customer code, if supplied by a customer. Encoding: ASCII. Max length: 25 characters. > Required for Level 2 and Level 3 data. + * @param string|null $enhancedSchemeDataCustomerReference The customer code, if supplied by a customer. Encoding: ASCII Max length: 25 characters Must not start with a space or be all spaces Must not be all zeros * * @return self */ @@ -428,7 +428,7 @@ public function getEnhancedSchemeDataDestinationCountryCode() /** * Sets enhancedSchemeDataDestinationCountryCode * - * @param string|null $enhancedSchemeDataDestinationCountryCode Destination country code. Encoding: ASCII. Max length: 3 characters. + * @param string|null $enhancedSchemeDataDestinationCountryCode The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. Encoding: ASCII Fixed length: 3 characters * * @return self */ @@ -455,7 +455,7 @@ public function getEnhancedSchemeDataDestinationPostalCode() /** * Sets enhancedSchemeDataDestinationPostalCode * - * @param string|null $enhancedSchemeDataDestinationPostalCode The postal code of a destination address. Encoding: ASCII. Max length: 10 characters. > Required for American Express. + * @param string|null $enhancedSchemeDataDestinationPostalCode The postal code of the destination address. Encoding: ASCII Max length: 10 characters Must not start with a space * * @return self */ @@ -482,7 +482,7 @@ public function getEnhancedSchemeDataDestinationStateProvinceCode() /** * Sets enhancedSchemeDataDestinationStateProvinceCode * - * @param string|null $enhancedSchemeDataDestinationStateProvinceCode Destination state or province code. Encoding: ASCII.Max length: 3 characters. + * @param string|null $enhancedSchemeDataDestinationStateProvinceCode Destination state or province code. Encoding: ASCII Max length: 3 characters Must not start with a space * * @return self */ @@ -509,7 +509,7 @@ public function getEnhancedSchemeDataDutyAmount() /** * Sets enhancedSchemeDataDutyAmount * - * @param string|null $enhancedSchemeDataDutyAmount Duty amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * @param string|null $enhancedSchemeDataDutyAmount The duty amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters * * @return self */ @@ -536,7 +536,7 @@ public function getEnhancedSchemeDataFreightAmount() /** * Sets enhancedSchemeDataFreightAmount * - * @param string|null $enhancedSchemeDataFreightAmount Shipping amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * @param string|null $enhancedSchemeDataFreightAmount The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters * * @return self */ @@ -563,7 +563,7 @@ public function getEnhancedSchemeDataItemDetailLineItemNrCommodityCode() /** * Sets enhancedSchemeDataItemDetailLineItemNrCommodityCode * - * @param string|null $enhancedSchemeDataItemDetailLineItemNrCommodityCode Item commodity code. Encoding: ASCII. Max length: 12 characters. + * @param string|null $enhancedSchemeDataItemDetailLineItemNrCommodityCode The [UNSPC commodity code](https://www.unspsc.org/) of the item. Encoding: ASCII Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros * * @return self */ @@ -590,7 +590,7 @@ public function getEnhancedSchemeDataItemDetailLineItemNrDescription() /** * Sets enhancedSchemeDataItemDetailLineItemNrDescription * - * @param string|null $enhancedSchemeDataItemDetailLineItemNrDescription Item description. Encoding: ASCII. Max length: 26 characters. + * @param string|null $enhancedSchemeDataItemDetailLineItemNrDescription A description of the item. Encoding: ASCII Max length: 26 characters Must not start with a space or be all spaces Must not be all zeros * * @return self */ @@ -617,7 +617,7 @@ public function getEnhancedSchemeDataItemDetailLineItemNrDiscountAmount() /** * Sets enhancedSchemeDataItemDetailLineItemNrDiscountAmount * - * @param string|null $enhancedSchemeDataItemDetailLineItemNrDiscountAmount Discount amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * @param string|null $enhancedSchemeDataItemDetailLineItemNrDiscountAmount The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters * * @return self */ @@ -644,7 +644,7 @@ public function getEnhancedSchemeDataItemDetailLineItemNrProductCode() /** * Sets enhancedSchemeDataItemDetailLineItemNrProductCode * - * @param string|null $enhancedSchemeDataItemDetailLineItemNrProductCode Product code. Encoding: ASCII. Max length: 12 characters. + * @param string|null $enhancedSchemeDataItemDetailLineItemNrProductCode The product code. Encoding: ASCII. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros * * @return self */ @@ -671,7 +671,7 @@ public function getEnhancedSchemeDataItemDetailLineItemNrQuantity() /** * Sets enhancedSchemeDataItemDetailLineItemNrQuantity * - * @param string|null $enhancedSchemeDataItemDetailLineItemNrQuantity Quantity, specified as an integer value. Value must be greater than 0. Max length: 12 characters. + * @param string|null $enhancedSchemeDataItemDetailLineItemNrQuantity The number of items. Must be an integer greater than zero. Encoding: Numeric Max length: 12 characters Must not start with a space or be all spaces * * @return self */ @@ -698,7 +698,7 @@ public function getEnhancedSchemeDataItemDetailLineItemNrTotalAmount() /** * Sets enhancedSchemeDataItemDetailLineItemNrTotalAmount * - * @param string|null $enhancedSchemeDataItemDetailLineItemNrTotalAmount Total amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * @param string|null $enhancedSchemeDataItemDetailLineItemNrTotalAmount The total amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros * * @return self */ @@ -725,7 +725,7 @@ public function getEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure() /** * Sets enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure * - * @param string|null $enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure Item unit of measurement. Encoding: ASCII. Max length: 3 characters. + * @param string|null $enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure The unit of measurement for an item. Encoding: ASCII Max length: 3 characters Must not start with a space or be all spaces Must not be all zeros * * @return self */ @@ -752,7 +752,7 @@ public function getEnhancedSchemeDataItemDetailLineItemNrUnitPrice() /** * Sets enhancedSchemeDataItemDetailLineItemNrUnitPrice * - * @param string|null $enhancedSchemeDataItemDetailLineItemNrUnitPrice Unit price, specified in [minor units](https://docs.adyen.com/development-resources/currency-codes). Max length: 12 characters. + * @param string|null $enhancedSchemeDataItemDetailLineItemNrUnitPrice The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters * * @return self */ @@ -779,7 +779,7 @@ public function getEnhancedSchemeDataOrderDate() /** * Sets enhancedSchemeDataOrderDate * - * @param string|null $enhancedSchemeDataOrderDate Order date. * Format: `ddMMyy` Encoding: ASCII. Max length: 6 characters. + * @param string|null $enhancedSchemeDataOrderDate The order date. * Format: `ddMMyy` Encoding: ASCII Max length: 6 characters * * @return self */ @@ -806,7 +806,7 @@ public function getEnhancedSchemeDataShipFromPostalCode() /** * Sets enhancedSchemeDataShipFromPostalCode * - * @param string|null $enhancedSchemeDataShipFromPostalCode The postal code of a \"ship-from\" address. Encoding: ASCII. Max length: 10 characters. + * @param string|null $enhancedSchemeDataShipFromPostalCode The postal code of the address the item is shipped from. Encoding: ASCII Max length: 10 characters Must not start with a space or be all spaces Must not be all zeros * * @return self */ @@ -833,7 +833,7 @@ public function getEnhancedSchemeDataTotalTaxAmount() /** * Sets enhancedSchemeDataTotalTaxAmount * - * @param string|null $enhancedSchemeDataTotalTaxAmount Total tax amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. > Required for Level 2 and Level 3 data. + * @param string|null $enhancedSchemeDataTotalTaxAmount The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters * * @return self */ diff --git a/src/Adyen/Model/Payments/AdditionalDataLodging.php b/src/Adyen/Model/Payments/AdditionalDataLodging.php index eef2f702f..606f5c1af 100644 --- a/src/Adyen/Model/Payments/AdditionalDataLodging.php +++ b/src/Adyen/Model/Payments/AdditionalDataLodging.php @@ -56,7 +56,6 @@ class AdditionalDataLodging implements ModelInterface, ArrayAccess, \JsonSeriali 'lodgingPropertyPhoneNumber' => 'string', 'lodgingRoom1NumberOfNights' => 'string', 'lodgingRoom1Rate' => 'string', - 'lodgingRoom1Tax' => 'string', 'lodgingTotalRoomTax' => 'string', 'lodgingTotalTax' => 'string', 'travelEntertainmentAuthDataDuration' => 'string', @@ -83,7 +82,6 @@ class AdditionalDataLodging implements ModelInterface, ArrayAccess, \JsonSeriali 'lodgingPropertyPhoneNumber' => null, 'lodgingRoom1NumberOfNights' => null, 'lodgingRoom1Rate' => null, - 'lodgingRoom1Tax' => null, 'lodgingTotalRoomTax' => null, 'lodgingTotalTax' => null, 'travelEntertainmentAuthDataDuration' => null, @@ -108,7 +106,6 @@ class AdditionalDataLodging implements ModelInterface, ArrayAccess, \JsonSeriali 'lodgingPropertyPhoneNumber' => false, 'lodgingRoom1NumberOfNights' => false, 'lodgingRoom1Rate' => false, - 'lodgingRoom1Tax' => false, 'lodgingTotalRoomTax' => false, 'lodgingTotalTax' => false, 'travelEntertainmentAuthDataDuration' => false, @@ -213,7 +210,6 @@ public function isNullableSetToNull(string $property): bool 'lodgingPropertyPhoneNumber' => 'lodging.propertyPhoneNumber', 'lodgingRoom1NumberOfNights' => 'lodging.room1.numberOfNights', 'lodgingRoom1Rate' => 'lodging.room1.rate', - 'lodgingRoom1Tax' => 'lodging.room1.tax', 'lodgingTotalRoomTax' => 'lodging.totalRoomTax', 'lodgingTotalTax' => 'lodging.totalTax', 'travelEntertainmentAuthDataDuration' => 'travelEntertainmentAuthData.duration', @@ -238,7 +234,6 @@ public function isNullableSetToNull(string $property): bool 'lodgingPropertyPhoneNumber' => 'setLodgingPropertyPhoneNumber', 'lodgingRoom1NumberOfNights' => 'setLodgingRoom1NumberOfNights', 'lodgingRoom1Rate' => 'setLodgingRoom1Rate', - 'lodgingRoom1Tax' => 'setLodgingRoom1Tax', 'lodgingTotalRoomTax' => 'setLodgingTotalRoomTax', 'lodgingTotalTax' => 'setLodgingTotalTax', 'travelEntertainmentAuthDataDuration' => 'setTravelEntertainmentAuthDataDuration', @@ -263,7 +258,6 @@ public function isNullableSetToNull(string $property): bool 'lodgingPropertyPhoneNumber' => 'getLodgingPropertyPhoneNumber', 'lodgingRoom1NumberOfNights' => 'getLodgingRoom1NumberOfNights', 'lodgingRoom1Rate' => 'getLodgingRoom1Rate', - 'lodgingRoom1Tax' => 'getLodgingRoom1Tax', 'lodgingTotalRoomTax' => 'getLodgingTotalRoomTax', 'lodgingTotalTax' => 'getLodgingTotalTax', 'travelEntertainmentAuthDataDuration' => 'getTravelEntertainmentAuthDataDuration', @@ -339,7 +333,6 @@ public function __construct(array $data = null) $this->setIfExists('lodgingPropertyPhoneNumber', $data ?? [], null); $this->setIfExists('lodgingRoom1NumberOfNights', $data ?? [], null); $this->setIfExists('lodgingRoom1Rate', $data ?? [], null); - $this->setIfExists('lodgingRoom1Tax', $data ?? [], null); $this->setIfExists('lodgingTotalRoomTax', $data ?? [], null); $this->setIfExists('lodgingTotalTax', $data ?? [], null); $this->setIfExists('travelEntertainmentAuthDataDuration', $data ?? [], null); @@ -401,7 +394,7 @@ public function getLodgingCheckInDate() /** * Sets lodgingCheckInDate * - * @param string|null $lodgingCheckInDate The arrival date. * Date format: `yyyyMMdd` + * @param string|null $lodgingCheckInDate The arrival date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. * * @return self */ @@ -428,7 +421,7 @@ public function getLodgingCheckOutDate() /** * Sets lodgingCheckOutDate * - * @param string|null $lodgingCheckOutDate The departure date. * Date format: `yyyyMMdd` + * @param string|null $lodgingCheckOutDate The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. * * @return self */ @@ -455,7 +448,7 @@ public function getLodgingCustomerServiceTollFreeNumber() /** * Sets lodgingCustomerServiceTollFreeNumber * - * @param string|null $lodgingCustomerServiceTollFreeNumber The toll free phone number for the hotel/lodgings. * Format: Alphanumeric * maxLength: 17 + * @param string|null $lodgingCustomerServiceTollFreeNumber The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - * * @return self */ @@ -482,7 +475,7 @@ public function getLodgingFireSafetyActIndicator() /** * Sets lodgingFireSafetyActIndicator * - * @param string|null $lodgingFireSafetyActIndicator Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Values can be: 'Y' or 'N'. * Format: Alphabetic * maxLength: 1 + * @param string|null $lodgingFireSafetyActIndicator Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Must be 'Y' or 'N'. * Format: alphabetic * Max length: 1 character * * @return self */ @@ -509,7 +502,7 @@ public function getLodgingFolioCashAdvances() /** * Sets lodgingFolioCashAdvances * - * @param string|null $lodgingFolioCashAdvances The folio cash advances. * Format: Numeric * maxLength: 12 + * @param string|null $lodgingFolioCashAdvances The folio cash advances, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * * @return self */ @@ -536,7 +529,7 @@ public function getLodgingFolioNumber() /** * Sets lodgingFolioNumber * - * @param string|null $lodgingFolioNumber Card acceptor’s internal invoice or billing ID reference number. * Format: Alphanumeric * maxLength: 25 + * @param string|null $lodgingFolioNumber The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters. * Must not start with a space * Must not be all zeros * * @return self */ @@ -563,7 +556,7 @@ public function getLodgingFoodBeverageCharges() /** * Sets lodgingFoodBeverageCharges * - * @param string|null $lodgingFoodBeverageCharges Any charges for food and beverages associated with the booking. * Format: Numeric * maxLength: 12 + * @param string|null $lodgingFoodBeverageCharges Any charges for food and beverages associated with the booking, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * * @return self */ @@ -590,7 +583,7 @@ public function getLodgingNoShowIndicator() /** * Sets lodgingNoShowIndicator * - * @param string|null $lodgingNoShowIndicator Indicates if the customer was a \"no-show\" (neither keeps nor cancels their booking). Value should be Y or N. * Format: Numeric * maxLength: 1 + * @param string|null $lodgingNoShowIndicator Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in * **N**: the customer checked in * * @return self */ @@ -617,7 +610,7 @@ public function getLodgingPrepaidExpenses() /** * Sets lodgingPrepaidExpenses * - * @param string|null $lodgingPrepaidExpenses Prepaid expenses for the booking. * Format: Numeric * maxLength: 12 + * @param string|null $lodgingPrepaidExpenses The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters * * @return self */ @@ -644,7 +637,7 @@ public function getLodgingPropertyPhoneNumber() /** * Sets lodgingPropertyPhoneNumber * - * @param string|null $lodgingPropertyPhoneNumber Identifies specific lodging property location by its local phone number. * Format: Alphanumeric * maxLength: 17 + * @param string|null $lodgingPropertyPhoneNumber The lodging property location's phone number. * Format: numeric. * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - * * @return self */ @@ -671,7 +664,7 @@ public function getLodgingRoom1NumberOfNights() /** * Sets lodgingRoom1NumberOfNights * - * @param string|null $lodgingRoom1NumberOfNights Total number of nights the room will be rented. * Format: Numeric * maxLength: 4 + * @param string|null $lodgingRoom1NumberOfNights The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 2 characters * * @return self */ @@ -698,7 +691,7 @@ public function getLodgingRoom1Rate() /** * Sets lodgingRoom1Rate * - * @param string|null $lodgingRoom1Rate The rate of the room. * Format: Numeric * maxLength: 12 + * @param string|null $lodgingRoom1Rate The rate for the room, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number * * @return self */ @@ -712,33 +705,6 @@ public function setLodgingRoom1Rate($lodgingRoom1Rate) return $this; } - /** - * Gets lodgingRoom1Tax - * - * @return string|null - */ - public function getLodgingRoom1Tax() - { - return $this->container['lodgingRoom1Tax']; - } - - /** - * Sets lodgingRoom1Tax - * - * @param string|null $lodgingRoom1Tax The total amount of tax to be paid. * Format: Numeric * maxLength: 12 - * - * @return self - */ - public function setLodgingRoom1Tax($lodgingRoom1Tax) - { - if (is_null($lodgingRoom1Tax)) { - throw new \InvalidArgumentException('non-nullable lodgingRoom1Tax cannot be null'); - } - $this->container['lodgingRoom1Tax'] = $lodgingRoom1Tax; - - return $this; - } - /** * Gets lodgingTotalRoomTax * @@ -752,7 +718,7 @@ public function getLodgingTotalRoomTax() /** * Sets lodgingTotalRoomTax * - * @param string|null $lodgingTotalRoomTax Total room tax amount. * Format: Numeric * maxLength: 12 + * @param string|null $lodgingTotalRoomTax The total room tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number * * @return self */ @@ -779,7 +745,7 @@ public function getLodgingTotalTax() /** * Sets lodgingTotalTax * - * @param string|null $lodgingTotalTax Total tax amount. * Format: Numeric * maxLength: 12 + * @param string|null $lodgingTotalTax The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number * * @return self */ @@ -806,7 +772,7 @@ public function getTravelEntertainmentAuthDataDuration() /** * Sets travelEntertainmentAuthDataDuration * - * @param string|null $travelEntertainmentAuthDataDuration Number of nights. This should be included in the auth message. * Format: Numeric * maxLength: 2 + * @param string|null $travelEntertainmentAuthDataDuration The number of nights. This should be included in the auth message. * Format: numeric * Max length: 2 characters * * @return self */ @@ -833,7 +799,7 @@ public function getTravelEntertainmentAuthDataMarket() /** * Sets travelEntertainmentAuthDataMarket * - * @param string|null $travelEntertainmentAuthDataMarket Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"H\" for Hotel. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 + * @param string|null $travelEntertainmentAuthDataMarket Indicates what market-specific dataset will be submitted. Must be 'H' for Hotel. This should be included in the auth message. * Format: alphanumeric * Max length: 1 character * * @return self */ diff --git a/src/Adyen/Model/Payments/AdditionalDataTemporaryServices.php b/src/Adyen/Model/Payments/AdditionalDataTemporaryServices.php index a14d12348..27af74221 100644 --- a/src/Adyen/Model/Payments/AdditionalDataTemporaryServices.php +++ b/src/Adyen/Model/Payments/AdditionalDataTemporaryServices.php @@ -345,7 +345,7 @@ public function getEnhancedSchemeDataCustomerReference() /** * Sets enhancedSchemeDataCustomerReference * - * @param string|null $enhancedSchemeDataCustomerReference Customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 + * @param string|null $enhancedSchemeDataCustomerReference The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 * * @return self */ @@ -372,7 +372,7 @@ public function getEnhancedSchemeDataEmployeeName() /** * Sets enhancedSchemeDataEmployeeName * - * @param string|null $enhancedSchemeDataEmployeeName Name or ID associated with the individual working in a temporary capacity. * maxLength: 40 + * @param string|null $enhancedSchemeDataEmployeeName The name or ID of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces * * @return self */ @@ -399,7 +399,7 @@ public function getEnhancedSchemeDataJobDescription() /** * Sets enhancedSchemeDataJobDescription * - * @param string|null $enhancedSchemeDataJobDescription Description of the job or task of the individual working in a temporary capacity. * maxLength: 40 + * @param string|null $enhancedSchemeDataJobDescription The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces * * @return self */ @@ -426,7 +426,7 @@ public function getEnhancedSchemeDataRegularHoursRate() /** * Sets enhancedSchemeDataRegularHoursRate * - * @param string|null $enhancedSchemeDataRegularHoursRate Amount paid per regular hours worked, minor units. * maxLength: 7 + * @param string|null $enhancedSchemeDataRegularHoursRate The amount paid for regular hours worked, [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 7 * Must not be empty * Can be all zeros * * @return self */ @@ -453,7 +453,7 @@ public function getEnhancedSchemeDataRegularHoursWorked() /** * Sets enhancedSchemeDataRegularHoursWorked * - * @param string|null $enhancedSchemeDataRegularHoursWorked Amount of time worked during a normal operation for the task or job. * maxLength: 7 + * @param string|null $enhancedSchemeDataRegularHoursWorked The hours worked. * maxLength: 7 * Must not be empty * Can be all zeros * * @return self */ @@ -480,7 +480,7 @@ public function getEnhancedSchemeDataRequestName() /** * Sets enhancedSchemeDataRequestName * - * @param string|null $enhancedSchemeDataRequestName Name of the individual requesting temporary services. * maxLength: 40 + * @param string|null $enhancedSchemeDataRequestName The name of the person requesting temporary services. * maxLength: 40 * Must not be all zeros * Must not be all spaces * * @return self */ @@ -507,7 +507,7 @@ public function getEnhancedSchemeDataTempStartDate() /** * Sets enhancedSchemeDataTempStartDate * - * @param string|null $enhancedSchemeDataTempStartDate Date for the beginning of the pay period. * Format: ddMMyy * maxLength: 6 + * @param string|null $enhancedSchemeDataTempStartDate The billing period start date. * Format: ddMMyy * maxLength: 6 * * @return self */ @@ -534,7 +534,7 @@ public function getEnhancedSchemeDataTempWeekEnding() /** * Sets enhancedSchemeDataTempWeekEnding * - * @param string|null $enhancedSchemeDataTempWeekEnding Date of the end of the billing cycle. * Format: ddMMyy * maxLength: 6 + * @param string|null $enhancedSchemeDataTempWeekEnding The billing period end date. * Format: ddMMyy * maxLength: 6 * * @return self */ @@ -561,7 +561,7 @@ public function getEnhancedSchemeDataTotalTaxAmount() /** * Sets enhancedSchemeDataTotalTaxAmount * - * @param string|null $enhancedSchemeDataTotalTaxAmount Total tax amount, in minor units. For example, 2000 means USD 20.00 * maxLength: 12 + * @param string|null $enhancedSchemeDataTotalTaxAmount The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00 * maxLength: 12 * * @return self */ diff --git a/src/Adyen/Model/Payments/Card.php b/src/Adyen/Model/Payments/Card.php index 27be71fd3..45a662a60 100644 --- a/src/Adyen/Model/Payments/Card.php +++ b/src/Adyen/Model/Payments/Card.php @@ -310,12 +310,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['expiryYear'] === null) { - $invalidProperties[] = "'expiryYear' can't be null"; - } - if ($this->container['holderName'] === null) { - $invalidProperties[] = "'holderName' can't be null"; - } return $invalidProperties; } @@ -388,7 +382,7 @@ public function setExpiryMonth($expiryMonth) /** * Gets expiryYear * - * @return string + * @return string|null */ public function getExpiryYear() { @@ -398,7 +392,7 @@ public function getExpiryYear() /** * Sets expiryYear * - * @param string $expiryYear The card expiry year. Format: 4 digits. For example: 2020 + * @param string|null $expiryYear The card expiry year. Format: 4 digits. For example: 2020 * * @return self */ @@ -415,7 +409,7 @@ public function setExpiryYear($expiryYear) /** * Gets holderName * - * @return string + * @return string|null */ public function getHolderName() { @@ -425,7 +419,7 @@ public function getHolderName() /** * Sets holderName * - * @param string $holderName The name of the cardholder, as printed on the card. + * @param string|null $holderName The name of the cardholder, as printed on the card. * * @return self */ diff --git a/src/Adyen/Model/Payments/FraudCheckResultWrapper.php b/src/Adyen/Model/Payments/FraudCheckResultWrapper.php new file mode 100644 index 000000000..e0fb85c0e --- /dev/null +++ b/src/Adyen/Model/Payments/FraudCheckResultWrapper.php @@ -0,0 +1,384 @@ + + */ +class FraudCheckResultWrapper implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FraudCheckResultWrapper'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'fraudCheckResult' => '\Adyen\Model\Payments\FraudCheckResult' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'fraudCheckResult' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'fraudCheckResult' => 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 = [ + 'fraudCheckResult' => 'FraudCheckResult' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'fraudCheckResult' => 'setFraudCheckResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'fraudCheckResult' => 'getFraudCheckResult' + ]; + + /** + * 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('fraudCheckResult', $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 fraudCheckResult + * + * @return \Adyen\Model\Payments\FraudCheckResult|null + */ + public function getFraudCheckResult() + { + return $this->container['fraudCheckResult']; + } + + /** + * Sets fraudCheckResult + * + * @param \Adyen\Model\Payments\FraudCheckResult|null $fraudCheckResult fraudCheckResult + * + * @return self + */ + public function setFraudCheckResult($fraudCheckResult) + { + if (is_null($fraudCheckResult)) { + throw new \InvalidArgumentException('non-nullable fraudCheckResult cannot be null'); + } + $this->container['fraudCheckResult'] = $fraudCheckResult; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/FraudResult.php b/src/Adyen/Model/Payments/FraudResult.php index e62d9662e..26fbe981f 100644 --- a/src/Adyen/Model/Payments/FraudResult.php +++ b/src/Adyen/Model/Payments/FraudResult.php @@ -45,7 +45,7 @@ class FraudResult implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'accountScore' => 'int', - 'results' => '\Adyen\Model\Payments\FraudCheckResult[]' + 'results' => '\Adyen\Model\Payments\FraudCheckResultWrapper[]' ]; /** @@ -314,7 +314,7 @@ public function setAccountScore($accountScore) /** * Gets results * - * @return \Adyen\Model\Payments\FraudCheckResult[]|null + * @return \Adyen\Model\Payments\FraudCheckResultWrapper[]|null */ public function getResults() { @@ -324,7 +324,7 @@ public function getResults() /** * Sets results * - * @param \Adyen\Model\Payments\FraudCheckResult[]|null $results The result of the individual risk checks. + * @param \Adyen\Model\Payments\FraudCheckResultWrapper[]|null $results The result of the individual risk checks. * * @return self */ diff --git a/src/Adyen/Model/Payments/PaymentRequest.php b/src/Adyen/Model/Payments/PaymentRequest.php index 7da01202d..056773951 100644 --- a/src/Adyen/Model/Payments/PaymentRequest.php +++ b/src/Adyen/Model/Payments/PaymentRequest.php @@ -1341,7 +1341,7 @@ public function getLocalizedShopperStatement() /** * Sets localizedShopperStatement * - * @param array|null $localizedShopperStatement This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * @param array|null $localizedShopperStatement This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. * * @return self */ @@ -1665,7 +1665,7 @@ public function getRecurringProcessingModel() /** * Sets recurringProcessingModel * - * @param string|null $recurringProcessingModel Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * @param string|null $recurringProcessingModel Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. * * @return self */ @@ -2063,7 +2063,7 @@ public function getStore() /** * Sets store * - * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). * * @return self */ diff --git a/src/Adyen/Model/Payments/PaymentRequest3d.php b/src/Adyen/Model/Payments/PaymentRequest3d.php index 41932a35f..b5a339252 100644 --- a/src/Adyen/Model/Payments/PaymentRequest3d.php +++ b/src/Adyen/Model/Payments/PaymentRequest3d.php @@ -1059,7 +1059,7 @@ public function getLocalizedShopperStatement() /** * Sets localizedShopperStatement * - * @param array|null $localizedShopperStatement This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * @param array|null $localizedShopperStatement This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. * * @return self */ @@ -1329,7 +1329,7 @@ public function getRecurringProcessingModel() /** * Sets recurringProcessingModel * - * @param string|null $recurringProcessingModel Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * @param string|null $recurringProcessingModel Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. * * @return self */ @@ -1727,7 +1727,7 @@ public function getStore() /** * Sets store * - * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). * * @return self */ diff --git a/src/Adyen/Model/Payments/PaymentRequest3ds2.php b/src/Adyen/Model/Payments/PaymentRequest3ds2.php index d6637ddf9..36d20a664 100644 --- a/src/Adyen/Model/Payments/PaymentRequest3ds2.php +++ b/src/Adyen/Model/Payments/PaymentRequest3ds2.php @@ -1059,7 +1059,7 @@ public function getLocalizedShopperStatement() /** * Sets localizedShopperStatement * - * @param array|null $localizedShopperStatement This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * @param array|null $localizedShopperStatement This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. * * @return self */ @@ -1275,7 +1275,7 @@ public function getRecurringProcessingModel() /** * Sets recurringProcessingModel * - * @param string|null $recurringProcessingModel Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * @param string|null $recurringProcessingModel Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. * * @return self */ @@ -1673,7 +1673,7 @@ public function getStore() /** * Sets store * - * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). * * @return self */ diff --git a/src/Adyen/Model/Payments/PlatformChargebackLogic.php b/src/Adyen/Model/Payments/PlatformChargebackLogic.php index 01b746a86..358054f1c 100644 --- a/src/Adyen/Model/Payments/PlatformChargebackLogic.php +++ b/src/Adyen/Model/Payments/PlatformChargebackLogic.php @@ -45,6 +45,7 @@ class PlatformChargebackLogic implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPITypes = [ 'behavior' => 'string', + 'costAllocationAccount' => 'string', 'targetAccount' => 'string' ]; @@ -57,6 +58,7 @@ class PlatformChargebackLogic implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPIFormats = [ 'behavior' => null, + 'costAllocationAccount' => null, 'targetAccount' => null ]; @@ -67,6 +69,7 @@ class PlatformChargebackLogic implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPINullables = [ 'behavior' => false, + 'costAllocationAccount' => false, 'targetAccount' => false ]; @@ -157,6 +160,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'behavior' => 'behavior', + 'costAllocationAccount' => 'costAllocationAccount', 'targetAccount' => 'targetAccount' ]; @@ -167,6 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'behavior' => 'setBehavior', + 'costAllocationAccount' => 'setCostAllocationAccount', 'targetAccount' => 'setTargetAccount' ]; @@ -177,6 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'behavior' => 'getBehavior', + 'costAllocationAccount' => 'getCostAllocationAccount', 'targetAccount' => 'getTargetAccount' ]; @@ -254,6 +260,7 @@ public function getBehaviorAllowableValues() public function __construct(array $data = null) { $this->setIfExists('behavior', $data ?? [], null); + $this->setIfExists('costAllocationAccount', $data ?? [], null); $this->setIfExists('targetAccount', $data ?? [], null); } @@ -321,7 +328,7 @@ public function getBehavior() /** * Sets behavior * - * @param string|null $behavior behavior + * @param string|null $behavior The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. * * @return self */ @@ -345,6 +352,33 @@ public function setBehavior($behavior) return $this; } + /** + * Gets costAllocationAccount + * + * @return string|null + */ + public function getCostAllocationAccount() + { + return $this->container['costAllocationAccount']; + } + + /** + * Sets costAllocationAccount + * + * @param string|null $costAllocationAccount The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account. + * + * @return self + */ + public function setCostAllocationAccount($costAllocationAccount) + { + if (is_null($costAllocationAccount)) { + throw new \InvalidArgumentException('non-nullable costAllocationAccount cannot be null'); + } + $this->container['costAllocationAccount'] = $costAllocationAccount; + + return $this; + } + /** * Gets targetAccount * @@ -358,7 +392,7 @@ public function getTargetAccount() /** * Sets targetAccount * - * @param string|null $targetAccount targetAccount + * @param string|null $targetAccount The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**. * * @return self */ diff --git a/src/Adyen/Model/Payments/Split.php b/src/Adyen/Model/Payments/Split.php index 7fae9406c..eca4e6073 100644 --- a/src/Adyen/Model/Payments/Split.php +++ b/src/Adyen/Model/Payments/Split.php @@ -244,6 +244,12 @@ public function getModelName() public const TYPE__DEFAULT = 'Default'; public const TYPE_MARKET_PLACE = 'MarketPlace'; public const TYPE_PAYMENT_FEE = 'PaymentFee'; + public const TYPE_PAYMENT_FEE_ACQUIRING = 'PaymentFeeAcquiring'; + public const TYPE_PAYMENT_FEE_ADYEN = 'PaymentFeeAdyen'; + public const TYPE_PAYMENT_FEE_ADYEN_COMMISSION = 'PaymentFeeAdyenCommission'; + public const TYPE_PAYMENT_FEE_ADYEN_MARKUP = 'PaymentFeeAdyenMarkup'; + public const TYPE_PAYMENT_FEE_INTERCHANGE = 'PaymentFeeInterchange'; + public const TYPE_PAYMENT_FEE_SCHEME_FEE = 'PaymentFeeSchemeFee'; public const TYPE_REMAINDER = 'Remainder'; public const TYPE_SURCHARGE = 'Surcharge'; public const TYPE_TIP = 'Tip'; @@ -263,6 +269,12 @@ public function getTypeAllowableValues() self::TYPE__DEFAULT, self::TYPE_MARKET_PLACE, self::TYPE_PAYMENT_FEE, + self::TYPE_PAYMENT_FEE_ACQUIRING, + self::TYPE_PAYMENT_FEE_ADYEN, + self::TYPE_PAYMENT_FEE_ADYEN_COMMISSION, + self::TYPE_PAYMENT_FEE_ADYEN_MARKUP, + self::TYPE_PAYMENT_FEE_INTERCHANGE, + self::TYPE_PAYMENT_FEE_SCHEME_FEE, self::TYPE_REMAINDER, self::TYPE_SURCHARGE, self::TYPE_TIP, diff --git a/src/Adyen/Model/Payments/ThreeDS2RequestData.php b/src/Adyen/Model/Payments/ThreeDS2RequestData.php index a133cdc85..730d27d11 100644 --- a/src/Adyen/Model/Payments/ThreeDS2RequestData.php +++ b/src/Adyen/Model/Payments/ThreeDS2RequestData.php @@ -581,7 +581,7 @@ public function __construct(array $data = null) $this->setIfExists('homePhone', $data ?? [], null); $this->setIfExists('mcc', $data ?? [], null); $this->setIfExists('merchantName', $data ?? [], null); - $this->setIfExists('messageVersion', $data ?? [], '2.1.0'); + $this->setIfExists('messageVersion', $data ?? [], null); $this->setIfExists('mobilePhone', $data ?? [], null); $this->setIfExists('notificationURL', $data ?? [], null); $this->setIfExists('payTokenInd', $data ?? [], null); diff --git a/src/Adyen/Model/Payout/Card.php b/src/Adyen/Model/Payout/Card.php index 06dfd60a7..c3609a76e 100644 --- a/src/Adyen/Model/Payout/Card.php +++ b/src/Adyen/Model/Payout/Card.php @@ -310,18 +310,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['expiryMonth'] === null) { - $invalidProperties[] = "'expiryMonth' can't be null"; - } - if ($this->container['expiryYear'] === null) { - $invalidProperties[] = "'expiryYear' can't be null"; - } - if ($this->container['holderName'] === null) { - $invalidProperties[] = "'holderName' can't be null"; - } - if ($this->container['number'] === null) { - $invalidProperties[] = "'number' can't be null"; - } return $invalidProperties; } @@ -367,7 +355,7 @@ public function setCvc($cvc) /** * Gets expiryMonth * - * @return string + * @return string|null */ public function getExpiryMonth() { @@ -377,7 +365,7 @@ public function getExpiryMonth() /** * Sets expiryMonth * - * @param string $expiryMonth The card expiry month. Format: 2 digits, zero-padded for single digits. For example: * 03 = March * 11 = November + * @param string|null $expiryMonth The card expiry month. Format: 2 digits, zero-padded for single digits. For example: * 03 = March * 11 = November * * @return self */ @@ -394,7 +382,7 @@ public function setExpiryMonth($expiryMonth) /** * Gets expiryYear * - * @return string + * @return string|null */ public function getExpiryYear() { @@ -404,7 +392,7 @@ public function getExpiryYear() /** * Sets expiryYear * - * @param string $expiryYear The card expiry year. Format: 4 digits. For example: 2020 + * @param string|null $expiryYear The card expiry year. Format: 4 digits. For example: 2020 * * @return self */ @@ -421,7 +409,7 @@ public function setExpiryYear($expiryYear) /** * Gets holderName * - * @return string + * @return string|null */ public function getHolderName() { @@ -431,7 +419,7 @@ public function getHolderName() /** * Sets holderName * - * @param string $holderName The name of the cardholder, as printed on the card. + * @param string|null $holderName The name of the cardholder, as printed on the card. * * @return self */ @@ -475,7 +463,7 @@ public function setIssueNumber($issueNumber) /** * Gets number * - * @return string + * @return string|null */ public function getNumber() { @@ -485,7 +473,7 @@ public function getNumber() /** * Sets number * - * @param string $number The card number (4-19 characters). Do not use any separators. When this value is returned in a response, only the last 4 digits of the card number are returned. + * @param string|null $number The card number (4-19 characters). Do not use any separators. When this value is returned in a response, only the last 4 digits of the card number are returned. * * @return self */ diff --git a/src/Adyen/Model/Payout/FraudCheckResultWrapper.php b/src/Adyen/Model/Payout/FraudCheckResultWrapper.php new file mode 100644 index 000000000..7febeab88 --- /dev/null +++ b/src/Adyen/Model/Payout/FraudCheckResultWrapper.php @@ -0,0 +1,384 @@ + + */ +class FraudCheckResultWrapper implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FraudCheckResultWrapper'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'fraudCheckResult' => '\Adyen\Model\Payout\FraudCheckResult' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'fraudCheckResult' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'fraudCheckResult' => 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 = [ + 'fraudCheckResult' => 'FraudCheckResult' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'fraudCheckResult' => 'setFraudCheckResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'fraudCheckResult' => 'getFraudCheckResult' + ]; + + /** + * 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('fraudCheckResult', $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 fraudCheckResult + * + * @return \Adyen\Model\Payout\FraudCheckResult|null + */ + public function getFraudCheckResult() + { + return $this->container['fraudCheckResult']; + } + + /** + * Sets fraudCheckResult + * + * @param \Adyen\Model\Payout\FraudCheckResult|null $fraudCheckResult fraudCheckResult + * + * @return self + */ + public function setFraudCheckResult($fraudCheckResult) + { + if (is_null($fraudCheckResult)) { + throw new \InvalidArgumentException('non-nullable fraudCheckResult cannot be null'); + } + $this->container['fraudCheckResult'] = $fraudCheckResult; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payout/FraudResult.php b/src/Adyen/Model/Payout/FraudResult.php index 19930420f..464888574 100644 --- a/src/Adyen/Model/Payout/FraudResult.php +++ b/src/Adyen/Model/Payout/FraudResult.php @@ -45,7 +45,7 @@ class FraudResult implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'accountScore' => 'int', - 'results' => '\Adyen\Model\Payout\FraudCheckResult[]' + 'results' => '\Adyen\Model\Payout\FraudCheckResultWrapper[]' ]; /** @@ -314,7 +314,7 @@ public function setAccountScore($accountScore) /** * Gets results * - * @return \Adyen\Model\Payout\FraudCheckResult[]|null + * @return \Adyen\Model\Payout\FraudCheckResultWrapper[]|null */ public function getResults() { @@ -324,7 +324,7 @@ public function getResults() /** * Sets results * - * @param \Adyen\Model\Payout\FraudCheckResult[]|null $results The result of the individual risk checks. + * @param \Adyen\Model\Payout\FraudCheckResultWrapper[]|null $results The result of the individual risk checks. * * @return self */ diff --git a/src/Adyen/Model/Payout/PayoutResponse.php b/src/Adyen/Model/Payout/PayoutResponse.php index 254d327f9..96119d065 100644 --- a/src/Adyen/Model/Payout/PayoutResponse.php +++ b/src/Adyen/Model/Payout/PayoutResponse.php @@ -282,6 +282,7 @@ public function getModelName() public const RESULT_CODE_CHALLENGE_SHOPPER = 'ChallengeShopper'; public const RESULT_CODE_ERROR = 'Error'; public const RESULT_CODE_IDENTIFY_SHOPPER = 'IdentifyShopper'; + public const RESULT_CODE_PARTIALLY_AUTHORISED = 'PartiallyAuthorised'; public const RESULT_CODE_PENDING = 'Pending'; public const RESULT_CODE_PRESENT_TO_SHOPPER = 'PresentToShopper'; public const RESULT_CODE_RECEIVED = 'Received'; @@ -304,6 +305,7 @@ public function getResultCodeAllowableValues() self::RESULT_CODE_CHALLENGE_SHOPPER, self::RESULT_CODE_ERROR, self::RESULT_CODE_IDENTIFY_SHOPPER, + self::RESULT_CODE_PARTIALLY_AUTHORISED, self::RESULT_CODE_PENDING, self::RESULT_CODE_PRESENT_TO_SHOPPER, self::RESULT_CODE_RECEIVED, @@ -674,7 +676,7 @@ public function getResultCode() /** * Sets resultCode * - * @param string|null $resultCode The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. + * @param string|null $resultCode The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * * @return self */ diff --git a/src/Adyen/Model/Payout/StoreDetailAndSubmitRequest.php b/src/Adyen/Model/Payout/StoreDetailAndSubmitRequest.php index 2063bf79d..53db680c6 100644 --- a/src/Adyen/Model/Payout/StoreDetailAndSubmitRequest.php +++ b/src/Adyen/Model/Payout/StoreDetailAndSubmitRequest.php @@ -78,7 +78,7 @@ class StoreDetailAndSubmitRequest implements ModelInterface, ArrayAccess, \JsonS 'bank' => null, 'billingAddress' => null, 'card' => null, - 'dateOfBirth' => 'date-time', + 'dateOfBirth' => 'date', 'entityType' => null, 'fraudOffset' => 'int32', 'merchantAccount' => null, diff --git a/src/Adyen/Model/Payout/StoreDetailRequest.php b/src/Adyen/Model/Payout/StoreDetailRequest.php index 2dc8a76ee..48102ef5b 100644 --- a/src/Adyen/Model/Payout/StoreDetailRequest.php +++ b/src/Adyen/Model/Payout/StoreDetailRequest.php @@ -74,7 +74,7 @@ class StoreDetailRequest implements ModelInterface, ArrayAccess, \JsonSerializab 'bank' => null, 'billingAddress' => null, 'card' => null, - 'dateOfBirth' => 'date-time', + 'dateOfBirth' => 'date', 'entityType' => null, 'fraudOffset' => 'int32', 'merchantAccount' => null, diff --git a/src/Adyen/Model/Payout/SubmitRequest.php b/src/Adyen/Model/Payout/SubmitRequest.php index 7f0c1a718..dd8eb9627 100644 --- a/src/Adyen/Model/Payout/SubmitRequest.php +++ b/src/Adyen/Model/Payout/SubmitRequest.php @@ -71,7 +71,7 @@ class SubmitRequest implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'additionalData' => null, 'amount' => null, - 'dateOfBirth' => 'date-time', + 'dateOfBirth' => 'date', 'entityType' => null, 'fraudOffset' => 'int32', 'merchantAccount' => null, diff --git a/src/Adyen/Model/Recurring/Card.php b/src/Adyen/Model/Recurring/Card.php index 0812f8526..16992994c 100644 --- a/src/Adyen/Model/Recurring/Card.php +++ b/src/Adyen/Model/Recurring/Card.php @@ -310,12 +310,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['expiryYear'] === null) { - $invalidProperties[] = "'expiryYear' can't be null"; - } - if ($this->container['holderName'] === null) { - $invalidProperties[] = "'holderName' can't be null"; - } return $invalidProperties; } @@ -388,7 +382,7 @@ public function setExpiryMonth($expiryMonth) /** * Gets expiryYear * - * @return string + * @return string|null */ public function getExpiryYear() { @@ -398,7 +392,7 @@ public function getExpiryYear() /** * Sets expiryYear * - * @param string $expiryYear The card expiry year. Format: 4 digits. For example: 2020 + * @param string|null $expiryYear The card expiry year. Format: 4 digits. For example: 2020 * * @return self */ @@ -415,7 +409,7 @@ public function setExpiryYear($expiryYear) /** * Gets holderName * - * @return string + * @return string|null */ public function getHolderName() { @@ -425,7 +419,7 @@ public function getHolderName() /** * Sets holderName * - * @param string $holderName The name of the cardholder, as printed on the card. + * @param string|null $holderName The name of the cardholder, as printed on the card. * * @return self */ diff --git a/src/Adyen/Model/Recurring/RecurringDetailWrapper.php b/src/Adyen/Model/Recurring/RecurringDetailWrapper.php new file mode 100644 index 000000000..de01c7a61 --- /dev/null +++ b/src/Adyen/Model/Recurring/RecurringDetailWrapper.php @@ -0,0 +1,384 @@ + + */ +class RecurringDetailWrapper implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RecurringDetailWrapper'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'recurringDetail' => '\Adyen\Model\Recurring\RecurringDetail' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'recurringDetail' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'recurringDetail' => 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 = [ + 'recurringDetail' => 'RecurringDetail' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'recurringDetail' => 'setRecurringDetail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'recurringDetail' => 'getRecurringDetail' + ]; + + /** + * 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('recurringDetail', $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 recurringDetail + * + * @return \Adyen\Model\Recurring\RecurringDetail|null + */ + public function getRecurringDetail() + { + return $this->container['recurringDetail']; + } + + /** + * Sets recurringDetail + * + * @param \Adyen\Model\Recurring\RecurringDetail|null $recurringDetail recurringDetail + * + * @return self + */ + public function setRecurringDetail($recurringDetail) + { + if (is_null($recurringDetail)) { + throw new \InvalidArgumentException('non-nullable recurringDetail cannot be null'); + } + $this->container['recurringDetail'] = $recurringDetail; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Recurring/RecurringDetailsResult.php b/src/Adyen/Model/Recurring/RecurringDetailsResult.php index 265b5c0a2..c06b54680 100644 --- a/src/Adyen/Model/Recurring/RecurringDetailsResult.php +++ b/src/Adyen/Model/Recurring/RecurringDetailsResult.php @@ -45,7 +45,7 @@ class RecurringDetailsResult implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPITypes = [ 'creationDate' => '\DateTime', - 'details' => '\Adyen\Model\Recurring\RecurringDetail[]', + 'details' => '\Adyen\Model\Recurring\RecurringDetailWrapper[]', 'lastKnownShopperEmail' => 'string', 'shopperReference' => 'string' ]; @@ -327,7 +327,7 @@ public function setCreationDate($creationDate) /** * Gets details * - * @return \Adyen\Model\Recurring\RecurringDetail[]|null + * @return \Adyen\Model\Recurring\RecurringDetailWrapper[]|null */ public function getDetails() { @@ -337,7 +337,7 @@ public function getDetails() /** * Sets details * - * @param \Adyen\Model\Recurring\RecurringDetail[]|null $details Payment details stored for recurring payments. + * @param \Adyen\Model\Recurring\RecurringDetailWrapper[]|null $details Payment details stored for recurring payments. * * @return self */ diff --git a/src/Adyen/Model/ReportWebhooks/BalancePlatformNotificationResponse.php b/src/Adyen/Model/ReportWebhooks/BalancePlatformNotificationResponse.php new file mode 100644 index 000000000..92f5f1304 --- /dev/null +++ b/src/Adyen/Model/ReportWebhooks/BalancePlatformNotificationResponse.php @@ -0,0 +1,384 @@ + + */ +class BalancePlatformNotificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalancePlatformNotificationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'notificationResponse' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'notificationResponse' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'notificationResponse' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'notificationResponse' => 'notificationResponse' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'notificationResponse' => 'setNotificationResponse' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'notificationResponse' => 'getNotificationResponse' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('notificationResponse', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets notificationResponse + * + * @return string|null + */ + public function getNotificationResponse() + { + return $this->container['notificationResponse']; + } + + /** + * Sets notificationResponse + * + * @param string|null $notificationResponse Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * + * @return self + */ + public function setNotificationResponse($notificationResponse) + { + if (is_null($notificationResponse)) { + throw new \InvalidArgumentException('non-nullable notificationResponse cannot be null'); + } + $this->container['notificationResponse'] = $notificationResponse; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * 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/ReportWebhooks/ModelInterface.php b/src/Adyen/Model/ReportWebhooks/ModelInterface.php new file mode 100644 index 000000000..ce11ed0e9 --- /dev/null +++ b/src/Adyen/Model/ReportWebhooks/ModelInterface.php @@ -0,0 +1,92 @@ +format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach ($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) { + return $timestamp; + } + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if (is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Adyen\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/src/Adyen/Model/ReportWebhooks/ReportNotificationData.php b/src/Adyen/Model/ReportWebhooks/ReportNotificationData.php new file mode 100644 index 000000000..53cadebe9 --- /dev/null +++ b/src/Adyen/Model/ReportWebhooks/ReportNotificationData.php @@ -0,0 +1,597 @@ + + */ +class ReportNotificationData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ReportNotificationData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountHolder' => '\Adyen\Model\ReportWebhooks\ResourceReference', + 'balanceAccount' => '\Adyen\Model\ReportWebhooks\ResourceReference', + 'balancePlatform' => 'string', + 'creationDate' => '\DateTime', + 'downloadUrl' => 'string', + 'fileName' => 'string', + 'reportType' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountHolder' => null, + 'balanceAccount' => null, + 'balancePlatform' => null, + 'creationDate' => 'date-time', + 'downloadUrl' => null, + 'fileName' => null, + 'reportType' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountHolder' => false, + 'balanceAccount' => false, + 'balancePlatform' => false, + 'creationDate' => false, + 'downloadUrl' => false, + 'fileName' => false, + 'reportType' => 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 = [ + 'accountHolder' => 'accountHolder', + 'balanceAccount' => 'balanceAccount', + 'balancePlatform' => 'balancePlatform', + 'creationDate' => 'creationDate', + 'downloadUrl' => 'downloadUrl', + 'fileName' => 'fileName', + 'reportType' => 'reportType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountHolder' => 'setAccountHolder', + 'balanceAccount' => 'setBalanceAccount', + 'balancePlatform' => 'setBalancePlatform', + 'creationDate' => 'setCreationDate', + 'downloadUrl' => 'setDownloadUrl', + 'fileName' => 'setFileName', + 'reportType' => 'setReportType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountHolder' => 'getAccountHolder', + 'balanceAccount' => 'getBalanceAccount', + 'balancePlatform' => 'getBalancePlatform', + 'creationDate' => 'getCreationDate', + 'downloadUrl' => 'getDownloadUrl', + 'fileName' => 'getFileName', + 'reportType' => 'getReportType' + ]; + + /** + * 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('accountHolder', $data ?? [], null); + $this->setIfExists('balanceAccount', $data ?? [], null); + $this->setIfExists('balancePlatform', $data ?? [], null); + $this->setIfExists('creationDate', $data ?? [], null); + $this->setIfExists('downloadUrl', $data ?? [], null); + $this->setIfExists('fileName', $data ?? [], null); + $this->setIfExists('reportType', $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['downloadUrl'] === null) { + $invalidProperties[] = "'downloadUrl' can't be null"; + } + if ($this->container['fileName'] === null) { + $invalidProperties[] = "'fileName' can't be null"; + } + if ($this->container['reportType'] === null) { + $invalidProperties[] = "'reportType' 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 accountHolder + * + * @return \Adyen\Model\ReportWebhooks\ResourceReference|null + */ + public function getAccountHolder() + { + return $this->container['accountHolder']; + } + + /** + * Sets accountHolder + * + * @param \Adyen\Model\ReportWebhooks\ResourceReference|null $accountHolder accountHolder + * + * @return self + */ + public function setAccountHolder($accountHolder) + { + if (is_null($accountHolder)) { + throw new \InvalidArgumentException('non-nullable accountHolder cannot be null'); + } + $this->container['accountHolder'] = $accountHolder; + + return $this; + } + + /** + * Gets balanceAccount + * + * @return \Adyen\Model\ReportWebhooks\ResourceReference|null + */ + public function getBalanceAccount() + { + return $this->container['balanceAccount']; + } + + /** + * Sets balanceAccount + * + * @param \Adyen\Model\ReportWebhooks\ResourceReference|null $balanceAccount balanceAccount + * + * @return self + */ + public function setBalanceAccount($balanceAccount) + { + if (is_null($balanceAccount)) { + throw new \InvalidArgumentException('non-nullable balanceAccount cannot be null'); + } + $this->container['balanceAccount'] = $balanceAccount; + + return $this; + } + + /** + * Gets balancePlatform + * + * @return string|null + */ + public function getBalancePlatform() + { + return $this->container['balancePlatform']; + } + + /** + * Sets balancePlatform + * + * @param string|null $balancePlatform The unique identifier of the balance platform. + * + * @return self + */ + public function setBalancePlatform($balancePlatform) + { + if (is_null($balancePlatform)) { + throw new \InvalidArgumentException('non-nullable balancePlatform cannot be null'); + } + $this->container['balancePlatform'] = $balancePlatform; + + return $this; + } + + /** + * Gets creationDate + * + * @return \DateTime|null + */ + public function getCreationDate() + { + return $this->container['creationDate']; + } + + /** + * Sets creationDate + * + * @param \DateTime|null $creationDate The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + * + * @return self + */ + public function setCreationDate($creationDate) + { + if (is_null($creationDate)) { + throw new \InvalidArgumentException('non-nullable creationDate cannot be null'); + } + $this->container['creationDate'] = $creationDate; + + return $this; + } + + /** + * Gets downloadUrl + * + * @return string + */ + public function getDownloadUrl() + { + return $this->container['downloadUrl']; + } + + /** + * Sets downloadUrl + * + * @param string $downloadUrl The URL at which you can download the report. To download, you must authenticate your GET request with your [API credentials](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/overview). + * + * @return self + */ + public function setDownloadUrl($downloadUrl) + { + if (is_null($downloadUrl)) { + throw new \InvalidArgumentException('non-nullable downloadUrl cannot be null'); + } + $this->container['downloadUrl'] = $downloadUrl; + + return $this; + } + + /** + * Gets fileName + * + * @return string + */ + public function getFileName() + { + return $this->container['fileName']; + } + + /** + * Sets fileName + * + * @param string $fileName The filename of the report. + * + * @return self + */ + public function setFileName($fileName) + { + if (is_null($fileName)) { + throw new \InvalidArgumentException('non-nullable fileName cannot be null'); + } + $this->container['fileName'] = $fileName; + + return $this; + } + + /** + * Gets reportType + * + * @return string + */ + public function getReportType() + { + return $this->container['reportType']; + } + + /** + * Sets reportType + * + * @param string $reportType Type of report. + * + * @return self + */ + public function setReportType($reportType) + { + if (is_null($reportType)) { + throw new \InvalidArgumentException('non-nullable reportType cannot be null'); + } + $this->container['reportType'] = $reportType; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ReportWebhooks/ReportNotificationRequest.php b/src/Adyen/Model/ReportWebhooks/ReportNotificationRequest.php new file mode 100644 index 000000000..57406e14d --- /dev/null +++ b/src/Adyen/Model/ReportWebhooks/ReportNotificationRequest.php @@ -0,0 +1,492 @@ + + */ +class ReportNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ReportNotificationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\ReportWebhooks\ReportNotificationData', + 'environment' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'environment' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false, + 'environment' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'environment' => 'environment', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'environment' => 'setEnvironment', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'environment' => 'getEnvironment', + '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_BALANCE_PLATFORM_REPORT_CREATED = 'balancePlatform.report.created'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BALANCE_PLATFORM_REPORT_CREATED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['environment'] === null) { + $invalidProperties[] = "'environment' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\ReportWebhooks\ReportNotificationData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\ReportWebhooks\ReportNotificationData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets environment + * + * @return string + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param string $environment The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @return self + */ + public function setEnvironment($environment) + { + if (is_null($environment)) { + throw new \InvalidArgumentException('non-nullable environment cannot be null'); + } + $this->container['environment'] = $environment; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of webhook. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/ReportWebhooks/Resource.php b/src/Adyen/Model/ReportWebhooks/Resource.php new file mode 100644 index 000000000..e7b9ee585 --- /dev/null +++ b/src/Adyen/Model/ReportWebhooks/Resource.php @@ -0,0 +1,452 @@ + + */ +class Resource implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Resource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balancePlatform' => 'string', + 'creationDate' => '\DateTime', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balancePlatform' => null, + 'creationDate' => 'date-time', + 'id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balancePlatform' => false, + 'creationDate' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balancePlatform' => 'balancePlatform', + 'creationDate' => 'creationDate', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balancePlatform' => 'setBalancePlatform', + 'creationDate' => 'setCreationDate', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balancePlatform' => 'getBalancePlatform', + 'creationDate' => 'getCreationDate', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('balancePlatform', $data ?? [], null); + $this->setIfExists('creationDate', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 balancePlatform + * + * @return string|null + */ + public function getBalancePlatform() + { + return $this->container['balancePlatform']; + } + + /** + * Sets balancePlatform + * + * @param string|null $balancePlatform The unique identifier of the balance platform. + * + * @return self + */ + public function setBalancePlatform($balancePlatform) + { + if (is_null($balancePlatform)) { + throw new \InvalidArgumentException('non-nullable balancePlatform cannot be null'); + } + $this->container['balancePlatform'] = $balancePlatform; + + return $this; + } + + /** + * Gets creationDate + * + * @return \DateTime|null + */ + public function getCreationDate() + { + return $this->container['creationDate']; + } + + /** + * Sets creationDate + * + * @param \DateTime|null $creationDate The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + * + * @return self + */ + public function setCreationDate($creationDate) + { + if (is_null($creationDate)) { + throw new \InvalidArgumentException('non-nullable creationDate cannot be null'); + } + $this->container['creationDate'] = $creationDate; + + 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) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * 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/ReportWebhooks/ResourceReference.php b/src/Adyen/Model/ReportWebhooks/ResourceReference.php new file mode 100644 index 000000000..c49f45573 --- /dev/null +++ b/src/Adyen/Model/ReportWebhooks/ResourceReference.php @@ -0,0 +1,452 @@ + + */ +class ResourceReference implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResourceReference'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'id' => 'string', + 'reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'id' => null, + 'reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'id' => false, + 'reference' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'reference' => 'reference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'reference' => 'setReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'reference' => 'getReference' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('reference', $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 description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the resource. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the resource. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The reference for the resource. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/AULocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/AULocalAccountIdentification.php new file mode 100644 index 000000000..38beb2730 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/AULocalAccountIdentification.php @@ -0,0 +1,492 @@ + + */ +class AULocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AULocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'bsbCode' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'bsbCode' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'bsbCode' => 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 = [ + 'accountNumber' => 'accountNumber', + 'bsbCode' => 'bsbCode', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'bsbCode' => 'setBsbCode', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'bsbCode' => 'getBsbCode', + '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_AU_LOCAL = 'auLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_AU_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('bsbCode', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'auLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['bsbCode'] === null) { + $invalidProperties[] = "'bsbCode' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets bsbCode + * + * @return string + */ + public function getBsbCode() + { + return $this->container['bsbCode']; + } + + /** + * Sets bsbCode + * + * @param string $bsbCode The 6-digit [Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or whitespace. + * + * @return self + */ + public function setBsbCode($bsbCode) + { + if (is_null($bsbCode)) { + throw new \InvalidArgumentException('non-nullable bsbCode cannot be null'); + } + $this->container['bsbCode'] = $bsbCode; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **auLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ShopperStatement.php b/src/Adyen/Model/TransferWebhooks/AdditionalBankIdentification.php similarity index 84% rename from src/Adyen/Model/Management/ShopperStatement.php rename to src/Adyen/Model/TransferWebhooks/AdditionalBankIdentification.php index f310117ff..464e01287 100644 --- a/src/Adyen/Model/Management/ShopperStatement.php +++ b/src/Adyen/Model/TransferWebhooks/AdditionalBankIdentification.php @@ -1,9 +1,9 @@ */ -class ShopperStatement implements ModelInterface, ArrayAccess, \JsonSerializable +class AdditionalBankIdentification implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -36,7 +36,7 @@ class ShopperStatement implements ModelInterface, ArrayAccess, \JsonSerializable * * @var string */ - protected static $openAPIModelName = 'ShopperStatement'; + protected static $openAPIModelName = 'AdditionalBankIdentification'; /** * Array of property to type mappings. Used for (de)serialization @@ -44,7 +44,7 @@ class ShopperStatement implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'doingBusinessAsName' => 'string', + 'code' => 'string', 'type' => 'string' ]; @@ -56,7 +56,7 @@ class ShopperStatement implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'doingBusinessAsName' => null, + 'code' => null, 'type' => null ]; @@ -66,7 +66,7 @@ class ShopperStatement implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ - 'doingBusinessAsName' => false, + 'code' => false, 'type' => false ]; @@ -156,7 +156,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'doingBusinessAsName' => 'doingBusinessAsName', + 'code' => 'code', 'type' => 'type' ]; @@ -166,7 +166,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'doingBusinessAsName' => 'setDoingBusinessAsName', + 'code' => 'setCode', 'type' => 'setType' ]; @@ -176,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'doingBusinessAsName' => 'getDoingBusinessAsName', + 'code' => 'getCode', 'type' => 'getType' ]; @@ -221,9 +221,8 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_APPEND = 'append'; - public const TYPE_DYNAMIC = 'dynamic'; - public const TYPE_FIXED = 'fixed'; + public const TYPE_GB_SORT_CODE = 'gbSortCode'; + public const TYPE_US_ROUTING_NUMBER = 'usRoutingNumber'; /** * Gets allowable values of the enum @@ -233,9 +232,8 @@ public function getModelName() public function getTypeAllowableValues() { return [ - self::TYPE_APPEND, - self::TYPE_DYNAMIC, - self::TYPE_FIXED, + self::TYPE_GB_SORT_CODE, + self::TYPE_US_ROUTING_NUMBER, ]; } /** @@ -253,8 +251,8 @@ public function getTypeAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('doingBusinessAsName', $data ?? [], null); - $this->setIfExists('type', $data ?? [], 'dynamic'); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); } /** @@ -309,28 +307,28 @@ public function valid() /** - * Gets doingBusinessAsName + * Gets code * * @return string|null */ - public function getDoingBusinessAsName() + public function getCode() { - return $this->container['doingBusinessAsName']; + return $this->container['code']; } /** - * Sets doingBusinessAsName + * Sets code * - * @param string|null $doingBusinessAsName The name you want to be shown on the shopper's bank or credit card statement. Can't be all numbers. If a shopper statement is present, this field is required. + * @param string|null $code The value of the additional bank identification. * * @return self */ - public function setDoingBusinessAsName($doingBusinessAsName) + public function setCode($code) { - if (is_null($doingBusinessAsName)) { - throw new \InvalidArgumentException('non-nullable doingBusinessAsName cannot be null'); + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); } - $this->container['doingBusinessAsName'] = $doingBusinessAsName; + $this->container['code'] = $code; return $this; } @@ -348,7 +346,7 @@ public function getType() /** * Sets type * - * @param string|null $type The type of shopperstatement you want to use: fixed, append or dynamic + * @param string|null $type The type of additional bank identification, depending on the country. Possible values: * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. * * @return self */ diff --git a/src/Adyen/Model/TransferWebhooks/Address.php b/src/Adyen/Model/TransferWebhooks/Address.php new file mode 100644 index 000000000..ea88a427b --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/Address.php @@ -0,0 +1,557 @@ + + */ +class Address implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Address'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'country' => 'string', + 'line1' => 'string', + 'line2' => 'string', + 'postalCode' => 'string', + 'stateOrProvince' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'city' => null, + 'country' => null, + 'line1' => null, + 'line2' => null, + 'postalCode' => null, + 'stateOrProvince' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'city' => false, + 'country' => false, + 'line1' => false, + 'line2' => false, + 'postalCode' => false, + 'stateOrProvince' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'country' => 'country', + 'line1' => 'line1', + 'line2' => 'line2', + 'postalCode' => 'postalCode', + 'stateOrProvince' => 'stateOrProvince' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'line1' => 'setLine1', + 'line2' => 'setLine2', + 'postalCode' => 'setPostalCode', + 'stateOrProvince' => 'setStateOrProvince' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'line1' => 'getLine1', + 'line2' => 'getLine2', + 'postalCode' => 'getPostalCode', + 'stateOrProvince' => 'getStateOrProvince' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('line1', $data ?? [], null); + $this->setIfExists('line2', $data ?? [], null); + $this->setIfExists('postalCode', $data ?? [], null); + $this->setIfExists('stateOrProvince', $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['country'] === null) { + $invalidProperties[] = "'country' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city The name of the city. + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country The two-character ISO 3166-1 alpha-2 country code. For example, **US**, **NL**, or **GB**. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets line1 + * + * @return string|null + */ + public function getLine1() + { + return $this->container['line1']; + } + + /** + * Sets line1 + * + * @param string|null $line1 First line of the street address. + * + * @return self + */ + public function setLine1($line1) + { + if (is_null($line1)) { + throw new \InvalidArgumentException('non-nullable line1 cannot be null'); + } + $this->container['line1'] = $line1; + + return $this; + } + + /** + * Gets line2 + * + * @return string|null + */ + public function getLine2() + { + return $this->container['line2']; + } + + /** + * Sets line2 + * + * @param string|null $line2 Second line of the street address. + * + * @return self + */ + public function setLine2($line2) + { + if (is_null($line2)) { + throw new \InvalidArgumentException('non-nullable line2 cannot be null'); + } + $this->container['line2'] = $line2; + + return $this; + } + + /** + * Gets postalCode + * + * @return string|null + */ + public function getPostalCode() + { + return $this->container['postalCode']; + } + + /** + * Sets postalCode + * + * @param string|null $postalCode The postal code. Maximum length: * 5 digits for an address in the US. * 10 characters for an address in all other countries. + * + * @return self + */ + public function setPostalCode($postalCode) + { + if (is_null($postalCode)) { + throw new \InvalidArgumentException('non-nullable postalCode cannot be null'); + } + $this->container['postalCode'] = $postalCode; + + return $this; + } + + /** + * Gets stateOrProvince + * + * @return string|null + */ + public function getStateOrProvince() + { + return $this->container['stateOrProvince']; + } + + /** + * Sets stateOrProvince + * + * @param string|null $stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + * + * @return self + */ + public function setStateOrProvince($stateOrProvince) + { + if (is_null($stateOrProvince)) { + throw new \InvalidArgumentException('non-nullable stateOrProvince cannot be null'); + } + $this->container['stateOrProvince'] = $stateOrProvince; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/Amount.php b/src/Adyen/Model/TransferWebhooks/Amount.php new file mode 100644 index 000000000..7922f9e36 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/Amount.php @@ -0,0 +1,424 @@ + + */ +class Amount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Amount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'value' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/AmountAdjustment.php b/src/Adyen/Model/TransferWebhooks/AmountAdjustment.php new file mode 100644 index 000000000..b151e34f6 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/AmountAdjustment.php @@ -0,0 +1,487 @@ + + */ +class AmountAdjustment implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AmountAdjustment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\TransferWebhooks\Amount', + 'amountAdjustmentType' => 'string', + 'basepoints' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'amountAdjustmentType' => null, + 'basepoints' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'amountAdjustmentType' => false, + 'basepoints' => true + ]; + + /** + * 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', + 'amountAdjustmentType' => 'amountAdjustmentType', + 'basepoints' => 'basepoints' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'amountAdjustmentType' => 'setAmountAdjustmentType', + 'basepoints' => 'setBasepoints' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'amountAdjustmentType' => 'getAmountAdjustmentType', + 'basepoints' => 'getBasepoints' + ]; + + /** + * 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 AMOUNT_ADJUSTMENT_TYPE_ATM_MARKUP = 'atmMarkup'; + public const AMOUNT_ADJUSTMENT_TYPE_AUTH_HOLD_RESERVE = 'authHoldReserve'; + public const AMOUNT_ADJUSTMENT_TYPE_EXCHANGE = 'exchange'; + public const AMOUNT_ADJUSTMENT_TYPE_FOREX_MARKUP = 'forexMarkup'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAmountAdjustmentTypeAllowableValues() + { + return [ + self::AMOUNT_ADJUSTMENT_TYPE_ATM_MARKUP, + self::AMOUNT_ADJUSTMENT_TYPE_AUTH_HOLD_RESERVE, + self::AMOUNT_ADJUSTMENT_TYPE_EXCHANGE, + self::AMOUNT_ADJUSTMENT_TYPE_FOREX_MARKUP, + ]; + } + /** + * 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('amountAdjustmentType', $data ?? [], null); + $this->setIfExists('basepoints', $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->getAmountAdjustmentTypeAllowableValues(); + if (!is_null($this->container['amountAdjustmentType']) && !in_array($this->container['amountAdjustmentType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'amountAdjustmentType', must be one of '%s'", + $this->container['amountAdjustmentType'], + 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\TransferWebhooks\Amount|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\TransferWebhooks\Amount|null $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets amountAdjustmentType + * + * @return string|null + */ + public function getAmountAdjustmentType() + { + return $this->container['amountAdjustmentType']; + } + + /** + * Sets amountAdjustmentType + * + * @param string|null $amountAdjustmentType The type of markup that is applied to an authorised payment. Possible values: **exchange**, **forexMarkup**, **authHoldReserve**, **atmMarkup**. + * + * @return self + */ + public function setAmountAdjustmentType($amountAdjustmentType) + { + if (is_null($amountAdjustmentType)) { + throw new \InvalidArgumentException('non-nullable amountAdjustmentType cannot be null'); + } + $allowedValues = $this->getAmountAdjustmentTypeAllowableValues(); + if (!in_array($amountAdjustmentType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'amountAdjustmentType', must be one of '%s'", + $amountAdjustmentType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['amountAdjustmentType'] = $amountAdjustmentType; + + return $this; + } + + /** + * Gets basepoints + * + * @return int|null + */ + public function getBasepoints() + { + return $this->container['basepoints']; + } + + /** + * Sets basepoints + * + * @param int|null $basepoints The basepoints associated with the applied markup. + * + * @return self + */ + public function setBasepoints($basepoints) + { + // Do nothing for nullable integers + $this->container['basepoints'] = $basepoints; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/BRLocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/BRLocalAccountIdentification.php new file mode 100644 index 000000000..55dab9595 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/BRLocalAccountIdentification.php @@ -0,0 +1,529 @@ + + */ +class BRLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BRLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'bankCode' => 'string', + 'branchNumber' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'bankCode' => null, + 'branchNumber' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'bankCode' => false, + 'branchNumber' => 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 = [ + 'accountNumber' => 'accountNumber', + 'bankCode' => 'bankCode', + 'branchNumber' => 'branchNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'bankCode' => 'setBankCode', + 'branchNumber' => 'setBranchNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'bankCode' => 'getBankCode', + 'branchNumber' => 'getBranchNumber', + '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_BR_LOCAL = 'brLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BR_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('bankCode', $data ?? [], null); + $this->setIfExists('branchNumber', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'brLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['bankCode'] === null) { + $invalidProperties[] = "'bankCode' can't be null"; + } + if ($this->container['branchNumber'] === null) { + $invalidProperties[] = "'branchNumber' 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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The bank account number (without separators or whitespace). + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets bankCode + * + * @return string + */ + public function getBankCode() + { + return $this->container['bankCode']; + } + + /** + * Sets bankCode + * + * @param string $bankCode The 3-digit Brazilian bank code (with leading zeros). + * + * @return self + */ + public function setBankCode($bankCode) + { + if (is_null($bankCode)) { + throw new \InvalidArgumentException('non-nullable bankCode cannot be null'); + } + $this->container['bankCode'] = $bankCode; + + return $this; + } + + /** + * Gets branchNumber + * + * @return string + */ + public function getBranchNumber() + { + return $this->container['branchNumber']; + } + + /** + * Sets branchNumber + * + * @param string $branchNumber The bank account branch number (without separators or whitespace). + * + * @return self + */ + public function setBranchNumber($branchNumber) + { + if (is_null($branchNumber)) { + throw new \InvalidArgumentException('non-nullable branchNumber cannot be null'); + } + $this->container['branchNumber'] = $branchNumber; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **brLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/BalanceMutation.php b/src/Adyen/Model/TransferWebhooks/BalanceMutation.php new file mode 100644 index 000000000..57c3318b8 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/BalanceMutation.php @@ -0,0 +1,486 @@ + + */ +class BalanceMutation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceMutation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balance' => 'int', + 'currency' => 'string', + 'received' => 'int', + 'reserved' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balance' => 'int64', + 'currency' => null, + 'received' => 'int64', + 'reserved' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balance' => false, + 'currency' => false, + 'received' => false, + 'reserved' => 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 = [ + 'balance' => 'balance', + 'currency' => 'currency', + 'received' => 'received', + 'reserved' => 'reserved' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balance' => 'setBalance', + 'currency' => 'setCurrency', + 'received' => 'setReceived', + 'reserved' => 'setReserved' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balance' => 'getBalance', + 'currency' => 'getCurrency', + 'received' => 'getReceived', + 'reserved' => 'getReserved' + ]; + + /** + * 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('balance', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('received', $data ?? [], null); + $this->setIfExists('reserved', $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 balance + * + * @return int|null + */ + public function getBalance() + { + return $this->container['balance']; + } + + /** + * Sets balance + * + * @param int|null $balance The amount in the payment's currency that is debited or credited on the balance accounting register. + * + * @return self + */ + public function setBalance($balance) + { + if (is_null($balance)) { + throw new \InvalidArgumentException('non-nullable balance cannot be null'); + } + $this->container['balance'] = $balance; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets received + * + * @return int|null + */ + public function getReceived() + { + return $this->container['received']; + } + + /** + * Sets received + * + * @param int|null $received The amount in the payment's currency that is debited or credited on the received accounting register. + * + * @return self + */ + public function setReceived($received) + { + if (is_null($received)) { + throw new \InvalidArgumentException('non-nullable received cannot be null'); + } + $this->container['received'] = $received; + + return $this; + } + + /** + * Gets reserved + * + * @return int|null + */ + public function getReserved() + { + return $this->container['reserved']; + } + + /** + * Sets reserved + * + * @param int|null $reserved The amount in the payment's currency that is debited or credited on the reserved accounting register. + * + * @return self + */ + public function setReserved($reserved) + { + if (is_null($reserved)) { + throw new \InvalidArgumentException('non-nullable reserved cannot be null'); + } + $this->container['reserved'] = $reserved; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/BalancePlatformNotificationResponse.php b/src/Adyen/Model/TransferWebhooks/BalancePlatformNotificationResponse.php new file mode 100644 index 000000000..515467a17 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/BalancePlatformNotificationResponse.php @@ -0,0 +1,384 @@ + + */ +class BalancePlatformNotificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalancePlatformNotificationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'notificationResponse' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'notificationResponse' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'notificationResponse' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'notificationResponse' => 'notificationResponse' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'notificationResponse' => 'setNotificationResponse' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'notificationResponse' => 'getNotificationResponse' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('notificationResponse', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets notificationResponse + * + * @return string|null + */ + public function getNotificationResponse() + { + return $this->container['notificationResponse']; + } + + /** + * Sets notificationResponse + * + * @param string|null $notificationResponse Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * + * @return self + */ + public function setNotificationResponse($notificationResponse) + { + if (is_null($notificationResponse)) { + throw new \InvalidArgumentException('non-nullable notificationResponse cannot be null'); + } + $this->container['notificationResponse'] = $notificationResponse; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/BankAccountV3.php b/src/Adyen/Model/TransferWebhooks/BankAccountV3.php new file mode 100644 index 000000000..ef2b89883 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/BankAccountV3.php @@ -0,0 +1,424 @@ + + */ +class BankAccountV3 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BankAccountV3'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountHolder' => '\Adyen\Model\TransferWebhooks\PartyIdentification', + 'accountIdentification' => '\Adyen\Model\TransferWebhooks\BankAccountV3AccountIdentification' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountHolder' => null, + 'accountIdentification' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountHolder' => false, + 'accountIdentification' => 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 = [ + 'accountHolder' => 'accountHolder', + 'accountIdentification' => 'accountIdentification' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountHolder' => 'setAccountHolder', + 'accountIdentification' => 'setAccountIdentification' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountHolder' => 'getAccountHolder', + 'accountIdentification' => 'getAccountIdentification' + ]; + + /** + * 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('accountHolder', $data ?? [], null); + $this->setIfExists('accountIdentification', $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['accountHolder'] === null) { + $invalidProperties[] = "'accountHolder' can't be null"; + } + if ($this->container['accountIdentification'] === null) { + $invalidProperties[] = "'accountIdentification' 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 accountHolder + * + * @return \Adyen\Model\TransferWebhooks\PartyIdentification + */ + public function getAccountHolder() + { + return $this->container['accountHolder']; + } + + /** + * Sets accountHolder + * + * @param \Adyen\Model\TransferWebhooks\PartyIdentification $accountHolder accountHolder + * + * @return self + */ + public function setAccountHolder($accountHolder) + { + if (is_null($accountHolder)) { + throw new \InvalidArgumentException('non-nullable accountHolder cannot be null'); + } + $this->container['accountHolder'] = $accountHolder; + + return $this; + } + + /** + * Gets accountIdentification + * + * @return \Adyen\Model\TransferWebhooks\BankAccountV3AccountIdentification + */ + public function getAccountIdentification() + { + return $this->container['accountIdentification']; + } + + /** + * Sets accountIdentification + * + * @param \Adyen\Model\TransferWebhooks\BankAccountV3AccountIdentification $accountIdentification accountIdentification + * + * @return self + */ + public function setAccountIdentification($accountIdentification) + { + if (is_null($accountIdentification)) { + throw new \InvalidArgumentException('non-nullable accountIdentification cannot be null'); + } + $this->container['accountIdentification'] = $accountIdentification; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/BankAccountV3AccountIdentification.php b/src/Adyen/Model/TransferWebhooks/BankAccountV3AccountIdentification.php new file mode 100644 index 000000000..11a06a5e2 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/BankAccountV3AccountIdentification.php @@ -0,0 +1,901 @@ + + */ +class BankAccountV3AccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BankAccountV3_accountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'bsbCode' => 'string', + 'type' => 'string', + 'bankCode' => 'string', + 'branchNumber' => 'string', + 'accountType' => 'string', + 'institutionNumber' => 'string', + 'transitNumber' => 'string', + 'iban' => 'string', + 'accountSuffix' => 'string', + 'additionalBankIdentification' => '\Adyen\Model\TransferWebhooks\AdditionalBankIdentification', + 'bic' => 'string', + 'clearingNumber' => 'string', + 'sortCode' => 'string', + 'routingNumber' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'bsbCode' => null, + 'type' => null, + 'bankCode' => null, + 'branchNumber' => null, + 'accountType' => null, + 'institutionNumber' => null, + 'transitNumber' => null, + 'iban' => null, + 'accountSuffix' => null, + 'additionalBankIdentification' => null, + 'bic' => null, + 'clearingNumber' => null, + 'sortCode' => null, + 'routingNumber' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'bsbCode' => false, + 'type' => false, + 'bankCode' => false, + 'branchNumber' => false, + 'accountType' => false, + 'institutionNumber' => false, + 'transitNumber' => false, + 'iban' => false, + 'accountSuffix' => false, + 'additionalBankIdentification' => false, + 'bic' => false, + 'clearingNumber' => false, + 'sortCode' => false, + 'routingNumber' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'accountNumber' => 'accountNumber', + 'bsbCode' => 'bsbCode', + 'type' => 'type', + 'bankCode' => 'bankCode', + 'branchNumber' => 'branchNumber', + 'accountType' => 'accountType', + 'institutionNumber' => 'institutionNumber', + 'transitNumber' => 'transitNumber', + 'iban' => 'iban', + 'accountSuffix' => 'accountSuffix', + 'additionalBankIdentification' => 'additionalBankIdentification', + 'bic' => 'bic', + 'clearingNumber' => 'clearingNumber', + 'sortCode' => 'sortCode', + 'routingNumber' => 'routingNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'bsbCode' => 'setBsbCode', + 'type' => 'setType', + 'bankCode' => 'setBankCode', + 'branchNumber' => 'setBranchNumber', + 'accountType' => 'setAccountType', + 'institutionNumber' => 'setInstitutionNumber', + 'transitNumber' => 'setTransitNumber', + 'iban' => 'setIban', + 'accountSuffix' => 'setAccountSuffix', + 'additionalBankIdentification' => 'setAdditionalBankIdentification', + 'bic' => 'setBic', + 'clearingNumber' => 'setClearingNumber', + 'sortCode' => 'setSortCode', + 'routingNumber' => 'setRoutingNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'bsbCode' => 'getBsbCode', + 'type' => 'getType', + 'bankCode' => 'getBankCode', + 'branchNumber' => 'getBranchNumber', + 'accountType' => 'getAccountType', + 'institutionNumber' => 'getInstitutionNumber', + 'transitNumber' => 'getTransitNumber', + 'iban' => 'getIban', + 'accountSuffix' => 'getAccountSuffix', + 'additionalBankIdentification' => 'getAdditionalBankIdentification', + 'bic' => 'getBic', + 'clearingNumber' => 'getClearingNumber', + 'sortCode' => 'getSortCode', + 'routingNumber' => 'getRoutingNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('bsbCode', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'usLocal'); + $this->setIfExists('bankCode', $data ?? [], null); + $this->setIfExists('branchNumber', $data ?? [], null); + $this->setIfExists('accountType', $data ?? [], 'checking'); + $this->setIfExists('institutionNumber', $data ?? [], null); + $this->setIfExists('transitNumber', $data ?? [], null); + $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('accountSuffix', $data ?? [], null); + $this->setIfExists('additionalBankIdentification', $data ?? [], null); + $this->setIfExists('bic', $data ?? [], null); + $this->setIfExists('clearingNumber', $data ?? [], null); + $this->setIfExists('sortCode', $data ?? [], null); + $this->setIfExists('routingNumber', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['bsbCode'] === null) { + $invalidProperties[] = "'bsbCode' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + + if ($this->container['bankCode'] === null) { + $invalidProperties[] = "'bankCode' can't be null"; + } + if ($this->container['branchNumber'] === null) { + $invalidProperties[] = "'branchNumber' can't be null"; + } + + if ($this->container['institutionNumber'] === null) { + $invalidProperties[] = "'institutionNumber' can't be null"; + } + if ($this->container['transitNumber'] === null) { + $invalidProperties[] = "'transitNumber' can't be null"; + } + if ($this->container['iban'] === null) { + $invalidProperties[] = "'iban' can't be null"; + } + if ($this->container['accountSuffix'] === null) { + $invalidProperties[] = "'accountSuffix' can't be null"; + } + if ($this->container['bic'] === null) { + $invalidProperties[] = "'bic' can't be null"; + } + if ($this->container['clearingNumber'] === null) { + $invalidProperties[] = "'clearingNumber' can't be null"; + } + if ($this->container['sortCode'] === null) { + $invalidProperties[] = "'sortCode' can't be null"; + } + if ($this->container['routingNumber'] === null) { + $invalidProperties[] = "'routingNumber' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets bsbCode + * + * @return string + */ + public function getBsbCode() + { + return $this->container['bsbCode']; + } + + /** + * Sets bsbCode + * + * @param string $bsbCode The 6-digit [Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or whitespace. + * + * @return self + */ + public function setBsbCode($bsbCode) + { + if (is_null($bsbCode)) { + throw new \InvalidArgumentException('non-nullable bsbCode cannot be null'); + } + $this->container['bsbCode'] = $bsbCode; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **usLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets bankCode + * + * @return string + */ + public function getBankCode() + { + return $this->container['bankCode']; + } + + /** + * Sets bankCode + * + * @param string $bankCode The 6-digit bank code including the 2-digit bank code and 4-digit branch code, without separators or whitespace. + * + * @return self + */ + public function setBankCode($bankCode) + { + if (is_null($bankCode)) { + throw new \InvalidArgumentException('non-nullable bankCode cannot be null'); + } + $this->container['bankCode'] = $bankCode; + + return $this; + } + + /** + * Gets branchNumber + * + * @return string + */ + public function getBranchNumber() + { + return $this->container['branchNumber']; + } + + /** + * Sets branchNumber + * + * @param string $branchNumber The bank account branch number (without separators or whitespace). + * + * @return self + */ + public function setBranchNumber($branchNumber) + { + if (is_null($branchNumber)) { + throw new \InvalidArgumentException('non-nullable branchNumber cannot be null'); + } + $this->container['branchNumber'] = $branchNumber; + + return $this; + } + + /** + * Gets accountType + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['accountType']; + } + + /** + * Sets accountType + * + * @param string|null $accountType The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * + * @return self + */ + public function setAccountType($accountType) + { + if (is_null($accountType)) { + throw new \InvalidArgumentException('non-nullable accountType cannot be null'); + } + $this->container['accountType'] = $accountType; + + return $this; + } + + /** + * Gets institutionNumber + * + * @return string + */ + public function getInstitutionNumber() + { + return $this->container['institutionNumber']; + } + + /** + * Sets institutionNumber + * + * @param string $institutionNumber The 3-digit institution number, without separators or whitespace. + * + * @return self + */ + public function setInstitutionNumber($institutionNumber) + { + if (is_null($institutionNumber)) { + throw new \InvalidArgumentException('non-nullable institutionNumber cannot be null'); + } + $this->container['institutionNumber'] = $institutionNumber; + + return $this; + } + + /** + * Gets transitNumber + * + * @return string + */ + public function getTransitNumber() + { + return $this->container['transitNumber']; + } + + /** + * Sets transitNumber + * + * @param string $transitNumber The 5-digit transit number, without separators or whitespace. + * + * @return self + */ + public function setTransitNumber($transitNumber) + { + if (is_null($transitNumber)) { + throw new \InvalidArgumentException('non-nullable transitNumber cannot be null'); + } + $this->container['transitNumber'] = $transitNumber; + + return $this; + } + + /** + * Gets iban + * + * @return string + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * + * @return self + */ + public function setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets accountSuffix + * + * @return string + */ + public function getAccountSuffix() + { + return $this->container['accountSuffix']; + } + + /** + * Sets accountSuffix + * + * @param string $accountSuffix The 2- to 3-digit account suffix, without separators or whitespace. + * + * @return self + */ + public function setAccountSuffix($accountSuffix) + { + if (is_null($accountSuffix)) { + throw new \InvalidArgumentException('non-nullable accountSuffix cannot be null'); + } + $this->container['accountSuffix'] = $accountSuffix; + + return $this; + } + + /** + * Gets additionalBankIdentification + * + * @return \Adyen\Model\TransferWebhooks\AdditionalBankIdentification|null + */ + public function getAdditionalBankIdentification() + { + return $this->container['additionalBankIdentification']; + } + + /** + * Sets additionalBankIdentification + * + * @param \Adyen\Model\TransferWebhooks\AdditionalBankIdentification|null $additionalBankIdentification additionalBankIdentification + * + * @return self + */ + public function setAdditionalBankIdentification($additionalBankIdentification) + { + if (is_null($additionalBankIdentification)) { + throw new \InvalidArgumentException('non-nullable additionalBankIdentification cannot be null'); + } + $this->container['additionalBankIdentification'] = $additionalBankIdentification; + + return $this; + } + + /** + * Gets bic + * + * @return string + */ + public function getBic() + { + return $this->container['bic']; + } + + /** + * Sets bic + * + * @param string $bic The bank's 8- or 11-character BIC or SWIFT code. + * + * @return self + */ + public function setBic($bic) + { + if (is_null($bic)) { + throw new \InvalidArgumentException('non-nullable bic cannot be null'); + } + $this->container['bic'] = $bic; + + return $this; + } + + /** + * Gets clearingNumber + * + * @return string + */ + public function getClearingNumber() + { + return $this->container['clearingNumber']; + } + + /** + * Sets clearingNumber + * + * @param string $clearingNumber The 4- to 5-digit clearing number ([Clearingnummer](https://sv.wikipedia.org/wiki/Clearingnummer)), without separators or whitespace. + * + * @return self + */ + public function setClearingNumber($clearingNumber) + { + if (is_null($clearingNumber)) { + throw new \InvalidArgumentException('non-nullable clearingNumber cannot be null'); + } + $this->container['clearingNumber'] = $clearingNumber; + + return $this; + } + + /** + * Gets sortCode + * + * @return string + */ + public function getSortCode() + { + return $this->container['sortCode']; + } + + /** + * Sets sortCode + * + * @param string $sortCode The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. + * + * @return self + */ + public function setSortCode($sortCode) + { + if (is_null($sortCode)) { + throw new \InvalidArgumentException('non-nullable sortCode cannot be null'); + } + $this->container['sortCode'] = $sortCode; + + return $this; + } + + /** + * Gets routingNumber + * + * @return string + */ + public function getRoutingNumber() + { + return $this->container['routingNumber']; + } + + /** + * Sets routingNumber + * + * @param string $routingNumber The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. + * + * @return self + */ + public function setRoutingNumber($routingNumber) + { + if (is_null($routingNumber)) { + throw new \InvalidArgumentException('non-nullable routingNumber cannot be null'); + } + $this->container['routingNumber'] = $routingNumber; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/CALocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/CALocalAccountIdentification.php new file mode 100644 index 000000000..e6b3a25db --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/CALocalAccountIdentification.php @@ -0,0 +1,596 @@ + + */ +class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CALocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'accountType' => 'string', + 'institutionNumber' => 'string', + 'transitNumber' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'accountType' => null, + 'institutionNumber' => null, + 'transitNumber' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'accountType' => false, + 'institutionNumber' => false, + 'transitNumber' => 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 = [ + 'accountNumber' => 'accountNumber', + 'accountType' => 'accountType', + 'institutionNumber' => 'institutionNumber', + 'transitNumber' => 'transitNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'accountType' => 'setAccountType', + 'institutionNumber' => 'setInstitutionNumber', + 'transitNumber' => 'setTransitNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'accountType' => 'getAccountType', + 'institutionNumber' => 'getInstitutionNumber', + 'transitNumber' => 'getTransitNumber', + '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 ACCOUNT_TYPE_CHECKING = 'checking'; + public const ACCOUNT_TYPE_SAVINGS = 'savings'; + public const TYPE_CA_LOCAL = 'caLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAccountTypeAllowableValues() + { + return [ + self::ACCOUNT_TYPE_CHECKING, + self::ACCOUNT_TYPE_SAVINGS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CA_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('accountType', $data ?? [], 'checking'); + $this->setIfExists('institutionNumber', $data ?? [], null); + $this->setIfExists('transitNumber', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'caLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + $allowedValues = $this->getAccountTypeAllowableValues(); + if (!is_null($this->container['accountType']) && !in_array($this->container['accountType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'accountType', must be one of '%s'", + $this->container['accountType'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['institutionNumber'] === null) { + $invalidProperties[] = "'institutionNumber' can't be null"; + } + if ($this->container['transitNumber'] === null) { + $invalidProperties[] = "'transitNumber' can't be null"; + } + if ($this->container['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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The 5- to 12-digit bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets accountType + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['accountType']; + } + + /** + * Sets accountType + * + * @param string|null $accountType The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * + * @return self + */ + public function setAccountType($accountType) + { + if (is_null($accountType)) { + throw new \InvalidArgumentException('non-nullable accountType cannot be null'); + } + $allowedValues = $this->getAccountTypeAllowableValues(); + if (!in_array($accountType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'accountType', must be one of '%s'", + $accountType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['accountType'] = $accountType; + + return $this; + } + + /** + * Gets institutionNumber + * + * @return string + */ + public function getInstitutionNumber() + { + return $this->container['institutionNumber']; + } + + /** + * Sets institutionNumber + * + * @param string $institutionNumber The 3-digit institution number, without separators or whitespace. + * + * @return self + */ + public function setInstitutionNumber($institutionNumber) + { + if (is_null($institutionNumber)) { + throw new \InvalidArgumentException('non-nullable institutionNumber cannot be null'); + } + $this->container['institutionNumber'] = $institutionNumber; + + return $this; + } + + /** + * Gets transitNumber + * + * @return string + */ + public function getTransitNumber() + { + return $this->container['transitNumber']; + } + + /** + * Sets transitNumber + * + * @param string $transitNumber The 5-digit transit number, without separators or whitespace. + * + * @return self + */ + public function setTransitNumber($transitNumber) + { + if (is_null($transitNumber)) { + throw new \InvalidArgumentException('non-nullable transitNumber cannot be null'); + } + $this->container['transitNumber'] = $transitNumber; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **caLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/CZLocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/CZLocalAccountIdentification.php new file mode 100644 index 000000000..ff1cf2e06 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/CZLocalAccountIdentification.php @@ -0,0 +1,492 @@ + + */ +class CZLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CZLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'bankCode' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'bankCode' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'bankCode' => 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 = [ + 'accountNumber' => 'accountNumber', + 'bankCode' => 'bankCode', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'bankCode' => 'setBankCode', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'bankCode' => 'getBankCode', + '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_CZ_LOCAL = 'czLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CZ_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('bankCode', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'czLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['bankCode'] === null) { + $invalidProperties[] = "'bankCode' 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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The 2- to 16-digit bank account number (Číslo účtu) in the following format: - The optional prefix (předčíslí). - The required second part (základní část) which must be at least two non-zero digits. Examples: - **19-123457** (with prefix) - **123457** (without prefix) - **000019-0000123457** (with prefix, normalized) - **000000-0000123457** (without prefix, normalized) + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets bankCode + * + * @return string + */ + public function getBankCode() + { + return $this->container['bankCode']; + } + + /** + * Sets bankCode + * + * @param string $bankCode The 4-digit bank code (Kód banky), without separators or whitespace. + * + * @return self + */ + public function setBankCode($bankCode) + { + if (is_null($bankCode)) { + throw new \InvalidArgumentException('non-nullable bankCode cannot be null'); + } + $this->container['bankCode'] = $bankCode; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **czLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/CounterpartyV3.php b/src/Adyen/Model/TransferWebhooks/CounterpartyV3.php new file mode 100644 index 000000000..45f67f6b6 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/CounterpartyV3.php @@ -0,0 +1,486 @@ + + */ +class CounterpartyV3 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CounterpartyV3'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balanceAccountId' => 'string', + 'bankAccount' => '\Adyen\Model\TransferWebhooks\BankAccountV3', + 'merchant' => '\Adyen\Model\TransferWebhooks\MerchantData', + '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, + 'bankAccount' => null, + 'merchant' => null, + 'transferInstrumentId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balanceAccountId' => false, + 'bankAccount' => false, + 'merchant' => 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', + 'bankAccount' => 'bankAccount', + 'merchant' => 'merchant', + 'transferInstrumentId' => 'transferInstrumentId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balanceAccountId' => 'setBalanceAccountId', + 'bankAccount' => 'setBankAccount', + 'merchant' => 'setMerchant', + 'transferInstrumentId' => 'setTransferInstrumentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balanceAccountId' => 'getBalanceAccountId', + 'bankAccount' => 'getBankAccount', + 'merchant' => 'getMerchant', + '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('bankAccount', $data ?? [], null); + $this->setIfExists('merchant', $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 Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). + * + * @return self + */ + public function setBalanceAccountId($balanceAccountId) + { + if (is_null($balanceAccountId)) { + throw new \InvalidArgumentException('non-nullable balanceAccountId cannot be null'); + } + $this->container['balanceAccountId'] = $balanceAccountId; + + return $this; + } + + /** + * Gets bankAccount + * + * @return \Adyen\Model\TransferWebhooks\BankAccountV3|null + */ + public function getBankAccount() + { + return $this->container['bankAccount']; + } + + /** + * Sets bankAccount + * + * @param \Adyen\Model\TransferWebhooks\BankAccountV3|null $bankAccount bankAccount + * + * @return self + */ + public function setBankAccount($bankAccount) + { + if (is_null($bankAccount)) { + throw new \InvalidArgumentException('non-nullable bankAccount cannot be null'); + } + $this->container['bankAccount'] = $bankAccount; + + return $this; + } + + /** + * Gets merchant + * + * @return \Adyen\Model\TransferWebhooks\MerchantData|null + */ + public function getMerchant() + { + return $this->container['merchant']; + } + + /** + * Sets merchant + * + * @param \Adyen\Model\TransferWebhooks\MerchantData|null $merchant merchant + * + * @return self + */ + public function setMerchant($merchant) + { + if (is_null($merchant)) { + throw new \InvalidArgumentException('non-nullable merchant cannot be null'); + } + $this->container['merchant'] = $merchant; + + return $this; + } + + /** + * Gets transferInstrumentId + * + * @return string|null + */ + public function getTransferInstrumentId() + { + return $this->container['transferInstrumentId']; + } + + /** + * Sets transferInstrumentId + * + * @param string|null $transferInstrumentId Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * + * @return self + */ + public function setTransferInstrumentId($transferInstrumentId) + { + if (is_null($transferInstrumentId)) { + throw new \InvalidArgumentException('non-nullable transferInstrumentId cannot be null'); + } + $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); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/DKLocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/DKLocalAccountIdentification.php new file mode 100644 index 000000000..576ae2550 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/DKLocalAccountIdentification.php @@ -0,0 +1,492 @@ + + */ +class DKLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DKLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'bankCode' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'bankCode' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'bankCode' => 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 = [ + 'accountNumber' => 'accountNumber', + 'bankCode' => 'bankCode', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'bankCode' => 'setBankCode', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'bankCode' => 'getBankCode', + '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_DK_LOCAL = 'dkLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DK_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('bankCode', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'dkLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['bankCode'] === null) { + $invalidProperties[] = "'bankCode' 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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The 4-10 digits bank account number (Kontonummer) (without separators or whitespace). + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets bankCode + * + * @return string + */ + public function getBankCode() + { + return $this->container['bankCode']; + } + + /** + * Sets bankCode + * + * @param string $bankCode The 4-digit bank code (Registreringsnummer) (without separators or whitespace). + * + * @return self + */ + public function setBankCode($bankCode) + { + if (is_null($bankCode)) { + throw new \InvalidArgumentException('non-nullable bankCode cannot be null'); + } + $this->container['bankCode'] = $bankCode; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **dkLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/HULocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/HULocalAccountIdentification.php new file mode 100644 index 000000000..64b2b5527 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/HULocalAccountIdentification.php @@ -0,0 +1,455 @@ + + */ +class HULocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'HULocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => 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 = [ + 'accountNumber' => 'accountNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + '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_HU_LOCAL = 'huLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_HU_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'huLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The 24-digit bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **huLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/IbanAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/IbanAccountIdentification.php new file mode 100644 index 000000000..4bc3931ce --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/IbanAccountIdentification.php @@ -0,0 +1,455 @@ + + */ +class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IbanAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'iban' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'iban' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'iban' => 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 = [ + 'iban' => 'iban', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'iban' => 'setIban', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'iban' => 'getIban', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_IBAN = 'iban'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_IBAN, + ]; + } + /** + * 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('iban', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'iban'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['iban'] === null) { + $invalidProperties[] = "'iban' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $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 iban + * + * @return string + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * + * @return self + */ + public function setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **iban** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/MerchantData.php b/src/Adyen/Model/TransferWebhooks/MerchantData.php new file mode 100644 index 000000000..a856431dc --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/MerchantData.php @@ -0,0 +1,486 @@ + + */ +class MerchantData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MerchantData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'mcc' => 'string', + 'merchantId' => 'string', + 'nameLocation' => '\Adyen\Model\TransferWebhooks\NameLocation', + 'postalCode' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'mcc' => null, + 'merchantId' => null, + 'nameLocation' => null, + 'postalCode' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'mcc' => false, + 'merchantId' => false, + 'nameLocation' => false, + 'postalCode' => 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 = [ + 'mcc' => 'mcc', + 'merchantId' => 'merchantId', + 'nameLocation' => 'nameLocation', + 'postalCode' => 'postalCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'mcc' => 'setMcc', + 'merchantId' => 'setMerchantId', + 'nameLocation' => 'setNameLocation', + 'postalCode' => 'setPostalCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'mcc' => 'getMcc', + 'merchantId' => 'getMerchantId', + 'nameLocation' => 'getNameLocation', + 'postalCode' => 'getPostalCode' + ]; + + /** + * 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('mcc', $data ?? [], null); + $this->setIfExists('merchantId', $data ?? [], null); + $this->setIfExists('nameLocation', $data ?? [], null); + $this->setIfExists('postalCode', $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 mcc + * + * @return string|null + */ + public function getMcc() + { + return $this->container['mcc']; + } + + /** + * Sets mcc + * + * @param string|null $mcc The merchant category code. + * + * @return self + */ + public function setMcc($mcc) + { + if (is_null($mcc)) { + throw new \InvalidArgumentException('non-nullable mcc cannot be null'); + } + $this->container['mcc'] = $mcc; + + return $this; + } + + /** + * Gets merchantId + * + * @return string|null + */ + public function getMerchantId() + { + return $this->container['merchantId']; + } + + /** + * Sets merchantId + * + * @param string|null $merchantId The merchant identifier. + * + * @return self + */ + public function setMerchantId($merchantId) + { + if (is_null($merchantId)) { + throw new \InvalidArgumentException('non-nullable merchantId cannot be null'); + } + $this->container['merchantId'] = $merchantId; + + return $this; + } + + /** + * Gets nameLocation + * + * @return \Adyen\Model\TransferWebhooks\NameLocation|null + */ + public function getNameLocation() + { + return $this->container['nameLocation']; + } + + /** + * Sets nameLocation + * + * @param \Adyen\Model\TransferWebhooks\NameLocation|null $nameLocation nameLocation + * + * @return self + */ + public function setNameLocation($nameLocation) + { + if (is_null($nameLocation)) { + throw new \InvalidArgumentException('non-nullable nameLocation cannot be null'); + } + $this->container['nameLocation'] = $nameLocation; + + return $this; + } + + /** + * Gets postalCode + * + * @return string|null + */ + public function getPostalCode() + { + return $this->container['postalCode']; + } + + /** + * Sets postalCode + * + * @param string|null $postalCode The merchant postal code. + * + * @return self + */ + public function setPostalCode($postalCode) + { + if (is_null($postalCode)) { + throw new \InvalidArgumentException('non-nullable postalCode cannot be null'); + } + $this->container['postalCode'] = $postalCode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/ModelInterface.php b/src/Adyen/Model/TransferWebhooks/ModelInterface.php new file mode 100644 index 000000000..809729f87 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/ModelInterface.php @@ -0,0 +1,92 @@ + + */ +class NOLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NOLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => 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 = [ + 'accountNumber' => 'accountNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + '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_NO_LOCAL = 'noLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_NO_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'noLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The 11-digit bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **noLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/NZLocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/NZLocalAccountIdentification.php new file mode 100644 index 000000000..6e5793946 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/NZLocalAccountIdentification.php @@ -0,0 +1,529 @@ + + */ +class NZLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NZLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'accountSuffix' => 'string', + 'bankCode' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'accountSuffix' => null, + 'bankCode' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'accountSuffix' => false, + 'bankCode' => 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 = [ + 'accountNumber' => 'accountNumber', + 'accountSuffix' => 'accountSuffix', + 'bankCode' => 'bankCode', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'accountSuffix' => 'setAccountSuffix', + 'bankCode' => 'setBankCode', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'accountSuffix' => 'getAccountSuffix', + 'bankCode' => 'getBankCode', + '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_NZ_LOCAL = 'nzLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_NZ_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('accountSuffix', $data ?? [], null); + $this->setIfExists('bankCode', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'nzLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['accountSuffix'] === null) { + $invalidProperties[] = "'accountSuffix' can't be null"; + } + if ($this->container['bankCode'] === null) { + $invalidProperties[] = "'bankCode' 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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The 7-digit bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets accountSuffix + * + * @return string + */ + public function getAccountSuffix() + { + return $this->container['accountSuffix']; + } + + /** + * Sets accountSuffix + * + * @param string $accountSuffix The 2- to 3-digit account suffix, without separators or whitespace. + * + * @return self + */ + public function setAccountSuffix($accountSuffix) + { + if (is_null($accountSuffix)) { + throw new \InvalidArgumentException('non-nullable accountSuffix cannot be null'); + } + $this->container['accountSuffix'] = $accountSuffix; + + return $this; + } + + /** + * Gets bankCode + * + * @return string + */ + public function getBankCode() + { + return $this->container['bankCode']; + } + + /** + * Sets bankCode + * + * @param string $bankCode The 6-digit bank code including the 2-digit bank code and 4-digit branch code, without separators or whitespace. + * + * @return self + */ + public function setBankCode($bankCode) + { + if (is_null($bankCode)) { + throw new \InvalidArgumentException('non-nullable bankCode cannot be null'); + } + $this->container['bankCode'] = $bankCode; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **nzLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/NameLocation.php b/src/Adyen/Model/TransferWebhooks/NameLocation.php new file mode 100644 index 000000000..f05006eb6 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/NameLocation.php @@ -0,0 +1,554 @@ + + */ +class NameLocation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NameLocation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'country' => 'string', + 'countryOfOrigin' => 'string', + 'name' => 'string', + 'rawData' => 'string', + 'state' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'city' => null, + 'country' => null, + 'countryOfOrigin' => null, + 'name' => null, + 'rawData' => null, + 'state' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'city' => false, + 'country' => false, + 'countryOfOrigin' => false, + 'name' => false, + 'rawData' => false, + 'state' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'country' => 'country', + 'countryOfOrigin' => 'countryOfOrigin', + 'name' => 'name', + 'rawData' => 'rawData', + 'state' => 'state' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'countryOfOrigin' => 'setCountryOfOrigin', + 'name' => 'setName', + 'rawData' => 'setRawData', + 'state' => 'setState' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'countryOfOrigin' => 'getCountryOfOrigin', + 'name' => 'getName', + 'rawData' => 'getRawData', + 'state' => 'getState' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('countryOfOrigin', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('rawData', $data ?? [], null); + $this->setIfExists('state', $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 city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city The city where the merchant is located. + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country The country where the merchant is located in [three-letter country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets countryOfOrigin + * + * @return string|null + */ + public function getCountryOfOrigin() + { + return $this->container['countryOfOrigin']; + } + + /** + * Sets countryOfOrigin + * + * @param string|null $countryOfOrigin The home country in [three-digit country code](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) format, used for government-controlled merchants such as embassies. + * + * @return self + */ + public function setCountryOfOrigin($countryOfOrigin) + { + if (is_null($countryOfOrigin)) { + throw new \InvalidArgumentException('non-nullable countryOfOrigin cannot be null'); + } + $this->container['countryOfOrigin'] = $countryOfOrigin; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the merchant's shop or service. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets rawData + * + * @return string|null + */ + public function getRawData() + { + return $this->container['rawData']; + } + + /** + * Sets rawData + * + * @param string|null $rawData The raw data. + * + * @return self + */ + public function setRawData($rawData) + { + if (is_null($rawData)) { + throw new \InvalidArgumentException('non-nullable rawData cannot be null'); + } + $this->container['rawData'] = $rawData; + + return $this; + } + + /** + * Gets state + * + * @return string|null + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param string|null $state The state where the merchant is located. + * + * @return self + */ + public function setState($state) + { + if (is_null($state)) { + throw new \InvalidArgumentException('non-nullable state cannot be null'); + } + $this->container['state'] = $state; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/NumberAndBicAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/NumberAndBicAccountIdentification.php new file mode 100644 index 000000000..b65d15ad0 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/NumberAndBicAccountIdentification.php @@ -0,0 +1,526 @@ + + */ +class NumberAndBicAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NumberAndBicAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'additionalBankIdentification' => '\Adyen\Model\TransferWebhooks\AdditionalBankIdentification', + 'bic' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'additionalBankIdentification' => null, + 'bic' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'additionalBankIdentification' => false, + 'bic' => 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 = [ + 'accountNumber' => 'accountNumber', + 'additionalBankIdentification' => 'additionalBankIdentification', + 'bic' => 'bic', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'additionalBankIdentification' => 'setAdditionalBankIdentification', + 'bic' => 'setBic', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'additionalBankIdentification' => 'getAdditionalBankIdentification', + 'bic' => 'getBic', + '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_NUMBER_AND_BIC = 'numberAndBic'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_NUMBER_AND_BIC, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('additionalBankIdentification', $data ?? [], null); + $this->setIfExists('bic', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'numberAndBic'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['bic'] === null) { + $invalidProperties[] = "'bic' 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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The bank account number, without separators or whitespace. The length and format depends on the bank or country. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets additionalBankIdentification + * + * @return \Adyen\Model\TransferWebhooks\AdditionalBankIdentification|null + */ + public function getAdditionalBankIdentification() + { + return $this->container['additionalBankIdentification']; + } + + /** + * Sets additionalBankIdentification + * + * @param \Adyen\Model\TransferWebhooks\AdditionalBankIdentification|null $additionalBankIdentification additionalBankIdentification + * + * @return self + */ + public function setAdditionalBankIdentification($additionalBankIdentification) + { + if (is_null($additionalBankIdentification)) { + throw new \InvalidArgumentException('non-nullable additionalBankIdentification cannot be null'); + } + $this->container['additionalBankIdentification'] = $additionalBankIdentification; + + return $this; + } + + /** + * Gets bic + * + * @return string + */ + public function getBic() + { + return $this->container['bic']; + } + + /** + * Sets bic + * + * @param string $bic The bank's 8- or 11-character BIC or SWIFT code. + * + * @return self + */ + public function setBic($bic) + { + if (is_null($bic)) { + throw new \InvalidArgumentException('non-nullable bic cannot be null'); + } + $this->container['bic'] = $bic; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **numberAndBic** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/ObjectSerializer.php b/src/Adyen/Model/TransferWebhooks/ObjectSerializer.php new file mode 100644 index 000000000..a12d89dd8 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/ObjectSerializer.php @@ -0,0 +1,317 @@ +format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach ($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) { + return $timestamp; + } + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if (is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Adyen\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/src/Adyen/Model/TransferWebhooks/PLLocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/PLLocalAccountIdentification.php new file mode 100644 index 000000000..0b5ce2096 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/PLLocalAccountIdentification.php @@ -0,0 +1,455 @@ + + */ +class PLLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PLLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => 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 = [ + 'accountNumber' => 'accountNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + '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_PL_LOCAL = 'plLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_PL_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'plLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The 26-digit bank account number ([Numer rachunku](https://pl.wikipedia.org/wiki/Numer_Rachunku_Bankowego)), without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **plLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/PartyIdentification.php b/src/Adyen/Model/TransferWebhooks/PartyIdentification.php new file mode 100644 index 000000000..8ccc88c80 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/PartyIdentification.php @@ -0,0 +1,626 @@ + + */ +class PartyIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PartyIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address' => '\Adyen\Model\TransferWebhooks\Address', + 'dateOfBirth' => '\DateTime', + 'firstName' => 'string', + 'fullName' => 'string', + 'lastName' => 'string', + 'reference' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address' => null, + 'dateOfBirth' => 'date', + 'firstName' => null, + 'fullName' => null, + 'lastName' => null, + 'reference' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'address' => false, + 'dateOfBirth' => false, + 'firstName' => false, + 'fullName' => false, + 'lastName' => false, + 'reference' => 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 = [ + 'address' => 'address', + 'dateOfBirth' => 'dateOfBirth', + 'firstName' => 'firstName', + 'fullName' => 'fullName', + 'lastName' => 'lastName', + 'reference' => 'reference', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'dateOfBirth' => 'setDateOfBirth', + 'firstName' => 'setFirstName', + 'fullName' => 'setFullName', + 'lastName' => 'setLastName', + 'reference' => 'setReference', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'dateOfBirth' => 'getDateOfBirth', + 'firstName' => 'getFirstName', + 'fullName' => 'getFullName', + 'lastName' => 'getLastName', + 'reference' => 'getReference', + '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_INDIVIDUAL = 'individual'; + public const TYPE_ORGANIZATION = 'organization'; + public const TYPE_UNKNOWN = 'unknown'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_INDIVIDUAL, + self::TYPE_ORGANIZATION, + self::TYPE_UNKNOWN, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('dateOfBirth', $data ?? [], null); + $this->setIfExists('firstName', $data ?? [], null); + $this->setIfExists('fullName', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'unknown'); + } + + /** + * 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['fullName'] === null) { + $invalidProperties[] = "'fullName' 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 address + * + * @return \Adyen\Model\TransferWebhooks\Address|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Adyen\Model\TransferWebhooks\Address|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets dateOfBirth + * + * @return \DateTime|null + */ + public function getDateOfBirth() + { + return $this->container['dateOfBirth']; + } + + /** + * Sets dateOfBirth + * + * @param \DateTime|null $dateOfBirth The date of birth of the individual in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. For example, **YYYY-MM-DD**. Should not be before January 1, 1900. Allowed only when `type` is **individual**. + * + * @return self + */ + public function setDateOfBirth($dateOfBirth) + { + if (is_null($dateOfBirth)) { + throw new \InvalidArgumentException('non-nullable dateOfBirth cannot be null'); + } + $this->container['dateOfBirth'] = $dateOfBirth; + + return $this; + } + + /** + * Gets firstName + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string|null $firstName First name of the individual. Allowed only when `type` is **individual**. + * + * @return self + */ + public function setFirstName($firstName) + { + if (is_null($firstName)) { + throw new \InvalidArgumentException('non-nullable firstName cannot be null'); + } + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets fullName + * + * @return string + */ + public function getFullName() + { + return $this->container['fullName']; + } + + /** + * Sets fullName + * + * @param string $fullName The name of the entity. + * + * @return self + */ + public function setFullName($fullName) + { + if (is_null($fullName)) { + throw new \InvalidArgumentException('non-nullable fullName cannot be null'); + } + $this->container['fullName'] = $fullName; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName() + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName Last name of the individual. Allowed only when `type` is **individual**. + * + * @return self + */ + public function setLastName($lastName) + { + if (is_null($lastName)) { + throw new \InvalidArgumentException('non-nullable lastName cannot be null'); + } + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference A unique reference to identify the party or counterparty involved in transfers. This identifier ensures consistency and uniqueness throughout all transactions initiated to and from the same party. For example, your client's unique wallet or payee ID. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of entity that owns the bank account. Possible values: **individual**, **organization**, or **unknown**. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/PaymentInstrument.php b/src/Adyen/Model/TransferWebhooks/PaymentInstrument.php new file mode 100644 index 000000000..6f5d3550c --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/PaymentInstrument.php @@ -0,0 +1,486 @@ + + */ +class PaymentInstrument implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentInstrument'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'id' => 'string', + 'reference' => 'string', + 'tokenType' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'id' => null, + 'reference' => null, + 'tokenType' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'id' => false, + 'reference' => false, + 'tokenType' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'reference' => 'reference', + 'tokenType' => 'tokenType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'reference' => 'setReference', + 'tokenType' => 'setTokenType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'reference' => 'getReference', + 'tokenType' => 'getTokenType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('tokenType', $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 description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the resource. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the resource. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The reference for the resource. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets tokenType + * + * @return string|null + */ + public function getTokenType() + { + return $this->container['tokenType']; + } + + /** + * Sets tokenType + * + * @param string|null $tokenType The type of wallet the network token is associated with. + * + * @return self + */ + public function setTokenType($tokenType) + { + if (is_null($tokenType)) { + throw new \InvalidArgumentException('non-nullable tokenType cannot be null'); + } + $this->container['tokenType'] = $tokenType; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/RelayedAuthorisationData.php b/src/Adyen/Model/TransferWebhooks/RelayedAuthorisationData.php new file mode 100644 index 000000000..bb7702d22 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/RelayedAuthorisationData.php @@ -0,0 +1,418 @@ + + */ +class RelayedAuthorisationData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RelayedAuthorisationData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'metadata' => 'array', + 'reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'metadata' => null, + 'reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'metadata' => false, + 'reference' => 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 = [ + 'metadata' => 'metadata', + 'reference' => 'reference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'metadata' => 'setMetadata', + 'reference' => 'setReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'metadata' => 'getMetadata', + 'reference' => 'getReference' + ]; + + /** + * 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('metadata', $data ?? [], null); + $this->setIfExists('reference', $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 metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Contains key-value pairs of your references and descriptions, for example, `customId`:`your-own-custom-field-12345`. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the relayed authorisation data. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/Resource.php b/src/Adyen/Model/TransferWebhooks/Resource.php new file mode 100644 index 000000000..0a381775b --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/Resource.php @@ -0,0 +1,452 @@ + + */ +class Resource implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Resource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balancePlatform' => 'string', + 'creationDate' => '\DateTime', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balancePlatform' => null, + 'creationDate' => 'date-time', + 'id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balancePlatform' => false, + 'creationDate' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balancePlatform' => 'balancePlatform', + 'creationDate' => 'creationDate', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balancePlatform' => 'setBalancePlatform', + 'creationDate' => 'setCreationDate', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balancePlatform' => 'getBalancePlatform', + 'creationDate' => 'getCreationDate', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('balancePlatform', $data ?? [], null); + $this->setIfExists('creationDate', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 balancePlatform + * + * @return string|null + */ + public function getBalancePlatform() + { + return $this->container['balancePlatform']; + } + + /** + * Sets balancePlatform + * + * @param string|null $balancePlatform The unique identifier of the balance platform. + * + * @return self + */ + public function setBalancePlatform($balancePlatform) + { + if (is_null($balancePlatform)) { + throw new \InvalidArgumentException('non-nullable balancePlatform cannot be null'); + } + $this->container['balancePlatform'] = $balancePlatform; + + return $this; + } + + /** + * Gets creationDate + * + * @return \DateTime|null + */ + public function getCreationDate() + { + return $this->container['creationDate']; + } + + /** + * Sets creationDate + * + * @param \DateTime|null $creationDate The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + * + * @return self + */ + public function setCreationDate($creationDate) + { + if (is_null($creationDate)) { + throw new \InvalidArgumentException('non-nullable creationDate cannot be null'); + } + $this->container['creationDate'] = $creationDate; + + 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) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/ResourceReference.php b/src/Adyen/Model/TransferWebhooks/ResourceReference.php new file mode 100644 index 000000000..9e95b807a --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/ResourceReference.php @@ -0,0 +1,452 @@ + + */ +class ResourceReference implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResourceReference'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'id' => 'string', + 'reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'id' => null, + 'reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'id' => false, + 'reference' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'reference' => 'reference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'reference' => 'setReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'reference' => 'getReference' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('reference', $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 description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the resource. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the resource. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The reference for the resource. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/SELocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/SELocalAccountIdentification.php new file mode 100644 index 000000000..c2d06a902 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/SELocalAccountIdentification.php @@ -0,0 +1,492 @@ + + */ +class SELocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SELocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'clearingNumber' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'clearingNumber' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'clearingNumber' => 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 = [ + 'accountNumber' => 'accountNumber', + 'clearingNumber' => 'clearingNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'clearingNumber' => 'setClearingNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'clearingNumber' => 'getClearingNumber', + '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_SE_LOCAL = 'seLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_SE_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('clearingNumber', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'seLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['clearingNumber'] === null) { + $invalidProperties[] = "'clearingNumber' 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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The 7- to 10-digit bank account number ([Bankkontonummer](https://sv.wikipedia.org/wiki/Bankkonto)), without the clearing number, separators, or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets clearingNumber + * + * @return string + */ + public function getClearingNumber() + { + return $this->container['clearingNumber']; + } + + /** + * Sets clearingNumber + * + * @param string $clearingNumber The 4- to 5-digit clearing number ([Clearingnummer](https://sv.wikipedia.org/wiki/Clearingnummer)), without separators or whitespace. + * + * @return self + */ + public function setClearingNumber($clearingNumber) + { + if (is_null($clearingNumber)) { + throw new \InvalidArgumentException('non-nullable clearingNumber cannot be null'); + } + $this->container['clearingNumber'] = $clearingNumber; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **seLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/SGLocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/SGLocalAccountIdentification.php new file mode 100644 index 000000000..3603991cb --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/SGLocalAccountIdentification.php @@ -0,0 +1,489 @@ + + */ +class SGLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SGLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'bic' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'bic' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'bic' => 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 = [ + 'accountNumber' => 'accountNumber', + 'bic' => 'bic', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'bic' => 'setBic', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'bic' => 'getBic', + '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_SG_LOCAL = 'sgLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_SG_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('bic', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'sgLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['bic'] === null) { + $invalidProperties[] = "'bic' 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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The 4- to 19-digit bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets bic + * + * @return string + */ + public function getBic() + { + return $this->container['bic']; + } + + /** + * Sets bic + * + * @param string $bic The bank's 8- or 11-character BIC or SWIFT code. + * + * @return self + */ + public function setBic($bic) + { + if (is_null($bic)) { + throw new \InvalidArgumentException('non-nullable bic cannot be null'); + } + $this->container['bic'] = $bic; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **sgLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/TransactionEventViolation.php b/src/Adyen/Model/TransferWebhooks/TransactionEventViolation.php new file mode 100644 index 000000000..bf2d4c65a --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/TransactionEventViolation.php @@ -0,0 +1,452 @@ + + */ +class TransactionEventViolation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransactionEventViolation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'reason' => 'string', + 'transactionRule' => '\Adyen\Model\TransferWebhooks\TransactionRuleReference', + 'transactionRuleSource' => '\Adyen\Model\TransferWebhooks\TransactionRuleSource' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'reason' => null, + 'transactionRule' => null, + 'transactionRuleSource' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'reason' => false, + 'transactionRule' => false, + 'transactionRuleSource' => 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 = [ + 'reason' => 'reason', + 'transactionRule' => 'transactionRule', + 'transactionRuleSource' => 'transactionRuleSource' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'reason' => 'setReason', + 'transactionRule' => 'setTransactionRule', + 'transactionRuleSource' => 'setTransactionRuleSource' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'reason' => 'getReason', + 'transactionRule' => 'getTransactionRule', + 'transactionRuleSource' => 'getTransactionRuleSource' + ]; + + /** + * 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('reason', $data ?? [], null); + $this->setIfExists('transactionRule', $data ?? [], null); + $this->setIfExists('transactionRuleSource', $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 reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason An explanation about why the transaction rule failed. + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets transactionRule + * + * @return \Adyen\Model\TransferWebhooks\TransactionRuleReference|null + */ + public function getTransactionRule() + { + return $this->container['transactionRule']; + } + + /** + * Sets transactionRule + * + * @param \Adyen\Model\TransferWebhooks\TransactionRuleReference|null $transactionRule transactionRule + * + * @return self + */ + public function setTransactionRule($transactionRule) + { + if (is_null($transactionRule)) { + throw new \InvalidArgumentException('non-nullable transactionRule cannot be null'); + } + $this->container['transactionRule'] = $transactionRule; + + return $this; + } + + /** + * Gets transactionRuleSource + * + * @return \Adyen\Model\TransferWebhooks\TransactionRuleSource|null + */ + public function getTransactionRuleSource() + { + return $this->container['transactionRuleSource']; + } + + /** + * Sets transactionRuleSource + * + * @param \Adyen\Model\TransferWebhooks\TransactionRuleSource|null $transactionRuleSource transactionRuleSource + * + * @return self + */ + public function setTransactionRuleSource($transactionRuleSource) + { + if (is_null($transactionRuleSource)) { + throw new \InvalidArgumentException('non-nullable transactionRuleSource cannot be null'); + } + $this->container['transactionRuleSource'] = $transactionRuleSource; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/TransactionRuleReference.php b/src/Adyen/Model/TransferWebhooks/TransactionRuleReference.php new file mode 100644 index 000000000..1c78e5880 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/TransactionRuleReference.php @@ -0,0 +1,452 @@ + + */ +class TransactionRuleReference implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransactionRuleReference'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'id' => 'string', + 'reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'id' => null, + 'reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'id' => false, + 'reference' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'reference' => 'reference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'reference' => 'setReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'reference' => 'getReference' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('reference', $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 description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the resource. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the resource. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The reference for the resource. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/TransactionRuleSource.php b/src/Adyen/Model/TransferWebhooks/TransactionRuleSource.php new file mode 100644 index 000000000..618ad4fab --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/TransactionRuleSource.php @@ -0,0 +1,418 @@ + + */ +class TransactionRuleSource implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransactionRuleSource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '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 = [ + 'id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '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 = [ + 'id' => 'id', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '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; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('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 id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id ID of the resource, when applicable. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Indicates the type of resource for which the transaction rule is defined. Possible values: * **PaymentInstrumentGroup** * **PaymentInstrument** * **BalancePlatform** * **EntityUsageConfiguration** * **PlatformRule**: The transaction rule is a platform-wide rule imposed by Adyen. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/TransactionRulesResult.php b/src/Adyen/Model/TransferWebhooks/TransactionRulesResult.php new file mode 100644 index 000000000..8d211e834 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/TransactionRulesResult.php @@ -0,0 +1,484 @@ + + */ +class TransactionRulesResult implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransactionRulesResult'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'advice' => 'string', + 'allRulesPassed' => 'bool', + 'failedTransactionRules' => '\Adyen\Model\TransferWebhooks\TransactionEventViolation[]', + 'score' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'advice' => null, + 'allRulesPassed' => null, + 'failedTransactionRules' => null, + 'score' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'advice' => false, + 'allRulesPassed' => false, + 'failedTransactionRules' => false, + 'score' => true + ]; + + /** + * 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 = [ + 'advice' => 'advice', + 'allRulesPassed' => 'allRulesPassed', + 'failedTransactionRules' => 'failedTransactionRules', + 'score' => 'score' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'advice' => 'setAdvice', + 'allRulesPassed' => 'setAllRulesPassed', + 'failedTransactionRules' => 'setFailedTransactionRules', + 'score' => 'setScore' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'advice' => 'getAdvice', + 'allRulesPassed' => 'getAllRulesPassed', + 'failedTransactionRules' => 'getFailedTransactionRules', + 'score' => 'getScore' + ]; + + /** + * 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('advice', $data ?? [], null); + $this->setIfExists('allRulesPassed', $data ?? [], null); + $this->setIfExists('failedTransactionRules', $data ?? [], null); + $this->setIfExists('score', $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 advice + * + * @return string|null + */ + public function getAdvice() + { + return $this->container['advice']; + } + + /** + * Sets advice + * + * @param string|null $advice The advice given by the Risk analysis. + * + * @return self + */ + public function setAdvice($advice) + { + if (is_null($advice)) { + throw new \InvalidArgumentException('non-nullable advice cannot be null'); + } + $this->container['advice'] = $advice; + + return $this; + } + + /** + * Gets allRulesPassed + * + * @return bool|null + */ + public function getAllRulesPassed() + { + return $this->container['allRulesPassed']; + } + + /** + * Sets allRulesPassed + * + * @param bool|null $allRulesPassed Indicates whether the transaction passed the evaluation for all transaction rules. + * + * @return self + */ + public function setAllRulesPassed($allRulesPassed) + { + if (is_null($allRulesPassed)) { + throw new \InvalidArgumentException('non-nullable allRulesPassed cannot be null'); + } + $this->container['allRulesPassed'] = $allRulesPassed; + + return $this; + } + + /** + * Gets failedTransactionRules + * + * @return \Adyen\Model\TransferWebhooks\TransactionEventViolation[]|null + */ + public function getFailedTransactionRules() + { + return $this->container['failedTransactionRules']; + } + + /** + * Sets failedTransactionRules + * + * @param \Adyen\Model\TransferWebhooks\TransactionEventViolation[]|null $failedTransactionRules Array containing all the transaction rules that the transaction violated. This list is only sent when `allRulesPassed` is **false**. + * + * @return self + */ + public function setFailedTransactionRules($failedTransactionRules) + { + if (is_null($failedTransactionRules)) { + throw new \InvalidArgumentException('non-nullable failedTransactionRules cannot be null'); + } + $this->container['failedTransactionRules'] = $failedTransactionRules; + + return $this; + } + + /** + * Gets score + * + * @return int|null + */ + public function getScore() + { + return $this->container['score']; + } + + /** + * Sets score + * + * @param int|null $score The score of the Risk analysis. + * + * @return self + */ + public function setScore($score) + { + // Do nothing for nullable integers + $this->container['score'] = $score; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/TransferData.php b/src/Adyen/Model/TransferWebhooks/TransferData.php new file mode 100644 index 000000000..a028406af --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/TransferData.php @@ -0,0 +1,2070 @@ + + */ +class TransferData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountHolder' => '\Adyen\Model\TransferWebhooks\ResourceReference', + 'amount' => '\Adyen\Model\TransferWebhooks\Amount', + 'balanceAccount' => '\Adyen\Model\TransferWebhooks\ResourceReference', + 'balanceAccountId' => 'string', + 'balancePlatform' => 'string', + 'balances' => '\Adyen\Model\TransferWebhooks\BalanceMutation[]', + 'category' => 'string', + 'counterparty' => '\Adyen\Model\TransferWebhooks\CounterpartyV3', + 'creationDate' => '\DateTime', + 'description' => 'string', + 'direction' => 'string', + 'events' => '\Adyen\Model\TransferWebhooks\TransferEvent[]', + 'id' => 'string', + 'modificationMerchantReference' => 'string', + 'modificationPspReference' => 'string', + 'panEntryMode' => 'string', + 'paymentInstrument' => '\Adyen\Model\TransferWebhooks\PaymentInstrument', + 'paymentInstrumentId' => 'string', + 'paymentMerchantReference' => 'string', + 'platformPaymentType' => 'string', + 'priority' => 'string', + 'processingType' => 'string', + 'pspPaymentReference' => 'string', + 'reason' => 'string', + 'reference' => 'string', + 'referenceForBeneficiary' => 'string', + 'relayedAuthorisationData' => '\Adyen\Model\TransferWebhooks\RelayedAuthorisationData', + 'sequenceNumber' => 'int', + 'status' => 'string', + 'tracking' => '\Adyen\Model\TransferWebhooks\TransferNotificationTransferTracking', + 'transactionId' => 'string', + 'transactionRulesResult' => '\Adyen\Model\TransferWebhooks\TransactionRulesResult', + 'type' => 'string', + 'validationFacts' => '\Adyen\Model\TransferWebhooks\TransferNotificationValidationFact[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountHolder' => null, + 'amount' => null, + 'balanceAccount' => null, + 'balanceAccountId' => null, + 'balancePlatform' => null, + 'balances' => null, + 'category' => null, + 'counterparty' => null, + 'creationDate' => 'date-time', + 'description' => null, + 'direction' => null, + 'events' => null, + 'id' => null, + 'modificationMerchantReference' => null, + 'modificationPspReference' => null, + 'panEntryMode' => null, + 'paymentInstrument' => null, + 'paymentInstrumentId' => null, + 'paymentMerchantReference' => null, + 'platformPaymentType' => null, + 'priority' => null, + 'processingType' => null, + 'pspPaymentReference' => null, + 'reason' => null, + 'reference' => null, + 'referenceForBeneficiary' => null, + 'relayedAuthorisationData' => null, + 'sequenceNumber' => 'int32', + 'status' => null, + 'tracking' => null, + 'transactionId' => null, + 'transactionRulesResult' => null, + 'type' => null, + 'validationFacts' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountHolder' => false, + 'amount' => false, + 'balanceAccount' => false, + 'balanceAccountId' => false, + 'balancePlatform' => false, + 'balances' => false, + 'category' => false, + 'counterparty' => false, + 'creationDate' => false, + 'description' => false, + 'direction' => false, + 'events' => false, + 'id' => false, + 'modificationMerchantReference' => false, + 'modificationPspReference' => false, + 'panEntryMode' => false, + 'paymentInstrument' => false, + 'paymentInstrumentId' => false, + 'paymentMerchantReference' => false, + 'platformPaymentType' => false, + 'priority' => false, + 'processingType' => false, + 'pspPaymentReference' => false, + 'reason' => false, + 'reference' => false, + 'referenceForBeneficiary' => false, + 'relayedAuthorisationData' => false, + 'sequenceNumber' => true, + 'status' => false, + 'tracking' => false, + 'transactionId' => false, + 'transactionRulesResult' => false, + 'type' => false, + 'validationFacts' => 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 = [ + 'accountHolder' => 'accountHolder', + 'amount' => 'amount', + 'balanceAccount' => 'balanceAccount', + 'balanceAccountId' => 'balanceAccountId', + 'balancePlatform' => 'balancePlatform', + 'balances' => 'balances', + 'category' => 'category', + 'counterparty' => 'counterparty', + 'creationDate' => 'creationDate', + 'description' => 'description', + 'direction' => 'direction', + 'events' => 'events', + 'id' => 'id', + 'modificationMerchantReference' => 'modificationMerchantReference', + 'modificationPspReference' => 'modificationPspReference', + 'panEntryMode' => 'panEntryMode', + 'paymentInstrument' => 'paymentInstrument', + 'paymentInstrumentId' => 'paymentInstrumentId', + 'paymentMerchantReference' => 'paymentMerchantReference', + 'platformPaymentType' => 'platformPaymentType', + 'priority' => 'priority', + 'processingType' => 'processingType', + 'pspPaymentReference' => 'pspPaymentReference', + 'reason' => 'reason', + 'reference' => 'reference', + 'referenceForBeneficiary' => 'referenceForBeneficiary', + 'relayedAuthorisationData' => 'relayedAuthorisationData', + 'sequenceNumber' => 'sequenceNumber', + 'status' => 'status', + 'tracking' => 'tracking', + 'transactionId' => 'transactionId', + 'transactionRulesResult' => 'transactionRulesResult', + 'type' => 'type', + 'validationFacts' => 'validationFacts' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountHolder' => 'setAccountHolder', + 'amount' => 'setAmount', + 'balanceAccount' => 'setBalanceAccount', + 'balanceAccountId' => 'setBalanceAccountId', + 'balancePlatform' => 'setBalancePlatform', + 'balances' => 'setBalances', + 'category' => 'setCategory', + 'counterparty' => 'setCounterparty', + 'creationDate' => 'setCreationDate', + 'description' => 'setDescription', + 'direction' => 'setDirection', + 'events' => 'setEvents', + 'id' => 'setId', + 'modificationMerchantReference' => 'setModificationMerchantReference', + 'modificationPspReference' => 'setModificationPspReference', + 'panEntryMode' => 'setPanEntryMode', + 'paymentInstrument' => 'setPaymentInstrument', + 'paymentInstrumentId' => 'setPaymentInstrumentId', + 'paymentMerchantReference' => 'setPaymentMerchantReference', + 'platformPaymentType' => 'setPlatformPaymentType', + 'priority' => 'setPriority', + 'processingType' => 'setProcessingType', + 'pspPaymentReference' => 'setPspPaymentReference', + 'reason' => 'setReason', + 'reference' => 'setReference', + 'referenceForBeneficiary' => 'setReferenceForBeneficiary', + 'relayedAuthorisationData' => 'setRelayedAuthorisationData', + 'sequenceNumber' => 'setSequenceNumber', + 'status' => 'setStatus', + 'tracking' => 'setTracking', + 'transactionId' => 'setTransactionId', + 'transactionRulesResult' => 'setTransactionRulesResult', + 'type' => 'setType', + 'validationFacts' => 'setValidationFacts' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountHolder' => 'getAccountHolder', + 'amount' => 'getAmount', + 'balanceAccount' => 'getBalanceAccount', + 'balanceAccountId' => 'getBalanceAccountId', + 'balancePlatform' => 'getBalancePlatform', + 'balances' => 'getBalances', + 'category' => 'getCategory', + 'counterparty' => 'getCounterparty', + 'creationDate' => 'getCreationDate', + 'description' => 'getDescription', + 'direction' => 'getDirection', + 'events' => 'getEvents', + 'id' => 'getId', + 'modificationMerchantReference' => 'getModificationMerchantReference', + 'modificationPspReference' => 'getModificationPspReference', + 'panEntryMode' => 'getPanEntryMode', + 'paymentInstrument' => 'getPaymentInstrument', + 'paymentInstrumentId' => 'getPaymentInstrumentId', + 'paymentMerchantReference' => 'getPaymentMerchantReference', + 'platformPaymentType' => 'getPlatformPaymentType', + 'priority' => 'getPriority', + 'processingType' => 'getProcessingType', + 'pspPaymentReference' => 'getPspPaymentReference', + 'reason' => 'getReason', + 'reference' => 'getReference', + 'referenceForBeneficiary' => 'getReferenceForBeneficiary', + 'relayedAuthorisationData' => 'getRelayedAuthorisationData', + 'sequenceNumber' => 'getSequenceNumber', + 'status' => 'getStatus', + 'tracking' => 'getTracking', + 'transactionId' => 'getTransactionId', + 'transactionRulesResult' => 'getTransactionRulesResult', + 'type' => 'getType', + 'validationFacts' => 'getValidationFacts' + ]; + + /** + * 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 CATEGORY_BANK = 'bank'; + public const CATEGORY_INTERNAL = 'internal'; + public const CATEGORY_ISSUED_CARD = 'issuedCard'; + public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; + public const DIRECTION_INCOMING = 'incoming'; + public const DIRECTION_OUTGOING = 'outgoing'; + public const PAN_ENTRY_MODE_CHIP = 'chip'; + public const PAN_ENTRY_MODE_COF = 'cof'; + public const PAN_ENTRY_MODE_CONTACTLESS = 'contactless'; + public const PAN_ENTRY_MODE_ECOMMERCE = 'ecommerce'; + public const PAN_ENTRY_MODE_MAGSTRIPE = 'magstripe'; + public const PAN_ENTRY_MODE_MANUAL = 'manual'; + public const PAN_ENTRY_MODE_TOKEN = 'token'; + public const PLATFORM_PAYMENT_TYPE_BALANCE_ACCOUNT = 'BalanceAccount'; + public const PLATFORM_PAYMENT_TYPE_COMMISSION = 'Commission'; + public const PLATFORM_PAYMENT_TYPE__DEFAULT = 'Default'; + public const PLATFORM_PAYMENT_TYPE_PAYMENT_FEE = 'PaymentFee'; + public const PLATFORM_PAYMENT_TYPE_VAT = 'VAT'; + public const PRIORITY_CROSS_BORDER = 'crossBorder'; + public const PRIORITY_DIRECT_DEBIT = 'directDebit'; + public const PRIORITY_FAST = 'fast'; + public const PRIORITY_INSTANT = 'instant'; + public const PRIORITY_INTERNAL = 'internal'; + public const PRIORITY_REGULAR = 'regular'; + public const PRIORITY_WIRE = 'wire'; + public const PROCESSING_TYPE_ATM_WITHDRAW = 'atmWithdraw'; + public const PROCESSING_TYPE_BALANCE_INQUIRY = 'balanceInquiry'; + public const PROCESSING_TYPE_ECOMMERCE = 'ecommerce'; + public const PROCESSING_TYPE_MOTO = 'moto'; + public const PROCESSING_TYPE_POS = 'pos'; + public const PROCESSING_TYPE_PURCHASE_WITH_CASHBACK = 'purchaseWithCashback'; + public const PROCESSING_TYPE_RECURRING = 'recurring'; + public const PROCESSING_TYPE_TOKEN = 'token'; + public const REASON_AMOUNT_LIMIT_EXCEEDED = 'amountLimitExceeded'; + public const REASON_APPROVED = 'approved'; + public const REASON_COUNTERPARTY_ACCOUNT_BLOCKED = 'counterpartyAccountBlocked'; + public const REASON_COUNTERPARTY_ACCOUNT_CLOSED = 'counterpartyAccountClosed'; + public const REASON_COUNTERPARTY_ACCOUNT_NOT_FOUND = 'counterpartyAccountNotFound'; + public const REASON_COUNTERPARTY_ADDRESS_REQUIRED = 'counterpartyAddressRequired'; + public const REASON_COUNTERPARTY_BANK_TIMED_OUT = 'counterpartyBankTimedOut'; + public const REASON_COUNTERPARTY_BANK_UNAVAILABLE = 'counterpartyBankUnavailable'; + public const REASON_ERROR = 'error'; + public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; + public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; + public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; + public const REASON_UNKNOWN = 'unknown'; + public const STATUS_APPROVAL_PENDING = 'approvalPending'; + public const STATUS_ATM_WITHDRAWAL = 'atmWithdrawal'; + public const STATUS_ATM_WITHDRAWAL_REVERSAL_PENDING = 'atmWithdrawalReversalPending'; + public const STATUS_ATM_WITHDRAWAL_REVERSED = 'atmWithdrawalReversed'; + public const STATUS_AUTH_ADJUSTMENT_AUTHORISED = 'authAdjustmentAuthorised'; + public const STATUS_AUTH_ADJUSTMENT_ERROR = 'authAdjustmentError'; + public const STATUS_AUTH_ADJUSTMENT_REFUSED = 'authAdjustmentRefused'; + public const STATUS_AUTHORISED = 'authorised'; + public const STATUS_BANK_TRANSFER = 'bankTransfer'; + public const STATUS_BANK_TRANSFER_PENDING = 'bankTransferPending'; + public const STATUS_BOOKED = 'booked'; + public const STATUS_BOOKING_PENDING = 'bookingPending'; + public const STATUS_CANCELLED = 'cancelled'; + public const STATUS_CAPTURE_PENDING = 'capturePending'; + public const STATUS_CAPTURE_REVERSAL_PENDING = 'captureReversalPending'; + public const STATUS_CAPTURE_REVERSED = 'captureReversed'; + public const STATUS_CAPTURED = 'captured'; + public const STATUS_CAPTURED_EXTERNALLY = 'capturedExternally'; + public const STATUS_CHARGEBACK = 'chargeback'; + public const STATUS_CHARGEBACK_EXTERNALLY = 'chargebackExternally'; + public const STATUS_CHARGEBACK_PENDING = 'chargebackPending'; + public const STATUS_CHARGEBACK_REVERSAL_PENDING = 'chargebackReversalPending'; + public const STATUS_CHARGEBACK_REVERSED = 'chargebackReversed'; + public const STATUS_CREDITED = 'credited'; + public const STATUS_DEPOSIT_CORRECTION = 'depositCorrection'; + public const STATUS_DEPOSIT_CORRECTION_PENDING = 'depositCorrectionPending'; + public const STATUS_DISPUTE = 'dispute'; + public const STATUS_DISPUTE_CLOSED = 'disputeClosed'; + public const STATUS_DISPUTE_EXPIRED = 'disputeExpired'; + public const STATUS_DISPUTE_NEEDS_REVIEW = 'disputeNeedsReview'; + public const STATUS_ERROR = 'error'; + public const STATUS_EXPIRED = 'expired'; + public const STATUS_FAILED = 'failed'; + public const STATUS_FEE = 'fee'; + public const STATUS_FEE_PENDING = 'feePending'; + public const STATUS_INTERNAL_TRANSFER = 'internalTransfer'; + public const STATUS_INTERNAL_TRANSFER_PENDING = 'internalTransferPending'; + public const STATUS_INVOICE_DEDUCTION = 'invoiceDeduction'; + public const STATUS_INVOICE_DEDUCTION_PENDING = 'invoiceDeductionPending'; + public const STATUS_MANUAL_CORRECTION_PENDING = 'manualCorrectionPending'; + public const STATUS_MANUALLY_CORRECTED = 'manuallyCorrected'; + public const STATUS_MATCHED_STATEMENT = 'matchedStatement'; + public const STATUS_MATCHED_STATEMENT_PENDING = 'matchedStatementPending'; + public const STATUS_MERCHANT_PAYIN = 'merchantPayin'; + public const STATUS_MERCHANT_PAYIN_PENDING = 'merchantPayinPending'; + public const STATUS_MERCHANT_PAYIN_REVERSED = 'merchantPayinReversed'; + public const STATUS_MERCHANT_PAYIN_REVERSED_PENDING = 'merchantPayinReversedPending'; + public const STATUS_MISC_COST = 'miscCost'; + public const STATUS_MISC_COST_PENDING = 'miscCostPending'; + public const STATUS_PAYMENT_COST = 'paymentCost'; + public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; + public const STATUS_RECEIVED = 'received'; + public const STATUS_REFUND_PENDING = 'refundPending'; + public const STATUS_REFUND_REVERSAL_PENDING = 'refundReversalPending'; + public const STATUS_REFUND_REVERSED = 'refundReversed'; + public const STATUS_REFUNDED = 'refunded'; + public const STATUS_REFUNDED_EXTERNALLY = 'refundedExternally'; + public const STATUS_REFUSED = 'refused'; + public const STATUS_RESERVE_ADJUSTMENT = 'reserveAdjustment'; + public const STATUS_RESERVE_ADJUSTMENT_PENDING = 'reserveAdjustmentPending'; + public const STATUS_RETURNED = 'returned'; + public const STATUS_SECOND_CHARGEBACK = 'secondChargeback'; + public const STATUS_SECOND_CHARGEBACK_PENDING = 'secondChargebackPending'; + public const STATUS_UNDEFINED = 'undefined'; + public const TYPE_ATM_WITHDRAWAL = 'atmWithdrawal'; + public const TYPE_ATM_WITHDRAWAL_REVERSAL = 'atmWithdrawalReversal'; + public const TYPE_BALANCE_ADJUSTMENT = 'balanceAdjustment'; + public const TYPE_BALANCE_ROLLOVER = 'balanceRollover'; + public const TYPE_BANK_TRANSFER = 'bankTransfer'; + public const TYPE_CAPTURE = 'capture'; + public const TYPE_CAPTURE_REVERSAL = 'captureReversal'; + public const TYPE_CARD_TRANSFER = 'cardTransfer'; + public const TYPE_CHARGEBACK = 'chargeback'; + public const TYPE_CHARGEBACK_REVERSAL = 'chargebackReversal'; + public const TYPE_DEPOSIT_CORRECTION = 'depositCorrection'; + public const TYPE_FEE = 'fee'; + public const TYPE_GRANT = 'grant'; + public const TYPE_INSTALLMENT = 'installment'; + public const TYPE_INSTALLMENT_REVERSAL = 'installmentReversal'; + public const TYPE_INTERNAL_TRANSFER = 'internalTransfer'; + public const TYPE_INVOICE_DEDUCTION = 'invoiceDeduction'; + public const TYPE_LEFTOVER = 'leftover'; + public const TYPE_MANUAL_CORRECTION = 'manualCorrection'; + public const TYPE_MISC_COST = 'miscCost'; + public const TYPE_PAYMENT = 'payment'; + public const TYPE_PAYMENT_COST = 'paymentCost'; + public const TYPE_REFUND = 'refund'; + public const TYPE_REFUND_REVERSAL = 'refundReversal'; + public const TYPE_REPAYMENT = 'repayment'; + public const TYPE_RESERVE_ADJUSTMENT = 'reserveAdjustment'; + public const TYPE_SECOND_CHARGEBACK = 'secondChargeback'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCategoryAllowableValues() + { + return [ + self::CATEGORY_BANK, + self::CATEGORY_INTERNAL, + self::CATEGORY_ISSUED_CARD, + self::CATEGORY_PLATFORM_PAYMENT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDirectionAllowableValues() + { + return [ + self::DIRECTION_INCOMING, + self::DIRECTION_OUTGOING, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPanEntryModeAllowableValues() + { + return [ + self::PAN_ENTRY_MODE_CHIP, + self::PAN_ENTRY_MODE_COF, + self::PAN_ENTRY_MODE_CONTACTLESS, + self::PAN_ENTRY_MODE_ECOMMERCE, + self::PAN_ENTRY_MODE_MAGSTRIPE, + self::PAN_ENTRY_MODE_MANUAL, + self::PAN_ENTRY_MODE_TOKEN, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPlatformPaymentTypeAllowableValues() + { + return [ + self::PLATFORM_PAYMENT_TYPE_BALANCE_ACCOUNT, + self::PLATFORM_PAYMENT_TYPE_COMMISSION, + self::PLATFORM_PAYMENT_TYPE__DEFAULT, + self::PLATFORM_PAYMENT_TYPE_PAYMENT_FEE, + self::PLATFORM_PAYMENT_TYPE_VAT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPriorityAllowableValues() + { + return [ + self::PRIORITY_CROSS_BORDER, + self::PRIORITY_DIRECT_DEBIT, + self::PRIORITY_FAST, + self::PRIORITY_INSTANT, + self::PRIORITY_INTERNAL, + self::PRIORITY_REGULAR, + self::PRIORITY_WIRE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getProcessingTypeAllowableValues() + { + return [ + self::PROCESSING_TYPE_ATM_WITHDRAW, + self::PROCESSING_TYPE_BALANCE_INQUIRY, + self::PROCESSING_TYPE_ECOMMERCE, + self::PROCESSING_TYPE_MOTO, + self::PROCESSING_TYPE_POS, + self::PROCESSING_TYPE_PURCHASE_WITH_CASHBACK, + self::PROCESSING_TYPE_RECURRING, + self::PROCESSING_TYPE_TOKEN, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getReasonAllowableValues() + { + return [ + self::REASON_AMOUNT_LIMIT_EXCEEDED, + self::REASON_APPROVED, + self::REASON_COUNTERPARTY_ACCOUNT_BLOCKED, + self::REASON_COUNTERPARTY_ACCOUNT_CLOSED, + self::REASON_COUNTERPARTY_ACCOUNT_NOT_FOUND, + self::REASON_COUNTERPARTY_ADDRESS_REQUIRED, + self::REASON_COUNTERPARTY_BANK_TIMED_OUT, + self::REASON_COUNTERPARTY_BANK_UNAVAILABLE, + self::REASON_ERROR, + self::REASON_NOT_ENOUGH_BALANCE, + self::REASON_REFUSED_BY_COUNTERPARTY_BANK, + self::REASON_ROUTE_NOT_FOUND, + self::REASON_UNKNOWN, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_APPROVAL_PENDING, + self::STATUS_ATM_WITHDRAWAL, + self::STATUS_ATM_WITHDRAWAL_REVERSAL_PENDING, + self::STATUS_ATM_WITHDRAWAL_REVERSED, + self::STATUS_AUTH_ADJUSTMENT_AUTHORISED, + self::STATUS_AUTH_ADJUSTMENT_ERROR, + self::STATUS_AUTH_ADJUSTMENT_REFUSED, + self::STATUS_AUTHORISED, + self::STATUS_BANK_TRANSFER, + self::STATUS_BANK_TRANSFER_PENDING, + self::STATUS_BOOKED, + self::STATUS_BOOKING_PENDING, + self::STATUS_CANCELLED, + self::STATUS_CAPTURE_PENDING, + self::STATUS_CAPTURE_REVERSAL_PENDING, + self::STATUS_CAPTURE_REVERSED, + self::STATUS_CAPTURED, + self::STATUS_CAPTURED_EXTERNALLY, + self::STATUS_CHARGEBACK, + self::STATUS_CHARGEBACK_EXTERNALLY, + self::STATUS_CHARGEBACK_PENDING, + self::STATUS_CHARGEBACK_REVERSAL_PENDING, + self::STATUS_CHARGEBACK_REVERSED, + self::STATUS_CREDITED, + self::STATUS_DEPOSIT_CORRECTION, + self::STATUS_DEPOSIT_CORRECTION_PENDING, + self::STATUS_DISPUTE, + self::STATUS_DISPUTE_CLOSED, + self::STATUS_DISPUTE_EXPIRED, + self::STATUS_DISPUTE_NEEDS_REVIEW, + self::STATUS_ERROR, + self::STATUS_EXPIRED, + self::STATUS_FAILED, + self::STATUS_FEE, + self::STATUS_FEE_PENDING, + self::STATUS_INTERNAL_TRANSFER, + self::STATUS_INTERNAL_TRANSFER_PENDING, + self::STATUS_INVOICE_DEDUCTION, + self::STATUS_INVOICE_DEDUCTION_PENDING, + self::STATUS_MANUAL_CORRECTION_PENDING, + self::STATUS_MANUALLY_CORRECTED, + self::STATUS_MATCHED_STATEMENT, + self::STATUS_MATCHED_STATEMENT_PENDING, + self::STATUS_MERCHANT_PAYIN, + self::STATUS_MERCHANT_PAYIN_PENDING, + self::STATUS_MERCHANT_PAYIN_REVERSED, + self::STATUS_MERCHANT_PAYIN_REVERSED_PENDING, + self::STATUS_MISC_COST, + self::STATUS_MISC_COST_PENDING, + self::STATUS_PAYMENT_COST, + self::STATUS_PAYMENT_COST_PENDING, + self::STATUS_RECEIVED, + self::STATUS_REFUND_PENDING, + self::STATUS_REFUND_REVERSAL_PENDING, + self::STATUS_REFUND_REVERSED, + self::STATUS_REFUNDED, + self::STATUS_REFUNDED_EXTERNALLY, + self::STATUS_REFUSED, + self::STATUS_RESERVE_ADJUSTMENT, + self::STATUS_RESERVE_ADJUSTMENT_PENDING, + self::STATUS_RETURNED, + self::STATUS_SECOND_CHARGEBACK, + self::STATUS_SECOND_CHARGEBACK_PENDING, + self::STATUS_UNDEFINED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_ATM_WITHDRAWAL, + self::TYPE_ATM_WITHDRAWAL_REVERSAL, + self::TYPE_BALANCE_ADJUSTMENT, + self::TYPE_BALANCE_ROLLOVER, + self::TYPE_BANK_TRANSFER, + self::TYPE_CAPTURE, + self::TYPE_CAPTURE_REVERSAL, + self::TYPE_CARD_TRANSFER, + self::TYPE_CHARGEBACK, + self::TYPE_CHARGEBACK_REVERSAL, + self::TYPE_DEPOSIT_CORRECTION, + self::TYPE_FEE, + self::TYPE_GRANT, + self::TYPE_INSTALLMENT, + self::TYPE_INSTALLMENT_REVERSAL, + self::TYPE_INTERNAL_TRANSFER, + self::TYPE_INVOICE_DEDUCTION, + self::TYPE_LEFTOVER, + self::TYPE_MANUAL_CORRECTION, + self::TYPE_MISC_COST, + self::TYPE_PAYMENT, + self::TYPE_PAYMENT_COST, + self::TYPE_REFUND, + self::TYPE_REFUND_REVERSAL, + self::TYPE_REPAYMENT, + self::TYPE_RESERVE_ADJUSTMENT, + self::TYPE_SECOND_CHARGEBACK, + ]; + } + /** + * 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('accountHolder', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('balanceAccount', $data ?? [], null); + $this->setIfExists('balanceAccountId', $data ?? [], null); + $this->setIfExists('balancePlatform', $data ?? [], null); + $this->setIfExists('balances', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('counterparty', $data ?? [], null); + $this->setIfExists('creationDate', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('direction', $data ?? [], null); + $this->setIfExists('events', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('modificationMerchantReference', $data ?? [], null); + $this->setIfExists('modificationPspReference', $data ?? [], null); + $this->setIfExists('panEntryMode', $data ?? [], null); + $this->setIfExists('paymentInstrument', $data ?? [], null); + $this->setIfExists('paymentInstrumentId', $data ?? [], null); + $this->setIfExists('paymentMerchantReference', $data ?? [], null); + $this->setIfExists('platformPaymentType', $data ?? [], null); + $this->setIfExists('priority', $data ?? [], null); + $this->setIfExists('processingType', $data ?? [], null); + $this->setIfExists('pspPaymentReference', $data ?? [], null); + $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('referenceForBeneficiary', $data ?? [], null); + $this->setIfExists('relayedAuthorisationData', $data ?? [], null); + $this->setIfExists('sequenceNumber', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('tracking', $data ?? [], null); + $this->setIfExists('transactionId', $data ?? [], null); + $this->setIfExists('transactionRulesResult', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('validationFacts', $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['category'] === null) { + $invalidProperties[] = "'category' can't be null"; + } + $allowedValues = $this->getCategoryAllowableValues(); + if (!is_null($this->container['category']) && !in_array($this->container['category'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'category', must be one of '%s'", + $this->container['category'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getDirectionAllowableValues(); + if (!is_null($this->container['direction']) && !in_array($this->container['direction'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'direction', must be one of '%s'", + $this->container['direction'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getPanEntryModeAllowableValues(); + if (!is_null($this->container['panEntryMode']) && !in_array($this->container['panEntryMode'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'panEntryMode', must be one of '%s'", + $this->container['panEntryMode'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getPlatformPaymentTypeAllowableValues(); + if (!is_null($this->container['platformPaymentType']) && !in_array($this->container['platformPaymentType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'platformPaymentType', must be one of '%s'", + $this->container['platformPaymentType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getPriorityAllowableValues(); + if (!is_null($this->container['priority']) && !in_array($this->container['priority'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'priority', must be one of '%s'", + $this->container['priority'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getProcessingTypeAllowableValues(); + if (!is_null($this->container['processingType']) && !in_array($this->container['processingType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'processingType', must be one of '%s'", + $this->container['processingType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getReasonAllowableValues(); + if (!is_null($this->container['reason']) && !in_array($this->container['reason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'reason', must be one of '%s'", + $this->container['reason'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 accountHolder + * + * @return \Adyen\Model\TransferWebhooks\ResourceReference|null + */ + public function getAccountHolder() + { + return $this->container['accountHolder']; + } + + /** + * Sets accountHolder + * + * @param \Adyen\Model\TransferWebhooks\ResourceReference|null $accountHolder accountHolder + * + * @return self + */ + public function setAccountHolder($accountHolder) + { + if (is_null($accountHolder)) { + throw new \InvalidArgumentException('non-nullable accountHolder cannot be null'); + } + $this->container['accountHolder'] = $accountHolder; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\TransferWebhooks\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\TransferWebhooks\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets balanceAccount + * + * @return \Adyen\Model\TransferWebhooks\ResourceReference|null + */ + public function getBalanceAccount() + { + return $this->container['balanceAccount']; + } + + /** + * Sets balanceAccount + * + * @param \Adyen\Model\TransferWebhooks\ResourceReference|null $balanceAccount balanceAccount + * + * @return self + */ + public function setBalanceAccount($balanceAccount) + { + if (is_null($balanceAccount)) { + throw new \InvalidArgumentException('non-nullable balanceAccount cannot be null'); + } + $this->container['balanceAccount'] = $balanceAccount; + + return $this; + } + + /** + * Gets balanceAccountId + * + * @return string|null + * @deprecated + */ + public function getBalanceAccountId() + { + return $this->container['balanceAccountId']; + } + + /** + * Sets balanceAccountId + * + * @param string|null $balanceAccountId The unique identifier of the source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). + * + * @return self + * @deprecated + */ + public function setBalanceAccountId($balanceAccountId) + { + if (is_null($balanceAccountId)) { + throw new \InvalidArgumentException('non-nullable balanceAccountId cannot be null'); + } + $this->container['balanceAccountId'] = $balanceAccountId; + + return $this; + } + + /** + * Gets balancePlatform + * + * @return string|null + */ + public function getBalancePlatform() + { + return $this->container['balancePlatform']; + } + + /** + * Sets balancePlatform + * + * @param string|null $balancePlatform The unique identifier of the balance platform. + * + * @return self + */ + public function setBalancePlatform($balancePlatform) + { + if (is_null($balancePlatform)) { + throw new \InvalidArgumentException('non-nullable balancePlatform cannot be null'); + } + $this->container['balancePlatform'] = $balancePlatform; + + return $this; + } + + /** + * Gets balances + * + * @return \Adyen\Model\TransferWebhooks\BalanceMutation[]|null + */ + public function getBalances() + { + return $this->container['balances']; + } + + /** + * Sets balances + * + * @param \Adyen\Model\TransferWebhooks\BalanceMutation[]|null $balances The list of the latest balance statuses in the transfer. + * + * @return self + */ + public function setBalances($balances) + { + if (is_null($balances)) { + throw new \InvalidArgumentException('non-nullable balances cannot be null'); + } + $this->container['balances'] = $balances; + + return $this; + } + + /** + * Gets category + * + * @return string + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param string $category The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: Transfer initiated by a Adyen-issued card. - **platformPayment**: Fund movements related to payments that are acquired for your users. + * + * @return self + */ + public function setCategory($category) + { + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); + } + $allowedValues = $this->getCategoryAllowableValues(); + if (!in_array($category, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'category', must be one of '%s'", + $category, + implode("', '", $allowedValues) + ) + ); + } + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets counterparty + * + * @return \Adyen\Model\TransferWebhooks\CounterpartyV3|null + */ + public function getCounterparty() + { + return $this->container['counterparty']; + } + + /** + * Sets counterparty + * + * @param \Adyen\Model\TransferWebhooks\CounterpartyV3|null $counterparty counterparty + * + * @return self + */ + public function setCounterparty($counterparty) + { + if (is_null($counterparty)) { + throw new \InvalidArgumentException('non-nullable counterparty cannot be null'); + } + $this->container['counterparty'] = $counterparty; + + return $this; + } + + /** + * Gets creationDate + * + * @return \DateTime|null + */ + public function getCreationDate() + { + return $this->container['creationDate']; + } + + /** + * Sets creationDate + * + * @param \DateTime|null $creationDate The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + * + * @return self + */ + public function setCreationDate($creationDate) + { + if (is_null($creationDate)) { + throw new \InvalidArgumentException('non-nullable creationDate cannot be null'); + } + $this->container['creationDate'] = $creationDate; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for the transfer. It is used by most banks as the transfer description. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. Supported characters: **[a-z] [A-Z] [0-9] / - ?** **: ( ) . , ' + Space** Supported characters for **regular** and **fast** transfers to a US counterparty: **[a-z] [A-Z] [0-9] & $ % # @** **~ = + - _ ' \" ! ?** + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets direction + * + * @return string|null + */ + public function getDirection() + { + return $this->container['direction']; + } + + /** + * Sets direction + * + * @param string|null $direction The direction of the transfer. Possible values: **incoming**, **outgoing**. + * + * @return self + */ + public function setDirection($direction) + { + if (is_null($direction)) { + throw new \InvalidArgumentException('non-nullable direction cannot be null'); + } + $allowedValues = $this->getDirectionAllowableValues(); + if (!in_array($direction, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'direction', must be one of '%s'", + $direction, + implode("', '", $allowedValues) + ) + ); + } + $this->container['direction'] = $direction; + + return $this; + } + + /** + * Gets events + * + * @return \Adyen\Model\TransferWebhooks\TransferEvent[]|null + */ + public function getEvents() + { + return $this->container['events']; + } + + /** + * Sets events + * + * @param \Adyen\Model\TransferWebhooks\TransferEvent[]|null $events The list of events leading up to the current status of the transfer. + * + * @return self + */ + public function setEvents($events) + { + if (is_null($events)) { + throw new \InvalidArgumentException('non-nullable events cannot be null'); + } + $this->container['events'] = $events; + + 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) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets modificationMerchantReference + * + * @return string|null + * @deprecated + */ + public function getModificationMerchantReference() + { + return $this->container['modificationMerchantReference']; + } + + /** + * Sets modificationMerchantReference + * + * @param string|null $modificationMerchantReference The capture's merchant reference included in the transfer. + * + * @return self + * @deprecated + */ + public function setModificationMerchantReference($modificationMerchantReference) + { + if (is_null($modificationMerchantReference)) { + throw new \InvalidArgumentException('non-nullable modificationMerchantReference cannot be null'); + } + $this->container['modificationMerchantReference'] = $modificationMerchantReference; + + return $this; + } + + /** + * Gets modificationPspReference + * + * @return string|null + * @deprecated + */ + public function getModificationPspReference() + { + return $this->container['modificationPspReference']; + } + + /** + * Sets modificationPspReference + * + * @param string|null $modificationPspReference The capture reference included in the transfer. + * + * @return self + * @deprecated + */ + public function setModificationPspReference($modificationPspReference) + { + if (is_null($modificationPspReference)) { + throw new \InvalidArgumentException('non-nullable modificationPspReference cannot be null'); + } + $this->container['modificationPspReference'] = $modificationPspReference; + + return $this; + } + + /** + * Gets panEntryMode + * + * @return string|null + * @deprecated + */ + public function getPanEntryMode() + { + return $this->container['panEntryMode']; + } + + /** + * Sets panEntryMode + * + * @param string|null $panEntryMode Indicates the method used for entering the PAN to initiate a transaction. Possible values: **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**. + * + * @return self + * @deprecated + */ + public function setPanEntryMode($panEntryMode) + { + if (is_null($panEntryMode)) { + throw new \InvalidArgumentException('non-nullable panEntryMode cannot be null'); + } + $allowedValues = $this->getPanEntryModeAllowableValues(); + if (!in_array($panEntryMode, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'panEntryMode', must be one of '%s'", + $panEntryMode, + implode("', '", $allowedValues) + ) + ); + } + $this->container['panEntryMode'] = $panEntryMode; + + return $this; + } + + /** + * Gets paymentInstrument + * + * @return \Adyen\Model\TransferWebhooks\PaymentInstrument|null + */ + public function getPaymentInstrument() + { + return $this->container['paymentInstrument']; + } + + /** + * Sets paymentInstrument + * + * @param \Adyen\Model\TransferWebhooks\PaymentInstrument|null $paymentInstrument paymentInstrument + * + * @return self + */ + public function setPaymentInstrument($paymentInstrument) + { + if (is_null($paymentInstrument)) { + throw new \InvalidArgumentException('non-nullable paymentInstrument cannot be null'); + } + $this->container['paymentInstrument'] = $paymentInstrument; + + return $this; + } + + /** + * Gets paymentInstrumentId + * + * @return string|null + * @deprecated + */ + public function getPaymentInstrumentId() + { + return $this->container['paymentInstrumentId']; + } + + /** + * Sets paymentInstrumentId + * + * @param string|null $paymentInstrumentId The unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) used in the transfer. + * + * @return self + * @deprecated + */ + public function setPaymentInstrumentId($paymentInstrumentId) + { + if (is_null($paymentInstrumentId)) { + throw new \InvalidArgumentException('non-nullable paymentInstrumentId cannot be null'); + } + $this->container['paymentInstrumentId'] = $paymentInstrumentId; + + return $this; + } + + /** + * Gets paymentMerchantReference + * + * @return string|null + * @deprecated + */ + public function getPaymentMerchantReference() + { + return $this->container['paymentMerchantReference']; + } + + /** + * Sets paymentMerchantReference + * + * @param string|null $paymentMerchantReference The payment's merchant reference included in the transfer. + * + * @return self + * @deprecated + */ + public function setPaymentMerchantReference($paymentMerchantReference) + { + if (is_null($paymentMerchantReference)) { + throw new \InvalidArgumentException('non-nullable paymentMerchantReference cannot be null'); + } + $this->container['paymentMerchantReference'] = $paymentMerchantReference; + + return $this; + } + + /** + * Gets platformPaymentType + * + * @return string|null + * @deprecated + */ + public function getPlatformPaymentType() + { + return $this->container['platformPaymentType']; + } + + /** + * Sets platformPaymentType + * + * @param string|null $platformPaymentType The type of the related split. + * + * @return self + * @deprecated + */ + public function setPlatformPaymentType($platformPaymentType) + { + if (is_null($platformPaymentType)) { + throw new \InvalidArgumentException('non-nullable platformPaymentType cannot be null'); + } + $allowedValues = $this->getPlatformPaymentTypeAllowableValues(); + if (!in_array($platformPaymentType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'platformPaymentType', must be one of '%s'", + $platformPaymentType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['platformPaymentType'] = $platformPaymentType; + + return $this; + } + + /** + * Gets priority + * + * @return string|null + */ + public function getPriority() + { + return $this->container['priority']; + } + + /** + * Sets priority + * + * @param string|null $priority The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). + * + * @return self + */ + public function setPriority($priority) + { + if (is_null($priority)) { + throw new \InvalidArgumentException('non-nullable priority cannot be null'); + } + $allowedValues = $this->getPriorityAllowableValues(); + if (!in_array($priority, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'priority', must be one of '%s'", + $priority, + implode("', '", $allowedValues) + ) + ); + } + $this->container['priority'] = $priority; + + return $this; + } + + /** + * Gets processingType + * + * @return string|null + * @deprecated + */ + public function getProcessingType() + { + return $this->container['processingType']; + } + + /** + * Sets processingType + * + * @param string|null $processingType Contains information about how the payment was processed. For example, **ecommerce** for online or **pos** for in-person payments. + * + * @return self + * @deprecated + */ + public function setProcessingType($processingType) + { + if (is_null($processingType)) { + throw new \InvalidArgumentException('non-nullable processingType cannot be null'); + } + $allowedValues = $this->getProcessingTypeAllowableValues(); + if (!in_array($processingType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'processingType', must be one of '%s'", + $processingType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['processingType'] = $processingType; + + return $this; + } + + /** + * Gets pspPaymentReference + * + * @return string|null + * @deprecated + */ + public function getPspPaymentReference() + { + return $this->container['pspPaymentReference']; + } + + /** + * Sets pspPaymentReference + * + * @param string|null $pspPaymentReference The payment reference included in the transfer. + * + * @return self + * @deprecated + */ + public function setPspPaymentReference($pspPaymentReference) + { + if (is_null($pspPaymentReference)) { + throw new \InvalidArgumentException('non-nullable pspPaymentReference cannot be null'); + } + $this->container['pspPaymentReference'] = $pspPaymentReference; + + return $this; + } + + /** + * Gets reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason Additional information about the status of the transfer. + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $allowedValues = $this->getReasonAllowableValues(); + if (!in_array($reason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'reason', must be one of '%s'", + $reason, + implode("', '", $allowedValues) + ) + ); + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the transfer, used internally within your platform. If you don't provide this in the request, Adyen generates a unique reference. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets referenceForBeneficiary + * + * @return string|null + */ + public function getReferenceForBeneficiary() + { + return $this->container['referenceForBeneficiary']; + } + + /** + * Sets referenceForBeneficiary + * + * @param string|null $referenceForBeneficiary A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. + * + * @return self + */ + public function setReferenceForBeneficiary($referenceForBeneficiary) + { + if (is_null($referenceForBeneficiary)) { + throw new \InvalidArgumentException('non-nullable referenceForBeneficiary cannot be null'); + } + $this->container['referenceForBeneficiary'] = $referenceForBeneficiary; + + return $this; + } + + /** + * Gets relayedAuthorisationData + * + * @return \Adyen\Model\TransferWebhooks\RelayedAuthorisationData|null + */ + public function getRelayedAuthorisationData() + { + return $this->container['relayedAuthorisationData']; + } + + /** + * Sets relayedAuthorisationData + * + * @param \Adyen\Model\TransferWebhooks\RelayedAuthorisationData|null $relayedAuthorisationData relayedAuthorisationData + * + * @return self + */ + public function setRelayedAuthorisationData($relayedAuthorisationData) + { + if (is_null($relayedAuthorisationData)) { + throw new \InvalidArgumentException('non-nullable relayedAuthorisationData cannot be null'); + } + $this->container['relayedAuthorisationData'] = $relayedAuthorisationData; + + return $this; + } + + /** + * Gets sequenceNumber + * + * @return int|null + */ + public function getSequenceNumber() + { + return $this->container['sequenceNumber']; + } + + /** + * Sets sequenceNumber + * + * @param int|null $sequenceNumber The sequence number of the transfer notification. The numbers start from 1 and increase with each new notification for a specific transfer. It can help you restore the correct sequence of events even if they arrive out of order. + * + * @return self + */ + public function setSequenceNumber($sequenceNumber) + { + // Do nothing for nullable integers + $this->container['sequenceNumber'] = $sequenceNumber; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The result of the transfer. For example, **authorised**, **refused**, or **error**. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets tracking + * + * @return \Adyen\Model\TransferWebhooks\TransferNotificationTransferTracking|null + */ + public function getTracking() + { + return $this->container['tracking']; + } + + /** + * Sets tracking + * + * @param \Adyen\Model\TransferWebhooks\TransferNotificationTransferTracking|null $tracking tracking + * + * @return self + */ + public function setTracking($tracking) + { + if (is_null($tracking)) { + throw new \InvalidArgumentException('non-nullable tracking cannot be null'); + } + $this->container['tracking'] = $tracking; + + return $this; + } + + /** + * Gets transactionId + * + * @return string|null + * @deprecated + */ + public function getTransactionId() + { + return $this->container['transactionId']; + } + + /** + * Sets transactionId + * + * @param string|null $transactionId The ID of the transaction that is created based on the transfer. + * + * @return self + * @deprecated + */ + public function setTransactionId($transactionId) + { + if (is_null($transactionId)) { + throw new \InvalidArgumentException('non-nullable transactionId cannot be null'); + } + $this->container['transactionId'] = $transactionId; + + return $this; + } + + /** + * Gets transactionRulesResult + * + * @return \Adyen\Model\TransferWebhooks\TransactionRulesResult|null + */ + public function getTransactionRulesResult() + { + return $this->container['transactionRulesResult']; + } + + /** + * Sets transactionRulesResult + * + * @param \Adyen\Model\TransferWebhooks\TransactionRulesResult|null $transactionRulesResult transactionRulesResult + * + * @return self + */ + public function setTransactionRulesResult($transactionRulesResult) + { + if (is_null($transactionRulesResult)) { + throw new \InvalidArgumentException('non-nullable transactionRulesResult cannot be null'); + } + $this->container['transactionRulesResult'] = $transactionRulesResult; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of transfer or transaction. For example, **refund**, **payment**, **internalTransfer**, **bankTransfer**. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets validationFacts + * + * @return \Adyen\Model\TransferWebhooks\TransferNotificationValidationFact[]|null + * @deprecated + */ + public function getValidationFacts() + { + return $this->container['validationFacts']; + } + + /** + * Sets validationFacts + * + * @param \Adyen\Model\TransferWebhooks\TransferNotificationValidationFact[]|null $validationFacts The evaluation of the validation facts. See [validation checks](https://docs.adyen.com/issuing/validation-checks) for more information. + * + * @return self + * @deprecated + */ + public function setValidationFacts($validationFacts) + { + if (is_null($validationFacts)) { + throw new \InvalidArgumentException('non-nullable validationFacts cannot be null'); + } + $this->container['validationFacts'] = $validationFacts; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/TransferEvent.php b/src/Adyen/Model/TransferWebhooks/TransferEvent.php new file mode 100644 index 000000000..89bf25e62 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/TransferEvent.php @@ -0,0 +1,1037 @@ + + */ +class TransferEvent implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferEvent'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\TransferWebhooks\Amount', + 'amountAdjustments' => '\Adyen\Model\TransferWebhooks\AmountAdjustment[]', + 'bookingDate' => '\DateTime', + 'estimatedArrivalTime' => '\DateTime', + 'id' => 'string', + 'mutations' => '\Adyen\Model\TransferWebhooks\BalanceMutation[]', + 'originalAmount' => '\Adyen\Model\TransferWebhooks\Amount', + 'reason' => 'string', + 'status' => 'string', + 'transactionId' => 'string', + 'type' => 'string', + 'updateDate' => '\DateTime', + 'valueDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'amountAdjustments' => null, + 'bookingDate' => 'date-time', + 'estimatedArrivalTime' => 'date-time', + 'id' => null, + 'mutations' => null, + 'originalAmount' => null, + 'reason' => null, + 'status' => null, + 'transactionId' => null, + 'type' => null, + 'updateDate' => 'date-time', + 'valueDate' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'amountAdjustments' => false, + 'bookingDate' => false, + 'estimatedArrivalTime' => false, + 'id' => false, + 'mutations' => false, + 'originalAmount' => false, + 'reason' => false, + 'status' => false, + 'transactionId' => false, + 'type' => false, + 'updateDate' => false, + 'valueDate' => 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', + 'amountAdjustments' => 'amountAdjustments', + 'bookingDate' => 'bookingDate', + 'estimatedArrivalTime' => 'estimatedArrivalTime', + 'id' => 'id', + 'mutations' => 'mutations', + 'originalAmount' => 'originalAmount', + 'reason' => 'reason', + 'status' => 'status', + 'transactionId' => 'transactionId', + 'type' => 'type', + 'updateDate' => 'updateDate', + 'valueDate' => 'valueDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'amountAdjustments' => 'setAmountAdjustments', + 'bookingDate' => 'setBookingDate', + 'estimatedArrivalTime' => 'setEstimatedArrivalTime', + 'id' => 'setId', + 'mutations' => 'setMutations', + 'originalAmount' => 'setOriginalAmount', + 'reason' => 'setReason', + 'status' => 'setStatus', + 'transactionId' => 'setTransactionId', + 'type' => 'setType', + 'updateDate' => 'setUpdateDate', + 'valueDate' => 'setValueDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'amountAdjustments' => 'getAmountAdjustments', + 'bookingDate' => 'getBookingDate', + 'estimatedArrivalTime' => 'getEstimatedArrivalTime', + 'id' => 'getId', + 'mutations' => 'getMutations', + 'originalAmount' => 'getOriginalAmount', + 'reason' => 'getReason', + 'status' => 'getStatus', + 'transactionId' => 'getTransactionId', + 'type' => 'getType', + 'updateDate' => 'getUpdateDate', + 'valueDate' => 'getValueDate' + ]; + + /** + * 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 REASON_AMOUNT_LIMIT_EXCEEDED = 'amountLimitExceeded'; + public const REASON_APPROVED = 'approved'; + public const REASON_COUNTERPARTY_ACCOUNT_BLOCKED = 'counterpartyAccountBlocked'; + public const REASON_COUNTERPARTY_ACCOUNT_CLOSED = 'counterpartyAccountClosed'; + public const REASON_COUNTERPARTY_ACCOUNT_NOT_FOUND = 'counterpartyAccountNotFound'; + public const REASON_COUNTERPARTY_ADDRESS_REQUIRED = 'counterpartyAddressRequired'; + public const REASON_COUNTERPARTY_BANK_TIMED_OUT = 'counterpartyBankTimedOut'; + public const REASON_COUNTERPARTY_BANK_UNAVAILABLE = 'counterpartyBankUnavailable'; + public const REASON_ERROR = 'error'; + public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; + public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; + public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; + public const REASON_UNKNOWN = 'unknown'; + public const STATUS_APPROVAL_PENDING = 'approvalPending'; + public const STATUS_ATM_WITHDRAWAL = 'atmWithdrawal'; + public const STATUS_ATM_WITHDRAWAL_REVERSAL_PENDING = 'atmWithdrawalReversalPending'; + public const STATUS_ATM_WITHDRAWAL_REVERSED = 'atmWithdrawalReversed'; + public const STATUS_AUTH_ADJUSTMENT_AUTHORISED = 'authAdjustmentAuthorised'; + public const STATUS_AUTH_ADJUSTMENT_ERROR = 'authAdjustmentError'; + public const STATUS_AUTH_ADJUSTMENT_REFUSED = 'authAdjustmentRefused'; + public const STATUS_AUTHORISED = 'authorised'; + public const STATUS_BANK_TRANSFER = 'bankTransfer'; + public const STATUS_BANK_TRANSFER_PENDING = 'bankTransferPending'; + public const STATUS_BOOKED = 'booked'; + public const STATUS_BOOKING_PENDING = 'bookingPending'; + public const STATUS_CANCELLED = 'cancelled'; + public const STATUS_CAPTURE_PENDING = 'capturePending'; + public const STATUS_CAPTURE_REVERSAL_PENDING = 'captureReversalPending'; + public const STATUS_CAPTURE_REVERSED = 'captureReversed'; + public const STATUS_CAPTURED = 'captured'; + public const STATUS_CAPTURED_EXTERNALLY = 'capturedExternally'; + public const STATUS_CHARGEBACK = 'chargeback'; + public const STATUS_CHARGEBACK_EXTERNALLY = 'chargebackExternally'; + public const STATUS_CHARGEBACK_PENDING = 'chargebackPending'; + public const STATUS_CHARGEBACK_REVERSAL_PENDING = 'chargebackReversalPending'; + public const STATUS_CHARGEBACK_REVERSED = 'chargebackReversed'; + public const STATUS_CREDITED = 'credited'; + public const STATUS_DEPOSIT_CORRECTION = 'depositCorrection'; + public const STATUS_DEPOSIT_CORRECTION_PENDING = 'depositCorrectionPending'; + public const STATUS_DISPUTE = 'dispute'; + public const STATUS_DISPUTE_CLOSED = 'disputeClosed'; + public const STATUS_DISPUTE_EXPIRED = 'disputeExpired'; + public const STATUS_DISPUTE_NEEDS_REVIEW = 'disputeNeedsReview'; + public const STATUS_ERROR = 'error'; + public const STATUS_EXPIRED = 'expired'; + public const STATUS_FAILED = 'failed'; + public const STATUS_FEE = 'fee'; + public const STATUS_FEE_PENDING = 'feePending'; + public const STATUS_INTERNAL_TRANSFER = 'internalTransfer'; + public const STATUS_INTERNAL_TRANSFER_PENDING = 'internalTransferPending'; + public const STATUS_INVOICE_DEDUCTION = 'invoiceDeduction'; + public const STATUS_INVOICE_DEDUCTION_PENDING = 'invoiceDeductionPending'; + public const STATUS_MANUAL_CORRECTION_PENDING = 'manualCorrectionPending'; + public const STATUS_MANUALLY_CORRECTED = 'manuallyCorrected'; + public const STATUS_MATCHED_STATEMENT = 'matchedStatement'; + public const STATUS_MATCHED_STATEMENT_PENDING = 'matchedStatementPending'; + public const STATUS_MERCHANT_PAYIN = 'merchantPayin'; + public const STATUS_MERCHANT_PAYIN_PENDING = 'merchantPayinPending'; + public const STATUS_MERCHANT_PAYIN_REVERSED = 'merchantPayinReversed'; + public const STATUS_MERCHANT_PAYIN_REVERSED_PENDING = 'merchantPayinReversedPending'; + public const STATUS_MISC_COST = 'miscCost'; + public const STATUS_MISC_COST_PENDING = 'miscCostPending'; + public const STATUS_PAYMENT_COST = 'paymentCost'; + public const STATUS_PAYMENT_COST_PENDING = 'paymentCostPending'; + public const STATUS_RECEIVED = 'received'; + public const STATUS_REFUND_PENDING = 'refundPending'; + public const STATUS_REFUND_REVERSAL_PENDING = 'refundReversalPending'; + public const STATUS_REFUND_REVERSED = 'refundReversed'; + public const STATUS_REFUNDED = 'refunded'; + public const STATUS_REFUNDED_EXTERNALLY = 'refundedExternally'; + public const STATUS_REFUSED = 'refused'; + public const STATUS_RESERVE_ADJUSTMENT = 'reserveAdjustment'; + public const STATUS_RESERVE_ADJUSTMENT_PENDING = 'reserveAdjustmentPending'; + public const STATUS_RETURNED = 'returned'; + 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_TRACKING = 'tracking'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getReasonAllowableValues() + { + return [ + self::REASON_AMOUNT_LIMIT_EXCEEDED, + self::REASON_APPROVED, + self::REASON_COUNTERPARTY_ACCOUNT_BLOCKED, + self::REASON_COUNTERPARTY_ACCOUNT_CLOSED, + self::REASON_COUNTERPARTY_ACCOUNT_NOT_FOUND, + self::REASON_COUNTERPARTY_ADDRESS_REQUIRED, + self::REASON_COUNTERPARTY_BANK_TIMED_OUT, + self::REASON_COUNTERPARTY_BANK_UNAVAILABLE, + self::REASON_ERROR, + self::REASON_NOT_ENOUGH_BALANCE, + self::REASON_REFUSED_BY_COUNTERPARTY_BANK, + self::REASON_ROUTE_NOT_FOUND, + self::REASON_UNKNOWN, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_APPROVAL_PENDING, + self::STATUS_ATM_WITHDRAWAL, + self::STATUS_ATM_WITHDRAWAL_REVERSAL_PENDING, + self::STATUS_ATM_WITHDRAWAL_REVERSED, + self::STATUS_AUTH_ADJUSTMENT_AUTHORISED, + self::STATUS_AUTH_ADJUSTMENT_ERROR, + self::STATUS_AUTH_ADJUSTMENT_REFUSED, + self::STATUS_AUTHORISED, + self::STATUS_BANK_TRANSFER, + self::STATUS_BANK_TRANSFER_PENDING, + self::STATUS_BOOKED, + self::STATUS_BOOKING_PENDING, + self::STATUS_CANCELLED, + self::STATUS_CAPTURE_PENDING, + self::STATUS_CAPTURE_REVERSAL_PENDING, + self::STATUS_CAPTURE_REVERSED, + self::STATUS_CAPTURED, + self::STATUS_CAPTURED_EXTERNALLY, + self::STATUS_CHARGEBACK, + self::STATUS_CHARGEBACK_EXTERNALLY, + self::STATUS_CHARGEBACK_PENDING, + self::STATUS_CHARGEBACK_REVERSAL_PENDING, + self::STATUS_CHARGEBACK_REVERSED, + self::STATUS_CREDITED, + self::STATUS_DEPOSIT_CORRECTION, + self::STATUS_DEPOSIT_CORRECTION_PENDING, + self::STATUS_DISPUTE, + self::STATUS_DISPUTE_CLOSED, + self::STATUS_DISPUTE_EXPIRED, + self::STATUS_DISPUTE_NEEDS_REVIEW, + self::STATUS_ERROR, + self::STATUS_EXPIRED, + self::STATUS_FAILED, + self::STATUS_FEE, + self::STATUS_FEE_PENDING, + self::STATUS_INTERNAL_TRANSFER, + self::STATUS_INTERNAL_TRANSFER_PENDING, + self::STATUS_INVOICE_DEDUCTION, + self::STATUS_INVOICE_DEDUCTION_PENDING, + self::STATUS_MANUAL_CORRECTION_PENDING, + self::STATUS_MANUALLY_CORRECTED, + self::STATUS_MATCHED_STATEMENT, + self::STATUS_MATCHED_STATEMENT_PENDING, + self::STATUS_MERCHANT_PAYIN, + self::STATUS_MERCHANT_PAYIN_PENDING, + self::STATUS_MERCHANT_PAYIN_REVERSED, + self::STATUS_MERCHANT_PAYIN_REVERSED_PENDING, + self::STATUS_MISC_COST, + self::STATUS_MISC_COST_PENDING, + self::STATUS_PAYMENT_COST, + self::STATUS_PAYMENT_COST_PENDING, + self::STATUS_RECEIVED, + self::STATUS_REFUND_PENDING, + self::STATUS_REFUND_REVERSAL_PENDING, + self::STATUS_REFUND_REVERSED, + self::STATUS_REFUNDED, + self::STATUS_REFUNDED_EXTERNALLY, + self::STATUS_REFUSED, + self::STATUS_RESERVE_ADJUSTMENT, + self::STATUS_RESERVE_ADJUSTMENT_PENDING, + self::STATUS_RETURNED, + self::STATUS_SECOND_CHARGEBACK, + self::STATUS_SECOND_CHARGEBACK_PENDING, + self::STATUS_UNDEFINED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_ACCOUNTING, + self::TYPE_TRACKING, + ]; + } + /** + * 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('amountAdjustments', $data ?? [], null); + $this->setIfExists('bookingDate', $data ?? [], null); + $this->setIfExists('estimatedArrivalTime', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('mutations', $data ?? [], null); + $this->setIfExists('originalAmount', $data ?? [], null); + $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('transactionId', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('updateDate', $data ?? [], null); + $this->setIfExists('valueDate', $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->getReasonAllowableValues(); + if (!is_null($this->container['reason']) && !in_array($this->container['reason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'reason', must be one of '%s'", + $this->container['reason'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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\TransferWebhooks\Amount|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\TransferWebhooks\Amount|null $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets amountAdjustments + * + * @return \Adyen\Model\TransferWebhooks\AmountAdjustment[]|null + */ + public function getAmountAdjustments() + { + return $this->container['amountAdjustments']; + } + + /** + * Sets amountAdjustments + * + * @param \Adyen\Model\TransferWebhooks\AmountAdjustment[]|null $amountAdjustments The amount adjustments in this transfer. + * + * @return self + */ + public function setAmountAdjustments($amountAdjustments) + { + if (is_null($amountAdjustments)) { + throw new \InvalidArgumentException('non-nullable amountAdjustments cannot be null'); + } + $this->container['amountAdjustments'] = $amountAdjustments; + + return $this; + } + + /** + * Gets bookingDate + * + * @return \DateTime|null + */ + public function getBookingDate() + { + return $this->container['bookingDate']; + } + + /** + * Sets bookingDate + * + * @param \DateTime|null $bookingDate The date when the transfer request was sent. + * + * @return self + */ + public function setBookingDate($bookingDate) + { + if (is_null($bookingDate)) { + throw new \InvalidArgumentException('non-nullable bookingDate cannot be null'); + } + $this->container['bookingDate'] = $bookingDate; + + return $this; + } + + /** + * Gets estimatedArrivalTime + * + * @return \DateTime|null + */ + public function getEstimatedArrivalTime() + { + return $this->container['estimatedArrivalTime']; + } + + /** + * Sets estimatedArrivalTime + * + * @param \DateTime|null $estimatedArrivalTime The estimated time the beneficiary should have access to the funds. + * + * @return self + */ + public function setEstimatedArrivalTime($estimatedArrivalTime) + { + if (is_null($estimatedArrivalTime)) { + throw new \InvalidArgumentException('non-nullable estimatedArrivalTime cannot be null'); + } + $this->container['estimatedArrivalTime'] = $estimatedArrivalTime; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the transfer event. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets mutations + * + * @return \Adyen\Model\TransferWebhooks\BalanceMutation[]|null + */ + public function getMutations() + { + return $this->container['mutations']; + } + + /** + * Sets mutations + * + * @param \Adyen\Model\TransferWebhooks\BalanceMutation[]|null $mutations The list of the balance mutation per event. + * + * @return self + */ + public function setMutations($mutations) + { + if (is_null($mutations)) { + throw new \InvalidArgumentException('non-nullable mutations cannot be null'); + } + $this->container['mutations'] = $mutations; + + return $this; + } + + /** + * Gets originalAmount + * + * @return \Adyen\Model\TransferWebhooks\Amount|null + */ + public function getOriginalAmount() + { + return $this->container['originalAmount']; + } + + /** + * Sets originalAmount + * + * @param \Adyen\Model\TransferWebhooks\Amount|null $originalAmount originalAmount + * + * @return self + */ + public function setOriginalAmount($originalAmount) + { + if (is_null($originalAmount)) { + throw new \InvalidArgumentException('non-nullable originalAmount cannot be null'); + } + $this->container['originalAmount'] = $originalAmount; + + return $this; + } + + /** + * Gets reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason The reason for the transfer status. + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $allowedValues = $this->getReasonAllowableValues(); + if (!in_array($reason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'reason', must be one of '%s'", + $reason, + implode("', '", $allowedValues) + ) + ); + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the transfer event. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets transactionId + * + * @return string|null + */ + public function getTransactionId() + { + return $this->container['transactionId']; + } + + /** + * Sets transactionId + * + * @param string|null $transactionId The id of the transaction that is related to this accounting event. Only sent for events of type **accounting** where the balance changes. + * + * @return self + */ + public function setTransactionId($transactionId) + { + if (is_null($transactionId)) { + throw new \InvalidArgumentException('non-nullable transactionId cannot be null'); + } + $this->container['transactionId'] = $transactionId; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the transfer event. Possible values: **accounting**, **tracking**. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets updateDate + * + * @return \DateTime|null + */ + public function getUpdateDate() + { + return $this->container['updateDate']; + } + + /** + * Sets updateDate + * + * @param \DateTime|null $updateDate The date when the tracking status was updated. + * + * @return self + */ + public function setUpdateDate($updateDate) + { + if (is_null($updateDate)) { + throw new \InvalidArgumentException('non-nullable updateDate cannot be null'); + } + $this->container['updateDate'] = $updateDate; + + return $this; + } + + /** + * Gets valueDate + * + * @return \DateTime|null + */ + public function getValueDate() + { + return $this->container['valueDate']; + } + + /** + * Sets valueDate + * + * @param \DateTime|null $valueDate A future date, when the funds are expected to be deducted from or credited to the balance account. + * + * @return self + */ + public function setValueDate($valueDate) + { + if (is_null($valueDate)) { + throw new \InvalidArgumentException('non-nullable valueDate cannot be null'); + } + $this->container['valueDate'] = $valueDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/TransferNotificationRequest.php b/src/Adyen/Model/TransferWebhooks/TransferNotificationRequest.php new file mode 100644 index 000000000..1f25ce9f6 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/TransferNotificationRequest.php @@ -0,0 +1,491 @@ + + */ +class TransferNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferNotificationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\TransferWebhooks\TransferData', + 'environment' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'environment' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false, + 'environment' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'environment' => 'environment', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'environment' => 'setEnvironment', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'environment' => 'getEnvironment', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_CREATED = 'balancePlatform.transfer.created'; + public const TYPE_UPDATED = 'balancePlatform.transfer.updated'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CREATED, + self::TYPE_UPDATED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['environment'] === null) { + $invalidProperties[] = "'environment' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\TransferWebhooks\TransferData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\TransferWebhooks\TransferData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets environment + * + * @return string + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param string $environment The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @return self + */ + public function setEnvironment($environment) + { + if (is_null($environment)) { + throw new \InvalidArgumentException('non-nullable environment cannot be null'); + } + $this->container['environment'] = $environment; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of webhook. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/TransferNotificationTransferTracking.php b/src/Adyen/Model/TransferWebhooks/TransferNotificationTransferTracking.php new file mode 100644 index 000000000..d29169a95 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/TransferNotificationTransferTracking.php @@ -0,0 +1,449 @@ + + */ +class TransferNotificationTransferTracking implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferNotificationTransferTracking'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'estimatedArrivalTime' => '\DateTime', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'estimatedArrivalTime' => 'date-time', + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'estimatedArrivalTime' => false, + 'status' => 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 = [ + 'estimatedArrivalTime' => 'estimatedArrivalTime', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'estimatedArrivalTime' => 'setEstimatedArrivalTime', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'estimatedArrivalTime' => 'getEstimatedArrivalTime', + 'status' => 'getStatus' + ]; + + /** + * 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 STATUS_CREDITED = 'credited'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_CREDITED, + ]; + } + /** + * 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('estimatedArrivalTime', $data ?? [], null); + $this->setIfExists('status', $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->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + 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 estimatedArrivalTime + * + * @return \DateTime|null + */ + public function getEstimatedArrivalTime() + { + return $this->container['estimatedArrivalTime']; + } + + /** + * Sets estimatedArrivalTime + * + * @param \DateTime|null $estimatedArrivalTime The estimated time the beneficiary should have access to the funds. + * + * @return self + */ + public function setEstimatedArrivalTime($estimatedArrivalTime) + { + if (is_null($estimatedArrivalTime)) { + throw new \InvalidArgumentException('non-nullable estimatedArrivalTime cannot be null'); + } + $this->container['estimatedArrivalTime'] = $estimatedArrivalTime; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The tracking status of the transfer. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/TransferNotificationValidationFact.php b/src/Adyen/Model/TransferWebhooks/TransferNotificationValidationFact.php new file mode 100644 index 000000000..504cf1462 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/TransferNotificationValidationFact.php @@ -0,0 +1,418 @@ + + */ +class TransferNotificationValidationFact implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferNotificationValidationFact'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'result' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'result' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'result' => 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 = [ + 'result' => 'result', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'result' => 'setResult', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'result' => 'getResult', + '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('result', $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 result + * + * @return string|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param string|null $result The evaluation result of the validation fact. + * + * @return self + */ + public function setResult($result) + { + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the validation fact. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/UKLocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/UKLocalAccountIdentification.php new file mode 100644 index 000000000..f12bd54b2 --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/UKLocalAccountIdentification.php @@ -0,0 +1,492 @@ + + */ +class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UKLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'sortCode' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'sortCode' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'sortCode' => 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 = [ + 'accountNumber' => 'accountNumber', + 'sortCode' => 'sortCode', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'sortCode' => 'setSortCode', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'sortCode' => 'getSortCode', + '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_LOCAL = 'ukLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_UK_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('sortCode', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'ukLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['sortCode'] === null) { + $invalidProperties[] = "'sortCode' 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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The 8-digit bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets sortCode + * + * @return string + */ + public function getSortCode() + { + return $this->container['sortCode']; + } + + /** + * Sets sortCode + * + * @param string $sortCode The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. + * + * @return self + */ + public function setSortCode($sortCode) + { + if (is_null($sortCode)) { + throw new \InvalidArgumentException('non-nullable sortCode cannot be null'); + } + $this->container['sortCode'] = $sortCode; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **ukLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/TransferWebhooks/USLocalAccountIdentification.php b/src/Adyen/Model/TransferWebhooks/USLocalAccountIdentification.php new file mode 100644 index 000000000..b3fb3a4ca --- /dev/null +++ b/src/Adyen/Model/TransferWebhooks/USLocalAccountIdentification.php @@ -0,0 +1,559 @@ + + */ +class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'USLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'accountType' => 'string', + 'routingNumber' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'accountType' => null, + 'routingNumber' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'accountType' => false, + 'routingNumber' => 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 = [ + 'accountNumber' => 'accountNumber', + 'accountType' => 'accountType', + 'routingNumber' => 'routingNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'accountType' => 'setAccountType', + 'routingNumber' => 'setRoutingNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'accountType' => 'getAccountType', + 'routingNumber' => 'getRoutingNumber', + '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 ACCOUNT_TYPE_CHECKING = 'checking'; + public const ACCOUNT_TYPE_SAVINGS = 'savings'; + public const TYPE_US_LOCAL = 'usLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAccountTypeAllowableValues() + { + return [ + self::ACCOUNT_TYPE_CHECKING, + self::ACCOUNT_TYPE_SAVINGS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_US_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('accountType', $data ?? [], 'checking'); + $this->setIfExists('routingNumber', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'usLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + $allowedValues = $this->getAccountTypeAllowableValues(); + if (!is_null($this->container['accountType']) && !in_array($this->container['accountType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'accountType', must be one of '%s'", + $this->container['accountType'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['routingNumber'] === null) { + $invalidProperties[] = "'routingNumber' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets accountType + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['accountType']; + } + + /** + * Sets accountType + * + * @param string|null $accountType The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * + * @return self + */ + public function setAccountType($accountType) + { + if (is_null($accountType)) { + throw new \InvalidArgumentException('non-nullable accountType cannot be null'); + } + $allowedValues = $this->getAccountTypeAllowableValues(); + if (!in_array($accountType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'accountType', must be one of '%s'", + $accountType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['accountType'] = $accountType; + + return $this; + } + + /** + * Gets routingNumber + * + * @return string + */ + public function getRoutingNumber() + { + return $this->container['routingNumber']; + } + + /** + * Sets routingNumber + * + * @param string $routingNumber The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. + * + * @return self + */ + public function setRoutingNumber($routingNumber) + { + if (is_null($routingNumber)) { + throw new \InvalidArgumentException('non-nullable routingNumber cannot be null'); + } + $this->container['routingNumber'] = $routingNumber; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **usLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * 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/Address2.php b/src/Adyen/Model/Transfers/Address2.php index d329b6ed9..030ee8507 100644 --- a/src/Adyen/Model/Transfers/Address2.php +++ b/src/Adyen/Model/Transfers/Address2.php @@ -354,7 +354,7 @@ public function getCountry() /** * Sets country * - * @param string $country The two-character ISO 3166-1 alpha-2 country code. For example, **US**. >If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + * @param string $country The two-character ISO 3166-1 alpha-2 country code. For example, **US**, **NL**, or **GB**. * * @return self */ diff --git a/src/Adyen/Model/Transfers/BankAccountV3AccountIdentification.php b/src/Adyen/Model/Transfers/BankAccountV3AccountIdentification.php index 6bc7a5282..97c7f80e7 100644 --- a/src/Adyen/Model/Transfers/BankAccountV3AccountIdentification.php +++ b/src/Adyen/Model/Transfers/BankAccountV3AccountIdentification.php @@ -54,6 +54,7 @@ class BankAccountV3AccountIdentification implements ModelInterface, ArrayAccess, 'institutionNumber' => 'string', 'transitNumber' => 'string', 'iban' => 'string', + 'accountSuffix' => 'string', 'additionalBankIdentification' => '\Adyen\Model\Transfers\AdditionalBankIdentification', 'bic' => 'string', 'clearingNumber' => 'string', @@ -78,6 +79,7 @@ class BankAccountV3AccountIdentification implements ModelInterface, ArrayAccess, 'institutionNumber' => null, 'transitNumber' => null, 'iban' => null, + 'accountSuffix' => null, 'additionalBankIdentification' => null, 'bic' => null, 'clearingNumber' => null, @@ -100,6 +102,7 @@ class BankAccountV3AccountIdentification implements ModelInterface, ArrayAccess, 'institutionNumber' => false, 'transitNumber' => false, 'iban' => false, + 'accountSuffix' => false, 'additionalBankIdentification' => false, 'bic' => false, 'clearingNumber' => false, @@ -202,6 +205,7 @@ public function isNullableSetToNull(string $property): bool 'institutionNumber' => 'institutionNumber', 'transitNumber' => 'transitNumber', 'iban' => 'iban', + 'accountSuffix' => 'accountSuffix', 'additionalBankIdentification' => 'additionalBankIdentification', 'bic' => 'bic', 'clearingNumber' => 'clearingNumber', @@ -224,6 +228,7 @@ public function isNullableSetToNull(string $property): bool 'institutionNumber' => 'setInstitutionNumber', 'transitNumber' => 'setTransitNumber', 'iban' => 'setIban', + 'accountSuffix' => 'setAccountSuffix', 'additionalBankIdentification' => 'setAdditionalBankIdentification', 'bic' => 'setBic', 'clearingNumber' => 'setClearingNumber', @@ -246,6 +251,7 @@ public function isNullableSetToNull(string $property): bool 'institutionNumber' => 'getInstitutionNumber', 'transitNumber' => 'getTransitNumber', 'iban' => 'getIban', + 'accountSuffix' => 'getAccountSuffix', 'additionalBankIdentification' => 'getAdditionalBankIdentification', 'bic' => 'getBic', 'clearingNumber' => 'getClearingNumber', @@ -318,6 +324,7 @@ public function __construct(array $data = null) $this->setIfExists('institutionNumber', $data ?? [], null); $this->setIfExists('transitNumber', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('accountSuffix', $data ?? [], null); $this->setIfExists('additionalBankIdentification', $data ?? [], null); $this->setIfExists('bic', $data ?? [], null); $this->setIfExists('clearingNumber', $data ?? [], null); @@ -378,6 +385,9 @@ public function listInvalidProperties() if ($this->container['iban'] === null) { $invalidProperties[] = "'iban' can't be null"; } + if ($this->container['accountSuffix'] === null) { + $invalidProperties[] = "'accountSuffix' can't be null"; + } if ($this->container['bic'] === null) { $invalidProperties[] = "'bic' can't be null"; } @@ -499,7 +509,7 @@ public function getBankCode() /** * Sets bankCode * - * @param string $bankCode The 4-digit bank code (Registreringsnummer) (without separators or whitespace). + * @param string $bankCode The 6-digit bank code including the 2-digit bank code and 4-digit branch code, without separators or whitespace. * * @return self */ @@ -648,6 +658,33 @@ public function setIban($iban) return $this; } + /** + * Gets accountSuffix + * + * @return string + */ + public function getAccountSuffix() + { + return $this->container['accountSuffix']; + } + + /** + * Sets accountSuffix + * + * @param string $accountSuffix The 2- to 3-digit account suffix, without separators or whitespace. + * + * @return self + */ + public function setAccountSuffix($accountSuffix) + { + if (is_null($accountSuffix)) { + throw new \InvalidArgumentException('non-nullable accountSuffix cannot be null'); + } + $this->container['accountSuffix'] = $accountSuffix; + + return $this; + } + /** * Gets additionalBankIdentification * diff --git a/src/Adyen/Model/Transfers/CapitalBalance.php b/src/Adyen/Model/Transfers/CapitalBalance.php new file mode 100644 index 000000000..a1c29888a --- /dev/null +++ b/src/Adyen/Model/Transfers/CapitalBalance.php @@ -0,0 +1,498 @@ + + */ +class CapitalBalance implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CapitalBalance'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'fee' => 'int', + 'principal' => 'int', + 'total' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'fee' => 'int64', + 'principal' => 'int64', + 'total' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'fee' => false, + 'principal' => false, + 'total' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'fee' => 'fee', + 'principal' => 'principal', + 'total' => 'total' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'fee' => 'setFee', + 'principal' => 'setPrincipal', + 'total' => 'setTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'fee' => 'getFee', + 'principal' => 'getPrincipal', + 'total' => 'getTotal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('fee', $data ?? [], null); + $this->setIfExists('principal', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['fee'] === null) { + $invalidProperties[] = "'fee' can't be null"; + } + if ($this->container['principal'] === null) { + $invalidProperties[] = "'principal' can't be null"; + } + if ($this->container['total'] === null) { + $invalidProperties[] = "'total' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets fee + * + * @return int + */ + public function getFee() + { + return $this->container['fee']; + } + + /** + * Sets fee + * + * @param int $fee Fee amount. + * + * @return self + */ + public function setFee($fee) + { + if (is_null($fee)) { + throw new \InvalidArgumentException('non-nullable fee cannot be null'); + } + $this->container['fee'] = $fee; + + return $this; + } + + /** + * Gets principal + * + * @return int + */ + public function getPrincipal() + { + return $this->container['principal']; + } + + /** + * Sets principal + * + * @param int $principal Principal amount. + * + * @return self + */ + public function setPrincipal($principal) + { + if (is_null($principal)) { + throw new \InvalidArgumentException('non-nullable principal cannot be null'); + } + $this->container['principal'] = $principal; + + return $this; + } + + /** + * Gets total + * + * @return int + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int $total Total amount. A sum of principal amount and fee amount. + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/CapitalGrant.php b/src/Adyen/Model/Transfers/CapitalGrant.php new file mode 100644 index 000000000..7aaca02bb --- /dev/null +++ b/src/Adyen/Model/Transfers/CapitalGrant.php @@ -0,0 +1,706 @@ + + */ +class CapitalGrant implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CapitalGrant'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Transfers\Amount', + 'balances' => '\Adyen\Model\Transfers\CapitalBalance', + 'counterparty' => '\Adyen\Model\Transfers\Counterparty2', + 'fee' => '\Adyen\Model\Transfers\Fee', + 'grantAccountId' => 'string', + 'grantOfferId' => 'string', + 'id' => 'string', + 'repayment' => '\Adyen\Model\Transfers\Repayment', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'balances' => null, + 'counterparty' => null, + 'fee' => null, + 'grantAccountId' => null, + 'grantOfferId' => null, + 'id' => null, + 'repayment' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'balances' => false, + 'counterparty' => false, + 'fee' => false, + 'grantAccountId' => false, + 'grantOfferId' => false, + 'id' => false, + 'repayment' => false, + 'status' => 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', + 'balances' => 'balances', + 'counterparty' => 'counterparty', + 'fee' => 'fee', + 'grantAccountId' => 'grantAccountId', + 'grantOfferId' => 'grantOfferId', + 'id' => 'id', + 'repayment' => 'repayment', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'balances' => 'setBalances', + 'counterparty' => 'setCounterparty', + 'fee' => 'setFee', + 'grantAccountId' => 'setGrantAccountId', + 'grantOfferId' => 'setGrantOfferId', + 'id' => 'setId', + 'repayment' => 'setRepayment', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'balances' => 'getBalances', + 'counterparty' => 'getCounterparty', + 'fee' => 'getFee', + 'grantAccountId' => 'getGrantAccountId', + 'grantOfferId' => 'getGrantOfferId', + 'id' => 'getId', + 'repayment' => 'getRepayment', + 'status' => 'getStatus' + ]; + + /** + * 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 STATUS_PENDING = 'Pending'; + public const STATUS_ACTIVE = 'Active'; + public const STATUS_REPAID = 'Repaid'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_PENDING, + self::STATUS_ACTIVE, + self::STATUS_REPAID, + ]; + } + /** + * 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('balances', $data ?? [], null); + $this->setIfExists('counterparty', $data ?? [], null); + $this->setIfExists('fee', $data ?? [], null); + $this->setIfExists('grantAccountId', $data ?? [], null); + $this->setIfExists('grantOfferId', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('repayment', $data ?? [], null); + $this->setIfExists('status', $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['balances'] === null) { + $invalidProperties[] = "'balances' can't be null"; + } + if ($this->container['grantAccountId'] === null) { + $invalidProperties[] = "'grantAccountId' can't be null"; + } + if ($this->container['grantOfferId'] === null) { + $invalidProperties[] = "'grantOfferId' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + 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|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Transfers\Amount|null $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets balances + * + * @return \Adyen\Model\Transfers\CapitalBalance + */ + public function getBalances() + { + return $this->container['balances']; + } + + /** + * Sets balances + * + * @param \Adyen\Model\Transfers\CapitalBalance $balances balances + * + * @return self + */ + public function setBalances($balances) + { + if (is_null($balances)) { + throw new \InvalidArgumentException('non-nullable balances cannot be null'); + } + $this->container['balances'] = $balances; + + return $this; + } + + /** + * Gets counterparty + * + * @return \Adyen\Model\Transfers\Counterparty2|null + */ + public function getCounterparty() + { + return $this->container['counterparty']; + } + + /** + * Sets counterparty + * + * @param \Adyen\Model\Transfers\Counterparty2|null $counterparty counterparty + * + * @return self + */ + public function setCounterparty($counterparty) + { + if (is_null($counterparty)) { + throw new \InvalidArgumentException('non-nullable counterparty cannot be null'); + } + $this->container['counterparty'] = $counterparty; + + 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) + { + if (is_null($fee)) { + throw new \InvalidArgumentException('non-nullable fee cannot be null'); + } + $this->container['fee'] = $fee; + + return $this; + } + + /** + * Gets grantAccountId + * + * @return string + */ + public function getGrantAccountId() + { + return $this->container['grantAccountId']; + } + + /** + * Sets grantAccountId + * + * @param string $grantAccountId The identifier of the grant account used for the grant. + * + * @return self + */ + public function setGrantAccountId($grantAccountId) + { + if (is_null($grantAccountId)) { + throw new \InvalidArgumentException('non-nullable grantAccountId cannot be null'); + } + $this->container['grantAccountId'] = $grantAccountId; + + return $this; + } + + /** + * Gets grantOfferId + * + * @return string + */ + public function getGrantOfferId() + { + return $this->container['grantOfferId']; + } + + /** + * Sets grantOfferId + * + * @param string $grantOfferId The identifier of the grant offer that has been selected and from which the grant details will be used. + * + * @return self + */ + public function setGrantOfferId($grantOfferId) + { + if (is_null($grantOfferId)) { + throw new \InvalidArgumentException('non-nullable grantOfferId cannot be null'); + } + $this->container['grantOfferId'] = $grantOfferId; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The identifier of the grant reference. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets repayment + * + * @return \Adyen\Model\Transfers\Repayment|null + */ + public function getRepayment() + { + return $this->container['repayment']; + } + + /** + * Sets repayment + * + * @param \Adyen\Model\Transfers\Repayment|null $repayment repayment + * + * @return self + */ + public function setRepayment($repayment) + { + if (is_null($repayment)) { + throw new \InvalidArgumentException('non-nullable repayment cannot be null'); + } + $this->container['repayment'] = $repayment; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The current status of the grant. Possible values: **Pending**, **Active**, **Repaid**. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/CapitalGrantInfo.php b/src/Adyen/Model/Transfers/CapitalGrantInfo.php new file mode 100644 index 000000000..574770092 --- /dev/null +++ b/src/Adyen/Model/Transfers/CapitalGrantInfo.php @@ -0,0 +1,458 @@ + + */ +class CapitalGrantInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CapitalGrantInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'counterparty' => '\Adyen\Model\Transfers\Counterparty2', + 'grantAccountId' => 'string', + 'grantOfferId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'counterparty' => null, + 'grantAccountId' => null, + 'grantOfferId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'counterparty' => false, + 'grantAccountId' => false, + 'grantOfferId' => 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 = [ + 'counterparty' => 'counterparty', + 'grantAccountId' => 'grantAccountId', + 'grantOfferId' => 'grantOfferId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'counterparty' => 'setCounterparty', + 'grantAccountId' => 'setGrantAccountId', + 'grantOfferId' => 'setGrantOfferId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'counterparty' => 'getCounterparty', + 'grantAccountId' => 'getGrantAccountId', + 'grantOfferId' => 'getGrantOfferId' + ]; + + /** + * 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('counterparty', $data ?? [], null); + $this->setIfExists('grantAccountId', $data ?? [], null); + $this->setIfExists('grantOfferId', $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['grantAccountId'] === null) { + $invalidProperties[] = "'grantAccountId' can't be null"; + } + if ($this->container['grantOfferId'] === null) { + $invalidProperties[] = "'grantOfferId' 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 counterparty + * + * @return \Adyen\Model\Transfers\Counterparty2|null + */ + public function getCounterparty() + { + return $this->container['counterparty']; + } + + /** + * Sets counterparty + * + * @param \Adyen\Model\Transfers\Counterparty2|null $counterparty counterparty + * + * @return self + */ + public function setCounterparty($counterparty) + { + if (is_null($counterparty)) { + throw new \InvalidArgumentException('non-nullable counterparty cannot be null'); + } + $this->container['counterparty'] = $counterparty; + + return $this; + } + + /** + * Gets grantAccountId + * + * @return string + */ + public function getGrantAccountId() + { + return $this->container['grantAccountId']; + } + + /** + * Sets grantAccountId + * + * @param string $grantAccountId The identifier of the grant account used for the grant. + * + * @return self + */ + public function setGrantAccountId($grantAccountId) + { + if (is_null($grantAccountId)) { + throw new \InvalidArgumentException('non-nullable grantAccountId cannot be null'); + } + $this->container['grantAccountId'] = $grantAccountId; + + return $this; + } + + /** + * Gets grantOfferId + * + * @return string + */ + public function getGrantOfferId() + { + return $this->container['grantOfferId']; + } + + /** + * Sets grantOfferId + * + * @param string $grantOfferId The identifier of the grant offer that has been selected and from which the grant details will be used. + * + * @return self + */ + public function setGrantOfferId($grantOfferId) + { + if (is_null($grantOfferId)) { + throw new \InvalidArgumentException('non-nullable grantOfferId cannot be null'); + } + $this->container['grantOfferId'] = $grantOfferId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/CapitalGrants.php b/src/Adyen/Model/Transfers/CapitalGrants.php new file mode 100644 index 000000000..1b5fbad7c --- /dev/null +++ b/src/Adyen/Model/Transfers/CapitalGrants.php @@ -0,0 +1,387 @@ + + */ +class CapitalGrants implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CapitalGrants'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'grants' => '\Adyen\Model\Transfers\CapitalGrant[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'grants' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'grants' => 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 = [ + 'grants' => 'grants' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'grants' => 'setGrants' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'grants' => 'getGrants' + ]; + + /** + * 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('grants', $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['grants'] === null) { + $invalidProperties[] = "'grants' 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 grants + * + * @return \Adyen\Model\Transfers\CapitalGrant[] + */ + public function getGrants() + { + return $this->container['grants']; + } + + /** + * Sets grants + * + * @param \Adyen\Model\Transfers\CapitalGrant[] $grants The unique identifier of the grant. + * + * @return self + */ + public function setGrants($grants) + { + if (is_null($grants)) { + throw new \InvalidArgumentException('non-nullable grants cannot be null'); + } + $this->container['grants'] = $grants; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/Counterparty2.php b/src/Adyen/Model/Transfers/Counterparty2.php new file mode 100644 index 000000000..7c4cd8e05 --- /dev/null +++ b/src/Adyen/Model/Transfers/Counterparty2.php @@ -0,0 +1,452 @@ + + */ +class Counterparty2 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Counterparty-2'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountHolderId' => 'string', + '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 = [ + 'accountHolderId' => null, + 'balanceAccountId' => null, + 'transferInstrumentId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountHolderId' => false, + '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 = [ + 'accountHolderId' => 'accountHolderId', + 'balanceAccountId' => 'balanceAccountId', + 'transferInstrumentId' => 'transferInstrumentId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountHolderId' => 'setAccountHolderId', + 'balanceAccountId' => 'setBalanceAccountId', + 'transferInstrumentId' => 'setTransferInstrumentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountHolderId' => 'getAccountHolderId', + '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('accountHolderId', $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 accountHolderId + * + * @return string|null + */ + public function getAccountHolderId() + { + return $this->container['accountHolderId']; + } + + /** + * 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. + * + * @return self + */ + public function setAccountHolderId($accountHolderId) + { + if (is_null($accountHolderId)) { + throw new \InvalidArgumentException('non-nullable accountHolderId cannot be null'); + } + $this->container['accountHolderId'] = $accountHolderId; + + return $this; + } + + /** + * 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) + { + if (is_null($balanceAccountId)) { + throw new \InvalidArgumentException('non-nullable balanceAccountId cannot be null'); + } + $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) + { + if (is_null($transferInstrumentId)) { + throw new \InvalidArgumentException('non-nullable transferInstrumentId cannot be null'); + } + $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); + } + + /** + * 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/Fee.php b/src/Adyen/Model/Transfers/Fee.php new file mode 100644 index 000000000..c40e216d9 --- /dev/null +++ b/src/Adyen/Model/Transfers/Fee.php @@ -0,0 +1,387 @@ + + */ +class Fee implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Fee'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Transfers\Amount' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' 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) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * 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/NZLocalAccountIdentification.php b/src/Adyen/Model/Transfers/NZLocalAccountIdentification.php new file mode 100644 index 000000000..02bf8a23c --- /dev/null +++ b/src/Adyen/Model/Transfers/NZLocalAccountIdentification.php @@ -0,0 +1,529 @@ + + */ +class NZLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NZLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'accountSuffix' => 'string', + 'bankCode' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'accountSuffix' => null, + 'bankCode' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'accountSuffix' => false, + 'bankCode' => 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 = [ + 'accountNumber' => 'accountNumber', + 'accountSuffix' => 'accountSuffix', + 'bankCode' => 'bankCode', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'accountSuffix' => 'setAccountSuffix', + 'bankCode' => 'setBankCode', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'accountSuffix' => 'getAccountSuffix', + 'bankCode' => 'getBankCode', + '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_NZ_LOCAL = 'nzLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_NZ_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('accountSuffix', $data ?? [], null); + $this->setIfExists('bankCode', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'nzLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['accountSuffix'] === null) { + $invalidProperties[] = "'accountSuffix' can't be null"; + } + if ($this->container['bankCode'] === null) { + $invalidProperties[] = "'bankCode' 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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The 7-digit bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets accountSuffix + * + * @return string + */ + public function getAccountSuffix() + { + return $this->container['accountSuffix']; + } + + /** + * Sets accountSuffix + * + * @param string $accountSuffix The 2- to 3-digit account suffix, without separators or whitespace. + * + * @return self + */ + public function setAccountSuffix($accountSuffix) + { + if (is_null($accountSuffix)) { + throw new \InvalidArgumentException('non-nullable accountSuffix cannot be null'); + } + $this->container['accountSuffix'] = $accountSuffix; + + return $this; + } + + /** + * Gets bankCode + * + * @return string + */ + public function getBankCode() + { + return $this->container['bankCode']; + } + + /** + * Sets bankCode + * + * @param string $bankCode The 6-digit bank code including the 2-digit bank code and 4-digit branch code, without separators or whitespace. + * + * @return self + */ + public function setBankCode($bankCode) + { + if (is_null($bankCode)) { + throw new \InvalidArgumentException('non-nullable bankCode cannot be null'); + } + $this->container['bankCode'] = $bankCode; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **nzLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/PartyIdentification2.php b/src/Adyen/Model/Transfers/PartyIdentification2.php index d28e20e7b..49563b48e 100644 --- a/src/Adyen/Model/Transfers/PartyIdentification2.php +++ b/src/Adyen/Model/Transfers/PartyIdentification2.php @@ -49,6 +49,7 @@ class PartyIdentification2 implements ModelInterface, ArrayAccess, \JsonSerializ 'firstName' => 'string', 'fullName' => 'string', 'lastName' => 'string', + 'reference' => 'string', 'type' => 'string' ]; @@ -65,6 +66,7 @@ class PartyIdentification2 implements ModelInterface, ArrayAccess, \JsonSerializ 'firstName' => null, 'fullName' => null, 'lastName' => null, + 'reference' => null, 'type' => null ]; @@ -79,6 +81,7 @@ class PartyIdentification2 implements ModelInterface, ArrayAccess, \JsonSerializ 'firstName' => false, 'fullName' => false, 'lastName' => false, + 'reference' => false, 'type' => false ]; @@ -173,6 +176,7 @@ public function isNullableSetToNull(string $property): bool 'firstName' => 'firstName', 'fullName' => 'fullName', 'lastName' => 'lastName', + 'reference' => 'reference', 'type' => 'type' ]; @@ -187,6 +191,7 @@ public function isNullableSetToNull(string $property): bool 'firstName' => 'setFirstName', 'fullName' => 'setFullName', 'lastName' => 'setLastName', + 'reference' => 'setReference', 'type' => 'setType' ]; @@ -201,6 +206,7 @@ public function isNullableSetToNull(string $property): bool 'firstName' => 'getFirstName', 'fullName' => 'getFullName', 'lastName' => 'getLastName', + 'reference' => 'getReference', 'type' => 'getType' ]; @@ -282,6 +288,7 @@ public function __construct(array $data = null) $this->setIfExists('firstName', $data ?? [], null); $this->setIfExists('fullName', $data ?? [], null); $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('type', $data ?? [], 'unknown'); } @@ -379,7 +386,7 @@ public function getDateOfBirth() /** * Sets dateOfBirth * - * @param \DateTime|null $dateOfBirth The date of birth of the individual. Format: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD Allowed only when `type` is **individual**. + * @param \DateTime|null $dateOfBirth The date of birth of the individual in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. For example, **YYYY-MM-DD**. Should not be before January 1, 1900. Allowed only when `type` is **individual**. * * @return self */ @@ -406,7 +413,7 @@ public function getFirstName() /** * Sets firstName * - * @param string|null $firstName First name of the individual. Allowed only when `type` is **individual**. + * @param string|null $firstName First name of the individual. Allowed only when `type` is **individual**. * * @return self */ @@ -460,7 +467,7 @@ public function getLastName() /** * Sets lastName * - * @param string|null $lastName Last name of the individual. Allowed only when `type` is **individual**. + * @param string|null $lastName Last name of the individual. Allowed only when `type` is **individual**. * * @return self */ @@ -474,6 +481,33 @@ public function setLastName($lastName) return $this; } + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference A unique reference to identify the party or counterparty involved in transfers. This identifier ensures consistency and uniqueness throughout all transactions initiated to and from the same party. For example, your client's unique wallet or payee ID. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + /** * Gets type * diff --git a/src/Adyen/Model/Transfers/PaymentInstrument.php b/src/Adyen/Model/Transfers/PaymentInstrument.php new file mode 100644 index 000000000..55ef2f126 --- /dev/null +++ b/src/Adyen/Model/Transfers/PaymentInstrument.php @@ -0,0 +1,486 @@ + + */ +class PaymentInstrument implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentInstrument'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'id' => 'string', + 'reference' => 'string', + 'tokenType' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'id' => null, + 'reference' => null, + 'tokenType' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'id' => false, + 'reference' => false, + 'tokenType' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'reference' => 'reference', + 'tokenType' => 'tokenType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'reference' => 'setReference', + 'tokenType' => 'setTokenType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'reference' => 'getReference', + 'tokenType' => 'getTokenType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('tokenType', $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 description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the resource. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the resource. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The reference for the resource. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets tokenType + * + * @return string|null + */ + public function getTokenType() + { + return $this->container['tokenType']; + } + + /** + * Sets tokenType + * + * @param string|null $tokenType The type of wallet the network token is associated with. + * + * @return self + */ + public function setTokenType($tokenType) + { + if (is_null($tokenType)) { + throw new \InvalidArgumentException('non-nullable tokenType cannot be null'); + } + $this->container['tokenType'] = $tokenType; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/Repayment.php b/src/Adyen/Model/Transfers/Repayment.php new file mode 100644 index 000000000..ddba3f4e2 --- /dev/null +++ b/src/Adyen/Model/Transfers/Repayment.php @@ -0,0 +1,453 @@ + + */ +class Repayment implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Repayment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'basisPoints' => 'int', + 'term' => '\Adyen\Model\Transfers\RepaymentTerm', + 'threshold' => '\Adyen\Model\Transfers\ThresholdRepayment' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'basisPoints' => 'int32', + 'term' => null, + 'threshold' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'basisPoints' => true, + 'term' => false, + 'threshold' => 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 = [ + 'basisPoints' => 'basisPoints', + 'term' => 'term', + 'threshold' => 'threshold' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'basisPoints' => 'setBasisPoints', + 'term' => 'setTerm', + 'threshold' => 'setThreshold' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'basisPoints' => 'getBasisPoints', + 'term' => 'getTerm', + 'threshold' => 'getThreshold' + ]; + + /** + * 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('basisPoints', $data ?? [], null); + $this->setIfExists('term', $data ?? [], null); + $this->setIfExists('threshold', $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['basisPoints'] === null) { + $invalidProperties[] = "'basisPoints' 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 basisPoints + * + * @return int + */ + public function getBasisPoints() + { + return $this->container['basisPoints']; + } + + /** + * Sets basisPoints + * + * @param int $basisPoints The repayment that is deducted daily from incoming net volume, in [basis points](https://www.investopedia.com/terms/b/basispoint.asp). + * + * @return self + */ + public function setBasisPoints($basisPoints) + { + // Do nothing for nullable integers + $this->container['basisPoints'] = $basisPoints; + + return $this; + } + + /** + * Gets term + * + * @return \Adyen\Model\Transfers\RepaymentTerm|null + */ + public function getTerm() + { + return $this->container['term']; + } + + /** + * Sets term + * + * @param \Adyen\Model\Transfers\RepaymentTerm|null $term term + * + * @return self + */ + public function setTerm($term) + { + if (is_null($term)) { + throw new \InvalidArgumentException('non-nullable term cannot be null'); + } + $this->container['term'] = $term; + + return $this; + } + + /** + * Gets threshold + * + * @return \Adyen\Model\Transfers\ThresholdRepayment|null + */ + public function getThreshold() + { + return $this->container['threshold']; + } + + /** + * Sets threshold + * + * @param \Adyen\Model\Transfers\ThresholdRepayment|null $threshold threshold + * + * @return self + */ + public function setThreshold($threshold) + { + if (is_null($threshold)) { + throw new \InvalidArgumentException('non-nullable threshold cannot be null'); + } + $this->container['threshold'] = $threshold; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/RepaymentTerm.php b/src/Adyen/Model/Transfers/RepaymentTerm.php new file mode 100644 index 000000000..e5806534b --- /dev/null +++ b/src/Adyen/Model/Transfers/RepaymentTerm.php @@ -0,0 +1,417 @@ + + */ +class RepaymentTerm implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RepaymentTerm'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'estimatedDays' => 'int', + 'maximumDays' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'estimatedDays' => 'int32', + 'maximumDays' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'estimatedDays' => true, + 'maximumDays' => true + ]; + + /** + * 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 = [ + 'estimatedDays' => 'estimatedDays', + 'maximumDays' => 'maximumDays' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'estimatedDays' => 'setEstimatedDays', + 'maximumDays' => 'setMaximumDays' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'estimatedDays' => 'getEstimatedDays', + 'maximumDays' => 'getMaximumDays' + ]; + + /** + * 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('estimatedDays', $data ?? [], null); + $this->setIfExists('maximumDays', $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['estimatedDays'] === null) { + $invalidProperties[] = "'estimatedDays' 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 estimatedDays + * + * @return int + */ + public function getEstimatedDays() + { + return $this->container['estimatedDays']; + } + + /** + * Sets estimatedDays + * + * @param int $estimatedDays The estimated term for repaying the grant, in days. + * + * @return self + */ + public function setEstimatedDays($estimatedDays) + { + // Do nothing for nullable integers + $this->container['estimatedDays'] = $estimatedDays; + + return $this; + } + + /** + * Gets maximumDays + * + * @return int|null + */ + public function getMaximumDays() + { + return $this->container['maximumDays']; + } + + /** + * Sets maximumDays + * + * @param int|null $maximumDays The maximum term for repaying the grant, in days. Only applies when `contractType` is **loan**. + * + * @return self + */ + public function setMaximumDays($maximumDays) + { + // Do nothing for nullable integers + $this->container['maximumDays'] = $maximumDays; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/ResourceReference.php b/src/Adyen/Model/Transfers/ResourceReference.php new file mode 100644 index 000000000..86a06e148 --- /dev/null +++ b/src/Adyen/Model/Transfers/ResourceReference.php @@ -0,0 +1,452 @@ + + */ +class ResourceReference implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResourceReference'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'id' => 'string', + 'reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'id' => null, + 'reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'id' => false, + 'reference' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'reference' => 'reference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'reference' => 'setReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'reference' => 'getReference' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('reference', $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 description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the resource. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the resource. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The reference for the resource. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Transfers/ThresholdRepayment.php b/src/Adyen/Model/Transfers/ThresholdRepayment.php new file mode 100644 index 000000000..870cb4abf --- /dev/null +++ b/src/Adyen/Model/Transfers/ThresholdRepayment.php @@ -0,0 +1,387 @@ + + */ +class ThresholdRepayment implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThresholdRepayment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Transfers\Amount' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' 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) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * 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/Transaction.php b/src/Adyen/Model/Transfers/Transaction.php index 4b3e193cc..a4a722c6b 100644 --- a/src/Adyen/Model/Transfers/Transaction.php +++ b/src/Adyen/Model/Transfers/Transaction.php @@ -318,9 +318,11 @@ public function getModelName() } public const CATEGORY_BANK = 'bank'; + public const CATEGORY_CARD = 'card'; public const CATEGORY_GRANTS = 'grants'; public const CATEGORY_INTERNAL = 'internal'; public const CATEGORY_ISSUED_CARD = 'issuedCard'; + public const CATEGORY_MIGRATION = 'migration'; public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; public const STATUS_BOOKED = 'booked'; public const STATUS_PENDING = 'pending'; @@ -331,6 +333,7 @@ public function getModelName() public const TYPE_BANK_TRANSFER = 'bankTransfer'; public const TYPE_CAPTURE = 'capture'; public const TYPE_CAPTURE_REVERSAL = 'captureReversal'; + public const TYPE_CARD_TRANSFER = 'cardTransfer'; public const TYPE_CHARGEBACK = 'chargeback'; public const TYPE_CHARGEBACK_REVERSAL = 'chargebackReversal'; public const TYPE_DEPOSIT_CORRECTION = 'depositCorrection'; @@ -360,9 +363,11 @@ public function getCategoryAllowableValues() { return [ self::CATEGORY_BANK, + self::CATEGORY_CARD, self::CATEGORY_GRANTS, self::CATEGORY_INTERNAL, self::CATEGORY_ISSUED_CARD, + self::CATEGORY_MIGRATION, self::CATEGORY_PLATFORM_PAYMENT, ]; } @@ -393,6 +398,7 @@ public function getTypeAllowableValues() self::TYPE_BANK_TRANSFER, self::TYPE_CAPTURE, self::TYPE_CAPTURE_REVERSAL, + self::TYPE_CARD_TRANSFER, self::TYPE_CHARGEBACK, self::TYPE_CHARGEBACK_REVERSAL, self::TYPE_DEPOSIT_CORRECTION, diff --git a/src/Adyen/Model/Transfers/Transfer.php b/src/Adyen/Model/Transfers/Transfer.php index 4273e47ab..185679d3d 100644 --- a/src/Adyen/Model/Transfers/Transfer.php +++ b/src/Adyen/Model/Transfers/Transfer.php @@ -44,13 +44,17 @@ class Transfer implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'accountHolder' => '\Adyen\Model\Transfers\ResourceReference', 'amount' => '\Adyen\Model\Transfers\Amount', + 'balanceAccount' => '\Adyen\Model\Transfers\ResourceReference', 'balanceAccountId' => 'string', 'category' => 'string', 'counterparty' => '\Adyen\Model\Transfers\CounterpartyV3', + 'creationDate' => '\DateTime', 'description' => 'string', 'direction' => 'string', 'id' => 'string', + 'paymentInstrument' => '\Adyen\Model\Transfers\PaymentInstrument', 'paymentInstrumentId' => 'string', 'priority' => 'string', 'reason' => 'string', @@ -67,13 +71,17 @@ class Transfer implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'accountHolder' => null, 'amount' => null, + 'balanceAccount' => null, 'balanceAccountId' => null, 'category' => null, 'counterparty' => null, + 'creationDate' => 'date-time', 'description' => null, 'direction' => null, 'id' => null, + 'paymentInstrument' => null, 'paymentInstrumentId' => null, 'priority' => null, 'reason' => null, @@ -88,13 +96,17 @@ class Transfer implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ + 'accountHolder' => false, 'amount' => false, + 'balanceAccount' => false, 'balanceAccountId' => false, 'category' => false, 'counterparty' => false, + 'creationDate' => false, 'description' => false, 'direction' => false, 'id' => false, + 'paymentInstrument' => false, 'paymentInstrumentId' => false, 'priority' => false, 'reason' => false, @@ -189,13 +201,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'accountHolder' => 'accountHolder', 'amount' => 'amount', + 'balanceAccount' => 'balanceAccount', 'balanceAccountId' => 'balanceAccountId', 'category' => 'category', 'counterparty' => 'counterparty', + 'creationDate' => 'creationDate', 'description' => 'description', 'direction' => 'direction', 'id' => 'id', + 'paymentInstrument' => 'paymentInstrument', 'paymentInstrumentId' => 'paymentInstrumentId', 'priority' => 'priority', 'reason' => 'reason', @@ -210,13 +226,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'accountHolder' => 'setAccountHolder', 'amount' => 'setAmount', + 'balanceAccount' => 'setBalanceAccount', 'balanceAccountId' => 'setBalanceAccountId', 'category' => 'setCategory', 'counterparty' => 'setCounterparty', + 'creationDate' => 'setCreationDate', 'description' => 'setDescription', 'direction' => 'setDirection', 'id' => 'setId', + 'paymentInstrument' => 'setPaymentInstrument', 'paymentInstrumentId' => 'setPaymentInstrumentId', 'priority' => 'setPriority', 'reason' => 'setReason', @@ -231,13 +251,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'accountHolder' => 'getAccountHolder', 'amount' => 'getAmount', + 'balanceAccount' => 'getBalanceAccount', 'balanceAccountId' => 'getBalanceAccountId', 'category' => 'getCategory', 'counterparty' => 'getCounterparty', + 'creationDate' => 'getCreationDate', 'description' => 'getDescription', 'direction' => 'getDirection', 'id' => 'getId', + 'paymentInstrument' => 'getPaymentInstrument', 'paymentInstrumentId' => 'getPaymentInstrumentId', 'priority' => 'getPriority', 'reason' => 'getReason', @@ -330,7 +354,9 @@ public function getModelName() public const STATUS_CAPTURE_REVERSAL_PENDING = 'captureReversalPending'; public const STATUS_CAPTURE_REVERSED = 'captureReversed'; public const STATUS_CAPTURED = 'captured'; + public const STATUS_CAPTURED_EXTERNALLY = 'capturedExternally'; public const STATUS_CHARGEBACK = 'chargeback'; + public const STATUS_CHARGEBACK_EXTERNALLY = 'chargebackExternally'; public const STATUS_CHARGEBACK_PENDING = 'chargebackPending'; public const STATUS_CHARGEBACK_REVERSAL_PENDING = 'chargebackReversalPending'; public const STATUS_CHARGEBACK_REVERSED = 'chargebackReversed'; @@ -367,6 +393,7 @@ public function getModelName() public const STATUS_REFUND_REVERSAL_PENDING = 'refundReversalPending'; public const STATUS_REFUND_REVERSED = 'refundReversed'; public const STATUS_REFUNDED = 'refunded'; + public const STATUS_REFUNDED_EXTERNALLY = 'refundedExternally'; public const STATUS_REFUSED = 'refused'; public const STATUS_RESERVE_ADJUSTMENT = 'reserveAdjustment'; public const STATUS_RESERVE_ADJUSTMENT_PENDING = 'reserveAdjustmentPending'; @@ -466,7 +493,9 @@ public function getStatusAllowableValues() self::STATUS_CAPTURE_REVERSAL_PENDING, self::STATUS_CAPTURE_REVERSED, self::STATUS_CAPTURED, + self::STATUS_CAPTURED_EXTERNALLY, self::STATUS_CHARGEBACK, + self::STATUS_CHARGEBACK_EXTERNALLY, self::STATUS_CHARGEBACK_PENDING, self::STATUS_CHARGEBACK_REVERSAL_PENDING, self::STATUS_CHARGEBACK_REVERSED, @@ -503,6 +532,7 @@ public function getStatusAllowableValues() self::STATUS_REFUND_REVERSAL_PENDING, self::STATUS_REFUND_REVERSED, self::STATUS_REFUNDED, + self::STATUS_REFUNDED_EXTERNALLY, self::STATUS_REFUSED, self::STATUS_RESERVE_ADJUSTMENT, self::STATUS_RESERVE_ADJUSTMENT_PENDING, @@ -527,13 +557,17 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { + $this->setIfExists('accountHolder', $data ?? [], null); $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('balanceAccount', $data ?? [], null); $this->setIfExists('balanceAccountId', $data ?? [], null); $this->setIfExists('category', $data ?? [], null); $this->setIfExists('counterparty', $data ?? [], null); + $this->setIfExists('creationDate', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); $this->setIfExists('direction', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('paymentInstrument', $data ?? [], null); $this->setIfExists('paymentInstrumentId', $data ?? [], null); $this->setIfExists('priority', $data ?? [], null); $this->setIfExists('reason', $data ?? [], null); @@ -641,6 +675,33 @@ public function valid() } + /** + * Gets accountHolder + * + * @return \Adyen\Model\Transfers\ResourceReference|null + */ + public function getAccountHolder() + { + return $this->container['accountHolder']; + } + + /** + * Sets accountHolder + * + * @param \Adyen\Model\Transfers\ResourceReference|null $accountHolder accountHolder + * + * @return self + */ + public function setAccountHolder($accountHolder) + { + if (is_null($accountHolder)) { + throw new \InvalidArgumentException('non-nullable accountHolder cannot be null'); + } + $this->container['accountHolder'] = $accountHolder; + + return $this; + } + /** * Gets amount * @@ -668,10 +729,38 @@ public function setAmount($amount) return $this; } + /** + * Gets balanceAccount + * + * @return \Adyen\Model\Transfers\ResourceReference|null + */ + public function getBalanceAccount() + { + return $this->container['balanceAccount']; + } + + /** + * Sets balanceAccount + * + * @param \Adyen\Model\Transfers\ResourceReference|null $balanceAccount balanceAccount + * + * @return self + */ + public function setBalanceAccount($balanceAccount) + { + if (is_null($balanceAccount)) { + throw new \InvalidArgumentException('non-nullable balanceAccount cannot be null'); + } + $this->container['balanceAccount'] = $balanceAccount; + + return $this; + } + /** * Gets balanceAccountId * * @return string|null + * @deprecated */ public function getBalanceAccountId() { @@ -684,6 +773,7 @@ public function getBalanceAccountId() * @param string|null $balanceAccountId The unique identifier of the source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). * * @return self + * @deprecated */ public function setBalanceAccountId($balanceAccountId) { @@ -759,6 +849,33 @@ public function setCounterparty($counterparty) return $this; } + /** + * Gets creationDate + * + * @return \DateTime|null + */ + public function getCreationDate() + { + return $this->container['creationDate']; + } + + /** + * Sets creationDate + * + * @param \DateTime|null $creationDate The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + * + * @return self + */ + public function setCreationDate($creationDate) + { + if (is_null($creationDate)) { + throw new \InvalidArgumentException('non-nullable creationDate cannot be null'); + } + $this->container['creationDate'] = $creationDate; + + return $this; + } + /** * Gets description * @@ -772,7 +889,7 @@ public function getDescription() /** * Sets description * - * @param string|null $description A human-readable description for the transfer. You can use alphanumeric characters and hyphens. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. + * @param string|null $description Your description for the transfer. It is used by most banks as the transfer description. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. Supported characters: **[a-z] [A-Z] [0-9] / - ?** **: ( ) . , ' + Space** Supported characters for **regular** and **fast** transfers to a US counterparty: **[a-z] [A-Z] [0-9] & $ % # @** **~ = + - _ ' \" ! ?** * * @return self */ @@ -850,10 +967,38 @@ public function setId($id) return $this; } + /** + * Gets paymentInstrument + * + * @return \Adyen\Model\Transfers\PaymentInstrument|null + */ + public function getPaymentInstrument() + { + return $this->container['paymentInstrument']; + } + + /** + * Sets paymentInstrument + * + * @param \Adyen\Model\Transfers\PaymentInstrument|null $paymentInstrument paymentInstrument + * + * @return self + */ + public function setPaymentInstrument($paymentInstrument) + { + if (is_null($paymentInstrument)) { + throw new \InvalidArgumentException('non-nullable paymentInstrument cannot be null'); + } + $this->container['paymentInstrument'] = $paymentInstrument; + + return $this; + } + /** * Gets paymentInstrumentId * * @return string|null + * @deprecated */ public function getPaymentInstrumentId() { @@ -863,9 +1008,10 @@ public function getPaymentInstrumentId() /** * Sets paymentInstrumentId * - * @param string|null $paymentInstrumentId The unique identifier of the source [payment instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/paymentInstruments__resParam_id). + * @param string|null $paymentInstrumentId The unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) used in the transfer. * * @return self + * @deprecated */ public function setPaymentInstrumentId($paymentInstrumentId) { @@ -991,7 +1137,7 @@ public function getReferenceForBeneficiary() /** * Sets referenceForBeneficiary * - * @param string|null $referenceForBeneficiary A reference that is sent to the recipient. This reference is also sent in all notification webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. + * @param string|null $referenceForBeneficiary A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. * * @return self */ diff --git a/src/Adyen/Model/Transfers/TransferInfo.php b/src/Adyen/Model/Transfers/TransferInfo.php index 9d94cd2c0..13dedfea8 100644 --- a/src/Adyen/Model/Transfers/TransferInfo.php +++ b/src/Adyen/Model/Transfers/TransferInfo.php @@ -53,7 +53,8 @@ class TransferInfo implements ModelInterface, ArrayAccess, \JsonSerializable 'paymentInstrumentId' => 'string', 'priority' => 'string', 'reference' => 'string', - 'referenceForBeneficiary' => 'string' + 'referenceForBeneficiary' => 'string', + 'ultimateParty' => '\Adyen\Model\Transfers\UltimatePartyIdentification' ]; /** @@ -73,7 +74,8 @@ class TransferInfo implements ModelInterface, ArrayAccess, \JsonSerializable 'paymentInstrumentId' => null, 'priority' => null, 'reference' => null, - 'referenceForBeneficiary' => null + 'referenceForBeneficiary' => null, + 'ultimateParty' => null ]; /** @@ -91,7 +93,8 @@ class TransferInfo implements ModelInterface, ArrayAccess, \JsonSerializable 'paymentInstrumentId' => false, 'priority' => false, 'reference' => false, - 'referenceForBeneficiary' => false + 'referenceForBeneficiary' => false, + 'ultimateParty' => false ]; /** @@ -189,7 +192,8 @@ public function isNullableSetToNull(string $property): bool 'paymentInstrumentId' => 'paymentInstrumentId', 'priority' => 'priority', 'reference' => 'reference', - 'referenceForBeneficiary' => 'referenceForBeneficiary' + 'referenceForBeneficiary' => 'referenceForBeneficiary', + 'ultimateParty' => 'ultimateParty' ]; /** @@ -207,7 +211,8 @@ public function isNullableSetToNull(string $property): bool 'paymentInstrumentId' => 'setPaymentInstrumentId', 'priority' => 'setPriority', 'reference' => 'setReference', - 'referenceForBeneficiary' => 'setReferenceForBeneficiary' + 'referenceForBeneficiary' => 'setReferenceForBeneficiary', + 'ultimateParty' => 'setUltimateParty' ]; /** @@ -225,7 +230,8 @@ public function isNullableSetToNull(string $property): bool 'paymentInstrumentId' => 'getPaymentInstrumentId', 'priority' => 'getPriority', 'reference' => 'getReference', - 'referenceForBeneficiary' => 'getReferenceForBeneficiary' + 'referenceForBeneficiary' => 'getReferenceForBeneficiary', + 'ultimateParty' => 'getUltimateParty' ]; /** @@ -273,6 +279,7 @@ public function getModelName() public const CATEGORY_INTERNAL = 'internal'; public const CATEGORY_ISSUED_CARD = 'issuedCard'; public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; + public const CATEGORY_CARD = 'card'; public const PRIORITY_CROSS_BORDER = 'crossBorder'; public const PRIORITY_DIRECT_DEBIT = 'directDebit'; public const PRIORITY_FAST = 'fast'; @@ -293,6 +300,7 @@ public function getCategoryAllowableValues() self::CATEGORY_INTERNAL, self::CATEGORY_ISSUED_CARD, self::CATEGORY_PLATFORM_PAYMENT, + self::CATEGORY_CARD, ]; } /** @@ -337,6 +345,7 @@ public function __construct(array $data = null) $this->setIfExists('priority', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('referenceForBeneficiary', $data ?? [], null); + $this->setIfExists('ultimateParty', $data ?? [], null); } /** @@ -539,7 +548,7 @@ public function getDescription() /** * Sets description * - * @param string|null $description A human-readable description for the transfer. You can use alphanumeric characters and hyphens. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. + * @param string|null $description Your description for the transfer. It is used by most banks as the transfer description. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. Supported characters: **[a-z] [A-Z] [0-9] / - ?** **: ( ) . , ' + Space** Supported characters for **regular** and **fast** transfers to a US counterparty: **[a-z] [A-Z] [0-9] & $ % # @** **~ = + - _ ' \" ! ?** * * @return self */ @@ -684,7 +693,7 @@ public function getReferenceForBeneficiary() /** * Sets referenceForBeneficiary * - * @param string|null $referenceForBeneficiary A reference that is sent to the recipient. This reference is also sent in all notification webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. + * @param string|null $referenceForBeneficiary A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. * * @return self */ @@ -697,6 +706,33 @@ public function setReferenceForBeneficiary($referenceForBeneficiary) 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) + { + if (is_null($ultimateParty)) { + throw new \InvalidArgumentException('non-nullable ultimateParty cannot be null'); + } + $this->container['ultimateParty'] = $ultimateParty; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Transfers/UltimatePartyIdentification.php b/src/Adyen/Model/Transfers/UltimatePartyIdentification.php new file mode 100644 index 000000000..db3d95e50 --- /dev/null +++ b/src/Adyen/Model/Transfers/UltimatePartyIdentification.php @@ -0,0 +1,626 @@ + + */ +class UltimatePartyIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UltimatePartyIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address' => '\Adyen\Model\Transfers\Address2', + 'dateOfBirth' => '\DateTime', + 'firstName' => 'string', + 'fullName' => 'string', + 'lastName' => 'string', + 'reference' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address' => null, + 'dateOfBirth' => 'date', + 'firstName' => null, + 'fullName' => null, + 'lastName' => null, + 'reference' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'address' => false, + 'dateOfBirth' => false, + 'firstName' => false, + 'fullName' => false, + 'lastName' => false, + 'reference' => 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 = [ + 'address' => 'address', + 'dateOfBirth' => 'dateOfBirth', + 'firstName' => 'firstName', + 'fullName' => 'fullName', + 'lastName' => 'lastName', + 'reference' => 'reference', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'dateOfBirth' => 'setDateOfBirth', + 'firstName' => 'setFirstName', + 'fullName' => 'setFullName', + 'lastName' => 'setLastName', + 'reference' => 'setReference', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'dateOfBirth' => 'getDateOfBirth', + 'firstName' => 'getFirstName', + 'fullName' => 'getFullName', + 'lastName' => 'getLastName', + 'reference' => 'getReference', + '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_INDIVIDUAL = 'individual'; + public const TYPE_ORGANIZATION = 'organization'; + public const TYPE_UNKNOWN = 'unknown'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_INDIVIDUAL, + self::TYPE_ORGANIZATION, + self::TYPE_UNKNOWN, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('dateOfBirth', $data ?? [], null); + $this->setIfExists('firstName', $data ?? [], null); + $this->setIfExists('fullName', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'unknown'); + } + + /** + * 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['fullName'] === null) { + $invalidProperties[] = "'fullName' 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 address + * + * @return \Adyen\Model\Transfers\Address2|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Adyen\Model\Transfers\Address2|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets dateOfBirth + * + * @return \DateTime|null + */ + public function getDateOfBirth() + { + return $this->container['dateOfBirth']; + } + + /** + * Sets dateOfBirth + * + * @param \DateTime|null $dateOfBirth The date of birth of the individual in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. For example, **YYYY-MM-DD**. Should not be before January 1, 1900. Allowed only when `type` is **individual**. + * + * @return self + */ + public function setDateOfBirth($dateOfBirth) + { + if (is_null($dateOfBirth)) { + throw new \InvalidArgumentException('non-nullable dateOfBirth cannot be null'); + } + $this->container['dateOfBirth'] = $dateOfBirth; + + return $this; + } + + /** + * Gets firstName + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string|null $firstName First name of the individual. Allowed only when `type` is **individual**. + * + * @return self + */ + public function setFirstName($firstName) + { + if (is_null($firstName)) { + throw new \InvalidArgumentException('non-nullable firstName cannot be null'); + } + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets fullName + * + * @return string + */ + public function getFullName() + { + return $this->container['fullName']; + } + + /** + * Sets fullName + * + * @param string $fullName The name of the entity. + * + * @return self + */ + public function setFullName($fullName) + { + if (is_null($fullName)) { + throw new \InvalidArgumentException('non-nullable fullName cannot be null'); + } + $this->container['fullName'] = $fullName; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName() + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName Last name of the individual. Allowed only when `type` is **individual**. + * + * @return self + */ + public function setLastName($lastName) + { + if (is_null($lastName)) { + throw new \InvalidArgumentException('non-nullable lastName cannot be null'); + } + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference A unique reference to identify the party or counterparty involved in transfers. This identifier ensures consistency and uniqueness throughout all transactions initiated to and from the same party. For example, your client's unique wallet or payee ID. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of entity that owns the bank account. Possible values: **individual**, **organization**, or **unknown**. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Service.php b/src/Adyen/Service.php index 20de3a412..935008b42 100644 --- a/src/Adyen/Service.php +++ b/src/Adyen/Service.php @@ -2,7 +2,7 @@ namespace Adyen; -use PHPUnit\Util\Exception; +use DateTime; class Service { @@ -22,16 +22,14 @@ class Service * @param Client $client * @throws AdyenException */ - public function __construct(\Adyen\Client $client) + public function __construct(Client $client) { - $msg = null; - // validate if client has all the configuration we need if (!$client->getConfig()->get('environment')) { // throw exception $msg = 'The Client does not have a correct environment, use ' . - \Adyen\Environment::TEST . ' or ' . \Adyen\Environment::LIVE; - throw new \Adyen\AdyenException($msg); + Environment::TEST . ' or ' . Environment::LIVE; + throw new AdyenException($msg); } $this->client = $client; @@ -40,13 +38,19 @@ public function __construct(\Adyen\Client $client) /** * @return Client */ - public function getClient() + public function getClient(): Client { return $this->client; } /** + * @param string $url + * @param string $method + * @param array|null $bodyParams + * @param array|null $requestOptions + * @return array * @throws AdyenException + * @throws ConnectionException */ protected function requestHttp( string $url, @@ -57,13 +61,11 @@ protected function requestHttp( // check if rest api method has a value if (!$method) { $msg = 'The REST API method is empty'; - $this->getClient()->getLogger()->error($msg); throw new AdyenException($msg); } // check if rest api method has a value if (!$url) { $msg = 'The REST API endpoint is empty'; - $this->getClient()->getLogger()->error($msg); throw new AdyenException($msg); } $curlClient = $this->getClient()->getHttpClient(); @@ -74,7 +76,7 @@ protected function requestHttp( // catch DateTime objects and convert them to string $queryParams = array_map( function ($val) { - if ($val instanceof \DateTime) { + if ($val instanceof DateTime) { return $val->format('c'); } return $val; @@ -91,7 +93,7 @@ function ($val) { /** * @return bool */ - public function requiresApiKey() + public function requiresApiKey(): bool { return $this->requiresApiKey; } @@ -104,12 +106,12 @@ public function requiresApiKey() public function createBaseUrl(string $url): string { $config = $this->getClient()->getConfig(); - if ($this->getClient()->getConfig()->getEnvironment() === \Adyen\Environment::LIVE) { + if ($this->getClient()->getConfig()->getEnvironment() === Environment::LIVE) { // Add live url prefix for pal/servlet endpoints if (strpos($url, "pal-") !== false) { // Check prefix is not empty and if so throw error if ($config->get('prefix') == null) { - throw new \Adyen\AdyenException( + throw new AdyenException( "Please add your live URL prefix from CA under Developers > API URLs > Prefix" ); } @@ -124,7 +126,7 @@ public function createBaseUrl(string $url): string // Add live url prefix for checkout if (strpos($url, "checkout-") !== false) { if ($config->get('prefix') == null) { - throw new \Adyen\AdyenException( + throw new AdyenException( "Please add your checkout live URL prefix from CA under Developers > API URLs > Prefix" ); } diff --git a/src/Adyen/Service/AbstractCheckoutResource.php b/src/Adyen/Service/AbstractCheckoutResource.php index 97aeeca05..37e3b02d6 100644 --- a/src/Adyen/Service/AbstractCheckoutResource.php +++ b/src/Adyen/Service/AbstractCheckoutResource.php @@ -2,6 +2,8 @@ namespace Adyen\Service; +use Adyen\AdyenException; + class AbstractCheckoutResource extends AbstractResource { /** @@ -9,18 +11,16 @@ class AbstractCheckoutResource extends AbstractResource * * @param $service * @return mixed - * @throws \Adyen\AdyenException + * @throws AdyenException */ public function getCheckoutEndpoint($service) { // check if endpoint is set if ($service->getClient()->getConfig()->get('endpointCheckout') == null) { - $logger = $service->getClient()->getLogger(); $msg = 'Please provide your unique live url prefix on the' . ' setEnvironment() call on the Client or provide endpointCheckout' . ' in your config object.'; - $logger->error($msg); - throw new \Adyen\AdyenException($msg); + throw new AdyenException($msg); } return $service->getClient()->getConfig()->get('endpointCheckout'); diff --git a/src/Adyen/Service/AbstractResource.php b/src/Adyen/Service/AbstractResource.php index 11ea8949c..f0b37d00e 100644 --- a/src/Adyen/Service/AbstractResource.php +++ b/src/Adyen/Service/AbstractResource.php @@ -3,6 +3,7 @@ namespace Adyen\Service; use Adyen\AdyenException; +use Adyen\ConnectionException; use Adyen\Service; abstract class AbstractResource @@ -41,15 +42,15 @@ abstract class AbstractResource * AbstractResource constructor. * * @param Service $service - * @param string $endpoint + * @param string|null $endpoint * @param bool $allowApplicationInfo * @param bool $allowApplicationInfoPOS */ public function __construct( Service $service, - $endpoint, - $allowApplicationInfo = false, - $allowApplicationInfoPOS = false + ?string $endpoint, + bool $allowApplicationInfo = false, + bool $allowApplicationInfoPOS = false ) { $this->service = $service; $this->endpoint = $endpoint; @@ -68,6 +69,7 @@ public function __construct( * @param null $requestOptions * @return mixed * @throws AdyenException + * @throws ConnectionException */ public function request($params, $requestOptions = null) { @@ -77,20 +79,17 @@ public function request($params, $requestOptions = null) if ($params === null && json_last_error() !== JSON_ERROR_NONE) { $msg = 'The parameters in the request expect valid JSON but JSON error code found: ' . json_last_error(); - $this->service->getClient()->getLogger()->error($msg); throw new AdyenException($msg); } } if (!is_array($params)) { $msg = 'The parameter is not valid array'; - $this->service->getClient()->getLogger()->error($msg); throw new AdyenException($msg); } $params = $this->addDefaultParametersToRequest($params); - - $this->replacePathParameters($params); + $updatedEndpoint = $this->replacePathParameters($params); if ($this->allowApplicationInfo) { $params = $this->handleApplicationInfoInRequest($params); @@ -104,7 +103,7 @@ public function request($params, $requestOptions = null) } $curlClient = $this->service->getClient()->getHttpClient(); - return $curlClient->requestJson($this->service, $this->endpoint, $params, $requestOptions); + return $curlClient->requestJson($this->service, $updatedEndpoint, $params, $requestOptions); } /** @@ -128,9 +127,9 @@ private function addDefaultParametersToRequest($params) * otherwise removes from the request * * @param $params - * @return mixed + * @return array */ - private function handleApplicationInfoInRequest($params) + private function handleApplicationInfoInRequest($params): array { // add/overwrite applicationInfo adyenLibrary even if it's already set $params['applicationInfo']['adyenLibrary']['name'] = $this->service->getClient()->getLibraryName(); @@ -165,10 +164,10 @@ private function handleApplicationInfoInRequest($params) * 2) Adds ApplicationInfo to the array * 3) Base64 encodes SaleToAcquirerData * - * @param $params + * @param array $params * @return array|null */ - private function handleApplicationInfoInRequestPOS(array $params) + private function handleApplicationInfoInRequestPOS(array $params): ?array { //If the POS request is not a payment request, do not add application info if (empty($params['SaleToPOIRequest']['PaymentRequest'])) { @@ -181,16 +180,16 @@ private function handleApplicationInfoInRequestPOS(array $params) if (!empty($params['SaleToPOIRequest']['PaymentRequest']['SaleData']['SaleToAcquirerData'])) { $saleToAcquirerData = $params['SaleToPOIRequest']['PaymentRequest']['SaleData']['SaleToAcquirerData']; - //If SaleToAcquirerData is a querystring convert it to array + //If SaleToAcquirerData is a query-string convert it to array parse_str($saleToAcquirerData, $queryString); $queryStringValues = array_values($queryString); - //check if querystring is nonempty and contains a value - if (!empty($queryString) && !empty($queryStringValues[0])) { - $saleToAcquirerData = $queryString; - } elseif ($this->isBase64Encoded($saleToAcquirerData)) { + // Check if $saleToAcquirerData is base64 encoded or query-string is nonempty and contains a value + if ($this->isBase64Encoded($saleToAcquirerData)) { //If SaleToAcquirerData is a base64encoded string decode it and convert it to array $saleToAcquirerData = json_decode(base64_decode($saleToAcquirerData, true), true); + } elseif (!empty($queryString) && !empty($queryStringValues[0])) { + $saleToAcquirerData = $queryString; } } @@ -206,18 +205,18 @@ private function handleApplicationInfoInRequestPOS(array $params) * @param $data * @return bool */ - private function isBase64Encoded($data) + private function isBase64Encoded($data): bool { return preg_match('%^[a-zA-Z0-9/+]*={0,2}$%', $data) && !empty($data); } /** * @param $data - * @return void + * @return string */ private function replacePathParameters($data) { - $this->endpoint = preg_replace_callback( + return preg_replace_callback( '/{([a-zA-Z]+)}/', function ($matches) use ($data) { return $data[$matches[1]] ?? $matches[0]; @@ -225,18 +224,18 @@ function ($matches) use ($data) { $this->endpoint ); } - + /** * @param $params * @return mixed * @throws AdyenException + * @throws ConnectionException */ public function requestPost($params) { // check if paramenters has a value if (!$params) { $msg = 'The parameters in the request are empty'; - $this->service->getClient()->getLogger()->error($msg); throw new AdyenException($msg); } @@ -246,23 +245,21 @@ public function requestPost($params) /** * @param $url - * @param $method + * @param string $method * @param array|null $params * @return mixed - * @throws AdyenException + * @throws AdyenException|ConnectionException */ - public function requestHttp($url, $method = 'get', array $params = null) + public function requestHttp($url, string $method = 'get', array $params = null) { // check if rest api method has a value if (!$method) { $msg = 'The REST API method is empty'; - $this->service->getClient()->getLogger()->error($msg); throw new AdyenException($msg); } // check if rest api method has a value if (!$url) { $msg = 'The REST API endpoint is empty'; - $this->service->getClient()->getLogger()->error($msg); throw new AdyenException($msg); } // build query param in url for get/delete diff --git a/src/Adyen/Service/Account.php b/src/Adyen/Service/Account.php index 3803c4d54..fdae84fb5 100755 --- a/src/Adyen/Service/Account.php +++ b/src/Adyen/Service/Account.php @@ -2,6 +2,11 @@ namespace Adyen\Service; +/** + * @deprecated Please consider using the BalancePlatform and LegalEntityManagement services instead + * @see \Adyen\Service\BalancePlatform\ + * @see \Adyen\Service\LegalEntityManagement\ + */ class Account extends \Adyen\Service { /** @@ -86,6 +91,7 @@ class Account extends \Adyen\Service /** * Account constructor. + * * @param \Adyen\Client $client * @throws \Adyen\AdyenException */ diff --git a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php index b537fc928..c646e0311 100644 --- a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php +++ b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php @@ -44,7 +44,6 @@ public function __construct(Client $client) * * @param \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest * @param array|null $requestOptions - * @return void * @throws AdyenException */ public function validateBankAccountIdentification(\Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest, array $requestOptions = null): void diff --git a/src/Adyen/Service/BalancePlatform/GrantAccountsApi.php b/src/Adyen/Service/BalancePlatform/GrantAccountsApi.php new file mode 100644 index 000000000..44ba3ba83 --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/GrantAccountsApi.php @@ -0,0 +1,56 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Get a grant account + * + * @param string $id + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\CapitalGrantAccount + * @throws AdyenException + */ + public function getGrantAccount(string $id, array $requestOptions = null): \Adyen\Model\BalancePlatform\CapitalGrantAccount + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/grantAccounts/{id}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\CapitalGrantAccount::class); + } +} diff --git a/src/Adyen/Service/BalancePlatform/GrantOffersApi.php b/src/Adyen/Service/BalancePlatform/GrantOffersApi.php new file mode 100644 index 000000000..f07b49615 --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/GrantOffersApi.php @@ -0,0 +1,70 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Get all available grant offers + * + * @param array|null $requestOptions ['queryParams' => ['accountHolderId'=> string]] + * @return \Adyen\Model\BalancePlatform\GrantOffers + * @throws AdyenException + */ + public function getAllAvailableGrantOffers(array $requestOptions = null): \Adyen\Model\BalancePlatform\GrantOffers + { + $endpoint = $this->baseURL . "/grantOffers"; + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\GrantOffers::class); + } + + /** + * Get a grant offer + * + * @param string $grantOfferId + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\GrantOffer + * @throws AdyenException + */ + public function getGrantOffer(string $grantOfferId, array $requestOptions = null): \Adyen\Model\BalancePlatform\GrantOffer + { + $endpoint = $this->baseURL . str_replace(['{grantOfferId}'], [$grantOfferId], "/grantOffers/{grantOfferId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\GrantOffer::class); + } +} diff --git a/src/Adyen/Service/BankingWebhookParser.php b/src/Adyen/Service/BankingWebhookParser.php new file mode 100644 index 000000000..61bf718b0 --- /dev/null +++ b/src/Adyen/Service/BankingWebhookParser.php @@ -0,0 +1,92 @@ +payload = $payload; + } + + public function getGenericWebhook() + { + $jsonPayload = json_decode($this->payload, true); + $type = $jsonPayload['type']; + + if (in_array($type, ($clazz = new AccountHolderNotificationRequest)->getTypeAllowableValues())) { + return (object)$this->deserializewebhook($clazz); + } + + if (in_array($type, ($clazz = new BalanceAccountNotificationRequest())->getTypeAllowableValues())) { + return (object)$this->deserializeWebhook($clazz); + } + + if (in_array($type, ($clazz = new PaymentNotificationRequest())->getTypeAllowableValues())) { + return (object)$this->deserializeWebhook($clazz); + } + + if (in_array($type, ($clazz = new SweepConfigurationNotificationRequest())->getTypeAllowableValues())) { + return (object)$this->deserializeWebhook($clazz); + } + + if (in_array($type, ($clazz = new ReportNotificationRequest())->getTypeAllowableValues())) { + return (object)$this->deserializeWebhook($clazz); + } + + if (in_array($type, ($clazz = new TransferNotificationRequest())->getTypeAllowableValues())) { + return(object)$this->deserializeWebhook($clazz); + } + } + + /** @noinspection PhpIncompatibleReturnTypeInspection */ + public function getAccountHolderNotificationRequest(): AccountHolderNotificationRequest + { + return $this->getGenericWebhook(); + } + + /** @noinspection PhpIncompatibleReturnTypeInspection */ + public function getBalanceAccountNotificationRequest(): BalanceAccountNotificationRequest + { + return $this->getGenericWebhook(); + } + + /** @noinspection PhpIncompatibleReturnTypeInspection */ + public function getPaymentNotificationRequest(): PaymentNotificationRequest + { + return $this->getGenericWebhook(); + } + + /** @noinspection PhpIncompatibleReturnTypeInspection */ + public function getSweepConfigurationNotificationRequest(): SweepConfigurationNotificationRequest + { + return $this->getGenericWebhook(); + } + + /** @noinspection PhpIncompatibleReturnTypeInspection */ + public function getReportNotificationRequest(): ReportNotificationRequest + { + return $this->getGenericWebhook(); + } + + /** @noinspection PhpIncompatibleReturnTypeInspection */ + public function getTransferNotificationRequest(): TransferNotificationRequest + { + return $this->getGenericWebhook(); + } + + private function deserializeWebhook($clazz) + { + return ObjectSerializer::deserialize($this->payload, get_class($clazz)); + } +} diff --git a/src/Adyen/Service/BinLookup.php b/src/Adyen/Service/BinLookup.php index 0cb19795a..9d591a15f 100644 --- a/src/Adyen/Service/BinLookup.php +++ b/src/Adyen/Service/BinLookup.php @@ -2,6 +2,10 @@ namespace Adyen\Service; +/** + * @deprecated Please consider using the model based services instead (suffix -Api.php) + * @see \Adyen\Service\BinLookupApi + */ class BinLookup extends \Adyen\Service { /** @@ -17,7 +21,6 @@ class BinLookup extends \Adyen\Service /** * BinLookup constructor. * - * @deprecated Please consider using the model based services instead (suffix -Api.php) * @param \Adyen\Client $client * @throws \Adyen\AdyenException */ diff --git a/src/Adyen/Service/Builder/Address.php b/src/Adyen/Service/Builder/Address.php index 0baed7e0a..7f04aafaa 100644 --- a/src/Adyen/Service/Builder/Address.php +++ b/src/Adyen/Service/Builder/Address.php @@ -23,6 +23,9 @@ namespace Adyen\Service\Builder; +/** + * @deprecated + */ class Address { /** diff --git a/src/Adyen/Service/Builder/Browser.php b/src/Adyen/Service/Builder/Browser.php index 3e82beb83..dfe67dbad 100644 --- a/src/Adyen/Service/Builder/Browser.php +++ b/src/Adyen/Service/Builder/Browser.php @@ -23,6 +23,9 @@ namespace Adyen\Service\Builder; +/** + * @deprecated + */ class Browser { const BROWSER_INFO = 'browserInfo'; diff --git a/src/Adyen/Service/Builder/Customer.php b/src/Adyen/Service/Builder/Customer.php index 9475ca608..335d7996a 100644 --- a/src/Adyen/Service/Builder/Customer.php +++ b/src/Adyen/Service/Builder/Customer.php @@ -23,6 +23,9 @@ namespace Adyen\Service\Builder; +/** + * @deprecated + */ class Customer { const PAYMENT_METHOD = 'paymentMethod'; diff --git a/src/Adyen/Service/Builder/OpenInvoice.php b/src/Adyen/Service/Builder/OpenInvoice.php index 2cf3789cf..64c74b0f4 100644 --- a/src/Adyen/Service/Builder/OpenInvoice.php +++ b/src/Adyen/Service/Builder/OpenInvoice.php @@ -23,6 +23,9 @@ namespace Adyen\Service\Builder; +/** + * @deprecated + */ class OpenInvoice { /** diff --git a/src/Adyen/Service/Builder/Payment.php b/src/Adyen/Service/Builder/Payment.php index acb7c2e30..6648b0235 100644 --- a/src/Adyen/Service/Builder/Payment.php +++ b/src/Adyen/Service/Builder/Payment.php @@ -23,6 +23,9 @@ namespace Adyen\Service\Builder; +/** + * @deprecated + */ class Payment { /** diff --git a/src/Adyen/Service/Builder/Referral.php b/src/Adyen/Service/Builder/Referral.php index 65b035b88..0a4669efa 100644 --- a/src/Adyen/Service/Builder/Referral.php +++ b/src/Adyen/Service/Builder/Referral.php @@ -2,6 +2,9 @@ namespace Adyen\Service\Builder; +/** + * @deprecated + */ class Referral { const ACTION_BLOCK = 'block'; diff --git a/src/Adyen/Service/Builder/Refund.php b/src/Adyen/Service/Builder/Refund.php index 391d32460..d9fa71769 100644 --- a/src/Adyen/Service/Builder/Refund.php +++ b/src/Adyen/Service/Builder/Refund.php @@ -25,6 +25,9 @@ use Adyen\Util\Currency; +/** + * @deprecated + */ class Refund { /** diff --git a/src/Adyen/Service/CapitalApi.php b/src/Adyen/Service/CapitalApi.php new file mode 100644 index 000000000..691f9bf32 --- /dev/null +++ b/src/Adyen/Service/CapitalApi.php @@ -0,0 +1,84 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/btl/v3"); + } + + /** + * Get a capital account + * + * @param array|null $requestOptions ['queryParams' => ['counterpartyAccountHolderId'=> string]] + * @return \Adyen\Model\Capital\CapitalGrants + * @throws AdyenException + */ + public function getCapitalAccount(array $requestOptions = null): \Adyen\Model\Capital\CapitalGrants + { + $endpoint = $this->baseURL . "/grants"; + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Capital\CapitalGrants::class); + } + + /** + * Get grant reference details + * + * @param string $id + * @param array|null $requestOptions + * @return \Adyen\Model\Capital\CapitalGrant + * @throws AdyenException + */ + public function getGrantReferenceDetails(string $id, array $requestOptions = null): \Adyen\Model\Capital\CapitalGrant + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/grants/{id}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Capital\CapitalGrant::class); + } + + /** + * Request a grant payout + * + * @param \Adyen\Model\Capital\CapitalGrantInfo $capitalGrantInfo + * @param array|null $requestOptions + * @return \Adyen\Model\Capital\CapitalGrant + * @throws AdyenException + */ + public function requestGrantPayout(\Adyen\Model\Capital\CapitalGrantInfo $capitalGrantInfo, array $requestOptions = null): \Adyen\Model\Capital\CapitalGrant + { + $endpoint = $this->baseURL . "/grants"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $capitalGrantInfo->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Capital\CapitalGrant::class); + } +} diff --git a/src/Adyen/Service/Checkout.php b/src/Adyen/Service/Checkout.php index 0004a4024..98ad5e99f 100644 --- a/src/Adyen/Service/Checkout.php +++ b/src/Adyen/Service/Checkout.php @@ -4,6 +4,10 @@ use Adyen\Service\ResourceModel\Checkout\Recurring; +/** + * @deprecated Please consider using the model based services instead (suffix -Api.php) + * @see \Adyen\Service\Checkout\ + */ class Checkout extends \Adyen\ApiKeyAuthenticatedService { /** @@ -101,7 +105,6 @@ class Checkout extends \Adyen\ApiKeyAuthenticatedService /** * Checkout constructor. * - * @deprecated Please consider using the model based services instead (suffix -Api.php) * @param \Adyen\Client $client * @throws \Adyen\AdyenException */ diff --git a/src/Adyen/Service/Checkout/ModificationsApi.php b/src/Adyen/Service/Checkout/ModificationsApi.php index b3079540e..48dce4dcb 100644 --- a/src/Adyen/Service/Checkout/ModificationsApi.php +++ b/src/Adyen/Service/Checkout/ModificationsApi.php @@ -42,95 +42,95 @@ public function __construct(Client $client) /** * Cancel an authorised payment * - * @param \Adyen\Model\Checkout\CreateStandalonePaymentCancelRequest $createStandalonePaymentCancelRequest + * @param \Adyen\Model\Checkout\StandalonePaymentCancelRequest $standalonePaymentCancelRequest * @param array|null $requestOptions - * @return \Adyen\Model\Checkout\StandalonePaymentCancelResource + * @return \Adyen\Model\Checkout\StandalonePaymentCancelResponse * @throws AdyenException */ - public function cancelAuthorisedPayment(\Adyen\Model\Checkout\CreateStandalonePaymentCancelRequest $createStandalonePaymentCancelRequest, array $requestOptions = null): \Adyen\Model\Checkout\StandalonePaymentCancelResource + public function cancelAuthorisedPayment(\Adyen\Model\Checkout\StandalonePaymentCancelRequest $standalonePaymentCancelRequest, array $requestOptions = null): \Adyen\Model\Checkout\StandalonePaymentCancelResponse { $endpoint = $this->baseURL . "/cancels"; - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createStandalonePaymentCancelRequest->jsonSerialize(), $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\StandalonePaymentCancelResource::class); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $standalonePaymentCancelRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\StandalonePaymentCancelResponse::class); } /** * Update an authorised amount * * @param string $paymentPspReference - * @param \Adyen\Model\Checkout\CreatePaymentAmountUpdateRequest $createPaymentAmountUpdateRequest + * @param \Adyen\Model\Checkout\PaymentAmountUpdateRequest $paymentAmountUpdateRequest * @param array|null $requestOptions - * @return \Adyen\Model\Checkout\PaymentAmountUpdateResource + * @return \Adyen\Model\Checkout\PaymentAmountUpdateResponse * @throws AdyenException */ - public function updateAuthorisedAmount(string $paymentPspReference, \Adyen\Model\Checkout\CreatePaymentAmountUpdateRequest $createPaymentAmountUpdateRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentAmountUpdateResource + public function updateAuthorisedAmount(string $paymentPspReference, \Adyen\Model\Checkout\PaymentAmountUpdateRequest $paymentAmountUpdateRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentAmountUpdateResponse { $endpoint = $this->baseURL . str_replace(['{paymentPspReference}'], [$paymentPspReference], "/payments/{paymentPspReference}/amountUpdates"); - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createPaymentAmountUpdateRequest->jsonSerialize(), $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentAmountUpdateResource::class); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentAmountUpdateRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentAmountUpdateResponse::class); } /** * Cancel an authorised payment * * @param string $paymentPspReference - * @param \Adyen\Model\Checkout\CreatePaymentCancelRequest $createPaymentCancelRequest + * @param \Adyen\Model\Checkout\PaymentCancelRequest $paymentCancelRequest * @param array|null $requestOptions - * @return \Adyen\Model\Checkout\PaymentCancelResource + * @return \Adyen\Model\Checkout\PaymentCancelResponse * @throws AdyenException */ - public function cancelAuthorisedPaymentByPspReference(string $paymentPspReference, \Adyen\Model\Checkout\CreatePaymentCancelRequest $createPaymentCancelRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentCancelResource + public function cancelAuthorisedPaymentByPspReference(string $paymentPspReference, \Adyen\Model\Checkout\PaymentCancelRequest $paymentCancelRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentCancelResponse { $endpoint = $this->baseURL . str_replace(['{paymentPspReference}'], [$paymentPspReference], "/payments/{paymentPspReference}/cancels"); - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createPaymentCancelRequest->jsonSerialize(), $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentCancelResource::class); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentCancelRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentCancelResponse::class); } /** * Capture an authorised payment * * @param string $paymentPspReference - * @param \Adyen\Model\Checkout\CreatePaymentCaptureRequest $createPaymentCaptureRequest + * @param \Adyen\Model\Checkout\PaymentCaptureRequest $paymentCaptureRequest * @param array|null $requestOptions - * @return \Adyen\Model\Checkout\PaymentCaptureResource + * @return \Adyen\Model\Checkout\PaymentCaptureResponse * @throws AdyenException */ - public function captureAuthorisedPayment(string $paymentPspReference, \Adyen\Model\Checkout\CreatePaymentCaptureRequest $createPaymentCaptureRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentCaptureResource + public function captureAuthorisedPayment(string $paymentPspReference, \Adyen\Model\Checkout\PaymentCaptureRequest $paymentCaptureRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentCaptureResponse { $endpoint = $this->baseURL . str_replace(['{paymentPspReference}'], [$paymentPspReference], "/payments/{paymentPspReference}/captures"); - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createPaymentCaptureRequest->jsonSerialize(), $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentCaptureResource::class); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentCaptureRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentCaptureResponse::class); } /** * Refund a captured payment * * @param string $paymentPspReference - * @param \Adyen\Model\Checkout\CreatePaymentRefundRequest $createPaymentRefundRequest + * @param \Adyen\Model\Checkout\PaymentRefundRequest $paymentRefundRequest * @param array|null $requestOptions - * @return \Adyen\Model\Checkout\PaymentRefundResource + * @return \Adyen\Model\Checkout\PaymentRefundResponse * @throws AdyenException */ - public function refundCapturedPayment(string $paymentPspReference, \Adyen\Model\Checkout\CreatePaymentRefundRequest $createPaymentRefundRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentRefundResource + public function refundCapturedPayment(string $paymentPspReference, \Adyen\Model\Checkout\PaymentRefundRequest $paymentRefundRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentRefundResponse { $endpoint = $this->baseURL . str_replace(['{paymentPspReference}'], [$paymentPspReference], "/payments/{paymentPspReference}/refunds"); - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createPaymentRefundRequest->jsonSerialize(), $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentRefundResource::class); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentRefundRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentRefundResponse::class); } /** * Refund or cancel a payment * * @param string $paymentPspReference - * @param \Adyen\Model\Checkout\CreatePaymentReversalRequest $createPaymentReversalRequest + * @param \Adyen\Model\Checkout\PaymentReversalRequest $paymentReversalRequest * @param array|null $requestOptions - * @return \Adyen\Model\Checkout\PaymentReversalResource + * @return \Adyen\Model\Checkout\PaymentReversalResponse * @throws AdyenException */ - public function refundOrCancelPayment(string $paymentPspReference, \Adyen\Model\Checkout\CreatePaymentReversalRequest $createPaymentReversalRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentReversalResource + public function refundOrCancelPayment(string $paymentPspReference, \Adyen\Model\Checkout\PaymentReversalRequest $paymentReversalRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentReversalResponse { $endpoint = $this->baseURL . str_replace(['{paymentPspReference}'], [$paymentPspReference], "/payments/{paymentPspReference}/reversals"); - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createPaymentReversalRequest->jsonSerialize(), $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentReversalResource::class); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentReversalRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentReversalResponse::class); } } diff --git a/src/Adyen/Service/Checkout/OrdersApi.php b/src/Adyen/Service/Checkout/OrdersApi.php index f47ff9ba0..a7df0fcad 100644 --- a/src/Adyen/Service/Checkout/OrdersApi.php +++ b/src/Adyen/Service/Checkout/OrdersApi.php @@ -42,45 +42,45 @@ public function __construct(Client $client) /** * Create an order * - * @param \Adyen\Model\Checkout\CheckoutCreateOrderRequest $checkoutCreateOrderRequest + * @param \Adyen\Model\Checkout\CreateOrderRequest $createOrderRequest * @param array|null $requestOptions - * @return \Adyen\Model\Checkout\CheckoutCreateOrderResponse + * @return \Adyen\Model\Checkout\CreateOrderResponse * @throws AdyenException */ - public function orders(\Adyen\Model\Checkout\CheckoutCreateOrderRequest $checkoutCreateOrderRequest, array $requestOptions = null): \Adyen\Model\Checkout\CheckoutCreateOrderResponse + public function orders(\Adyen\Model\Checkout\CreateOrderRequest $createOrderRequest, array $requestOptions = null): \Adyen\Model\Checkout\CreateOrderResponse { $endpoint = $this->baseURL . "/orders"; - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $checkoutCreateOrderRequest->jsonSerialize(), $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\CheckoutCreateOrderResponse::class); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createOrderRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\CreateOrderResponse::class); } /** * Cancel an order * - * @param \Adyen\Model\Checkout\CheckoutCancelOrderRequest $checkoutCancelOrderRequest + * @param \Adyen\Model\Checkout\CancelOrderRequest $cancelOrderRequest * @param array|null $requestOptions - * @return \Adyen\Model\Checkout\CheckoutCancelOrderResponse + * @return \Adyen\Model\Checkout\CancelOrderResponse * @throws AdyenException */ - public function cancelOrder(\Adyen\Model\Checkout\CheckoutCancelOrderRequest $checkoutCancelOrderRequest, array $requestOptions = null): \Adyen\Model\Checkout\CheckoutCancelOrderResponse + public function cancelOrder(\Adyen\Model\Checkout\CancelOrderRequest $cancelOrderRequest, array $requestOptions = null): \Adyen\Model\Checkout\CancelOrderResponse { $endpoint = $this->baseURL . "/orders/cancel"; - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $checkoutCancelOrderRequest->jsonSerialize(), $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\CheckoutCancelOrderResponse::class); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $cancelOrderRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\CancelOrderResponse::class); } /** * Get the balance of a gift card * - * @param \Adyen\Model\Checkout\CheckoutBalanceCheckRequest $checkoutBalanceCheckRequest + * @param \Adyen\Model\Checkout\BalanceCheckRequest $balanceCheckRequest * @param array|null $requestOptions - * @return \Adyen\Model\Checkout\CheckoutBalanceCheckResponse + * @return \Adyen\Model\Checkout\BalanceCheckResponse * @throws AdyenException */ - public function getBalanceOfGiftCard(\Adyen\Model\Checkout\CheckoutBalanceCheckRequest $checkoutBalanceCheckRequest, array $requestOptions = null): \Adyen\Model\Checkout\CheckoutBalanceCheckResponse + public function getBalanceOfGiftCard(\Adyen\Model\Checkout\BalanceCheckRequest $balanceCheckRequest, array $requestOptions = null): \Adyen\Model\Checkout\BalanceCheckResponse { $endpoint = $this->baseURL . "/paymentMethods/balance"; - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $checkoutBalanceCheckRequest->jsonSerialize(), $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\CheckoutBalanceCheckResponse::class); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $balanceCheckRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\BalanceCheckResponse::class); } } diff --git a/src/Adyen/Service/Checkout/PaymentLinksApi.php b/src/Adyen/Service/Checkout/PaymentLinksApi.php index 76adabe03..79ffcbee9 100644 --- a/src/Adyen/Service/Checkout/PaymentLinksApi.php +++ b/src/Adyen/Service/Checkout/PaymentLinksApi.php @@ -73,15 +73,15 @@ public function updatePaymentLink(string $linkId, \Adyen\Model\Checkout\UpdatePa /** * Create a payment link * - * @param \Adyen\Model\Checkout\CreatePaymentLinkRequest $createPaymentLinkRequest + * @param \Adyen\Model\Checkout\PaymentLinkRequest $paymentLinkRequest * @param array|null $requestOptions * @return \Adyen\Model\Checkout\PaymentLinkResponse * @throws AdyenException */ - public function paymentLinks(\Adyen\Model\Checkout\CreatePaymentLinkRequest $createPaymentLinkRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentLinkResponse + public function paymentLinks(\Adyen\Model\Checkout\PaymentLinkRequest $paymentLinkRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentLinkResponse { $endpoint = $this->baseURL . "/paymentLinks"; - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createPaymentLinkRequest->jsonSerialize(), $requestOptions); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentLinkRequest->jsonSerialize(), $requestOptions); return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentLinkResponse::class); } } diff --git a/src/Adyen/Service/Checkout/PaymentsApi.php b/src/Adyen/Service/Checkout/PaymentsApi.php index 5d2df6d39..823b1319a 100644 --- a/src/Adyen/Service/Checkout/PaymentsApi.php +++ b/src/Adyen/Service/Checkout/PaymentsApi.php @@ -39,6 +39,21 @@ public function __construct(Client $client) $this->baseURL = $this->createBaseUrl("https://checkout-test.adyen.com/v70"); } + /** + * Get the result of a payment session + * + * @param string $sessionId + * @param array|null $requestOptions ['queryParams' => ['sessionResult'=> string]] + * @return \Adyen\Model\Checkout\SessionResultResponse + * @throws AdyenException + */ + public function getResultOfPaymentSession(string $sessionId, array $requestOptions = null): \Adyen\Model\Checkout\SessionResultResponse + { + $endpoint = $this->baseURL . str_replace(['{sessionId}'], [$sessionId], "/sessions/{sessionId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\SessionResultResponse::class); + } + /** * Get the list of brands on the card * @@ -57,16 +72,16 @@ public function cardDetails(\Adyen\Model\Checkout\CardDetailsRequest $cardDetail /** * Start a transaction for donations * - * @param \Adyen\Model\Checkout\PaymentDonationRequest $paymentDonationRequest + * @param \Adyen\Model\Checkout\DonationPaymentRequest $donationPaymentRequest * @param array|null $requestOptions - * @return \Adyen\Model\Checkout\DonationResponse + * @return \Adyen\Model\Checkout\DonationPaymentResponse * @throws AdyenException */ - public function donations(\Adyen\Model\Checkout\PaymentDonationRequest $paymentDonationRequest, array $requestOptions = null): \Adyen\Model\Checkout\DonationResponse + public function donations(\Adyen\Model\Checkout\DonationPaymentRequest $donationPaymentRequest, array $requestOptions = null): \Adyen\Model\Checkout\DonationPaymentResponse { $endpoint = $this->baseURL . "/donations"; - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentDonationRequest->jsonSerialize(), $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\DonationResponse::class); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $donationPaymentRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\DonationPaymentResponse::class); } /** @@ -102,15 +117,15 @@ public function payments(\Adyen\Model\Checkout\PaymentRequest $paymentRequest, a /** * Submit details for a payment * - * @param \Adyen\Model\Checkout\DetailsRequest $detailsRequest + * @param \Adyen\Model\Checkout\PaymentDetailsRequest $paymentDetailsRequest * @param array|null $requestOptions * @return \Adyen\Model\Checkout\PaymentDetailsResponse * @throws AdyenException */ - public function paymentsDetails(\Adyen\Model\Checkout\DetailsRequest $detailsRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentDetailsResponse + public function paymentsDetails(\Adyen\Model\Checkout\PaymentDetailsRequest $paymentDetailsRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentDetailsResponse { $endpoint = $this->baseURL . "/payments/details"; - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $detailsRequest->jsonSerialize(), $requestOptions); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentDetailsRequest->jsonSerialize(), $requestOptions); return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentDetailsResponse::class); } diff --git a/src/Adyen/Service/Checkout/RecurringApi.php b/src/Adyen/Service/Checkout/RecurringApi.php index 10bfd4461..2c9bb58c3 100644 --- a/src/Adyen/Service/Checkout/RecurringApi.php +++ b/src/Adyen/Service/Checkout/RecurringApi.php @@ -42,14 +42,14 @@ public function __construct(Client $client) /** * Delete a token for stored payment details * - * @param string $recurringId + * @param string $storedPaymentMethodId * @param array|null $requestOptions ['queryParams' => ['shopperReference'=> string, 'merchantAccount'=> string]] * @return \Adyen\Model\Checkout\StoredPaymentMethodResource * @throws AdyenException */ - public function deleteTokenForStoredPaymentDetails(string $recurringId, array $requestOptions = null): \Adyen\Model\Checkout\StoredPaymentMethodResource + public function deleteTokenForStoredPaymentDetails(string $storedPaymentMethodId, array $requestOptions = null): \Adyen\Model\Checkout\StoredPaymentMethodResource { - $endpoint = $this->baseURL . str_replace(['{recurringId}'], [$recurringId], "/storedPaymentMethods/{recurringId}"); + $endpoint = $this->baseURL . str_replace(['{storedPaymentMethodId}'], [$storedPaymentMethodId], "/storedPaymentMethods/{storedPaymentMethodId}"); $response = $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\StoredPaymentMethodResource::class); } diff --git a/src/Adyen/Service/Checkout/UtilityApi.php b/src/Adyen/Service/Checkout/UtilityApi.php index 7e21a6212..09605340b 100644 --- a/src/Adyen/Service/Checkout/UtilityApi.php +++ b/src/Adyen/Service/Checkout/UtilityApi.php @@ -42,30 +42,30 @@ public function __construct(Client $client) /** * Get an Apple Pay session * - * @param \Adyen\Model\Checkout\CreateApplePaySessionRequest $createApplePaySessionRequest + * @param \Adyen\Model\Checkout\ApplePaySessionRequest $applePaySessionRequest * @param array|null $requestOptions * @return \Adyen\Model\Checkout\ApplePaySessionResponse * @throws AdyenException */ - public function getApplePaySession(\Adyen\Model\Checkout\CreateApplePaySessionRequest $createApplePaySessionRequest, array $requestOptions = null): \Adyen\Model\Checkout\ApplePaySessionResponse + public function getApplePaySession(\Adyen\Model\Checkout\ApplePaySessionRequest $applePaySessionRequest, array $requestOptions = null): \Adyen\Model\Checkout\ApplePaySessionResponse { $endpoint = $this->baseURL . "/applePay/sessions"; - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createApplePaySessionRequest->jsonSerialize(), $requestOptions); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $applePaySessionRequest->jsonSerialize(), $requestOptions); return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\ApplePaySessionResponse::class); } /** * Create originKey values for domains * - * @param \Adyen\Model\Checkout\CheckoutUtilityRequest $checkoutUtilityRequest + * @param \Adyen\Model\Checkout\UtilityRequest $utilityRequest * @param array|null $requestOptions - * @return \Adyen\Model\Checkout\CheckoutUtilityResponse + * @return \Adyen\Model\Checkout\UtilityResponse * @throws AdyenException */ - public function originKeys(\Adyen\Model\Checkout\CheckoutUtilityRequest $checkoutUtilityRequest, array $requestOptions = null): \Adyen\Model\Checkout\CheckoutUtilityResponse + public function originKeys(\Adyen\Model\Checkout\UtilityRequest $utilityRequest, array $requestOptions = null): \Adyen\Model\Checkout\UtilityResponse { $endpoint = $this->baseURL . "/originKeys"; - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $checkoutUtilityRequest->jsonSerialize(), $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\CheckoutUtilityResponse::class); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $utilityRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\UtilityResponse::class); } } diff --git a/src/Adyen/Service/CheckoutUtility.php b/src/Adyen/Service/CheckoutUtility.php index 05444247d..475099514 100644 --- a/src/Adyen/Service/CheckoutUtility.php +++ b/src/Adyen/Service/CheckoutUtility.php @@ -2,6 +2,10 @@ namespace Adyen\Service; +/** + * @deprecated Please consider using the model based services instead (suffix -Api.php) + * @see \Adyen\Service\Checkout\UtilityApi + */ class CheckoutUtility extends \Adyen\ApiKeyAuthenticatedService { /** @@ -12,7 +16,6 @@ class CheckoutUtility extends \Adyen\ApiKeyAuthenticatedService /** * CheckoutUtility constructor. * - * @deprecated Please consider using the model based services instead (suffix -Api.php) * @param \Adyen\Client $client * @throws \Adyen\AdyenException */ diff --git a/src/Adyen/Service/DirectoryLookup.php b/src/Adyen/Service/DirectoryLookup.php deleted file mode 100644 index 95625ab8c..000000000 --- a/src/Adyen/Service/DirectoryLookup.php +++ /dev/null @@ -1,40 +0,0 @@ -directoryLookup = new \Adyen\Service\ResourceModel\DirectoryLookup\Directory($this); - } - - /** - * @param $params - * @deprecated - * @return mixed - * @throws \Adyen\AdyenException - */ - public function directoryLookup($params) - { - $result = $this->directoryLookup->requestPost($params); - return $result; - } -} diff --git a/src/Adyen/Service/Fund.php b/src/Adyen/Service/Fund.php index 649b735f1..686cd619e 100755 --- a/src/Adyen/Service/Fund.php +++ b/src/Adyen/Service/Fund.php @@ -2,6 +2,11 @@ namespace Adyen\Service; +/** + * @deprecated Please consider using the BalancePlatform and Transfers services instead + * @see \Adyen\Service\BalancePlatform\ + * @see \Adyen\Service\Transfers\ + */ class Fund extends \Adyen\Service { @@ -37,6 +42,7 @@ class Fund extends \Adyen\Service /** * Fund constructor. + * * @param \Adyen\Client $client * @throws \Adyen\AdyenException */ diff --git a/src/Adyen/Service/Hop.php b/src/Adyen/Service/Hop.php index 24c969d9e..0cd2a17a4 100644 --- a/src/Adyen/Service/Hop.php +++ b/src/Adyen/Service/Hop.php @@ -2,6 +2,10 @@ namespace Adyen\Service; +/** + * @deprecated Please consider using the LegalEntityManagement services instead + * @see \Adyen\Service\LegalEntityManagement\ + */ class Hop extends \Adyen\Service { /** @@ -16,6 +20,7 @@ class Hop extends \Adyen\Service /** * Hop constructor. + * * @param \Adyen\Client $client * @throws \Adyen\AdyenException */ diff --git a/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php b/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php index c4744978c..30c191e2f 100644 --- a/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php +++ b/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php @@ -44,10 +44,10 @@ public function __construct(Client $client) * * @param string $id * @param array|null $requestOptions - * @return void + * @throws AdyenException */ - public function deleteDocument(string $id, array $requestOptions = null): void + public function deleteDocument(string $id, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/documents/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); diff --git a/src/Adyen/Service/LegalEntityManagement/PCIQuestionnairesApi.php b/src/Adyen/Service/LegalEntityManagement/PCIQuestionnairesApi.php new file mode 100644 index 000000000..7b87bfb56 --- /dev/null +++ b/src/Adyen/Service/LegalEntityManagement/PCIQuestionnairesApi.php @@ -0,0 +1,104 @@ +baseURL = $this->createBaseUrl("https://kyc-test.adyen.com/lem/v3"); + } + + /** + * Get PCI questionnaire details + * + * @param string $id + * @param array|null $requestOptions + * @return \Adyen\Model\LegalEntityManagement\GetPciQuestionnaireInfosResponse + * @throws AdyenException + */ + public function getPciQuestionnaireDetails(string $id, array $requestOptions = null): \Adyen\Model\LegalEntityManagement\GetPciQuestionnaireInfosResponse + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/legalEntities/{id}/pciQuestionnaires"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\LegalEntityManagement\GetPciQuestionnaireInfosResponse::class); + } + + /** + * Get PCI questionnaire + * + * @param string $id + * @param string $pciid + * @param array|null $requestOptions + * @return \Adyen\Model\LegalEntityManagement\GetPciQuestionnaireResponse + * @throws AdyenException + */ + public function getPciQuestionnaire(string $id, string $pciid, array $requestOptions = null): \Adyen\Model\LegalEntityManagement\GetPciQuestionnaireResponse + { + $endpoint = $this->baseURL . str_replace(['{id}', '{pciid}'], [$id, $pciid], "/legalEntities/{id}/pciQuestionnaires/{pciid}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\LegalEntityManagement\GetPciQuestionnaireResponse::class); + } + + /** + * Generate PCI questionnaire + * + * @param string $id + * @param \Adyen\Model\LegalEntityManagement\GeneratePciDescriptionRequest $generatePciDescriptionRequest + * @param array|null $requestOptions + * @return \Adyen\Model\LegalEntityManagement\GeneratePciDescriptionResponse + * @throws AdyenException + */ + public function generatePciQuestionnaire(string $id, \Adyen\Model\LegalEntityManagement\GeneratePciDescriptionRequest $generatePciDescriptionRequest, array $requestOptions = null): \Adyen\Model\LegalEntityManagement\GeneratePciDescriptionResponse + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/legalEntities/{id}/pciQuestionnaires/generatePciTemplates"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $generatePciDescriptionRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\LegalEntityManagement\GeneratePciDescriptionResponse::class); + } + + /** + * Sign PCI questionnaire + * + * @param string $id + * @param \Adyen\Model\LegalEntityManagement\PciSigningRequest $pciSigningRequest + * @param array|null $requestOptions + * @return \Adyen\Model\LegalEntityManagement\PciSigningResponse + * @throws AdyenException + */ + public function signPciQuestionnaire(string $id, \Adyen\Model\LegalEntityManagement\PciSigningRequest $pciSigningRequest, array $requestOptions = null): \Adyen\Model\LegalEntityManagement\PciSigningResponse + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/legalEntities/{id}/pciQuestionnaires/signPciTemplates"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $pciSigningRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\LegalEntityManagement\PciSigningResponse::class); + } +} diff --git a/src/Adyen/Service/Management.php b/src/Adyen/Service/Management.php index c414f633d..fd55f2e6f 100644 --- a/src/Adyen/Service/Management.php +++ b/src/Adyen/Service/Management.php @@ -11,6 +11,10 @@ use Adyen\Service\ResourceModel\Management\MerchantClientKey; use Adyen\Service\ResourceModel\Management\MerchantWebhooks; +/** + * @deprecated Please consider using the model based services instead (suffix -Api.php) + * @see \Adyen\Service\Management\ + */ class Management extends \Adyen\Service { /** @@ -52,7 +56,6 @@ class Management extends \Adyen\Service /** * Management constructor. * - * @deprecated Please consider using the model based services instead (suffix -Api.php) * @param \Adyen\Client $client * @throws \Adyen\AdyenException */ diff --git a/src/Adyen/Service/Management/SplitConfigurationMerchantLevelApi.php b/src/Adyen/Service/Management/SplitConfigurationMerchantLevelApi.php new file mode 100644 index 000000000..4b0992891 --- /dev/null +++ b/src/Adyen/Service/Management/SplitConfigurationMerchantLevelApi.php @@ -0,0 +1,192 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Delete a split configuration + * + * @param string $merchantId + * @param string $splitConfigurationId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\SplitConfiguration + * @throws AdyenException + */ + public function deleteSplitConfiguration(string $merchantId, string $splitConfigurationId, array $requestOptions = null): \Adyen\Model\Management\SplitConfiguration + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{splitConfigurationId}'], [$merchantId, $splitConfigurationId], "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}"); + $response = $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\SplitConfiguration::class); + } + + /** + * Delete a split configuration rule + * + * @param string $merchantId + * @param string $splitConfigurationId + * @param string $ruleId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\SplitConfiguration + * @throws AdyenException + */ + public function deleteSplitConfigurationRule(string $merchantId, string $splitConfigurationId, string $ruleId, array $requestOptions = null): \Adyen\Model\Management\SplitConfiguration + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{splitConfigurationId}', '{ruleId}'], [$merchantId, $splitConfigurationId, $ruleId], "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}/rules/{ruleId}"); + $response = $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\SplitConfiguration::class); + } + + /** + * Get a list of split configurations + * + * @param string $merchantId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\SplitConfigurationList + * @throws AdyenException + */ + public function listSplitConfigurations(string $merchantId, array $requestOptions = null): \Adyen\Model\Management\SplitConfigurationList + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/splitConfigurations"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\SplitConfigurationList::class); + } + + /** + * Get a split configuration + * + * @param string $merchantId + * @param string $splitConfigurationId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\SplitConfiguration + * @throws AdyenException + */ + public function getSplitConfiguration(string $merchantId, string $splitConfigurationId, array $requestOptions = null): \Adyen\Model\Management\SplitConfiguration + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{splitConfigurationId}'], [$merchantId, $splitConfigurationId], "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\SplitConfiguration::class); + } + + /** + * Update split configuration description + * + * @param string $merchantId + * @param string $splitConfigurationId + * @param \Adyen\Model\Management\UpdateSplitConfigurationRequest $updateSplitConfigurationRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\SplitConfiguration + * @throws AdyenException + */ + public function updateSplitConfigurationDescription(string $merchantId, string $splitConfigurationId, \Adyen\Model\Management\UpdateSplitConfigurationRequest $updateSplitConfigurationRequest, array $requestOptions = null): \Adyen\Model\Management\SplitConfiguration + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{splitConfigurationId}'], [$merchantId, $splitConfigurationId], "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateSplitConfigurationRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\SplitConfiguration::class); + } + + /** + * Update split conditions + * + * @param string $merchantId + * @param string $splitConfigurationId + * @param string $ruleId + * @param \Adyen\Model\Management\UpdateSplitConfigurationRuleRequest $updateSplitConfigurationRuleRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\SplitConfiguration + * @throws AdyenException + */ + public function updateSplitConditions(string $merchantId, string $splitConfigurationId, string $ruleId, \Adyen\Model\Management\UpdateSplitConfigurationRuleRequest $updateSplitConfigurationRuleRequest, array $requestOptions = null): \Adyen\Model\Management\SplitConfiguration + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{splitConfigurationId}', '{ruleId}'], [$merchantId, $splitConfigurationId, $ruleId], "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}/rules/{ruleId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateSplitConfigurationRuleRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\SplitConfiguration::class); + } + + /** + * Update the split logic + * + * @param string $merchantId + * @param string $splitConfigurationId + * @param string $ruleId + * @param string $splitLogicId + * @param \Adyen\Model\Management\UpdateSplitConfigurationLogicRequest $updateSplitConfigurationLogicRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\SplitConfiguration + * @throws AdyenException + */ + public function updateSplitLogic(string $merchantId, string $splitConfigurationId, string $ruleId, string $splitLogicId, \Adyen\Model\Management\UpdateSplitConfigurationLogicRequest $updateSplitConfigurationLogicRequest, array $requestOptions = null): \Adyen\Model\Management\SplitConfiguration + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{splitConfigurationId}', '{ruleId}', '{splitLogicId}'], [$merchantId, $splitConfigurationId, $ruleId, $splitLogicId], "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}/rules/{ruleId}/splitLogic/{splitLogicId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateSplitConfigurationLogicRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\SplitConfiguration::class); + } + + /** + * Create a split configuration + * + * @param string $merchantId + * @param \Adyen\Model\Management\SplitConfiguration $splitConfiguration + * @param array|null $requestOptions + * @return \Adyen\Model\Management\SplitConfiguration + * @throws AdyenException + */ + public function createSplitConfiguration(string $merchantId, \Adyen\Model\Management\SplitConfiguration $splitConfiguration, array $requestOptions = null): \Adyen\Model\Management\SplitConfiguration + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/splitConfigurations"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $splitConfiguration->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\SplitConfiguration::class); + } + + /** + * Create a rule + * + * @param string $merchantId + * @param string $splitConfigurationId + * @param \Adyen\Model\Management\SplitConfigurationRule $splitConfigurationRule + * @param array|null $requestOptions + * @return \Adyen\Model\Management\SplitConfiguration + * @throws AdyenException + */ + public function createRule(string $merchantId, string $splitConfigurationId, \Adyen\Model\Management\SplitConfigurationRule $splitConfigurationRule, array $requestOptions = null): \Adyen\Model\Management\SplitConfiguration + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{splitConfigurationId}'], [$merchantId, $splitConfigurationId], "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $splitConfigurationRule->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\SplitConfiguration::class); + } +} diff --git a/src/Adyen/Service/Management/TerminalActionsCompanyLevelApi.php b/src/Adyen/Service/Management/TerminalActionsCompanyLevelApi.php index 1c1fe32e1..b3a6104f5 100644 --- a/src/Adyen/Service/Management/TerminalActionsCompanyLevelApi.php +++ b/src/Adyen/Service/Management/TerminalActionsCompanyLevelApi.php @@ -43,7 +43,7 @@ public function __construct(Client $client) * Get a list of Android apps * * @param string $companyId - * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int]] + * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int, 'packageName'=> string, 'versionCode'=> int]] * @return \Adyen\Model\Management\AndroidAppsResponse * @throws AdyenException */ @@ -58,7 +58,7 @@ public function listAndroidApps(string $companyId, array $requestOptions = null) * Get a list of Android certificates * * @param string $companyId - * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int]] + * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int, 'certificateName'=> string]] * @return \Adyen\Model\Management\AndroidCertificatesResponse * @throws AdyenException */ diff --git a/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php b/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php index d611435db..873dcf107 100644 --- a/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php +++ b/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php @@ -42,7 +42,7 @@ public function __construct(Client $client) /** * Get a list of terminals * - * @param array|null $requestOptions ['queryParams' => ['searchQuery'=> string, 'countries'=> string, 'merchantIds'=> string, 'storeIds'=> string, 'brandModels'=> string, 'pageNumber'=> int, 'pageSize'=> int]] + * @param array|null $requestOptions ['queryParams' => ['searchQuery'=> string, 'otpQuery'=> string, 'countries'=> string, 'merchantIds'=> string, 'storeIds'=> string, 'brandModels'=> string, 'pageNumber'=> int, 'pageSize'=> int]] * @return \Adyen\Model\Management\ListTerminalsResponse * @throws AdyenException */ diff --git a/src/Adyen/Service/Modification.php b/src/Adyen/Service/Modification.php index 0f4969e06..3346bb75f 100644 --- a/src/Adyen/Service/Modification.php +++ b/src/Adyen/Service/Modification.php @@ -2,6 +2,10 @@ namespace Adyen\Service; +/** + * @deprecated Please consider using the model based services instead (suffix -Api.php) + * @see \Adyen\Service\Payments\ModificationsApi + */ class Modification extends \Adyen\Service { /** @@ -37,7 +41,6 @@ class Modification extends \Adyen\Service /** * Modification constructor. * - * @deprecated Please consider using the model based services instead (suffix -Api.php) * @param \Adyen\Client $client * @throws \Adyen\AdyenException */ diff --git a/src/Adyen/Service/Notification.php b/src/Adyen/Service/Notification.php index 00c3b0088..e2d11ba80 100644 --- a/src/Adyen/Service/Notification.php +++ b/src/Adyen/Service/Notification.php @@ -12,6 +12,11 @@ use Adyen\Service\ResourceModel\Notification\TestNotificationConfiguration; use Adyen\Service\ResourceModel\Notification\UpdateNotificationConfiguration; +/** + * @deprecated Please consider using the model based services instead (suffix -Api.php) + * @see \Adyen\Service\BalancePlatform\ + * @see \Adyen\Service\Transfers\ + */ class Notification extends Service { @@ -47,6 +52,7 @@ class Notification extends Service /** * Notification constructor. + * * @param Client $client * @throws AdyenException */ diff --git a/src/Adyen/Service/Payment.php b/src/Adyen/Service/Payment.php index 35ae11a94..fff3d2ff2 100644 --- a/src/Adyen/Service/Payment.php +++ b/src/Adyen/Service/Payment.php @@ -2,6 +2,10 @@ namespace Adyen\Service; +/** + * @deprecated Please consider using the model based services instead (suffix -Api.php) + * @see \Adyen\Service\Payments\GeneralApi + */ class Payment extends \Adyen\Service { /** @@ -22,7 +26,6 @@ class Payment extends \Adyen\Service /** * Payment constructor. * - * @deprecated Please consider using the model based services instead (suffix -Api.php) * @param \Adyen\Client $client * @throws \Adyen\AdyenException */ diff --git a/src/Adyen/Service/Payout.php b/src/Adyen/Service/Payout.php index ffd948f7c..89c034a6e 100644 --- a/src/Adyen/Service/Payout.php +++ b/src/Adyen/Service/Payout.php @@ -15,6 +15,10 @@ use Adyen\Service\ResourceModel\Payout\ThirdParty\StoreDetailsAndSubmitThirdParty; use Adyen\Service\ResourceModel\Payout\ThirdParty\SubmitThirdParty; +/** + * @deprecated Please consider using the model based services instead (suffix -Api.php) + * @see \Adyen\Service\Payout\ + */ class Payout extends Service { /** @@ -65,7 +69,6 @@ class Payout extends Service /** * Payout constructor. * - * @deprecated Please consider using the model based services instead (suffix -Api.php) * @param Client $client * @throws AdyenException */ diff --git a/src/Adyen/Service/Payout/InitializationApi.php b/src/Adyen/Service/Payout/InitializationApi.php index 0a721fa79..715e2cfa9 100644 --- a/src/Adyen/Service/Payout/InitializationApi.php +++ b/src/Adyen/Service/Payout/InitializationApi.php @@ -47,7 +47,7 @@ public function __construct(Client $client) * @return \Adyen\Model\Payout\StoreDetailResponse * @throws AdyenException */ - public function storePayoutDetails(\Adyen\Model\Payout\StoreDetailRequest $storeDetailRequest, array $requestOptions = null): \Adyen\Model\Payout\StoreDetailResponse + public function storeDetail(\Adyen\Model\Payout\StoreDetailRequest $storeDetailRequest, array $requestOptions = null): \Adyen\Model\Payout\StoreDetailResponse { $endpoint = $this->baseURL . "/storeDetail"; $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $storeDetailRequest->jsonSerialize(), $requestOptions); @@ -62,7 +62,7 @@ public function storePayoutDetails(\Adyen\Model\Payout\StoreDetailRequest $store * @return \Adyen\Model\Payout\StoreDetailAndSubmitResponse * @throws AdyenException */ - public function storeDetailsAndSubmitPayout(\Adyen\Model\Payout\StoreDetailAndSubmitRequest $storeDetailAndSubmitRequest, array $requestOptions = null): \Adyen\Model\Payout\StoreDetailAndSubmitResponse + public function storeDetailAndSubmitThirdParty(\Adyen\Model\Payout\StoreDetailAndSubmitRequest $storeDetailAndSubmitRequest, array $requestOptions = null): \Adyen\Model\Payout\StoreDetailAndSubmitResponse { $endpoint = $this->baseURL . "/storeDetailAndSubmitThirdParty"; $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $storeDetailAndSubmitRequest->jsonSerialize(), $requestOptions); @@ -77,7 +77,7 @@ public function storeDetailsAndSubmitPayout(\Adyen\Model\Payout\StoreDetailAndSu * @return \Adyen\Model\Payout\SubmitResponse * @throws AdyenException */ - public function submitPayout(\Adyen\Model\Payout\SubmitRequest $submitRequest, array $requestOptions = null): \Adyen\Model\Payout\SubmitResponse + public function submitThirdParty(\Adyen\Model\Payout\SubmitRequest $submitRequest, array $requestOptions = null): \Adyen\Model\Payout\SubmitResponse { $endpoint = $this->baseURL . "/submitThirdParty"; $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $submitRequest->jsonSerialize(), $requestOptions); diff --git a/src/Adyen/Service/Payout/InstantPayoutsApi.php b/src/Adyen/Service/Payout/InstantPayoutsApi.php index b17078dcf..12f68ac36 100644 --- a/src/Adyen/Service/Payout/InstantPayoutsApi.php +++ b/src/Adyen/Service/Payout/InstantPayoutsApi.php @@ -47,7 +47,7 @@ public function __construct(Client $client) * @return \Adyen\Model\Payout\PayoutResponse * @throws AdyenException */ - public function makeInstantCardPayout(\Adyen\Model\Payout\PayoutRequest $payoutRequest, array $requestOptions = null): \Adyen\Model\Payout\PayoutResponse + public function payout(\Adyen\Model\Payout\PayoutRequest $payoutRequest, array $requestOptions = null): \Adyen\Model\Payout\PayoutResponse { $endpoint = $this->baseURL . "/payout"; $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $payoutRequest->jsonSerialize(), $requestOptions); diff --git a/src/Adyen/Service/Payout/ReviewingApi.php b/src/Adyen/Service/Payout/ReviewingApi.php index f6175a08d..622e706e7 100644 --- a/src/Adyen/Service/Payout/ReviewingApi.php +++ b/src/Adyen/Service/Payout/ReviewingApi.php @@ -47,7 +47,7 @@ public function __construct(Client $client) * @return \Adyen\Model\Payout\ModifyResponse * @throws AdyenException */ - public function confirmPayout(\Adyen\Model\Payout\ModifyRequest $modifyRequest, array $requestOptions = null): \Adyen\Model\Payout\ModifyResponse + public function confirmThirdParty(\Adyen\Model\Payout\ModifyRequest $modifyRequest, array $requestOptions = null): \Adyen\Model\Payout\ModifyResponse { $endpoint = $this->baseURL . "/confirmThirdParty"; $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $modifyRequest->jsonSerialize(), $requestOptions); @@ -62,7 +62,7 @@ public function confirmPayout(\Adyen\Model\Payout\ModifyRequest $modifyRequest, * @return \Adyen\Model\Payout\ModifyResponse * @throws AdyenException */ - public function cancelPayout(\Adyen\Model\Payout\ModifyRequest $modifyRequest, array $requestOptions = null): \Adyen\Model\Payout\ModifyResponse + public function declineThirdParty(\Adyen\Model\Payout\ModifyRequest $modifyRequest, array $requestOptions = null): \Adyen\Model\Payout\ModifyResponse { $endpoint = $this->baseURL . "/declineThirdParty"; $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $modifyRequest->jsonSerialize(), $requestOptions); diff --git a/src/Adyen/Service/Recurring.php b/src/Adyen/Service/Recurring.php index 46b5825fa..60215f643 100644 --- a/src/Adyen/Service/Recurring.php +++ b/src/Adyen/Service/Recurring.php @@ -2,6 +2,10 @@ namespace Adyen\Service; +/** + * @deprecated Please consider using the model based services instead (suffix -Api.php) + * @see \Adyen\Service\RecurringApi + */ class Recurring extends \Adyen\Service { /** @@ -27,7 +31,6 @@ class Recurring extends \Adyen\Service /** * Recurring constructor. * - * @deprecated Please consider using the model based services instead (suffix -Api.php) * @param \Adyen\Client $client * @throws \Adyen\AdyenException */ diff --git a/src/Adyen/Service/ResourceModel/DirectoryLookup/Directory.php b/src/Adyen/Service/ResourceModel/DirectoryLookup/Directory.php deleted file mode 100644 index 3421d80bd..000000000 --- a/src/Adyen/Service/ResourceModel/DirectoryLookup/Directory.php +++ /dev/null @@ -1,23 +0,0 @@ -endpoint = $service->getClient()->getConfig()->get('endpointDirectorylookup'); - parent::__construct($service, $this->endpoint); - } -} diff --git a/src/Adyen/Service/RiskManagement.php b/src/Adyen/Service/RiskManagement.php index 4bda6da56..2aed0eaa9 100644 --- a/src/Adyen/Service/RiskManagement.php +++ b/src/Adyen/Service/RiskManagement.php @@ -2,6 +2,9 @@ namespace Adyen\Service; +/** + * @deprecated + */ class RiskManagement extends \Adyen\Service { /** diff --git a/src/Adyen/Service/Transfers/CapitalApi.php b/src/Adyen/Service/Transfers/CapitalApi.php new file mode 100644 index 000000000..f030dfce1 --- /dev/null +++ b/src/Adyen/Service/Transfers/CapitalApi.php @@ -0,0 +1,85 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/btl/v3"); + } + + /** + * Get a capital account + * + * @param array|null $requestOptions ['queryParams' => ['counterpartyAccountHolderId'=> string]] + * @return \Adyen\Model\Transfers\CapitalGrants + * @throws AdyenException + */ + public function getCapitalAccount(array $requestOptions = null): \Adyen\Model\Transfers\CapitalGrants + { + $endpoint = $this->baseURL . "/grants"; + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Transfers\CapitalGrants::class); + } + + /** + * Get grant reference details + * + * @param string $id + * @param array|null $requestOptions + * @return \Adyen\Model\Transfers\CapitalGrant + * @throws AdyenException + */ + public function getGrantReferenceDetails(string $id, array $requestOptions = null): \Adyen\Model\Transfers\CapitalGrant + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/grants/{id}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Transfers\CapitalGrant::class); + } + + /** + * Request a grant payout + * + * @param \Adyen\Model\Transfers\CapitalGrantInfo $capitalGrantInfo + * @param array|null $requestOptions + * @return \Adyen\Model\Transfers\CapitalGrant + * @throws AdyenException + */ + public function requestGrantPayout(\Adyen\Model\Transfers\CapitalGrantInfo $capitalGrantInfo, array $requestOptions = null): \Adyen\Model\Transfers\CapitalGrant + { + $endpoint = $this->baseURL . "/grants"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $capitalGrantInfo->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Transfers\CapitalGrant::class); + } +} diff --git a/src/Adyen/Service/Validator/CheckoutStateDataValidator.php b/src/Adyen/Service/Validator/CheckoutStateDataValidator.php index 3b5fb7669..edc978214 100644 --- a/src/Adyen/Service/Validator/CheckoutStateDataValidator.php +++ b/src/Adyen/Service/Validator/CheckoutStateDataValidator.php @@ -2,6 +2,9 @@ namespace Adyen\Service\Validator; +/** + * @deprecated + */ class CheckoutStateDataValidator { protected $stateDataRootKeys = array( diff --git a/src/Adyen/Service/Validator/DataArrayValidator.php b/src/Adyen/Service/Validator/DataArrayValidator.php index a78962c6f..40a7277d1 100644 --- a/src/Adyen/Service/Validator/DataArrayValidator.php +++ b/src/Adyen/Service/Validator/DataArrayValidator.php @@ -3,6 +3,9 @@ namespace Adyen\Service\Validator; +/** + * @deprecated + */ class DataArrayValidator { /** diff --git a/src/Adyen/Util/Currency.php b/src/Adyen/Util/Currency.php index a81cc0958..a20f41984 100644 --- a/src/Adyen/Util/Currency.php +++ b/src/Adyen/Util/Currency.php @@ -23,6 +23,9 @@ namespace Adyen\Util; +/** + * @deprecated + */ class Currency { /** diff --git a/src/Adyen/Util/HmacSignature.php b/src/Adyen/Util/HmacSignature.php index 622625bc9..38f28a948 100644 --- a/src/Adyen/Util/HmacSignature.php +++ b/src/Adyen/Util/HmacSignature.php @@ -1,25 +1,4 @@ createMockClientUrl('tests/Resources/Capital/get-capital-account.json'); + + // initialize service + $service = new \Adyen\Service\CapitalApi($client); + + $result = $service->getCapitalAccount(); + $this->assertEquals(0, $result->getGrants()[0]->getAmount()->getValue()); + self::assertEquals( + 'https://balanceplatform-api-test.adyen.com/btl/v3/grants', + $this->requestUrl + ); + } +} diff --git a/tests/Unit/CheckoutTest.php b/tests/Unit/CheckoutTest.php index ec649b2c8..db099945d 100644 --- a/tests/Unit/CheckoutTest.php +++ b/tests/Unit/CheckoutTest.php @@ -25,6 +25,8 @@ use Adyen\AdyenException; use Adyen\Service\Checkout; +use function PHPUnit\Framework\assertContains; +use function PHPUnit\Framework\assertEquals; class CheckoutTest extends TestCaseMock { @@ -583,4 +585,13 @@ public static function successDeleteStoredPaymentMethodsProvider() array('tests/Resources/Checkout/deleteStoredPaymentMethods-success.json', 200), ); } + + public function testDoublePathParamSubstitution() + { + $client = $this->createMockClientUrl('tests/Resources/ModelBasedCheckout/sessions-success.json'); + $resource = new Checkout($client); + $resource->captures(array('paymentPspReference' => 'pspRef1')); + $resource->captures(array('paymentPspReference' => 'pspRef2')); + assertEquals($this->requestUrl, 'https://checkout-test.adyen.com/v70/payments/pspRef2/captures'); + } } diff --git a/tests/Unit/ModelBasedCheckoutTest.php b/tests/Unit/ModelBasedCheckoutTest.php index 5787f0166..06b261921 100644 --- a/tests/Unit/ModelBasedCheckoutTest.php +++ b/tests/Unit/ModelBasedCheckoutTest.php @@ -8,8 +8,11 @@ use Adyen\Model\Checkout\CreateCheckoutSessionRequest; use Adyen\Model\Checkout\CreatePaymentLinkRequest; use Adyen\Model\Checkout\DetailsRequest; +use Adyen\Model\Checkout\DonationPaymentRequest; +use Adyen\Model\Checkout\PaymentDetailsRequest; use Adyen\Model\Checkout\PaymentDonationRequest; use Adyen\Model\Checkout\PaymentDonationRequestPaymentMethod; +use Adyen\Model\Checkout\PaymentLinkRequest; use Adyen\Model\Checkout\PaymentMethodsRequest; use Adyen\Model\Checkout\PaymentRequest; use Adyen\Model\Checkout\PaymentSetupRequest; @@ -109,7 +112,7 @@ public function testPaymentsDetailsSuccess($jsonFile, $httpStatus) ), ); - $result = $service->paymentsDetails(new DetailsRequest($params)); + $result = $service->paymentsDetails(new PaymentDetailsRequest($params)); $this->assertContains($result->getResultCode(), array('Authorised')); } @@ -192,7 +195,7 @@ public function testPaymentLinksSuccess($jsonFile, $httpStatus) $service = new PaymentLinksApi($client); - $result = $service->paymentLinks(new CreatePaymentLinkRequest()); + $result = $service->paymentLinks(new PaymentLinkRequest()); $this->assertEquals( 'https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=PL0A6D6846DB347E59', @@ -219,7 +222,7 @@ public function testDonationsSuccess($jsonFile, $httpStatus) $service = new PaymentsApi($client); - $result = $service->donations(new PaymentDonationRequest()); + $result = $service->donations(new DonationPaymentRequest()); $this->assertStringContainsString($result->getReference(), 'YOUR_DONATION_REFERENCE'); $this->assertStringContainsString($result->getId(), 'UNIQUE_RESOURCE_ID'); $this->assertStringContainsString($result->getDonationAccount(), 'CHARITY_ACCOUNT'); diff --git a/tests/Unit/ModelBasedPayoutTest.php b/tests/Unit/ModelBasedPayoutTest.php index 89e28ea9d..6d032b429 100644 --- a/tests/Unit/ModelBasedPayoutTest.php +++ b/tests/Unit/ModelBasedPayoutTest.php @@ -20,7 +20,7 @@ public function testInstantCardPayout() // initialize service $service = new InstantPayoutsApi($client); - $result = $service->makeInstantCardPayout(new PayoutRequest()); + $result = $service->payout(new PayoutRequest()); $this->assertEquals(PayoutResponse::RESULT_CODE_AUTHENTICATION_FINISHED, $result->getResultCode()); } @@ -32,7 +32,7 @@ public function testConfirmThirdParty() // initialize service $service = new ReviewingApi($client); - $result = $service->confirmPayout(new ModifyRequest()); + $result = $service->confirmThirdParty(new ModifyRequest()); $this->assertEquals('[payout-confirm-received]', $result->getResponse()); } @@ -44,7 +44,7 @@ public function testStorePayoutDetails() // initialize service $service = new InitializationApi($client); - $result = $service->storePayoutDetails(new StoreDetailRequest()); + $result = $service->storeDetail(new StoreDetailRequest()); $this->assertEquals('Success', $result->getResultCode()); } } diff --git a/tests/Unit/NotificationTest.php b/tests/Unit/NotificationTest.php index 62d8075a2..5076a7d9b 100755 --- a/tests/Unit/NotificationTest.php +++ b/tests/Unit/NotificationTest.php @@ -23,6 +23,10 @@ namespace Adyen\Tests\Unit; +use Adyen\Model\BalancePlatform\Balance; +use Adyen\Model\ConfigurationWebhooks\BalanceAccountNotificationRequest; +use Adyen\Model\ConfigurationWebhooks\SweepConfigurationNotificationRequest; +use Adyen\Service\BankingWebhookParser; use Adyen\Service\Notification; class NotificationTest extends TestCaseMock @@ -256,4 +260,21 @@ public static function successNotificationTestProvider() array('tests/Resources/Notification/test-success.json', 200), ); } + + public function testBankingWebhookParser() + { + $jsonString = '{ "data": {"balancePlatform":"YOUR_BALANCE_PLATFORM","accountHolder":{"contactDetails":{"address":{"country":"NL","houseNumberOrName":"274","postalCode":"1020CD","street":"Brannan Street"},"email": "s.hopper@example.com","phone": {"number": "+315551231234","type": "Mobile"}},"description": "S.Hopper - Staff 123","id": "AH00000000000000000000001","status": "Active"}},"environment": "test","type": "balancePlatform.accountHolder.created"}'; + $webhookParser = new BankingWebhookParser($jsonString); + $result = $webhookParser->getAccountHolderNotificationRequest(); + self::assertEquals("test", $result->getEnvironment()); + } + + public function testBankingWebhookParserBalanceAccount() + { + $jsonString = '{"data":{"balancePlatform":"Integration_tools_test","accountId":"BA32272223222H5HVKTBK4MLB","sweep":{"id":"SWPC42272223222H5HVKV6H8C64DP5","schedule":{"type":"balance"},"status":"active","targetAmount":{"currency":"EUR","value":0},"triggerAmount":{"currency":"EUR","value":0},"type":"pull","counterparty":{"balanceAccountId":"BA3227C223222H5HVKT3H9WLC"},"currency":"EUR"}},"environment":"test","type":"balancePlatform.balanceAccountSweep.updated"}'; + $webhookParser = new BankingWebhookParser($jsonString); + $result = $webhookParser->getGenericWebhook(); + self::assertEquals(SweepConfigurationNotificationRequest::class, get_class($result)); + self::assertEquals("test", $result->getEnvironment()); + } } diff --git a/tests/Unit/PaymentTest.php b/tests/Unit/PaymentTest.php index 12239d93f..6eed0fd91 100644 --- a/tests/Unit/PaymentTest.php +++ b/tests/Unit/PaymentTest.php @@ -26,8 +26,6 @@ use Adyen\AdyenException; use Adyen\ConnectionException; use Adyen\Service\Payment; -use Monolog\Handler\TestHandler; -use Monolog\Logger; class PaymentTest extends TestCaseMock { @@ -39,13 +37,6 @@ public function testAuthoriseSuccessInTestEnvironment($jsonFile, $httpStatus) // create client $client = $this->createMockClient($jsonFile, $httpStatus); - $handler = new TestHandler(); - - $logger = new Logger('test', array($handler)); - - // Stub Logger to prevent full card data being logged - $client->setLogger($logger); - // initialize service $service = new Payment($client); @@ -74,10 +65,6 @@ public function testAuthoriseSuccessInTestEnvironment($jsonFile, $httpStatus) $this->assertArrayHasKey('resultCode', $result); $this->assertEquals('Authorised', $result['resultCode']); - - $this->assertTrue($handler->hasInfoThatContains('4111111111111111')); - $this->assertTrue($handler->hasInfoThatContains('737')); - $this->assertTrue($handler->hasInfoThatContains('adyenjs....')); } /** @@ -88,13 +75,6 @@ public function testAuthoriseSuccessInLiveEnvironment($jsonFile, $httpStatus) // create client $client = $this->createMockClient($jsonFile, $httpStatus, null, \Adyen\Environment::LIVE); - $handler = new TestHandler(); - - $logger = new Logger('test', array($handler)); - - // Stub Logger to prevent full card data being logged - $client->setLogger($logger); - // initialize service $service = new Payment($client); @@ -123,11 +103,6 @@ public function testAuthoriseSuccessInLiveEnvironment($jsonFile, $httpStatus) $this->assertArrayHasKey('resultCode', $result); $this->assertEquals('Authorised', $result['resultCode']); - - $this->markTestSkipped('Move this checks to integration test'); - $this->assertFalse($handler->hasInfoThatContains('4111111111111111')); - $this->assertFalse($handler->hasInfoThatContains('737')); - $this->assertFalse($handler->hasInfoThatContains('adyenjs_0897248234342242524232...')); } public static function successAuthoriseProvider() diff --git a/tests/Unit/TestCaseMock.php b/tests/Unit/TestCaseMock.php index 65362b4ad..e7c7a3b0e 100644 --- a/tests/Unit/TestCaseMock.php +++ b/tests/Unit/TestCaseMock.php @@ -51,10 +51,6 @@ protected function createMockClient($jsonFile, $httpStatus, $errno = null, $envi } else { $result = null; } - if ($client->getLogger() && isset($json)) { - $client->getLogger()->info(json_encode($params)); - $client->getLogger()->info($json); - } if (isset($result['errorCode'])) { throw new AdyenException($result['message']); } diff --git a/tests/Unit/Util/HmacSignatureTest.php b/tests/Unit/Util/HmacSignatureTest.php index b07e3004b..c5a6bf43b 100644 --- a/tests/Unit/Util/HmacSignatureTest.php +++ b/tests/Unit/Util/HmacSignatureTest.php @@ -151,4 +151,24 @@ public function testIsHmacSupportedEventCode() $this->fail('Unexpected exception'); } } + + /** + * @throws AdyenException + */ + public function testBankingWebhookHmacValidation() + { + $params = "{\"data\":{\"balancePlatform\":\"Integration_tools_test\"," + . "\"accountId\":\"BA32272223222H5HVKTBK4MLB\",\"sweep\":{\"id\":\"SWPC42272223222H5HVKV6H8C64DP5\"," + . "\"schedule\":{\"type\":\"balance\"},\"status\":\"active\",\"targetAmount\":{\"currency\":\"EUR\"" + . ",\"value\":0},\"triggerAmount\":{\"currency\":\"EUR\",\"value\":0},\"type\":\"pull\",\"counterparty\":" + . "{\"balanceAccountId\":\"BA3227C223222H5HVKT3H9WLC\"},\"currency\":\"EUR\"}},\"environment\":" + . "\"test\",\"type\":\"balancePlatform.balanceAccountSweep.updated\"}"; + $hmac = new HmacSignature(); + $result = $hmac->validateHMAC( + "9Qz9S/0xpar1klkniKdshxpAhRKbiSAewPpWoxKefQA=", + "D7DD5BA6146493707BF0BE7496F6404EC7A63616B7158EC927B9F54BB436765F", + $params + ); + self::assertTrue($result); + } } diff --git a/tests/Unit/Util/UtilTest.php b/tests/Unit/Util/UtilTest.php deleted file mode 100644 index 7a52f00e0..000000000 --- a/tests/Unit/Util/UtilTest.php +++ /dev/null @@ -1,97 +0,0 @@ -expectException(AdyenException::class); - $this->expectExceptionMessage('Invalid HMAC key: INVALID'); - Util::calculateSha256Signature("INVALID", array('key' => 'value')); - } - - public function testSha256() - { - $signature = Util::calculateSha256Signature("123ABC", array( - 'akey' => 'val\\ue', - 'ckey' => 'val:ue', - 'bkey' => '1' - )); - $this->assertEquals("YtbpYcrdbvk0RSVwTwENMzomS0LYtiItMwXhI5tohXs=", $signature); - } - - public function testFormatAmountThreeDecimals() - { - $amount = 15.021; - $currency = "TND"; - $formattedAmount = Util::formatAmount($amount, $currency); - $this->assertEquals(15021, $formattedAmount); - } - - public function testFormatAmountTwoDecimals() - { - $amount = 15.02; - $currency = "EUR"; - $formattedAmount = Util::formatAmount($amount, $currency); - $this->assertEquals(1502, $formattedAmount); - } - - public function testFormatAmountZeroDecimals() - { - $amount = 15021; - $currency = "IDR"; - $formattedAmount = Util::formatAmount($amount, $currency); - $this->assertEquals(15021, $formattedAmount); - } - - public function testNotificationRequestItemHmac() - { - $params = json_decode('{ - "pspReference": "7914073381342284", - "merchantAccountCode": "TestMerchant", - "merchantReference": "TestPayment-1407325143704", - "amount": { - "value": 1130, - "currency": "EUR" - }, - "eventCode": "AUTHORISATION", - "success": "true" - }', true); - $key = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00"; - $hmacCalculation = Util::calculateNotificationHMAC($params, $key); - $expectedHmac = "Ny9gS2veKo5E4w8/OL6xz1/wvT/hYkAXy1xNc/QvO4I="; - $this->assertTrue($hmacCalculation != ""); - $this->assertEquals($hmacCalculation, $expectedHmac); - $params['additionalData'] = array( - 'hmacSignature' => $hmacCalculation - ); - $hmacValidate = Util::isValidNotificationHMAC($params, $key); - $this->assertTrue($hmacValidate); - } -} diff --git a/tests/config/test.ini.sample b/tests/config/test.ini.sample deleted file mode 100644 index a0d6a2ac5..000000000 --- a/tests/config/test.ini.sample +++ /dev/null @@ -1,13 +0,0 @@ -; Test.ini file -username = YOUR USERNAME -password = "YOUR PASSWORD" -merchantAccount = YOUR MERCHANT ACCOUNT -donationAccount = YOUR DONATION MERCHANT ACCOUNT -skinCode = YOUR SKIN CODE -hmacSignature = YOUR HMAC SIGNATURE -x-api-key = YOUR X-API KEY - -storePayoutUsername = YOUR STORE PAYOUT USERNAME -storePayoutPassword = "YOUR STORE PAYOUT PASSWORD" -reviewPayoutUsername = YOUR REVIEW PAYOUT USERNAME -reviewPayoutPassword = "YOUR REVIEW PAYOUT PASSWORD"