diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..ce44f0f17 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,25 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 165 +eclint_block_comment_start = /* +eclint_block_comment = * +eclint_block_comment_end = */ + +[Makefile] +indent_style = tab +max_line_length = unset + +[{*.xml,*.yml,*.yaml}] +indent_size = 2 + +[{*.json,*.md,*.mustache}] +indent_size = 2 +max_line_length = unset +insert_final_newline = unset diff --git a/.gitattributes b/.gitattributes index 25cc8c11b..6f9181d34 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,13 +3,17 @@ # Exclude non-essential files from dist /.github export-ignore -/tests export-ignore /.editorconfig export-ignore +/.gitattributes export-ignore /.gitignore export-ignore +/bin export-ignore /CODE_OF_CONDUCT.md export-ignore /composer.lock export-ignore /CONTRIBUTING.md export-ignore /phpcs.xml export-ignore /phpunit.xml export-ignore +/Makefile export-ignore /renovate.json export-ignore +/sonar-project.properties export-ignore +/tests export-ignore /Vagrantfile export-ignore diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5392dcb63..6fef42706 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,10 +58,3 @@ jobs: - name: Make sure project files are compilable run: find -L . -path ./vendor -prune -o -path ./tests -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l - - - name: SonarCloud integration - if: ${{ env.SONAR_TOKEN }} - uses: sonarsource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/models.yml b/.github/workflows/models.yml index e3fc8c069..d4f6f8652 100644 --- a/.github/workflows/models.yml +++ b/.github/workflows/models.yml @@ -9,7 +9,7 @@ jobs: steps: - uses: actions/checkout@v3 - run: make models - - name: Setup PHP + - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: 8.2 @@ -36,4 +36,4 @@ jobs: title: ${{ steps.vars.outputs.pr_title }} body: ${{ steps.vars.outputs.pr_body }} add-paths: | - src/Adyen/Model \ No newline at end of file + src/Adyen/Model diff --git a/.github/workflows/services.yml b/.github/workflows/services.yml index 02d81070c..dec61818b 100644 --- a/.github/workflows/services.yml +++ b/.github/workflows/services.yml @@ -9,7 +9,7 @@ jobs: steps: - uses: actions/checkout@v3 - run: make all - - name: Setup PHP + - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: 8.2 @@ -37,4 +37,4 @@ jobs: body: ${{ steps.vars.outputs.pr_body }} add-paths: | src/Adyen/Model - src/Adyen/Service \ No newline at end of file + src/Adyen/Service diff --git a/.gitignore b/.gitignore index 5662d99ca..8159b50a7 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,4 @@ composer.lock .phpunit.result.cache # Automation -/target/ \ No newline at end of file +/target/ diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 17a0592cd..78709019a 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -23,13 +23,13 @@ include: Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or - advances + advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic - address, without explicit permission + address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a - professional setting + professional setting ## Our Responsibilities diff --git a/Makefile b/Makefile index b7ba2f110..fbc0be3be 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 ConfigurationWebhooks StoredValue Payments Payout Management LegalEntityManagement TransferWebhooks Transfers BinLookup StoredValue POSTerminalManagement Recurring ReportWebhooks +modelGen:=AcsWebhooks BalanceControl BalancePlatform Checkout ConfigurationWebhooks StoredValue Payments Payout Management ManagementWebhooks LegalEntityManagement TransferWebhooks Transfers BinLookup StoredValue POSTerminalManagement Recurring ReportWebhooks models:=src/Adyen/Model output:=target/out @@ -24,10 +24,14 @@ Payout: spec=PayoutService-v68 Management: spec=ManagementService-v1 LegalEntityManagement: spec=LegalEntityService-v3 Transfers: spec=TransferService-v3 + # BalanceWebhooks +AcsWebhooks: spec=BalancePlatformAcsNotification-v1 ConfigurationWebhooks: spec=BalancePlatformConfigurationNotification-v1 ReportWebhooks: spec=BalancePlatformReportNotification-v1 TransferWebhooks: spec=BalancePlatformTransferNotification-v3 +# ManagementWebhooks +ManagementWebhooks: spec=ManagementNotificationService-v1 # Classic Platforms marketpay/account: spec=AccountService-v6 diff --git a/README.md b/README.md index 817f4a59b..f0f7da23e 100644 --- a/README.md +++ b/README.md @@ -9,33 +9,39 @@ This is the officially supported PHP library for using Adyen's APIs. ## Supported API versions The library supports all APIs under the following services: -| API | Description | Service Name | Supported version | -|------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------|------------------------------------------------------------------| -| [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/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/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** | +| API | Description | Service Name | Supported version | +|------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------|--------------------------| +| [BIN Lookup API](https://docs.adyen.com/api-explorer/BinLookup/54/overview) | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | [Binlookup](src/Adyen/Service/BinLookupApi.php) | **v54** | +| [Capital API](https://docs.adyen.com/api-explorer/capital/3/overview) | Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. | [Capital](src/Adyen/Service/CapitalApi.php) | **v3** | +| [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** | +| [Configuration API](https://docs.adyen.com/api-explorer/balanceplatform/2/overview) | The Configuration API enables you to create a platform where you can onboard your users as account holders and create balance accounts, cards, and business accounts. | [BalancePlatform](src/Adyen/Service/BalancePlatform/) | **v2** | +| [DataProtection API](https://docs.adyen.com/development-resources/data-protection-api) | Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email) | [DataProtection](src/Adyen/Service/DataProtectionApi.php) | **v1** | +| [Management API](https://docs.adyen.com/api-explorer/Management/1/overview) | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | [Management](src/Adyen/Service/Management/) | **v1** | +| [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** | +| [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** | +| [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/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** | +| [Authentication Webhooks](https://docs.adyen.com/api-explorer/acs-webhook/1/overview) | Adyen sends this webhook when the process of cardholder authentication is finalized, whether it is completed successfully, fails, or expires. | [AcsWebhooks](src/Adyen/Model/AcsWebhooks) | **v1** | +| [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. | [ConfigurationWebhooks](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. | [TransferWebhooks](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 | [ReportWebhooks](src/Adyen/Model/ReportWebhooks) | **v1** | +| [Management Webhooks](https://docs.adyen.com/api-explorer/ManagementNotification/1/overview) | Adyen uses webhooks to inform your system about events that happen with your Adyen company and merchant accounts, stores, payment terminals, and payment methods when using Management API. | [ManagementWebhooks](src/Adyen/Model/ManagementWebhooks) | **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/). @@ -117,7 +123,7 @@ $client = new \Adyen\Client(); $client->setXApiKey("YOUR API KEY"); $client->setEnvironment(\Adyen\Environment::LIVE, 'Your live URL prefix'); $client->setTimeout(30); - + ... ~~~~ @@ -167,6 +173,18 @@ if ($isValid) { $result = $webhookParser->getGenericWebhook(); } ~~~~ +### Using Management Webhooks +~~~~ php +... + +$jsonString = 'webhook_payload'; +$isValid = $hmac->validateHMAC("YOUR_HMAC_KEY", "YOUR_HMAC_SIGN", $jsonString); + +if ($isValid) { + $webhookParser = new ManagementWebhookParser($jsonString); + $result = $webhookParser->getGenericWebhook(); +} +~~~~ ### Example integration diff --git a/bin/composer-installer.sh b/bin/composer-installer.sh index 83dc0f913..994512a81 100644 --- a/bin/composer-installer.sh +++ b/bin/composer-installer.sh @@ -14,4 +14,4 @@ fi php composer-setup.php --quiet RESULT=$? rm composer-setup.php -exit $RESULT \ No newline at end of file +exit $RESULT diff --git a/composer.json b/composer.json index 2cb6d0fa4..5042d87ff 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "require-dev": { "dms/phpunit-arraysubset-asserts": "0.5.0", "friendsofphp/php-cs-fixer": "*", - "phpunit/phpunit": "9.6.10", + "phpunit/phpunit": "9.6.11", "php-coveralls/php-coveralls": "2.6.0", "squizlabs/php_codesniffer": "3.7.2" }, diff --git a/phpcs.xml b/phpcs.xml index 56b2f8f72..b447e3ee3 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -9,8 +9,10 @@ ~ --> - + vendor/* build/* @@ -20,4 +22,4 @@ - \ No newline at end of file + diff --git a/sonar-project.properties b/sonar-project.properties deleted file mode 100644 index 60cb60da7..000000000 --- a/sonar-project.properties +++ /dev/null @@ -1,6 +0,0 @@ -sonar.organization=adyen -sonar.projectKey=Adyen_adyen-php-api-library -sonar.sources=. -sonar.php.coverage.reportPaths=build/clover.xml -sonar.php.tests.reportPath=build/tests-log.xml -sonar.exclusions=src/Adyen/Model/**,src/Adyen/Service/*Api.php,src/Adyen/Service/**/*Api.php diff --git a/src/Adyen/Client.php b/src/Adyen/Client.php index acb13e4a3..4daedd782 100644 --- a/src/Adyen/Client.php +++ b/src/Adyen/Client.php @@ -7,7 +7,7 @@ class Client { - const LIB_VERSION = "15.1.0"; + const LIB_VERSION = "15.2.0"; const LIB_NAME = "adyen-php-api-library"; const USER_AGENT_SUFFIX = "adyen-php-api-library/"; const ENDPOINT_TEST = "https://pal-test.adyen.com"; diff --git a/src/Adyen/Model/AcsWebhooks/Amount.php b/src/Adyen/Model/AcsWebhooks/Amount.php new file mode 100644 index 000000000..0d1e0bede --- /dev/null +++ b/src/Adyen/Model/AcsWebhooks/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/AcsWebhooks/AuthenticationInfo.php b/src/Adyen/Model/AcsWebhooks/AuthenticationInfo.php new file mode 100644 index 000000000..a49096d9e --- /dev/null +++ b/src/Adyen/Model/AcsWebhooks/AuthenticationInfo.php @@ -0,0 +1,1222 @@ + + */ +class AuthenticationInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AuthenticationInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'acsTransId' => 'string', + 'challenge' => '\Adyen\Model\AcsWebhooks\ChallengeInfo', + 'challengeIndicator' => 'string', + 'createdAt' => '\DateTime', + 'deviceChannel' => 'string', + 'dsTransID' => 'string', + 'exemptionIndicator' => 'string', + 'inPSD2Scope' => 'bool', + 'messageCategory' => 'string', + 'messageVersion' => 'string', + 'riskScore' => 'int', + 'threeDSServerTransID' => 'string', + 'transStatus' => 'string', + 'transStatusReason' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'acsTransId' => null, + 'challenge' => null, + 'challengeIndicator' => null, + 'createdAt' => 'date-time', + 'deviceChannel' => null, + 'dsTransID' => null, + 'exemptionIndicator' => null, + 'inPSD2Scope' => null, + 'messageCategory' => null, + 'messageVersion' => null, + 'riskScore' => 'int32', + 'threeDSServerTransID' => null, + 'transStatus' => null, + 'transStatusReason' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'acsTransId' => false, + 'challenge' => false, + 'challengeIndicator' => false, + 'createdAt' => false, + 'deviceChannel' => false, + 'dsTransID' => false, + 'exemptionIndicator' => false, + 'inPSD2Scope' => false, + 'messageCategory' => false, + 'messageVersion' => false, + 'riskScore' => true, + 'threeDSServerTransID' => false, + 'transStatus' => false, + 'transStatusReason' => 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 = [ + 'acsTransId' => 'acsTransId', + 'challenge' => 'challenge', + 'challengeIndicator' => 'challengeIndicator', + 'createdAt' => 'createdAt', + 'deviceChannel' => 'deviceChannel', + 'dsTransID' => 'dsTransID', + 'exemptionIndicator' => 'exemptionIndicator', + 'inPSD2Scope' => 'inPSD2Scope', + 'messageCategory' => 'messageCategory', + 'messageVersion' => 'messageVersion', + 'riskScore' => 'riskScore', + 'threeDSServerTransID' => 'threeDSServerTransID', + 'transStatus' => 'transStatus', + 'transStatusReason' => 'transStatusReason', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'acsTransId' => 'setAcsTransId', + 'challenge' => 'setChallenge', + 'challengeIndicator' => 'setChallengeIndicator', + 'createdAt' => 'setCreatedAt', + 'deviceChannel' => 'setDeviceChannel', + 'dsTransID' => 'setDsTransID', + 'exemptionIndicator' => 'setExemptionIndicator', + 'inPSD2Scope' => 'setInPSD2Scope', + 'messageCategory' => 'setMessageCategory', + 'messageVersion' => 'setMessageVersion', + 'riskScore' => 'setRiskScore', + 'threeDSServerTransID' => 'setThreeDSServerTransID', + 'transStatus' => 'setTransStatus', + 'transStatusReason' => 'setTransStatusReason', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'acsTransId' => 'getAcsTransId', + 'challenge' => 'getChallenge', + 'challengeIndicator' => 'getChallengeIndicator', + 'createdAt' => 'getCreatedAt', + 'deviceChannel' => 'getDeviceChannel', + 'dsTransID' => 'getDsTransID', + 'exemptionIndicator' => 'getExemptionIndicator', + 'inPSD2Scope' => 'getInPSD2Scope', + 'messageCategory' => 'getMessageCategory', + 'messageVersion' => 'getMessageVersion', + 'riskScore' => 'getRiskScore', + 'threeDSServerTransID' => 'getThreeDSServerTransID', + 'transStatus' => 'getTransStatus', + 'transStatusReason' => 'getTransStatusReason', + '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 CHALLENGE_INDICATOR__01 = '01'; + public const CHALLENGE_INDICATOR__02 = '02'; + public const CHALLENGE_INDICATOR__03 = '03'; + public const CHALLENGE_INDICATOR__04 = '04'; + public const CHALLENGE_INDICATOR__05 = '05'; + public const CHALLENGE_INDICATOR__07 = '07'; + public const CHALLENGE_INDICATOR__08 = '08'; + public const CHALLENGE_INDICATOR__09 = '09'; + public const CHALLENGE_INDICATOR__80 = '80'; + public const CHALLENGE_INDICATOR__82 = '82'; + public const DEVICE_CHANNEL_APP = 'app'; + public const DEVICE_CHANNEL_BROWSER = 'browser'; + public const DEVICE_CHANNEL_THREE_DS_REQUESTOR_INITIATED = 'ThreeDSRequestorInitiated'; + 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 EXEMPTION_INDICATOR_ACQUIRER_EXEMPTION = 'acquirerExemption'; + public const EXEMPTION_INDICATOR_NO_EXEMPTION_APPLIED = 'noExemptionApplied'; + public const EXEMPTION_INDICATOR_VISA_DAF_EXEMPTION = 'visaDAFExemption'; + public const MESSAGE_CATEGORY_PAYMENT = 'payment'; + public const MESSAGE_CATEGORY_NON_PAYMENT = 'nonPayment'; + public const TRANS_STATUS_Y = 'Y'; + public const TRANS_STATUS_N = 'N'; + public const TRANS_STATUS_R = 'R'; + public const TRANS_STATUS_I = 'I'; + public const TRANS_STATUS_U = 'U'; + public const TRANS_STATUS_REASON__01 = '01'; + public const TRANS_STATUS_REASON__02 = '02'; + public const TRANS_STATUS_REASON__03 = '03'; + public const TRANS_STATUS_REASON__04 = '04'; + public const TRANS_STATUS_REASON__05 = '05'; + public const TRANS_STATUS_REASON__06 = '06'; + public const TRANS_STATUS_REASON__07 = '07'; + public const TRANS_STATUS_REASON__08 = '08'; + public const TRANS_STATUS_REASON__09 = '09'; + public const TRANS_STATUS_REASON__10 = '10'; + public const TRANS_STATUS_REASON__11 = '11'; + public const TRANS_STATUS_REASON__12 = '12'; + public const TRANS_STATUS_REASON__13 = '13'; + public const TRANS_STATUS_REASON__14 = '14'; + public const TRANS_STATUS_REASON__15 = '15'; + public const TRANS_STATUS_REASON__16 = '16'; + public const TRANS_STATUS_REASON__17 = '17'; + public const TRANS_STATUS_REASON__18 = '18'; + public const TRANS_STATUS_REASON__19 = '19'; + public const TRANS_STATUS_REASON__20 = '20'; + public const TRANS_STATUS_REASON__21 = '21'; + public const TRANS_STATUS_REASON__22 = '22'; + public const TRANS_STATUS_REASON__23 = '23'; + public const TRANS_STATUS_REASON__24 = '24'; + public const TRANS_STATUS_REASON__25 = '25'; + public const TRANS_STATUS_REASON__26 = '26'; + public const TRANS_STATUS_REASON__80 = '80'; + public const TRANS_STATUS_REASON__81 = '81'; + public const TRANS_STATUS_REASON__82 = '82'; + public const TRANS_STATUS_REASON__83 = '83'; + public const TRANS_STATUS_REASON__84 = '84'; + public const TRANS_STATUS_REASON__85 = '85'; + public const TRANS_STATUS_REASON__86 = '86'; + public const TRANS_STATUS_REASON__87 = '87'; + public const TRANS_STATUS_REASON__88 = '88'; + public const TYPE_FRICTIONLESS = 'frictionless'; + public const TYPE_CHALLENGE = 'challenge'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChallengeIndicatorAllowableValues() + { + return [ + self::CHALLENGE_INDICATOR__01, + self::CHALLENGE_INDICATOR__02, + self::CHALLENGE_INDICATOR__03, + self::CHALLENGE_INDICATOR__04, + self::CHALLENGE_INDICATOR__05, + self::CHALLENGE_INDICATOR__07, + self::CHALLENGE_INDICATOR__08, + self::CHALLENGE_INDICATOR__09, + self::CHALLENGE_INDICATOR__80, + self::CHALLENGE_INDICATOR__82, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDeviceChannelAllowableValues() + { + return [ + self::DEVICE_CHANNEL_APP, + self::DEVICE_CHANNEL_BROWSER, + self::DEVICE_CHANNEL_THREE_DS_REQUESTOR_INITIATED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExemptionIndicatorAllowableValues() + { + return [ + self::EXEMPTION_INDICATOR_LOW_VALUE, + self::EXEMPTION_INDICATOR_SECURE_CORPORATE, + self::EXEMPTION_INDICATOR_TRUSTED_BENEFICIARY, + self::EXEMPTION_INDICATOR_TRANSACTION_RISK_ANALYSIS, + self::EXEMPTION_INDICATOR_ACQUIRER_EXEMPTION, + self::EXEMPTION_INDICATOR_NO_EXEMPTION_APPLIED, + self::EXEMPTION_INDICATOR_VISA_DAF_EXEMPTION, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMessageCategoryAllowableValues() + { + return [ + self::MESSAGE_CATEGORY_PAYMENT, + self::MESSAGE_CATEGORY_NON_PAYMENT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTransStatusAllowableValues() + { + return [ + self::TRANS_STATUS_Y, + self::TRANS_STATUS_N, + self::TRANS_STATUS_R, + self::TRANS_STATUS_I, + self::TRANS_STATUS_U, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTransStatusReasonAllowableValues() + { + return [ + self::TRANS_STATUS_REASON__01, + self::TRANS_STATUS_REASON__02, + self::TRANS_STATUS_REASON__03, + self::TRANS_STATUS_REASON__04, + self::TRANS_STATUS_REASON__05, + self::TRANS_STATUS_REASON__06, + self::TRANS_STATUS_REASON__07, + self::TRANS_STATUS_REASON__08, + self::TRANS_STATUS_REASON__09, + self::TRANS_STATUS_REASON__10, + self::TRANS_STATUS_REASON__11, + self::TRANS_STATUS_REASON__12, + self::TRANS_STATUS_REASON__13, + self::TRANS_STATUS_REASON__14, + self::TRANS_STATUS_REASON__15, + self::TRANS_STATUS_REASON__16, + self::TRANS_STATUS_REASON__17, + self::TRANS_STATUS_REASON__18, + self::TRANS_STATUS_REASON__19, + self::TRANS_STATUS_REASON__20, + self::TRANS_STATUS_REASON__21, + self::TRANS_STATUS_REASON__22, + self::TRANS_STATUS_REASON__23, + self::TRANS_STATUS_REASON__24, + self::TRANS_STATUS_REASON__25, + self::TRANS_STATUS_REASON__26, + self::TRANS_STATUS_REASON__80, + self::TRANS_STATUS_REASON__81, + self::TRANS_STATUS_REASON__82, + self::TRANS_STATUS_REASON__83, + self::TRANS_STATUS_REASON__84, + self::TRANS_STATUS_REASON__85, + self::TRANS_STATUS_REASON__86, + self::TRANS_STATUS_REASON__87, + self::TRANS_STATUS_REASON__88, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_FRICTIONLESS, + self::TYPE_CHALLENGE, + ]; + } + /** + * 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('acsTransId', $data ?? [], null); + $this->setIfExists('challenge', $data ?? [], null); + $this->setIfExists('challengeIndicator', $data ?? [], null); + $this->setIfExists('createdAt', $data ?? [], null); + $this->setIfExists('deviceChannel', $data ?? [], null); + $this->setIfExists('dsTransID', $data ?? [], null); + $this->setIfExists('exemptionIndicator', $data ?? [], null); + $this->setIfExists('inPSD2Scope', $data ?? [], null); + $this->setIfExists('messageCategory', $data ?? [], null); + $this->setIfExists('messageVersion', $data ?? [], null); + $this->setIfExists('riskScore', $data ?? [], null); + $this->setIfExists('threeDSServerTransID', $data ?? [], null); + $this->setIfExists('transStatus', $data ?? [], null); + $this->setIfExists('transStatusReason', $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['acsTransId'] === null) { + $invalidProperties[] = "'acsTransId' can't be null"; + } + if ($this->container['challengeIndicator'] === null) { + $invalidProperties[] = "'challengeIndicator' can't be null"; + } + $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) + ); + } + + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['deviceChannel'] === null) { + $invalidProperties[] = "'deviceChannel' can't be null"; + } + $allowedValues = $this->getDeviceChannelAllowableValues(); + if (!is_null($this->container['deviceChannel']) && !in_array($this->container['deviceChannel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'deviceChannel', must be one of '%s'", + $this->container['deviceChannel'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['dsTransID'] === null) { + $invalidProperties[] = "'dsTransID' can't be null"; + } + $allowedValues = $this->getExemptionIndicatorAllowableValues(); + if (!is_null($this->container['exemptionIndicator']) && !in_array($this->container['exemptionIndicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exemptionIndicator', must be one of '%s'", + $this->container['exemptionIndicator'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['inPSD2Scope'] === null) { + $invalidProperties[] = "'inPSD2Scope' can't be null"; + } + if ($this->container['messageCategory'] === null) { + $invalidProperties[] = "'messageCategory' can't be null"; + } + $allowedValues = $this->getMessageCategoryAllowableValues(); + if (!is_null($this->container['messageCategory']) && !in_array($this->container['messageCategory'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'messageCategory', must be one of '%s'", + $this->container['messageCategory'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['messageVersion'] === null) { + $invalidProperties[] = "'messageVersion' can't be null"; + } + if ($this->container['threeDSServerTransID'] === null) { + $invalidProperties[] = "'threeDSServerTransID' can't be null"; + } + if ($this->container['transStatus'] === null) { + $invalidProperties[] = "'transStatus' can't be null"; + } + $allowedValues = $this->getTransStatusAllowableValues(); + if (!is_null($this->container['transStatus']) && !in_array($this->container['transStatus'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'transStatus', must be one of '%s'", + $this->container['transStatus'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTransStatusReasonAllowableValues(); + if (!is_null($this->container['transStatusReason']) && !in_array($this->container['transStatusReason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'transStatusReason', must be one of '%s'", + $this->container['transStatusReason'], + 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 acsTransId + * + * @return string + */ + public function getAcsTransId() + { + return $this->container['acsTransId']; + } + + /** + * Sets acsTransId + * + * @param string $acsTransId Universally unique transaction identifier assigned by the Access Control Server (ACS) to identify a single transaction. + * + * @return self + */ + public function setAcsTransId($acsTransId) + { + if (is_null($acsTransId)) { + throw new \InvalidArgumentException('non-nullable acsTransId cannot be null'); + } + $this->container['acsTransId'] = $acsTransId; + + return $this; + } + + /** + * Gets challenge + * + * @return \Adyen\Model\AcsWebhooks\ChallengeInfo|null + */ + public function getChallenge() + { + return $this->container['challenge']; + } + + /** + * Sets challenge + * + * @param \Adyen\Model\AcsWebhooks\ChallengeInfo|null $challenge challenge + * + * @return self + */ + public function setChallenge($challenge) + { + if (is_null($challenge)) { + throw new \InvalidArgumentException('non-nullable challenge cannot be null'); + } + $this->container['challenge'] = $challenge; + + return $this; + } + + /** + * Gets challengeIndicator + * + * @return string + */ + public function getChallengeIndicator() + { + return $this->container['challengeIndicator']; + } + + /** + * Sets challengeIndicator + * + * @param string $challengeIndicator Specifies a preference for receiving a challenge. Possible values: * **01**: No preference * **02**: No challenge requested * **03**: Challenge requested (preference) * **04**: Challenge requested (mandate) * **05**: No challenge requested (transactional risk analysis is already performed) * **07**: No challenge requested (SCA is already performed) * **08**: No challenge requested (trusted beneficiaries exemption of no challenge required) * **09**: Challenge requested (trusted beneficiaries prompt requested if challenge required) * **80**: No challenge requested (secure corporate payment with Mastercard) * **82**: No challenge requested (secure corporate payment with Visa) + * + * @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 createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Date and time in UTC of the cardholder authentication. [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**. + * + * @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 deviceChannel + * + * @return string + */ + public function getDeviceChannel() + { + return $this->container['deviceChannel']; + } + + /** + * Sets deviceChannel + * + * @param string $deviceChannel Indicates the type of channel interface being used to initiate the transaction. Possible values: * **app** * **browser** * **3DSRequestorInitiated** (initiated by a merchant when the cardholder is not available) + * + * @return self + */ + public function setDeviceChannel($deviceChannel) + { + if (is_null($deviceChannel)) { + throw new \InvalidArgumentException('non-nullable deviceChannel cannot be null'); + } + $allowedValues = $this->getDeviceChannelAllowableValues(); + if (!in_array($deviceChannel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'deviceChannel', must be one of '%s'", + $deviceChannel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['deviceChannel'] = $deviceChannel; + + return $this; + } + + /** + * Gets dsTransID + * + * @return string + */ + public function getDsTransID() + { + return $this->container['dsTransID']; + } + + /** + * Sets dsTransID + * + * @param string $dsTransID Universally unique transaction identifier assigned by the DS (card scheme) to identify a single transaction. + * + * @return self + */ + public function setDsTransID($dsTransID) + { + if (is_null($dsTransID)) { + throw new \InvalidArgumentException('non-nullable dsTransID cannot be null'); + } + $this->container['dsTransID'] = $dsTransID; + + return $this; + } + + /** + * Gets exemptionIndicator + * + * @return string|null + */ + public function getExemptionIndicator() + { + return $this->container['exemptionIndicator']; + } + + /** + * Sets exemptionIndicator + * + * @param string|null $exemptionIndicator Indicates the exemption type that was applied to the authentication by the issuer, if exemption applied. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** * **acquirerExemption** * **noExemptionApplied** * **visaDAFExemption** + * + * @return self + */ + public function setExemptionIndicator($exemptionIndicator) + { + if (is_null($exemptionIndicator)) { + throw new \InvalidArgumentException('non-nullable exemptionIndicator cannot be null'); + } + $allowedValues = $this->getExemptionIndicatorAllowableValues(); + if (!in_array($exemptionIndicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exemptionIndicator', must be one of '%s'", + $exemptionIndicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exemptionIndicator'] = $exemptionIndicator; + + return $this; + } + + /** + * Gets inPSD2Scope + * + * @return bool + */ + public function getInPSD2Scope() + { + return $this->container['inPSD2Scope']; + } + + /** + * Sets inPSD2Scope + * + * @param bool $inPSD2Scope Indicates if the purchase was in the PSD2 scope. + * + * @return self + */ + public function setInPSD2Scope($inPSD2Scope) + { + if (is_null($inPSD2Scope)) { + throw new \InvalidArgumentException('non-nullable inPSD2Scope cannot be null'); + } + $this->container['inPSD2Scope'] = $inPSD2Scope; + + return $this; + } + + /** + * Gets messageCategory + * + * @return string + */ + public function getMessageCategory() + { + return $this->container['messageCategory']; + } + + /** + * Sets messageCategory + * + * @param string $messageCategory Identifies the category of the message for a specific use case. Possible values: * **payment** * **nonPayment** + * + * @return self + */ + public function setMessageCategory($messageCategory) + { + if (is_null($messageCategory)) { + throw new \InvalidArgumentException('non-nullable messageCategory cannot be null'); + } + $allowedValues = $this->getMessageCategoryAllowableValues(); + if (!in_array($messageCategory, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'messageCategory', must be one of '%s'", + $messageCategory, + implode("', '", $allowedValues) + ) + ); + } + $this->container['messageCategory'] = $messageCategory; + + return $this; + } + + /** + * Gets messageVersion + * + * @return string + */ + public function getMessageVersion() + { + return $this->container['messageVersion']; + } + + /** + * Sets messageVersion + * + * @param string $messageVersion The `messageVersion` value as defined in the 3D Secure 2 specification. + * + * @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 riskScore + * + * @return int|null + */ + public function getRiskScore() + { + return $this->container['riskScore']; + } + + /** + * Sets riskScore + * + * @param int|null $riskScore Risk score calculated from the transaction rules. + * + * @return self + */ + public function setRiskScore($riskScore) + { + // Do nothing for nullable integers + $this->container['riskScore'] = $riskScore; + + return $this; + } + + /** + * Gets threeDSServerTransID + * + * @return string + */ + public function getThreeDSServerTransID() + { + return $this->container['threeDSServerTransID']; + } + + /** + * Sets threeDSServerTransID + * + * @param string $threeDSServerTransID The `threeDSServerTransID` value as defined in the 3D Secure 2 specification. + * + * @return self + */ + public function setThreeDSServerTransID($threeDSServerTransID) + { + if (is_null($threeDSServerTransID)) { + throw new \InvalidArgumentException('non-nullable threeDSServerTransID cannot be null'); + } + $this->container['threeDSServerTransID'] = $threeDSServerTransID; + + return $this; + } + + /** + * Gets transStatus + * + * @return string + */ + public function getTransStatus() + { + return $this->container['transStatus']; + } + + /** + * Sets transStatus + * + * @param string $transStatus The `transStatus` value as defined in the 3D Secure 2 specification. Possible values: * **Y**: Authentication / Account verification successful. * **N**: Not Authenticated / Account not verified. Transaction denied. * **U**: Authentication / Account verification could not be performed. * **I**: Informational Only / 3D Secure Requestor challenge preference acknowledged. * **R**: Authentication / Account verification rejected by the Issuer. + * + * @return self + */ + public function setTransStatus($transStatus) + { + if (is_null($transStatus)) { + throw new \InvalidArgumentException('non-nullable transStatus cannot be null'); + } + $allowedValues = $this->getTransStatusAllowableValues(); + if (!in_array($transStatus, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'transStatus', must be one of '%s'", + $transStatus, + implode("', '", $allowedValues) + ) + ); + } + $this->container['transStatus'] = $transStatus; + + return $this; + } + + /** + * Gets transStatusReason + * + * @return string|null + */ + public function getTransStatusReason() + { + return $this->container['transStatusReason']; + } + + /** + * Sets transStatusReason + * + * @param string|null $transStatusReason Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). + * + * @return self + */ + public function setTransStatusReason($transStatusReason) + { + if (is_null($transStatusReason)) { + throw new \InvalidArgumentException('non-nullable transStatusReason cannot be null'); + } + $allowedValues = $this->getTransStatusReasonAllowableValues(); + if (!in_array($transStatusReason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'transStatusReason', must be one of '%s'", + $transStatusReason, + implode("', '", $allowedValues) + ) + ); + } + $this->container['transStatusReason'] = $transStatusReason; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of authentication performed. Possible values: * **frictionless** * **challenge** + * + * @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/AcsWebhooks/AuthenticationNotificationData.php b/src/Adyen/Model/AcsWebhooks/AuthenticationNotificationData.php new file mode 100644 index 000000000..ae9a51ee1 --- /dev/null +++ b/src/Adyen/Model/AcsWebhooks/AuthenticationNotificationData.php @@ -0,0 +1,604 @@ + + */ +class AuthenticationNotificationData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AuthenticationNotificationData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authentication' => '\Adyen\Model\AcsWebhooks\AuthenticationInfo', + 'balancePlatform' => 'string', + 'id' => 'string', + 'paymentInstrumentId' => 'string', + 'purchase' => '\Adyen\Model\AcsWebhooks\PurchaseInfo', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authentication' => null, + 'balancePlatform' => null, + 'id' => null, + 'paymentInstrumentId' => null, + 'purchase' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authentication' => false, + 'balancePlatform' => false, + 'id' => false, + 'paymentInstrumentId' => false, + 'purchase' => 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 = [ + 'authentication' => 'authentication', + 'balancePlatform' => 'balancePlatform', + 'id' => 'id', + 'paymentInstrumentId' => 'paymentInstrumentId', + 'purchase' => 'purchase', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authentication' => 'setAuthentication', + 'balancePlatform' => 'setBalancePlatform', + 'id' => 'setId', + 'paymentInstrumentId' => 'setPaymentInstrumentId', + 'purchase' => 'setPurchase', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authentication' => 'getAuthentication', + 'balancePlatform' => 'getBalancePlatform', + 'id' => 'getId', + 'paymentInstrumentId' => 'getPaymentInstrumentId', + 'purchase' => 'getPurchase', + '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_AUTHENTICATED = 'authenticated'; + public const STATUS_REJECTED = 'rejected'; + public const STATUS_ERROR = 'error'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_AUTHENTICATED, + self::STATUS_REJECTED, + self::STATUS_ERROR, + ]; + } + /** + * 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('balancePlatform', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('paymentInstrumentId', $data ?? [], null); + $this->setIfExists('purchase', $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['authentication'] === null) { + $invalidProperties[] = "'authentication' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['paymentInstrumentId'] === null) { + $invalidProperties[] = "'paymentInstrumentId' can't be null"; + } + if ($this->container['purchase'] === null) { + $invalidProperties[] = "'purchase' 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 authentication + * + * @return \Adyen\Model\AcsWebhooks\AuthenticationInfo + */ + public function getAuthentication() + { + return $this->container['authentication']; + } + + /** + * Sets authentication + * + * @param \Adyen\Model\AcsWebhooks\AuthenticationInfo $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 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 id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id Unique identifier of the authentication. + * + * @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 + */ + public function getPaymentInstrumentId() + { + return $this->container['paymentInstrumentId']; + } + + /** + * Sets paymentInstrumentId + * + * @param string $paymentInstrumentId Unique identifier of the payment instrument that was used for the authentication. + * + * @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 purchase + * + * @return \Adyen\Model\AcsWebhooks\PurchaseInfo + */ + public function getPurchase() + { + return $this->container['purchase']; + } + + /** + * Sets purchase + * + * @param \Adyen\Model\AcsWebhooks\PurchaseInfo $purchase purchase + * + * @return self + */ + public function setPurchase($purchase) + { + if (is_null($purchase)) { + throw new \InvalidArgumentException('non-nullable purchase cannot be null'); + } + $this->container['purchase'] = $purchase; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Outcome of the authentication. Allowed values: * authenticated * rejected * 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; + } + /** + * 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/AcsWebhooks/AuthenticationNotificationRequest.php b/src/Adyen/Model/AcsWebhooks/AuthenticationNotificationRequest.php new file mode 100644 index 000000000..2f6027ad8 --- /dev/null +++ b/src/Adyen/Model/AcsWebhooks/AuthenticationNotificationRequest.php @@ -0,0 +1,492 @@ + + */ +class AuthenticationNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AuthenticationNotificationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\AcsWebhooks\AuthenticationNotificationData', + '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_AUTHENTICATION_CREATED = 'balancePlatform.authentication.created'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BALANCE_PLATFORM_AUTHENTICATION_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\AcsWebhooks\AuthenticationNotificationData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\AcsWebhooks\AuthenticationNotificationData $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 notification. + * + * @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/AcsWebhooks/BalancePlatformNotificationResponse.php b/src/Adyen/Model/AcsWebhooks/BalancePlatformNotificationResponse.php new file mode 100644 index 000000000..343ad050b --- /dev/null +++ b/src/Adyen/Model/AcsWebhooks/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/AcsWebhooks/ChallengeInfo.php b/src/Adyen/Model/AcsWebhooks/ChallengeInfo.php new file mode 100644 index 000000000..0a07805a7 --- /dev/null +++ b/src/Adyen/Model/AcsWebhooks/ChallengeInfo.php @@ -0,0 +1,632 @@ + + */ +class ChallengeInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ChallengeInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'challengeCancel' => 'string', + 'flow' => 'string', + 'lastInteraction' => '\DateTime', + 'phoneNumber' => 'string', + 'resends' => 'int', + 'retries' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'challengeCancel' => null, + 'flow' => null, + 'lastInteraction' => 'date-time', + 'phoneNumber' => null, + 'resends' => 'int32', + 'retries' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'challengeCancel' => false, + 'flow' => false, + 'lastInteraction' => false, + 'phoneNumber' => false, + 'resends' => true, + 'retries' => 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 = [ + 'challengeCancel' => 'challengeCancel', + 'flow' => 'flow', + 'lastInteraction' => 'lastInteraction', + 'phoneNumber' => 'phoneNumber', + 'resends' => 'resends', + 'retries' => 'retries' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'challengeCancel' => 'setChallengeCancel', + 'flow' => 'setFlow', + 'lastInteraction' => 'setLastInteraction', + 'phoneNumber' => 'setPhoneNumber', + 'resends' => 'setResends', + 'retries' => 'setRetries' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'challengeCancel' => 'getChallengeCancel', + 'flow' => 'getFlow', + 'lastInteraction' => 'getLastInteraction', + 'phoneNumber' => 'getPhoneNumber', + 'resends' => 'getResends', + 'retries' => 'getRetries' + ]; + + /** + * 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 CHALLENGE_CANCEL__01 = '01'; + public const CHALLENGE_CANCEL__02 = '02'; + public const CHALLENGE_CANCEL__03 = '03'; + public const CHALLENGE_CANCEL__04 = '04'; + public const CHALLENGE_CANCEL__05 = '05'; + public const CHALLENGE_CANCEL__06 = '06'; + public const CHALLENGE_CANCEL__07 = '07'; + public const FLOW_OTP_SMS = 'OTP_SMS'; + public const FLOW_OOB = 'OOB'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChallengeCancelAllowableValues() + { + return [ + self::CHALLENGE_CANCEL__01, + self::CHALLENGE_CANCEL__02, + self::CHALLENGE_CANCEL__03, + self::CHALLENGE_CANCEL__04, + self::CHALLENGE_CANCEL__05, + self::CHALLENGE_CANCEL__06, + self::CHALLENGE_CANCEL__07, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFlowAllowableValues() + { + return [ + self::FLOW_OTP_SMS, + self::FLOW_OOB, + ]; + } + /** + * 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('challengeCancel', $data ?? [], null); + $this->setIfExists('flow', $data ?? [], null); + $this->setIfExists('lastInteraction', $data ?? [], null); + $this->setIfExists('phoneNumber', $data ?? [], null); + $this->setIfExists('resends', $data ?? [], null); + $this->setIfExists('retries', $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->getChallengeCancelAllowableValues(); + if (!is_null($this->container['challengeCancel']) && !in_array($this->container['challengeCancel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'challengeCancel', must be one of '%s'", + $this->container['challengeCancel'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['flow'] === null) { + $invalidProperties[] = "'flow' can't be null"; + } + $allowedValues = $this->getFlowAllowableValues(); + if (!is_null($this->container['flow']) && !in_array($this->container['flow'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'flow', must be one of '%s'", + $this->container['flow'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['lastInteraction'] === null) { + $invalidProperties[] = "'lastInteraction' 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 challengeCancel + * + * @return string|null + */ + public function getChallengeCancel() + { + return $this->container['challengeCancel']; + } + + /** + * Sets challengeCancel + * + * @param string|null $challengeCancel Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). + * + * @return self + */ + public function setChallengeCancel($challengeCancel) + { + if (is_null($challengeCancel)) { + throw new \InvalidArgumentException('non-nullable challengeCancel cannot be null'); + } + $allowedValues = $this->getChallengeCancelAllowableValues(); + if (!in_array($challengeCancel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'challengeCancel', must be one of '%s'", + $challengeCancel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['challengeCancel'] = $challengeCancel; + + return $this; + } + + /** + * Gets flow + * + * @return string + */ + public function getFlow() + { + return $this->container['flow']; + } + + /** + * Sets flow + * + * @param string $flow The flow used in the challenge. Possible values: * **OTP_SMS**: one-time password (OTP) flow * **OOB**: out-of-band (OOB) flow + * + * @return self + */ + public function setFlow($flow) + { + if (is_null($flow)) { + throw new \InvalidArgumentException('non-nullable flow cannot be null'); + } + $allowedValues = $this->getFlowAllowableValues(); + if (!in_array($flow, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'flow', must be one of '%s'", + $flow, + implode("', '", $allowedValues) + ) + ); + } + $this->container['flow'] = $flow; + + return $this; + } + + /** + * Gets lastInteraction + * + * @return \DateTime + */ + public function getLastInteraction() + { + return $this->container['lastInteraction']; + } + + /** + * Sets lastInteraction + * + * @param \DateTime $lastInteraction The last time of interaction with the challenge. + * + * @return self + */ + public function setLastInteraction($lastInteraction) + { + if (is_null($lastInteraction)) { + throw new \InvalidArgumentException('non-nullable lastInteraction cannot be null'); + } + $this->container['lastInteraction'] = $lastInteraction; + + return $this; + } + + /** + * Gets phoneNumber + * + * @return string|null + */ + public function getPhoneNumber() + { + return $this->container['phoneNumber']; + } + + /** + * Sets phoneNumber + * + * @param string|null $phoneNumber The last four digits of the phone number used in the challenge. + * + * @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 resends + * + * @return int|null + */ + public function getResends() + { + return $this->container['resends']; + } + + /** + * Sets resends + * + * @param int|null $resends The number of times the one-time password (OTP) was resent during the challenge. + * + * @return self + */ + public function setResends($resends) + { + // Do nothing for nullable integers + $this->container['resends'] = $resends; + + return $this; + } + + /** + * Gets retries + * + * @return int|null + */ + public function getRetries() + { + return $this->container['retries']; + } + + /** + * Sets retries + * + * @param int|null $retries The number of retries used in the challenge. + * + * @return self + */ + public function setRetries($retries) + { + // Do nothing for nullable integers + $this->container['retries'] = $retries; + + 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/AcsWebhooks/ModelInterface.php b/src/Adyen/Model/AcsWebhooks/ModelInterface.php new file mode 100644 index 000000000..bc3470681 --- /dev/null +++ b/src/Adyen/Model/AcsWebhooks/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/AcsWebhooks/PurchaseInfo.php b/src/Adyen/Model/AcsWebhooks/PurchaseInfo.php new file mode 100644 index 000000000..2893ec11a --- /dev/null +++ b/src/Adyen/Model/AcsWebhooks/PurchaseInfo.php @@ -0,0 +1,461 @@ + + */ +class PurchaseInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PurchaseInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'date' => 'string', + 'merchantName' => 'string', + 'originalAmount' => '\Adyen\Model\AcsWebhooks\Amount' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'date' => null, + 'merchantName' => null, + 'originalAmount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'date' => false, + 'merchantName' => false, + 'originalAmount' => 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 = [ + 'date' => 'date', + 'merchantName' => 'merchantName', + 'originalAmount' => 'originalAmount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'date' => 'setDate', + 'merchantName' => 'setMerchantName', + 'originalAmount' => 'setOriginalAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'date' => 'getDate', + 'merchantName' => 'getMerchantName', + 'originalAmount' => 'getOriginalAmount' + ]; + + /** + * 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('date', $data ?? [], null); + $this->setIfExists('merchantName', $data ?? [], null); + $this->setIfExists('originalAmount', $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['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + if ($this->container['merchantName'] === null) { + $invalidProperties[] = "'merchantName' can't be null"; + } + if ($this->container['originalAmount'] === null) { + $invalidProperties[] = "'originalAmount' 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 date + * + * @return string + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param string $date Date of the purchase. + * + * @return self + */ + public function setDate($date) + { + if (is_null($date)) { + throw new \InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets merchantName + * + * @return string + */ + public function getMerchantName() + { + return $this->container['merchantName']; + } + + /** + * Sets merchantName + * + * @param string $merchantName Name of the merchant. + * + * @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 originalAmount + * + * @return \Adyen\Model\AcsWebhooks\Amount + */ + public function getOriginalAmount() + { + return $this->container['originalAmount']; + } + + /** + * Sets originalAmount + * + * @param \Adyen\Model\AcsWebhooks\Amount $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; + } + /** + * 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/AcsWebhooks/Resource.php b/src/Adyen/Model/AcsWebhooks/Resource.php new file mode 100644 index 000000000..13396ae9c --- /dev/null +++ b/src/Adyen/Model/AcsWebhooks/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/Checkout/CardDetails.php b/src/Adyen/Model/Checkout/CardDetails.php index c5280513b..33974d5a1 100644 --- a/src/Adyen/Model/Checkout/CardDetails.php +++ b/src/Adyen/Model/Checkout/CardDetails.php @@ -324,6 +324,7 @@ public function getModelName() } public const FUNDING_SOURCE_DEBIT = 'debit'; + public const TYPE_BCMC = 'bcmc'; public const TYPE_SCHEME = 'scheme'; public const TYPE_NETWORK_TOKEN = 'networkToken'; public const TYPE_GIFTCARD = 'giftcard'; @@ -349,6 +350,7 @@ public function getFundingSourceAllowableValues() public function getTypeAllowableValues() { return [ + self::TYPE_BCMC, self::TYPE_SCHEME, self::TYPE_NETWORK_TOKEN, self::TYPE_GIFTCARD, diff --git a/src/Adyen/Model/Checkout/Split.php b/src/Adyen/Model/Checkout/Split.php index 37c5e0011..c0c3203a3 100644 --- a/src/Adyen/Model/Checkout/Split.php +++ b/src/Adyen/Model/Checkout/Split.php @@ -244,18 +244,10 @@ 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'; - public const TYPE_TOP_UP = 'TopUp'; public const TYPE_VAT = 'VAT'; - public const TYPE_VERIFICATION = 'Verification'; /** * Gets allowable values of the enum @@ -270,18 +262,10 @@ 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, - self::TYPE_TOP_UP, self::TYPE_VAT, - self::TYPE_VERIFICATION, ]; } /** diff --git a/src/Adyen/Model/LegalEntityManagement/BankAccount.php b/src/Adyen/Model/LegalEntityManagement/BankAccount.php index 54d992343..2aaad6357 100644 --- a/src/Adyen/Model/LegalEntityManagement/BankAccount.php +++ b/src/Adyen/Model/LegalEntityManagement/BankAccount.php @@ -52,6 +52,7 @@ class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable 'institutionNumber' => 'string', 'transitNumber' => 'string', 'bankCode' => 'string', + 'clearingCode' => 'string', 'iban' => 'string', 'additionalBankIdentification' => '\Adyen\Model\LegalEntityManagement\AdditionalBankIdentification', 'bic' => 'string', @@ -75,6 +76,7 @@ class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable 'institutionNumber' => null, 'transitNumber' => null, 'bankCode' => null, + 'clearingCode' => null, 'iban' => null, 'additionalBankIdentification' => null, 'bic' => null, @@ -96,6 +98,7 @@ class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable 'institutionNumber' => false, 'transitNumber' => false, 'bankCode' => false, + 'clearingCode' => false, 'iban' => false, 'additionalBankIdentification' => false, 'bic' => false, @@ -197,6 +200,7 @@ public function isNullableSetToNull(string $property): bool 'institutionNumber' => 'institutionNumber', 'transitNumber' => 'transitNumber', 'bankCode' => 'bankCode', + 'clearingCode' => 'clearingCode', 'iban' => 'iban', 'additionalBankIdentification' => 'additionalBankIdentification', 'bic' => 'bic', @@ -218,6 +222,7 @@ public function isNullableSetToNull(string $property): bool 'institutionNumber' => 'setInstitutionNumber', 'transitNumber' => 'setTransitNumber', 'bankCode' => 'setBankCode', + 'clearingCode' => 'setClearingCode', 'iban' => 'setIban', 'additionalBankIdentification' => 'setAdditionalBankIdentification', 'bic' => 'setBic', @@ -239,6 +244,7 @@ public function isNullableSetToNull(string $property): bool 'institutionNumber' => 'getInstitutionNumber', 'transitNumber' => 'getTransitNumber', 'bankCode' => 'getBankCode', + 'clearingCode' => 'getClearingCode', 'iban' => 'getIban', 'additionalBankIdentification' => 'getAdditionalBankIdentification', 'bic' => 'getBic', @@ -310,6 +316,7 @@ public function __construct(array $data = null) $this->setIfExists('institutionNumber', $data ?? [], null); $this->setIfExists('transitNumber', $data ?? [], null); $this->setIfExists('bankCode', $data ?? [], null); + $this->setIfExists('clearingCode', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); $this->setIfExists('additionalBankIdentification', $data ?? [], null); $this->setIfExists('bic', $data ?? [], null); @@ -365,6 +372,9 @@ public function listInvalidProperties() if ($this->container['bankCode'] === null) { $invalidProperties[] = "'bankCode' can't be null"; } + if ($this->container['clearingCode'] === null) { + $invalidProperties[] = "'clearingCode' can't be null"; + } if ($this->container['iban'] === null) { $invalidProperties[] = "'iban' can't be null"; } @@ -570,7 +580,7 @@ public function getBankCode() /** * Sets bankCode * - * @param string $bankCode The 6-digit bank code including the 3-digit bank code and 3-digit branch code, without separators or whitespace. + * @param string $bankCode The 4-digit bank code (Registreringsnummer) (without separators or whitespace). * * @return self */ @@ -584,6 +594,33 @@ public function setBankCode($bankCode) return $this; } + /** + * Gets clearingCode + * + * @return string + */ + public function getClearingCode() + { + return $this->container['clearingCode']; + } + + /** + * Sets clearingCode + * + * @param string $clearingCode The 3-digit clearing code, without separators or whitespace. + * + * @return self + */ + public function setClearingCode($clearingCode) + { + if (is_null($clearingCode)) { + throw new \InvalidArgumentException('non-nullable clearingCode cannot be null'); + } + $this->container['clearingCode'] = $clearingCode; + + return $this; + } + /** * Gets iban * diff --git a/src/Adyen/Model/LegalEntityManagement/HKLocalAccountIdentification.php b/src/Adyen/Model/LegalEntityManagement/HKLocalAccountIdentification.php index b44fb61db..57e32882a 100644 --- a/src/Adyen/Model/LegalEntityManagement/HKLocalAccountIdentification.php +++ b/src/Adyen/Model/LegalEntityManagement/HKLocalAccountIdentification.php @@ -45,7 +45,7 @@ class HKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'accountNumber' => 'string', - 'bankCode' => 'string', + 'clearingCode' => 'string', 'type' => 'string' ]; @@ -58,7 +58,7 @@ class HKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'accountNumber' => null, - 'bankCode' => null, + 'clearingCode' => null, 'type' => null ]; @@ -69,7 +69,7 @@ class HKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'accountNumber' => false, - 'bankCode' => false, + 'clearingCode' => false, 'type' => false ]; @@ -160,7 +160,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountNumber' => 'accountNumber', - 'bankCode' => 'bankCode', + 'clearingCode' => 'clearingCode', 'type' => 'type' ]; @@ -171,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountNumber' => 'setAccountNumber', - 'bankCode' => 'setBankCode', + 'clearingCode' => 'setClearingCode', 'type' => 'setType' ]; @@ -182,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountNumber' => 'getAccountNumber', - 'bankCode' => 'getBankCode', + 'clearingCode' => 'getClearingCode', 'type' => 'getType' ]; @@ -256,7 +256,7 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('bankCode', $data ?? [], null); + $this->setIfExists('clearingCode', $data ?? [], null); $this->setIfExists('type', $data ?? [], 'hkLocal'); } @@ -290,8 +290,8 @@ public function listInvalidProperties() 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['clearingCode'] === null) { + $invalidProperties[] = "'clearingCode' can't be null"; } if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; @@ -333,7 +333,7 @@ public function getAccountNumber() /** * Sets accountNumber * - * @param string $accountNumber The 6- to 19-character bank account number (alphanumeric), without separators or whitespace. + * @param string $accountNumber The 9- to 12-character bank account number (alphanumeric), without separators or whitespace. Starts with the 3-digit branch code. * * @return self */ @@ -348,28 +348,28 @@ public function setAccountNumber($accountNumber) } /** - * Gets bankCode + * Gets clearingCode * * @return string */ - public function getBankCode() + public function getClearingCode() { - return $this->container['bankCode']; + return $this->container['clearingCode']; } /** - * Sets bankCode + * Sets clearingCode * - * @param string $bankCode The 6-digit bank code including the 3-digit bank code and 3-digit branch code, without separators or whitespace. + * @param string $clearingCode The 3-digit clearing code, without separators or whitespace. * * @return self */ - public function setBankCode($bankCode) + public function setClearingCode($clearingCode) { - if (is_null($bankCode)) { - throw new \InvalidArgumentException('non-nullable bankCode cannot be null'); + if (is_null($clearingCode)) { + throw new \InvalidArgumentException('non-nullable clearingCode cannot be null'); } - $this->container['bankCode'] = $bankCode; + $this->container['clearingCode'] = $clearingCode; return $this; } diff --git a/src/Adyen/Model/Management/AndroidApp.php b/src/Adyen/Model/Management/AndroidApp.php index 52361f9c4..82627e111 100644 --- a/src/Adyen/Model/Management/AndroidApp.php +++ b/src/Adyen/Model/Management/AndroidApp.php @@ -45,6 +45,7 @@ class AndroidApp implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'description' => 'string', + 'errorCode' => 'string', 'id' => 'string', 'label' => 'string', 'packageName' => 'string', @@ -62,6 +63,7 @@ class AndroidApp implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'description' => null, + 'errorCode' => null, 'id' => null, 'label' => null, 'packageName' => null, @@ -77,6 +79,7 @@ class AndroidApp implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'description' => false, + 'errorCode' => false, 'id' => false, 'label' => false, 'packageName' => false, @@ -172,6 +175,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'description' => 'description', + 'errorCode' => 'errorCode', 'id' => 'id', 'label' => 'label', 'packageName' => 'packageName', @@ -187,6 +191,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'description' => 'setDescription', + 'errorCode' => 'setErrorCode', 'id' => 'setId', 'label' => 'setLabel', 'packageName' => 'setPackageName', @@ -202,6 +207,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'description' => 'getDescription', + 'errorCode' => 'getErrorCode', 'id' => 'getId', 'label' => 'getLabel', 'packageName' => 'getPackageName', @@ -268,6 +274,7 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('errorCode', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('label', $data ?? [], null); $this->setIfExists('packageName', $data ?? [], null); @@ -351,6 +358,33 @@ public function setDescription($description) return $this; } + /** + * Gets errorCode + * + * @return string|null + */ + public function getErrorCode() + { + return $this->container['errorCode']; + } + + /** + * Sets errorCode + * + * @param string|null $errorCode The error code of the app. It exists if the status is error or invalid. + * + * @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 id * @@ -445,7 +479,7 @@ public function getStatus() /** * Sets status * - * @param string $status The status of the app. Possible values: * `processing`: The app is being signed and converted to a format that the terminal can handle. * `error`: Something went wrong. Check that the app matches the [requirements](https://docs.adyen.com/point-of-sale/android-terminals/app-requirements). * `invalid`: There is something wrong with the APK file of the app. * `ready`: The app has been signed and converted. * `archived`: The app is no longer available. + * @param string $status The status of the app. Possible values: * `processing`: the app is being signed and converted to a format that the terminal can handle. * `error`: something went wrong. Check that the app matches the [requirements](https://docs.adyen.com/point-of-sale/android-terminals/app-requirements). * `invalid`: there is something wrong with the APK file of the app. * `ready`: the app has been signed and converted. * `archived`: the app is no longer available. * * @return self */ diff --git a/src/Adyen/Model/Management/BcmcInfo.php b/src/Adyen/Model/Management/BcmcInfo.php index 766d1f606..037b65ad6 100644 --- a/src/Adyen/Model/Management/BcmcInfo.php +++ b/src/Adyen/Model/Management/BcmcInfo.php @@ -44,7 +44,8 @@ class BcmcInfo implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'enableBcmcMobile' => 'bool' + 'enableBcmcMobile' => 'bool', + 'transactionDescription' => '\Adyen\Model\Management\TransactionDescriptionInfo' ]; /** @@ -55,7 +56,8 @@ class BcmcInfo implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'enableBcmcMobile' => null + 'enableBcmcMobile' => null, + 'transactionDescription' => null ]; /** @@ -64,7 +66,8 @@ class BcmcInfo implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ - 'enableBcmcMobile' => false + 'enableBcmcMobile' => false, + 'transactionDescription' => false ]; /** @@ -153,7 +156,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'enableBcmcMobile' => 'enableBcmcMobile' + 'enableBcmcMobile' => 'enableBcmcMobile', + 'transactionDescription' => 'transactionDescription' ]; /** @@ -162,7 +166,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'enableBcmcMobile' => 'setEnableBcmcMobile' + 'enableBcmcMobile' => 'setEnableBcmcMobile', + 'transactionDescription' => 'setTransactionDescription' ]; /** @@ -171,7 +176,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'enableBcmcMobile' => 'getEnableBcmcMobile' + 'enableBcmcMobile' => 'getEnableBcmcMobile', + 'transactionDescription' => 'getTransactionDescription' ]; /** @@ -232,6 +238,7 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('enableBcmcMobile', $data ?? [], null); + $this->setIfExists('transactionDescription', $data ?? [], null); } /** @@ -302,6 +309,33 @@ public function setEnableBcmcMobile($enableBcmcMobile) return $this; } + + /** + * Gets transactionDescription + * + * @return \Adyen\Model\Management\TransactionDescriptionInfo|null + */ + public function getTransactionDescription() + { + return $this->container['transactionDescription']; + } + + /** + * Sets transactionDescription + * + * @param \Adyen\Model\Management\TransactionDescriptionInfo|null $transactionDescription transactionDescription + * + * @return self + */ + public function setTransactionDescription($transactionDescription) + { + if (is_null($transactionDescription)) { + throw new \InvalidArgumentException('non-nullable transactionDescription cannot be null'); + } + $this->container['transactionDescription'] = $transactionDescription; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Management/CartesBancairesInfo.php b/src/Adyen/Model/Management/CartesBancairesInfo.php index 7659a78d5..6d2cd7088 100644 --- a/src/Adyen/Model/Management/CartesBancairesInfo.php +++ b/src/Adyen/Model/Management/CartesBancairesInfo.php @@ -44,7 +44,8 @@ class CartesBancairesInfo implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'siret' => 'string' + 'siret' => 'string', + 'transactionDescription' => '\Adyen\Model\Management\TransactionDescriptionInfo' ]; /** @@ -55,7 +56,8 @@ class CartesBancairesInfo implements ModelInterface, ArrayAccess, \JsonSerializa * @psalm-var array */ protected static $openAPIFormats = [ - 'siret' => null + 'siret' => null, + 'transactionDescription' => null ]; /** @@ -64,7 +66,8 @@ class CartesBancairesInfo implements ModelInterface, ArrayAccess, \JsonSerializa * @var boolean[] */ protected static $openAPINullables = [ - 'siret' => false + 'siret' => false, + 'transactionDescription' => false ]; /** @@ -153,7 +156,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'siret' => 'siret' + 'siret' => 'siret', + 'transactionDescription' => 'transactionDescription' ]; /** @@ -162,7 +166,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'siret' => 'setSiret' + 'siret' => 'setSiret', + 'transactionDescription' => 'setTransactionDescription' ]; /** @@ -171,7 +176,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'siret' => 'getSiret' + 'siret' => 'getSiret', + 'transactionDescription' => 'getTransactionDescription' ]; /** @@ -232,6 +238,7 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('siret', $data ?? [], null); + $this->setIfExists('transactionDescription', $data ?? [], null); } /** @@ -305,6 +312,33 @@ public function setSiret($siret) return $this; } + + /** + * Gets transactionDescription + * + * @return \Adyen\Model\Management\TransactionDescriptionInfo|null + */ + public function getTransactionDescription() + { + return $this->container['transactionDescription']; + } + + /** + * Sets transactionDescription + * + * @param \Adyen\Model\Management\TransactionDescriptionInfo|null $transactionDescription transactionDescription + * + * @return self + */ + public function setTransactionDescription($transactionDescription) + { + if (is_null($transactionDescription)) { + throw new \InvalidArgumentException('non-nullable transactionDescription cannot be null'); + } + $this->container['transactionDescription'] = $transactionDescription; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php b/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php index 79cfe809b..271170055 100644 --- a/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php +++ b/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php @@ -709,7 +709,7 @@ public function getFilterMerchantAccountType() /** * Sets filterMerchantAccountType * - * @param string $filterMerchantAccountType Shows how merchant accounts are filtered when configuring the webhook. Possible values: * **includeAccounts**: The webhook is configured for the merchant accounts listed in `filterMerchantAccounts`. * **excludeAccounts**: The webhook is not configured for the merchant accounts listed in `filterMerchantAccounts`. * **allAccounts**: Includes all merchant accounts, and does not require specifying `filterMerchantAccounts`. + * @param string $filterMerchantAccountType Shows how merchant accounts are filtered when configuring the webhook. Possible values: * **allAccounts** : Includes all merchant accounts, and does not require specifying `filterMerchantAccounts`. * **includeAccounts** : The webhook is configured for the merchant accounts listed in `filterMerchantAccounts`. * **excludeAccounts** : The webhook is not configured for the merchant accounts listed in `filterMerchantAccounts`. * * @return self */ @@ -901,7 +901,7 @@ public function getType() /** * Sets type * - * @param string $type The type of webhook that is being created. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **rreq-notification** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). + * @param string $type The type of webhook that is being created. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **ach-notification-of-change-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **rreq-notification** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). * * @return self */ diff --git a/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php b/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php index b96274e96..f90694a8a 100644 --- a/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php +++ b/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php @@ -792,7 +792,7 @@ public function getType() /** * Sets type * - * @param string $type The type of webhook that is being created. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **rreq-notification** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). + * @param string $type The type of webhook that is being created. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **ach-notification-of-change-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **rreq-notification** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). * * @return self */ diff --git a/src/Adyen/Model/Management/CustomNotification.php b/src/Adyen/Model/Management/CustomNotification.php index b0d979477..faff7c1bc 100644 --- a/src/Adyen/Model/Management/CustomNotification.php +++ b/src/Adyen/Model/Management/CustomNotification.php @@ -358,7 +358,7 @@ public function getEventCode() /** * Sets eventCode * - * @param string|null $eventCode The event that caused the notification to be sent.Currently supported values: * **AUTHORISATION** * **CANCELLATION** * **REFUND** * **CAPTURE** * **DEACTIVATE_RECURRING** * **REPORT_AVAILABLE** * **CHARGEBACK** * **REQUEST_FOR_INFORMATION** * **NOTIFICATION_OF_CHARGEBACK** * **NOTIFICATIONTEST** * **ORDER_OPENED** * **ORDER_CLOSED** * **CHARGEBACK_REVERSED** * **REFUNDED_REVERSED** * **REFUND_WITH_DATA** + * @param string|null $eventCode The event that caused the notification to be sent.Currently supported values: * **AUTHORISATION** * **CANCELLATION** * **REFUND** * **CAPTURE** * **REPORT_AVAILABLE** * **CHARGEBACK** * **REQUEST_FOR_INFORMATION** * **NOTIFICATION_OF_CHARGEBACK** * **NOTIFICATIONTEST** * **ORDER_OPENED** * **ORDER_CLOSED** * **CHARGEBACK_REVERSED** * **REFUNDED_REVERSED** * **REFUND_WITH_DATA** * * @return self */ diff --git a/src/Adyen/Model/Management/GenericPmWithTdiInfo.php b/src/Adyen/Model/Management/GenericPmWithTdiInfo.php new file mode 100644 index 000000000..5d65225e3 --- /dev/null +++ b/src/Adyen/Model/Management/GenericPmWithTdiInfo.php @@ -0,0 +1,384 @@ + + */ +class GenericPmWithTdiInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenericPmWithTdiInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'transactionDescription' => '\Adyen\Model\Management\TransactionDescriptionInfo' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'transactionDescription' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'transactionDescription' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'transactionDescription' => 'transactionDescription' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'transactionDescription' => 'setTransactionDescription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'transactionDescription' => 'getTransactionDescription' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * 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('transactionDescription', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 transactionDescription + * + * @return \Adyen\Model\Management\TransactionDescriptionInfo|null + */ + public function getTransactionDescription() + { + return $this->container['transactionDescription']; + } + + /** + * Sets transactionDescription + * + * @param \Adyen\Model\Management\TransactionDescriptionInfo|null $transactionDescription transactionDescription + * + * @return self + */ + public function setTransactionDescription($transactionDescription) + { + if (is_null($transactionDescription)) { + throw new \InvalidArgumentException('non-nullable transactionDescription cannot be null'); + } + $this->container['transactionDescription'] = $transactionDescription; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @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/MealVoucherFRInfo.php b/src/Adyen/Model/Management/MealVoucherFRInfo.php index 287a9c7e5..661ae5970 100644 --- a/src/Adyen/Model/Management/MealVoucherFRInfo.php +++ b/src/Adyen/Model/Management/MealVoucherFRInfo.php @@ -366,7 +366,7 @@ public function getSubTypes() /** * Sets subTypes * - * @param string[] $subTypes The list of additional payment methods. Allowed values: **mealVoucher_FR_endenred**, **mealVoucher_FR_groupeup**, **mealVoucher_FR_natixis**, **mealVoucher_FR_sodexo**. + * @param string[] $subTypes The list of additional payment methods. Allowed values: **mealVoucher_FR_edenred**, **mealVoucher_FR_groupeup**, **mealVoucher_FR_natixis**, **mealVoucher_FR_sodexo**. * * @return self */ diff --git a/src/Adyen/Model/Management/PaymentMethod.php b/src/Adyen/Model/Management/PaymentMethod.php index ec629a823..dbe650655 100644 --- a/src/Adyen/Model/Management/PaymentMethod.php +++ b/src/Adyen/Model/Management/PaymentMethod.php @@ -52,13 +52,23 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'cartesBancaires' => '\Adyen\Model\Management\CartesBancairesInfo', 'clearpay' => '\Adyen\Model\Management\ClearpayInfo', 'countries' => 'string[]', + 'cup' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'currencies' => 'string[]', 'customRoutingFlags' => 'string[]', + 'diners' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'discover' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'eftposAustralia' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'enabled' => 'bool', 'giroPay' => '\Adyen\Model\Management\GiroPayInfo', + 'girocard' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'googlePay' => '\Adyen\Model\Management\GooglePayInfo', 'id' => 'string', + 'ideal' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'interacCard' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'jcb' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'klarna' => '\Adyen\Model\Management\KlarnaInfo', + 'maestro' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'mc' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'mealVoucherFR' => '\Adyen\Model\Management\MealVoucherFRInfo', 'paypal' => '\Adyen\Model\Management\PayPalInfo', 'reference' => 'string', @@ -69,7 +79,8 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'twint' => '\Adyen\Model\Management\TwintInfo', 'type' => 'string', 'verificationStatus' => 'string', - 'vipps' => '\Adyen\Model\Management\VippsInfo' + 'vipps' => '\Adyen\Model\Management\VippsInfo', + 'visa' => '\Adyen\Model\Management\GenericPmWithTdiInfo' ]; /** @@ -88,13 +99,23 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'cartesBancaires' => null, 'clearpay' => null, 'countries' => null, + 'cup' => null, 'currencies' => null, 'customRoutingFlags' => null, + 'diners' => null, + 'discover' => null, + 'eftposAustralia' => null, 'enabled' => null, 'giroPay' => null, + 'girocard' => null, 'googlePay' => null, 'id' => null, + 'ideal' => null, + 'interacCard' => null, + 'jcb' => null, 'klarna' => null, + 'maestro' => null, + 'mc' => null, 'mealVoucherFR' => null, 'paypal' => null, 'reference' => null, @@ -105,7 +126,8 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'twint' => null, 'type' => null, 'verificationStatus' => null, - 'vipps' => null + 'vipps' => null, + 'visa' => null ]; /** @@ -122,13 +144,23 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'cartesBancaires' => false, 'clearpay' => false, 'countries' => false, + 'cup' => false, 'currencies' => false, 'customRoutingFlags' => false, + 'diners' => false, + 'discover' => false, + 'eftposAustralia' => false, 'enabled' => false, 'giroPay' => false, + 'girocard' => false, 'googlePay' => false, 'id' => false, + 'ideal' => false, + 'interacCard' => false, + 'jcb' => false, 'klarna' => false, + 'maestro' => false, + 'mc' => false, 'mealVoucherFR' => false, 'paypal' => false, 'reference' => false, @@ -139,7 +171,8 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'twint' => false, 'type' => false, 'verificationStatus' => false, - 'vipps' => false + 'vipps' => false, + 'visa' => false ]; /** @@ -236,13 +269,23 @@ public function isNullableSetToNull(string $property): bool 'cartesBancaires' => 'cartesBancaires', 'clearpay' => 'clearpay', 'countries' => 'countries', + 'cup' => 'cup', 'currencies' => 'currencies', 'customRoutingFlags' => 'customRoutingFlags', + 'diners' => 'diners', + 'discover' => 'discover', + 'eftposAustralia' => 'eftpos_australia', 'enabled' => 'enabled', 'giroPay' => 'giroPay', + 'girocard' => 'girocard', 'googlePay' => 'googlePay', 'id' => 'id', + 'ideal' => 'ideal', + 'interacCard' => 'interac_card', + 'jcb' => 'jcb', 'klarna' => 'klarna', + 'maestro' => 'maestro', + 'mc' => 'mc', 'mealVoucherFR' => 'mealVoucher_FR', 'paypal' => 'paypal', 'reference' => 'reference', @@ -253,7 +296,8 @@ public function isNullableSetToNull(string $property): bool 'twint' => 'twint', 'type' => 'type', 'verificationStatus' => 'verificationStatus', - 'vipps' => 'vipps' + 'vipps' => 'vipps', + 'visa' => 'visa' ]; /** @@ -270,13 +314,23 @@ public function isNullableSetToNull(string $property): bool 'cartesBancaires' => 'setCartesBancaires', 'clearpay' => 'setClearpay', 'countries' => 'setCountries', + 'cup' => 'setCup', 'currencies' => 'setCurrencies', 'customRoutingFlags' => 'setCustomRoutingFlags', + 'diners' => 'setDiners', + 'discover' => 'setDiscover', + 'eftposAustralia' => 'setEftposAustralia', 'enabled' => 'setEnabled', 'giroPay' => 'setGiroPay', + 'girocard' => 'setGirocard', 'googlePay' => 'setGooglePay', 'id' => 'setId', + 'ideal' => 'setIdeal', + 'interacCard' => 'setInteracCard', + 'jcb' => 'setJcb', 'klarna' => 'setKlarna', + 'maestro' => 'setMaestro', + 'mc' => 'setMc', 'mealVoucherFR' => 'setMealVoucherFR', 'paypal' => 'setPaypal', 'reference' => 'setReference', @@ -287,7 +341,8 @@ public function isNullableSetToNull(string $property): bool 'twint' => 'setTwint', 'type' => 'setType', 'verificationStatus' => 'setVerificationStatus', - 'vipps' => 'setVipps' + 'vipps' => 'setVipps', + 'visa' => 'setVisa' ]; /** @@ -304,13 +359,23 @@ public function isNullableSetToNull(string $property): bool 'cartesBancaires' => 'getCartesBancaires', 'clearpay' => 'getClearpay', 'countries' => 'getCountries', + 'cup' => 'getCup', 'currencies' => 'getCurrencies', 'customRoutingFlags' => 'getCustomRoutingFlags', + 'diners' => 'getDiners', + 'discover' => 'getDiscover', + 'eftposAustralia' => 'getEftposAustralia', 'enabled' => 'getEnabled', 'giroPay' => 'getGiroPay', + 'girocard' => 'getGirocard', 'googlePay' => 'getGooglePay', 'id' => 'getId', + 'ideal' => 'getIdeal', + 'interacCard' => 'getInteracCard', + 'jcb' => 'getJcb', 'klarna' => 'getKlarna', + 'maestro' => 'getMaestro', + 'mc' => 'getMc', 'mealVoucherFR' => 'getMealVoucherFR', 'paypal' => 'getPaypal', 'reference' => 'getReference', @@ -321,7 +386,8 @@ public function isNullableSetToNull(string $property): bool 'twint' => 'getTwint', 'type' => 'getType', 'verificationStatus' => 'getVerificationStatus', - 'vipps' => 'getVipps' + 'vipps' => 'getVipps', + 'visa' => 'getVisa' ]; /** @@ -407,13 +473,23 @@ public function __construct(array $data = null) $this->setIfExists('cartesBancaires', $data ?? [], null); $this->setIfExists('clearpay', $data ?? [], null); $this->setIfExists('countries', $data ?? [], null); + $this->setIfExists('cup', $data ?? [], null); $this->setIfExists('currencies', $data ?? [], null); $this->setIfExists('customRoutingFlags', $data ?? [], null); + $this->setIfExists('diners', $data ?? [], null); + $this->setIfExists('discover', $data ?? [], null); + $this->setIfExists('eftposAustralia', $data ?? [], null); $this->setIfExists('enabled', $data ?? [], null); $this->setIfExists('giroPay', $data ?? [], null); + $this->setIfExists('girocard', $data ?? [], null); $this->setIfExists('googlePay', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('ideal', $data ?? [], null); + $this->setIfExists('interacCard', $data ?? [], null); + $this->setIfExists('jcb', $data ?? [], null); $this->setIfExists('klarna', $data ?? [], null); + $this->setIfExists('maestro', $data ?? [], null); + $this->setIfExists('mc', $data ?? [], null); $this->setIfExists('mealVoucherFR', $data ?? [], null); $this->setIfExists('paypal', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); @@ -425,6 +501,7 @@ public function __construct(array $data = null) $this->setIfExists('type', $data ?? [], null); $this->setIfExists('verificationStatus', $data ?? [], null); $this->setIfExists('vipps', $data ?? [], null); + $this->setIfExists('visa', $data ?? [], null); } /** @@ -697,6 +774,33 @@ public function setCountries($countries) return $this; } + /** + * Gets cup + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getCup() + { + return $this->container['cup']; + } + + /** + * Sets cup + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $cup cup + * + * @return self + */ + public function setCup($cup) + { + if (is_null($cup)) { + throw new \InvalidArgumentException('non-nullable cup cannot be null'); + } + $this->container['cup'] = $cup; + + return $this; + } + /** * Gets currencies * @@ -751,6 +855,87 @@ public function setCustomRoutingFlags($customRoutingFlags) return $this; } + /** + * Gets diners + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getDiners() + { + return $this->container['diners']; + } + + /** + * Sets diners + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $diners diners + * + * @return self + */ + public function setDiners($diners) + { + if (is_null($diners)) { + throw new \InvalidArgumentException('non-nullable diners cannot be null'); + } + $this->container['diners'] = $diners; + + return $this; + } + + /** + * Gets discover + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getDiscover() + { + return $this->container['discover']; + } + + /** + * Sets discover + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $discover discover + * + * @return self + */ + public function setDiscover($discover) + { + if (is_null($discover)) { + throw new \InvalidArgumentException('non-nullable discover cannot be null'); + } + $this->container['discover'] = $discover; + + return $this; + } + + /** + * Gets eftposAustralia + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getEftposAustralia() + { + return $this->container['eftposAustralia']; + } + + /** + * Sets eftposAustralia + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $eftposAustralia eftposAustralia + * + * @return self + */ + public function setEftposAustralia($eftposAustralia) + { + if (is_null($eftposAustralia)) { + throw new \InvalidArgumentException('non-nullable eftposAustralia cannot be null'); + } + $this->container['eftposAustralia'] = $eftposAustralia; + + return $this; + } + /** * Gets enabled * @@ -805,6 +990,33 @@ public function setGiroPay($giroPay) return $this; } + /** + * Gets girocard + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getGirocard() + { + return $this->container['girocard']; + } + + /** + * Sets girocard + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $girocard girocard + * + * @return self + */ + public function setGirocard($girocard) + { + if (is_null($girocard)) { + throw new \InvalidArgumentException('non-nullable girocard cannot be null'); + } + $this->container['girocard'] = $girocard; + + return $this; + } + /** * Gets googlePay * @@ -859,6 +1071,87 @@ public function setId($id) return $this; } + /** + * Gets ideal + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getIdeal() + { + return $this->container['ideal']; + } + + /** + * Sets ideal + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $ideal ideal + * + * @return self + */ + public function setIdeal($ideal) + { + if (is_null($ideal)) { + throw new \InvalidArgumentException('non-nullable ideal cannot be null'); + } + $this->container['ideal'] = $ideal; + + return $this; + } + + /** + * Gets interacCard + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getInteracCard() + { + return $this->container['interacCard']; + } + + /** + * Sets interacCard + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $interacCard interacCard + * + * @return self + */ + public function setInteracCard($interacCard) + { + if (is_null($interacCard)) { + throw new \InvalidArgumentException('non-nullable interacCard cannot be null'); + } + $this->container['interacCard'] = $interacCard; + + return $this; + } + + /** + * Gets jcb + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getJcb() + { + return $this->container['jcb']; + } + + /** + * Sets jcb + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $jcb jcb + * + * @return self + */ + public function setJcb($jcb) + { + if (is_null($jcb)) { + throw new \InvalidArgumentException('non-nullable jcb cannot be null'); + } + $this->container['jcb'] = $jcb; + + return $this; + } + /** * Gets klarna * @@ -886,6 +1179,60 @@ public function setKlarna($klarna) return $this; } + /** + * Gets maestro + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getMaestro() + { + return $this->container['maestro']; + } + + /** + * Sets maestro + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $maestro maestro + * + * @return self + */ + public function setMaestro($maestro) + { + if (is_null($maestro)) { + throw new \InvalidArgumentException('non-nullable maestro cannot be null'); + } + $this->container['maestro'] = $maestro; + + return $this; + } + + /** + * Gets mc + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getMc() + { + return $this->container['mc']; + } + + /** + * Sets mc + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $mc mc + * + * @return self + */ + public function setMc($mc) + { + if (is_null($mc)) { + throw new \InvalidArgumentException('non-nullable mc cannot be null'); + } + $this->container['mc'] = $mc; + + return $this; + } + /** * Gets mealVoucherFR * @@ -1192,6 +1539,33 @@ public function setVipps($vipps) return $this; } + + /** + * Gets visa + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getVisa() + { + return $this->container['visa']; + } + + /** + * Sets visa + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $visa visa + * + * @return self + */ + public function setVisa($visa) + { + if (is_null($visa)) { + throw new \InvalidArgumentException('non-nullable visa cannot be null'); + } + $this->container['visa'] = $visa; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Management/PaymentMethodSetupInfo.php b/src/Adyen/Model/Management/PaymentMethodSetupInfo.php index 8a4dd4bf3..971c9a767 100644 --- a/src/Adyen/Model/Management/PaymentMethodSetupInfo.php +++ b/src/Adyen/Model/Management/PaymentMethodSetupInfo.php @@ -51,11 +51,21 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'cartesBancaires' => '\Adyen\Model\Management\CartesBancairesInfo', 'clearpay' => '\Adyen\Model\Management\ClearpayInfo', 'countries' => 'string[]', + 'cup' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'currencies' => 'string[]', 'customRoutingFlags' => 'string[]', + 'diners' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'discover' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'eftposAustralia' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'giroPay' => '\Adyen\Model\Management\GiroPayInfo', + 'girocard' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'googlePay' => '\Adyen\Model\Management\GooglePayInfo', + 'ideal' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'interacCard' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'jcb' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'klarna' => '\Adyen\Model\Management\KlarnaInfo', + 'maestro' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'mc' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'mealVoucherFR' => '\Adyen\Model\Management\MealVoucherFRInfo', 'paypal' => '\Adyen\Model\Management\PayPalInfo', 'reference' => 'string', @@ -65,7 +75,8 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'swish' => '\Adyen\Model\Management\SwishInfo', 'twint' => '\Adyen\Model\Management\TwintInfo', 'type' => 'string', - 'vipps' => '\Adyen\Model\Management\VippsInfo' + 'vipps' => '\Adyen\Model\Management\VippsInfo', + 'visa' => '\Adyen\Model\Management\GenericPmWithTdiInfo' ]; /** @@ -83,11 +94,21 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'cartesBancaires' => null, 'clearpay' => null, 'countries' => null, + 'cup' => null, 'currencies' => null, 'customRoutingFlags' => null, + 'diners' => null, + 'discover' => null, + 'eftposAustralia' => null, 'giroPay' => null, + 'girocard' => null, 'googlePay' => null, + 'ideal' => null, + 'interacCard' => null, + 'jcb' => null, 'klarna' => null, + 'maestro' => null, + 'mc' => null, 'mealVoucherFR' => null, 'paypal' => null, 'reference' => null, @@ -97,7 +118,8 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'swish' => null, 'twint' => null, 'type' => null, - 'vipps' => null + 'vipps' => null, + 'visa' => null ]; /** @@ -113,11 +135,21 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'cartesBancaires' => false, 'clearpay' => false, 'countries' => false, + 'cup' => false, 'currencies' => false, 'customRoutingFlags' => false, + 'diners' => false, + 'discover' => false, + 'eftposAustralia' => false, 'giroPay' => false, + 'girocard' => false, 'googlePay' => false, + 'ideal' => false, + 'interacCard' => false, + 'jcb' => false, 'klarna' => false, + 'maestro' => false, + 'mc' => false, 'mealVoucherFR' => false, 'paypal' => false, 'reference' => false, @@ -127,7 +159,8 @@ class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerial 'swish' => false, 'twint' => false, 'type' => false, - 'vipps' => false + 'vipps' => false, + 'visa' => false ]; /** @@ -223,11 +256,21 @@ public function isNullableSetToNull(string $property): bool 'cartesBancaires' => 'cartesBancaires', 'clearpay' => 'clearpay', 'countries' => 'countries', + 'cup' => 'cup', 'currencies' => 'currencies', 'customRoutingFlags' => 'customRoutingFlags', + 'diners' => 'diners', + 'discover' => 'discover', + 'eftposAustralia' => 'eftpos_australia', 'giroPay' => 'giroPay', + 'girocard' => 'girocard', 'googlePay' => 'googlePay', + 'ideal' => 'ideal', + 'interacCard' => 'interac_card', + 'jcb' => 'jcb', 'klarna' => 'klarna', + 'maestro' => 'maestro', + 'mc' => 'mc', 'mealVoucherFR' => 'mealVoucher_FR', 'paypal' => 'paypal', 'reference' => 'reference', @@ -237,7 +280,8 @@ public function isNullableSetToNull(string $property): bool 'swish' => 'swish', 'twint' => 'twint', 'type' => 'type', - 'vipps' => 'vipps' + 'vipps' => 'vipps', + 'visa' => 'visa' ]; /** @@ -253,11 +297,21 @@ public function isNullableSetToNull(string $property): bool 'cartesBancaires' => 'setCartesBancaires', 'clearpay' => 'setClearpay', 'countries' => 'setCountries', + 'cup' => 'setCup', 'currencies' => 'setCurrencies', 'customRoutingFlags' => 'setCustomRoutingFlags', + 'diners' => 'setDiners', + 'discover' => 'setDiscover', + 'eftposAustralia' => 'setEftposAustralia', 'giroPay' => 'setGiroPay', + 'girocard' => 'setGirocard', 'googlePay' => 'setGooglePay', + 'ideal' => 'setIdeal', + 'interacCard' => 'setInteracCard', + 'jcb' => 'setJcb', 'klarna' => 'setKlarna', + 'maestro' => 'setMaestro', + 'mc' => 'setMc', 'mealVoucherFR' => 'setMealVoucherFR', 'paypal' => 'setPaypal', 'reference' => 'setReference', @@ -267,7 +321,8 @@ public function isNullableSetToNull(string $property): bool 'swish' => 'setSwish', 'twint' => 'setTwint', 'type' => 'setType', - 'vipps' => 'setVipps' + 'vipps' => 'setVipps', + 'visa' => 'setVisa' ]; /** @@ -283,11 +338,21 @@ public function isNullableSetToNull(string $property): bool 'cartesBancaires' => 'getCartesBancaires', 'clearpay' => 'getClearpay', 'countries' => 'getCountries', + 'cup' => 'getCup', 'currencies' => 'getCurrencies', 'customRoutingFlags' => 'getCustomRoutingFlags', + 'diners' => 'getDiners', + 'discover' => 'getDiscover', + 'eftposAustralia' => 'getEftposAustralia', 'giroPay' => 'getGiroPay', + 'girocard' => 'getGirocard', 'googlePay' => 'getGooglePay', + 'ideal' => 'getIdeal', + 'interacCard' => 'getInteracCard', + 'jcb' => 'getJcb', 'klarna' => 'getKlarna', + 'maestro' => 'getMaestro', + 'mc' => 'getMc', 'mealVoucherFR' => 'getMealVoucherFR', 'paypal' => 'getPaypal', 'reference' => 'getReference', @@ -297,7 +362,8 @@ public function isNullableSetToNull(string $property): bool 'swish' => 'getSwish', 'twint' => 'getTwint', 'type' => 'getType', - 'vipps' => 'getVipps' + 'vipps' => 'getVipps', + 'visa' => 'getVisa' ]; /** @@ -492,11 +558,21 @@ public function __construct(array $data = null) $this->setIfExists('cartesBancaires', $data ?? [], null); $this->setIfExists('clearpay', $data ?? [], null); $this->setIfExists('countries', $data ?? [], null); + $this->setIfExists('cup', $data ?? [], null); $this->setIfExists('currencies', $data ?? [], null); $this->setIfExists('customRoutingFlags', $data ?? [], null); + $this->setIfExists('diners', $data ?? [], null); + $this->setIfExists('discover', $data ?? [], null); + $this->setIfExists('eftposAustralia', $data ?? [], null); $this->setIfExists('giroPay', $data ?? [], null); + $this->setIfExists('girocard', $data ?? [], null); $this->setIfExists('googlePay', $data ?? [], null); + $this->setIfExists('ideal', $data ?? [], null); + $this->setIfExists('interacCard', $data ?? [], null); + $this->setIfExists('jcb', $data ?? [], null); $this->setIfExists('klarna', $data ?? [], null); + $this->setIfExists('maestro', $data ?? [], null); + $this->setIfExists('mc', $data ?? [], null); $this->setIfExists('mealVoucherFR', $data ?? [], null); $this->setIfExists('paypal', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); @@ -507,6 +583,7 @@ public function __construct(array $data = null) $this->setIfExists('twint', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('vipps', $data ?? [], null); + $this->setIfExists('visa', $data ?? [], null); } /** @@ -758,6 +835,33 @@ public function setCountries($countries) return $this; } + /** + * Gets cup + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getCup() + { + return $this->container['cup']; + } + + /** + * Sets cup + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $cup cup + * + * @return self + */ + public function setCup($cup) + { + if (is_null($cup)) { + throw new \InvalidArgumentException('non-nullable cup cannot be null'); + } + $this->container['cup'] = $cup; + + return $this; + } + /** * Gets currencies * @@ -812,6 +916,87 @@ public function setCustomRoutingFlags($customRoutingFlags) return $this; } + /** + * Gets diners + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getDiners() + { + return $this->container['diners']; + } + + /** + * Sets diners + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $diners diners + * + * @return self + */ + public function setDiners($diners) + { + if (is_null($diners)) { + throw new \InvalidArgumentException('non-nullable diners cannot be null'); + } + $this->container['diners'] = $diners; + + return $this; + } + + /** + * Gets discover + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getDiscover() + { + return $this->container['discover']; + } + + /** + * Sets discover + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $discover discover + * + * @return self + */ + public function setDiscover($discover) + { + if (is_null($discover)) { + throw new \InvalidArgumentException('non-nullable discover cannot be null'); + } + $this->container['discover'] = $discover; + + return $this; + } + + /** + * Gets eftposAustralia + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getEftposAustralia() + { + return $this->container['eftposAustralia']; + } + + /** + * Sets eftposAustralia + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $eftposAustralia eftposAustralia + * + * @return self + */ + public function setEftposAustralia($eftposAustralia) + { + if (is_null($eftposAustralia)) { + throw new \InvalidArgumentException('non-nullable eftposAustralia cannot be null'); + } + $this->container['eftposAustralia'] = $eftposAustralia; + + return $this; + } + /** * Gets giroPay * @@ -839,6 +1024,33 @@ public function setGiroPay($giroPay) return $this; } + /** + * Gets girocard + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getGirocard() + { + return $this->container['girocard']; + } + + /** + * Sets girocard + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $girocard girocard + * + * @return self + */ + public function setGirocard($girocard) + { + if (is_null($girocard)) { + throw new \InvalidArgumentException('non-nullable girocard cannot be null'); + } + $this->container['girocard'] = $girocard; + + return $this; + } + /** * Gets googlePay * @@ -866,6 +1078,87 @@ public function setGooglePay($googlePay) return $this; } + /** + * Gets ideal + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getIdeal() + { + return $this->container['ideal']; + } + + /** + * Sets ideal + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $ideal ideal + * + * @return self + */ + public function setIdeal($ideal) + { + if (is_null($ideal)) { + throw new \InvalidArgumentException('non-nullable ideal cannot be null'); + } + $this->container['ideal'] = $ideal; + + return $this; + } + + /** + * Gets interacCard + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getInteracCard() + { + return $this->container['interacCard']; + } + + /** + * Sets interacCard + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $interacCard interacCard + * + * @return self + */ + public function setInteracCard($interacCard) + { + if (is_null($interacCard)) { + throw new \InvalidArgumentException('non-nullable interacCard cannot be null'); + } + $this->container['interacCard'] = $interacCard; + + return $this; + } + + /** + * Gets jcb + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getJcb() + { + return $this->container['jcb']; + } + + /** + * Sets jcb + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $jcb jcb + * + * @return self + */ + public function setJcb($jcb) + { + if (is_null($jcb)) { + throw new \InvalidArgumentException('non-nullable jcb cannot be null'); + } + $this->container['jcb'] = $jcb; + + return $this; + } + /** * Gets klarna * @@ -893,6 +1186,60 @@ public function setKlarna($klarna) return $this; } + /** + * Gets maestro + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getMaestro() + { + return $this->container['maestro']; + } + + /** + * Sets maestro + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $maestro maestro + * + * @return self + */ + public function setMaestro($maestro) + { + if (is_null($maestro)) { + throw new \InvalidArgumentException('non-nullable maestro cannot be null'); + } + $this->container['maestro'] = $maestro; + + return $this; + } + + /** + * Gets mc + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getMc() + { + return $this->container['mc']; + } + + /** + * Sets mc + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $mc mc + * + * @return self + */ + public function setMc($mc) + { + if (is_null($mc)) { + throw new \InvalidArgumentException('non-nullable mc cannot be null'); + } + $this->container['mc'] = $mc; + + return $this; + } + /** * Gets mealVoucherFR * @@ -1182,6 +1529,33 @@ public function setVipps($vipps) return $this; } + + /** + * Gets visa + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getVisa() + { + return $this->container['visa']; + } + + /** + * Sets visa + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $visa visa + * + * @return self + */ + public function setVisa($visa) + { + if (is_null($visa)) { + throw new \InvalidArgumentException('non-nullable visa cannot be null'); + } + $this->container['visa'] = $visa; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Management/TransactionDescriptionInfo.php b/src/Adyen/Model/Management/TransactionDescriptionInfo.php new file mode 100644 index 000000000..fd8e90e4f --- /dev/null +++ b/src/Adyen/Model/Management/TransactionDescriptionInfo.php @@ -0,0 +1,453 @@ + + */ +class TransactionDescriptionInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransactionDescriptionInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'doingBusinessAsName' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'doingBusinessAsName' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'doingBusinessAsName' => 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 = [ + 'doingBusinessAsName' => 'doingBusinessAsName', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'doingBusinessAsName' => 'setDoingBusinessAsName', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'doingBusinessAsName' => 'getDoingBusinessAsName', + '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_APPEND = 'append'; + public const TYPE_DYNAMIC = 'dynamic'; + public const TYPE_FIXED = 'fixed'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_APPEND, + self::TYPE_DYNAMIC, + self::TYPE_FIXED, + ]; + } + /** + * 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('doingBusinessAsName', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'dynamic'); + } + + /** + * 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 doingBusinessAsName + * + * @return string|null + */ + public function getDoingBusinessAsName() + { + return $this->container['doingBusinessAsName']; + } + + /** + * Sets doingBusinessAsName + * + * @param string|null $doingBusinessAsName The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + * + * @return self + */ + public function setDoingBusinessAsName($doingBusinessAsName) + { + if (is_null($doingBusinessAsName)) { + throw new \InvalidArgumentException('non-nullable doingBusinessAsName cannot be null'); + } + $this->container['doingBusinessAsName'] = $doingBusinessAsName; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of transaction description you want to use: - **fixed**: The transaction description set in this request is used for all payments with this payment method. - **append**: The transaction description set in this request is used as a base for all payments with this payment method. The [transaction description set in the request to process the payment](https://docs.adyen.com/api-explorer/Checkout/70/post/sessions#request-shopperStatement) is appended to this base description. Note that if the combined length exceeds 22 characters, banks may truncate the string. - **dynamic**: Only the [transaction description set in the request to process the payment](https://docs.adyen.com/api-explorer/Checkout/70/post/sessions#request-shopperStatement) is used for payments with this payment method. + * + * @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/UpdatePaymentMethodInfo.php b/src/Adyen/Model/Management/UpdatePaymentMethodInfo.php index a5d23c0e7..e6ca38ff4 100644 --- a/src/Adyen/Model/Management/UpdatePaymentMethodInfo.php +++ b/src/Adyen/Model/Management/UpdatePaymentMethodInfo.php @@ -47,9 +47,20 @@ class UpdatePaymentMethodInfo implements ModelInterface, ArrayAccess, \JsonSeria 'bcmc' => '\Adyen\Model\Management\BcmcInfo', 'cartesBancaires' => '\Adyen\Model\Management\CartesBancairesInfo', 'countries' => 'string[]', + 'cup' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'currencies' => 'string[]', + 'diners' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'discover' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'eftposAustralia' => '\Adyen\Model\Management\GenericPmWithTdiInfo', 'enabled' => 'bool', - 'storeIds' => 'string[]' + 'girocard' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'ideal' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'interacCard' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'jcb' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'maestro' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'mc' => '\Adyen\Model\Management\GenericPmWithTdiInfo', + 'storeIds' => 'string[]', + 'visa' => '\Adyen\Model\Management\GenericPmWithTdiInfo' ]; /** @@ -63,9 +74,20 @@ class UpdatePaymentMethodInfo implements ModelInterface, ArrayAccess, \JsonSeria 'bcmc' => null, 'cartesBancaires' => null, 'countries' => null, + 'cup' => null, 'currencies' => null, + 'diners' => null, + 'discover' => null, + 'eftposAustralia' => null, 'enabled' => null, - 'storeIds' => null + 'girocard' => null, + 'ideal' => null, + 'interacCard' => null, + 'jcb' => null, + 'maestro' => null, + 'mc' => null, + 'storeIds' => null, + 'visa' => null ]; /** @@ -77,9 +99,20 @@ class UpdatePaymentMethodInfo implements ModelInterface, ArrayAccess, \JsonSeria 'bcmc' => false, 'cartesBancaires' => false, 'countries' => false, + 'cup' => false, 'currencies' => false, + 'diners' => false, + 'discover' => false, + 'eftposAustralia' => false, 'enabled' => false, - 'storeIds' => false + 'girocard' => false, + 'ideal' => false, + 'interacCard' => false, + 'jcb' => false, + 'maestro' => false, + 'mc' => false, + 'storeIds' => false, + 'visa' => false ]; /** @@ -171,9 +204,20 @@ public function isNullableSetToNull(string $property): bool 'bcmc' => 'bcmc', 'cartesBancaires' => 'cartesBancaires', 'countries' => 'countries', + 'cup' => 'cup', 'currencies' => 'currencies', + 'diners' => 'diners', + 'discover' => 'discover', + 'eftposAustralia' => 'eftpos_australia', 'enabled' => 'enabled', - 'storeIds' => 'storeIds' + 'girocard' => 'girocard', + 'ideal' => 'ideal', + 'interacCard' => 'interac_card', + 'jcb' => 'jcb', + 'maestro' => 'maestro', + 'mc' => 'mc', + 'storeIds' => 'storeIds', + 'visa' => 'visa' ]; /** @@ -185,9 +229,20 @@ public function isNullableSetToNull(string $property): bool 'bcmc' => 'setBcmc', 'cartesBancaires' => 'setCartesBancaires', 'countries' => 'setCountries', + 'cup' => 'setCup', 'currencies' => 'setCurrencies', + 'diners' => 'setDiners', + 'discover' => 'setDiscover', + 'eftposAustralia' => 'setEftposAustralia', 'enabled' => 'setEnabled', - 'storeIds' => 'setStoreIds' + 'girocard' => 'setGirocard', + 'ideal' => 'setIdeal', + 'interacCard' => 'setInteracCard', + 'jcb' => 'setJcb', + 'maestro' => 'setMaestro', + 'mc' => 'setMc', + 'storeIds' => 'setStoreIds', + 'visa' => 'setVisa' ]; /** @@ -199,9 +254,20 @@ public function isNullableSetToNull(string $property): bool 'bcmc' => 'getBcmc', 'cartesBancaires' => 'getCartesBancaires', 'countries' => 'getCountries', + 'cup' => 'getCup', 'currencies' => 'getCurrencies', + 'diners' => 'getDiners', + 'discover' => 'getDiscover', + 'eftposAustralia' => 'getEftposAustralia', 'enabled' => 'getEnabled', - 'storeIds' => 'getStoreIds' + 'girocard' => 'getGirocard', + 'ideal' => 'getIdeal', + 'interacCard' => 'getInteracCard', + 'jcb' => 'getJcb', + 'maestro' => 'getMaestro', + 'mc' => 'getMc', + 'storeIds' => 'getStoreIds', + 'visa' => 'getVisa' ]; /** @@ -264,9 +330,20 @@ public function __construct(array $data = null) $this->setIfExists('bcmc', $data ?? [], null); $this->setIfExists('cartesBancaires', $data ?? [], null); $this->setIfExists('countries', $data ?? [], null); + $this->setIfExists('cup', $data ?? [], null); $this->setIfExists('currencies', $data ?? [], null); + $this->setIfExists('diners', $data ?? [], null); + $this->setIfExists('discover', $data ?? [], null); + $this->setIfExists('eftposAustralia', $data ?? [], null); $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('girocard', $data ?? [], null); + $this->setIfExists('ideal', $data ?? [], null); + $this->setIfExists('interacCard', $data ?? [], null); + $this->setIfExists('jcb', $data ?? [], null); + $this->setIfExists('maestro', $data ?? [], null); + $this->setIfExists('mc', $data ?? [], null); $this->setIfExists('storeIds', $data ?? [], null); + $this->setIfExists('visa', $data ?? [], null); } /** @@ -392,6 +469,33 @@ public function setCountries($countries) return $this; } + /** + * Gets cup + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getCup() + { + return $this->container['cup']; + } + + /** + * Sets cup + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $cup cup + * + * @return self + */ + public function setCup($cup) + { + if (is_null($cup)) { + throw new \InvalidArgumentException('non-nullable cup cannot be null'); + } + $this->container['cup'] = $cup; + + return $this; + } + /** * Gets currencies * @@ -419,6 +523,87 @@ public function setCurrencies($currencies) return $this; } + /** + * Gets diners + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getDiners() + { + return $this->container['diners']; + } + + /** + * Sets diners + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $diners diners + * + * @return self + */ + public function setDiners($diners) + { + if (is_null($diners)) { + throw new \InvalidArgumentException('non-nullable diners cannot be null'); + } + $this->container['diners'] = $diners; + + return $this; + } + + /** + * Gets discover + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getDiscover() + { + return $this->container['discover']; + } + + /** + * Sets discover + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $discover discover + * + * @return self + */ + public function setDiscover($discover) + { + if (is_null($discover)) { + throw new \InvalidArgumentException('non-nullable discover cannot be null'); + } + $this->container['discover'] = $discover; + + return $this; + } + + /** + * Gets eftposAustralia + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getEftposAustralia() + { + return $this->container['eftposAustralia']; + } + + /** + * Sets eftposAustralia + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $eftposAustralia eftposAustralia + * + * @return self + */ + public function setEftposAustralia($eftposAustralia) + { + if (is_null($eftposAustralia)) { + throw new \InvalidArgumentException('non-nullable eftposAustralia cannot be null'); + } + $this->container['eftposAustralia'] = $eftposAustralia; + + return $this; + } + /** * Gets enabled * @@ -446,6 +631,168 @@ public function setEnabled($enabled) return $this; } + /** + * Gets girocard + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getGirocard() + { + return $this->container['girocard']; + } + + /** + * Sets girocard + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $girocard girocard + * + * @return self + */ + public function setGirocard($girocard) + { + if (is_null($girocard)) { + throw new \InvalidArgumentException('non-nullable girocard cannot be null'); + } + $this->container['girocard'] = $girocard; + + return $this; + } + + /** + * Gets ideal + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getIdeal() + { + return $this->container['ideal']; + } + + /** + * Sets ideal + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $ideal ideal + * + * @return self + */ + public function setIdeal($ideal) + { + if (is_null($ideal)) { + throw new \InvalidArgumentException('non-nullable ideal cannot be null'); + } + $this->container['ideal'] = $ideal; + + return $this; + } + + /** + * Gets interacCard + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getInteracCard() + { + return $this->container['interacCard']; + } + + /** + * Sets interacCard + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $interacCard interacCard + * + * @return self + */ + public function setInteracCard($interacCard) + { + if (is_null($interacCard)) { + throw new \InvalidArgumentException('non-nullable interacCard cannot be null'); + } + $this->container['interacCard'] = $interacCard; + + return $this; + } + + /** + * Gets jcb + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getJcb() + { + return $this->container['jcb']; + } + + /** + * Sets jcb + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $jcb jcb + * + * @return self + */ + public function setJcb($jcb) + { + if (is_null($jcb)) { + throw new \InvalidArgumentException('non-nullable jcb cannot be null'); + } + $this->container['jcb'] = $jcb; + + return $this; + } + + /** + * Gets maestro + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getMaestro() + { + return $this->container['maestro']; + } + + /** + * Sets maestro + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $maestro maestro + * + * @return self + */ + public function setMaestro($maestro) + { + if (is_null($maestro)) { + throw new \InvalidArgumentException('non-nullable maestro cannot be null'); + } + $this->container['maestro'] = $maestro; + + return $this; + } + + /** + * Gets mc + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getMc() + { + return $this->container['mc']; + } + + /** + * Sets mc + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $mc mc + * + * @return self + */ + public function setMc($mc) + { + if (is_null($mc)) { + throw new \InvalidArgumentException('non-nullable mc cannot be null'); + } + $this->container['mc'] = $mc; + + return $this; + } + /** * Gets storeIds * @@ -472,6 +819,33 @@ public function setStoreIds($storeIds) return $this; } + + /** + * Gets visa + * + * @return \Adyen\Model\Management\GenericPmWithTdiInfo|null + */ + public function getVisa() + { + return $this->container['visa']; + } + + /** + * Sets visa + * + * @param \Adyen\Model\Management\GenericPmWithTdiInfo|null $visa visa + * + * @return self + */ + public function setVisa($visa) + { + if (is_null($visa)) { + throw new \InvalidArgumentException('non-nullable visa cannot be null'); + } + $this->container['visa'] = $visa; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Management/Webhook.php b/src/Adyen/Model/Management/Webhook.php index 20e793fe4..542332391 100644 --- a/src/Adyen/Model/Management/Webhook.php +++ b/src/Adyen/Model/Management/Webhook.php @@ -1099,7 +1099,7 @@ public function getType() /** * Sets type * - * @param string $type The type of webhook. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **terminal-api-notification** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). + * @param string $type The type of webhook. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **ach-notification-of-change-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **terminal-api-notification** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). * * @return self */ diff --git a/src/Adyen/Model/ManagementWebhooks/AccountCapabilityData.php b/src/Adyen/Model/ManagementWebhooks/AccountCapabilityData.php new file mode 100644 index 000000000..dd655d0f4 --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/AccountCapabilityData.php @@ -0,0 +1,594 @@ + + */ +class AccountCapabilityData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AccountCapabilityData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'allowed' => 'bool', + 'allowedLevel' => 'string', + 'capability' => 'string', + 'problems' => '\Adyen\Model\ManagementWebhooks\CapabilityProblem[]', + '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, + 'capability' => null, + 'problems' => null, + 'requested' => null, + 'requestedLevel' => null, + 'verificationStatus' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'allowed' => false, + 'allowedLevel' => false, + 'capability' => false, + 'problems' => 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', + 'capability' => 'capability', + 'problems' => 'problems', + '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', + 'capability' => 'setCapability', + 'problems' => 'setProblems', + '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', + 'capability' => 'getCapability', + 'problems' => 'getProblems', + '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; + } + + + /** + * 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('capability', $data ?? [], null); + $this->setIfExists('problems', $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 = []; + + if ($this->container['requested'] === null) { + $invalidProperties[] = "'requested' can't be null"; + } + if ($this->container['requestedLevel'] === null) { + $invalidProperties[] = "'requestedLevel' 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 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. + * + * @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 allowed level of the capability. Some capabilities have different levels which correspond to thresholds. Higher levels may require additional checks and increased monitoring.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'); + } + $this->container['allowedLevel'] = $allowedLevel; + + return $this; + } + + /** + * Gets capability + * + * @return string|null + */ + public function getCapability() + { + return $this->container['capability']; + } + + /** + * Sets capability + * + * @param string|null $capability The name of the capability. For example, **sendToTransferInstrument**. + * + * @return self + */ + public function setCapability($capability) + { + if (is_null($capability)) { + throw new \InvalidArgumentException('non-nullable capability cannot be null'); + } + $this->container['capability'] = $capability; + + return $this; + } + + /** + * Gets problems + * + * @return \Adyen\Model\ManagementWebhooks\CapabilityProblem[]|null + */ + public function getProblems() + { + return $this->container['problems']; + } + + /** + * Sets problems + * + * @param \Adyen\Model\ManagementWebhooks\CapabilityProblem[]|null $problems List of entities that has problems with verification. The information includes the details of the 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 + */ + public function getRequested() + { + return $this->container['requested']; + } + + /** + * Sets requested + * + * @param bool $requested Indicates whether you requested the capability. + * + * @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 + */ + public function getRequestedLevel() + { + return $this->container['requestedLevel']; + } + + /** + * Sets requestedLevel + * + * @param string $requestedLevel The level that you requested for the capability. Some capabilities have different levels which correspond to thresholds. Higher levels may 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'); + } + $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 capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification was successful. * **rejected**: Adyen checked the information and 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'); + } + $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/ManagementWebhooks/AccountCreateNotificationData.php b/src/Adyen/Model/ManagementWebhooks/AccountCreateNotificationData.php new file mode 100644 index 000000000..ca738df85 --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/AccountCreateNotificationData.php @@ -0,0 +1,532 @@ + + */ +class AccountCreateNotificationData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AccountCreateNotificationData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'capabilities' => 'array', + 'companyId' => 'string', + 'legalEntityId' => 'string', + 'merchantId' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'capabilities' => null, + 'companyId' => null, + 'legalEntityId' => null, + 'merchantId' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'capabilities' => false, + 'companyId' => false, + 'legalEntityId' => false, + 'merchantId' => 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 = [ + 'capabilities' => 'capabilities', + 'companyId' => 'companyId', + 'legalEntityId' => 'legalEntityId', + 'merchantId' => 'merchantId', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'capabilities' => 'setCapabilities', + 'companyId' => 'setCompanyId', + 'legalEntityId' => 'setLegalEntityId', + 'merchantId' => 'setMerchantId', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'capabilities' => 'getCapabilities', + 'companyId' => 'getCompanyId', + 'legalEntityId' => 'getLegalEntityId', + 'merchantId' => 'getMerchantId', + '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; + } + + + /** + * 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('companyId', $data ?? [], null); + $this->setIfExists('legalEntityId', $data ?? [], null); + $this->setIfExists('merchantId', $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['capabilities'] === null) { + $invalidProperties[] = "'capabilities' can't be null"; + } + if ($this->container['companyId'] === null) { + $invalidProperties[] = "'companyId' can't be null"; + } + if ($this->container['merchantId'] === null) { + $invalidProperties[] = "'merchantId' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' 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 array + */ + public function getCapabilities() + { + return $this->container['capabilities']; + } + + /** + * Sets capabilities + * + * @param array $capabilities Key-value pairs that specify the actions that the merchant account can do and its settings. The key is a capability. For example, the **sendToTransferInstrument** is the capability required before you can pay out funds to the bank account. 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 companyId + * + * @return string + */ + public function getCompanyId() + { + return $this->container['companyId']; + } + + /** + * Sets companyId + * + * @param string $companyId The unique identifier of the company account. + * + * @return self + */ + public function setCompanyId($companyId) + { + if (is_null($companyId)) { + throw new \InvalidArgumentException('non-nullable companyId cannot be null'); + } + $this->container['companyId'] = $companyId; + + return $this; + } + + /** + * Gets legalEntityId + * + * @return string|null + */ + public function getLegalEntityId() + { + return $this->container['legalEntityId']; + } + + /** + * Sets legalEntityId + * + * @param string|null $legalEntityId The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id). + * + * @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 merchantId + * + * @return string + */ + public function getMerchantId() + { + return $this->container['merchantId']; + } + + /** + * Sets merchantId + * + * @param string $merchantId The unique identifier of the merchant account. + * + * @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 status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of the merchant account. Possible values: * **PreActive**: The merchant account has been created. Users cannot access the merchant account in the Customer Area. The account cannot process payments. * **Active**: Users can access the merchant account in the Customer Area. If the company account is also **Active**, then payment processing and payouts are enabled. * **InactiveWithModifications**: Users can access the merchant account in the Customer Area. The account cannot process new payments but can still modify payments, for example issue refunds. The account can still receive payouts. * **Inactive**: Users can access the merchant account in the Customer Area. Payment processing and payouts are disabled. * **Closed**: The account is closed and this cannot be reversed. Users cannot log in. Payment processing and payouts are disabled. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $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/ManagementWebhooks/AccountNotificationResponse.php b/src/Adyen/Model/ManagementWebhooks/AccountNotificationResponse.php new file mode 100644 index 000000000..d370e6c7f --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/AccountNotificationResponse.php @@ -0,0 +1,384 @@ + + */ +class AccountNotificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AccountNotificationResponse'; + + /** + * 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/ManagementWebhooks/AccountUpdateNotificationData.php b/src/Adyen/Model/ManagementWebhooks/AccountUpdateNotificationData.php new file mode 100644 index 000000000..f6c80ac59 --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/AccountUpdateNotificationData.php @@ -0,0 +1,495 @@ + + */ +class AccountUpdateNotificationData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AccountUpdateNotificationData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'capabilities' => 'array', + 'legalEntityId' => 'string', + 'merchantId' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'capabilities' => null, + 'legalEntityId' => null, + 'merchantId' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'capabilities' => false, + 'legalEntityId' => false, + 'merchantId' => 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 = [ + 'capabilities' => 'capabilities', + 'legalEntityId' => 'legalEntityId', + 'merchantId' => 'merchantId', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'capabilities' => 'setCapabilities', + 'legalEntityId' => 'setLegalEntityId', + 'merchantId' => 'setMerchantId', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'capabilities' => 'getCapabilities', + 'legalEntityId' => 'getLegalEntityId', + 'merchantId' => 'getMerchantId', + '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; + } + + + /** + * 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('legalEntityId', $data ?? [], null); + $this->setIfExists('merchantId', $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['capabilities'] === null) { + $invalidProperties[] = "'capabilities' can't be null"; + } + if ($this->container['merchantId'] === null) { + $invalidProperties[] = "'merchantId' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' 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 array + */ + public function getCapabilities() + { + return $this->container['capabilities']; + } + + /** + * Sets capabilities + * + * @param array $capabilities Key-value pairs that specify what you can do with the merchant account and its settings. The key is a capability. For example, the **sendToTransferInstrument** is the capability required before you can pay out the funds of a merchant account to a [bank account](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments). 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 legalEntityId + * + * @return string|null + */ + public function getLegalEntityId() + { + return $this->container['legalEntityId']; + } + + /** + * Sets legalEntityId + * + * @param string|null $legalEntityId The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id). + * + * @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 merchantId + * + * @return string + */ + public function getMerchantId() + { + return $this->container['merchantId']; + } + + /** + * Sets merchantId + * + * @param string $merchantId The unique identifier of the merchant account. + * + * @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 status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of the merchant account. Possible values: * **PreActive**: The merchant account has been created. Users cannot access the merchant account in the Customer Area. The account cannot process payments. * **Active**: Users can access the merchant account in the Customer Area. If the company account is also **Active**, then payment processing and payouts are enabled. * **InactiveWithModifications**: Users can access the merchant account in the Customer Area. The account cannot process new payments but can still modify payments, for example issue refunds. The account can still receive payouts. * **Inactive**: Users can access the merchant account in the Customer Area. Payment processing and payouts are disabled. * **Closed**: The account is closed and this cannot be reversed. Users cannot log in. Payment processing and payouts are disabled. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $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/ManagementWebhooks/CapabilityProblem.php b/src/Adyen/Model/ManagementWebhooks/CapabilityProblem.php new file mode 100644 index 000000000..c5c5e9252 --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/CapabilityProblem.php @@ -0,0 +1,418 @@ + + */ +class CapabilityProblem implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CapabilityProblem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'entity' => '\Adyen\Model\ManagementWebhooks\CapabilityProblemEntity', + 'verificationErrors' => '\Adyen\Model\ManagementWebhooks\VerificationError[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'entity' => null, + 'verificationErrors' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'entity' => false, + 'verificationErrors' => 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 = [ + 'entity' => 'entity', + 'verificationErrors' => 'verificationErrors' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entity' => 'setEntity', + 'verificationErrors' => 'setVerificationErrors' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entity' => 'getEntity', + 'verificationErrors' => 'getVerificationErrors' + ]; + + /** + * 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('entity', $data ?? [], null); + $this->setIfExists('verificationErrors', $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 entity + * + * @return \Adyen\Model\ManagementWebhooks\CapabilityProblemEntity|null + */ + public function getEntity() + { + return $this->container['entity']; + } + + /** + * Sets entity + * + * @param \Adyen\Model\ManagementWebhooks\CapabilityProblemEntity|null $entity entity + * + * @return self + */ + public function setEntity($entity) + { + if (is_null($entity)) { + throw new \InvalidArgumentException('non-nullable entity cannot be null'); + } + $this->container['entity'] = $entity; + + return $this; + } + + /** + * Gets verificationErrors + * + * @return \Adyen\Model\ManagementWebhooks\VerificationError[]|null + */ + public function getVerificationErrors() + { + return $this->container['verificationErrors']; + } + + /** + * Sets verificationErrors + * + * @param \Adyen\Model\ManagementWebhooks\VerificationError[]|null $verificationErrors List of verification errors. + * + * @return self + */ + public function setVerificationErrors($verificationErrors) + { + if (is_null($verificationErrors)) { + throw new \InvalidArgumentException('non-nullable verificationErrors cannot be null'); + } + $this->container['verificationErrors'] = $verificationErrors; + + 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/ManagementWebhooks/CapabilityProblemEntity.php b/src/Adyen/Model/ManagementWebhooks/CapabilityProblemEntity.php new file mode 100644 index 000000000..255ce66bf --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/CapabilityProblemEntity.php @@ -0,0 +1,521 @@ + + */ +class CapabilityProblemEntity implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CapabilityProblemEntity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'documents' => 'string[]', + 'id' => 'string', + 'owner' => '\Adyen\Model\ManagementWebhooks\CapabilityProblemEntityRecursive', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'documents' => null, + 'id' => null, + 'owner' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'documents' => false, + 'id' => false, + 'owner' => 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 = [ + 'documents' => 'documents', + 'id' => 'id', + 'owner' => 'owner', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'documents' => 'setDocuments', + 'id' => 'setId', + 'owner' => 'setOwner', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'documents' => 'getDocuments', + 'id' => 'getId', + 'owner' => 'getOwner', + '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_BANK_ACCOUNT = 'BankAccount'; + public const TYPE_DOCUMENT = 'Document'; + public const TYPE_LEGAL_ENTITY = 'LegalEntity'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BANK_ACCOUNT, + self::TYPE_DOCUMENT, + self::TYPE_LEGAL_ENTITY, + ]; + } + /** + * 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('documents', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('owner', $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 documents + * + * @return string[]|null + */ + public function getDocuments() + { + return $this->container['documents']; + } + + /** + * Sets documents + * + * @param string[]|null $documents List of document IDs to which the verification errors related to the capabilities correspond to. + * + * @return self + */ + public function setDocuments($documents) + { + if (is_null($documents)) { + throw new \InvalidArgumentException('non-nullable documents cannot be null'); + } + $this->container['documents'] = $documents; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The ID of the 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 owner + * + * @return \Adyen\Model\ManagementWebhooks\CapabilityProblemEntityRecursive|null + */ + public function getOwner() + { + return $this->container['owner']; + } + + /** + * Sets owner + * + * @param \Adyen\Model\ManagementWebhooks\CapabilityProblemEntityRecursive|null $owner owner + * + * @return self + */ + public function setOwner($owner) + { + if (is_null($owner)) { + throw new \InvalidArgumentException('non-nullable owner cannot be null'); + } + $this->container['owner'] = $owner; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of entity. Possible values: **LegalEntity**, **BankAccount**, or **Document**. + * + * @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/ManagementWebhooks/CapabilityProblemEntityRecursive.php b/src/Adyen/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.php new file mode 100644 index 000000000..cdbe29957 --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.php @@ -0,0 +1,487 @@ + + */ +class CapabilityProblemEntityRecursive implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CapabilityProblemEntity-recursive'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'documents' => 'string[]', + '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 = [ + 'documents' => null, + 'id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'documents' => false, + 'id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'documents' => 'documents', + 'id' => 'id', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'documents' => 'setDocuments', + 'id' => 'setId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'documents' => 'getDocuments', + 'id' => 'getId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_BANK_ACCOUNT = 'BankAccount'; + public const TYPE_DOCUMENT = 'Document'; + public const TYPE_LEGAL_ENTITY = 'LegalEntity'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BANK_ACCOUNT, + self::TYPE_DOCUMENT, + self::TYPE_LEGAL_ENTITY, + ]; + } + /** + * 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('documents', $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 = []; + + $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 documents + * + * @return string[]|null + */ + public function getDocuments() + { + return $this->container['documents']; + } + + /** + * Sets documents + * + * @param string[]|null $documents List of document IDs to which the verification errors related to the capabilities correspond to. + * + * @return self + */ + public function setDocuments($documents) + { + if (is_null($documents)) { + throw new \InvalidArgumentException('non-nullable documents cannot be null'); + } + $this->container['documents'] = $documents; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The ID of the 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 type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of entity. Possible values: **LegalEntity**, **BankAccount**, or **Document**. + * + * @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/ManagementWebhooks/MerchantCreatedNotificationRequest.php b/src/Adyen/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.php new file mode 100644 index 000000000..03ae97661 --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.php @@ -0,0 +1,529 @@ + + */ +class MerchantCreatedNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MerchantCreatedNotificationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'createdAt' => '\DateTime', + 'data' => '\Adyen\Model\ManagementWebhooks\AccountCreateNotificationData', + '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 = [ + 'createdAt' => 'date-time', + 'data' => null, + 'environment' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'createdAt' => false, + '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 = [ + 'createdAt' => 'createdAt', + 'data' => 'data', + 'environment' => 'environment', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'createdAt' => 'setCreatedAt', + 'data' => 'setData', + 'environment' => 'setEnvironment', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'createdAt' => 'getCreatedAt', + '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_MERCHANT_CREATED = 'merchant.created'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_MERCHANT_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('createdAt', $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['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + 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 createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Timestamp for when the webhook was created. + * + * @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 data + * + * @return \Adyen\Model\ManagementWebhooks\AccountCreateNotificationData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\ManagementWebhooks\AccountCreateNotificationData $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 notification. + * + * @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/ManagementWebhooks/MerchantUpdatedNotificationRequest.php b/src/Adyen/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.php new file mode 100644 index 000000000..12a4c4b31 --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.php @@ -0,0 +1,529 @@ + + */ +class MerchantUpdatedNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MerchantUpdatedNotificationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'createdAt' => '\DateTime', + 'data' => '\Adyen\Model\ManagementWebhooks\AccountUpdateNotificationData', + '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 = [ + 'createdAt' => 'date-time', + 'data' => null, + 'environment' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'createdAt' => false, + '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 = [ + 'createdAt' => 'createdAt', + 'data' => 'data', + 'environment' => 'environment', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'createdAt' => 'setCreatedAt', + 'data' => 'setData', + 'environment' => 'setEnvironment', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'createdAt' => 'getCreatedAt', + '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_MERCHANT_UPDATED = 'merchant.updated'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_MERCHANT_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('createdAt', $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['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + 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 createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Timestamp for when the webhook was created. + * + * @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 data + * + * @return \Adyen\Model\ManagementWebhooks\AccountUpdateNotificationData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\ManagementWebhooks\AccountUpdateNotificationData $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 notification. + * + * @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/ManagementWebhooks/MidServiceNotificationData.php b/src/Adyen/Model/ManagementWebhooks/MidServiceNotificationData.php new file mode 100644 index 000000000..db9e82359 --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/MidServiceNotificationData.php @@ -0,0 +1,738 @@ + + */ +class MidServiceNotificationData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MidServiceNotificationData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'allowed' => 'bool', + 'enabled' => 'bool', + 'id' => 'string', + 'merchantId' => 'string', + 'reference' => 'string', + 'result' => 'string', + 'storeId' => 'string', + 'type' => '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, + 'enabled' => null, + 'id' => null, + 'merchantId' => null, + 'reference' => null, + 'result' => null, + 'storeId' => null, + 'type' => null, + 'verificationStatus' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'allowed' => false, + 'enabled' => false, + 'id' => false, + 'merchantId' => false, + 'reference' => false, + 'result' => false, + 'storeId' => false, + 'type' => 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', + 'enabled' => 'enabled', + 'id' => 'id', + 'merchantId' => 'merchantId', + 'reference' => 'reference', + 'result' => 'result', + 'storeId' => 'storeId', + 'type' => 'type', + 'verificationStatus' => 'verificationStatus' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowed' => 'setAllowed', + 'enabled' => 'setEnabled', + 'id' => 'setId', + 'merchantId' => 'setMerchantId', + 'reference' => 'setReference', + 'result' => 'setResult', + 'storeId' => 'setStoreId', + 'type' => 'setType', + 'verificationStatus' => 'setVerificationStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowed' => 'getAllowed', + 'enabled' => 'getEnabled', + 'id' => 'getId', + 'merchantId' => 'getMerchantId', + 'reference' => 'getReference', + 'result' => 'getResult', + 'storeId' => 'getStoreId', + 'type' => 'getType', + '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 RESULT_SUCCESS = 'SUCCESS'; + public const RESULT_FAILURE = 'FAILURE'; + public const VERIFICATION_STATUS_VALID = 'valid'; + public const VERIFICATION_STATUS_PENDING = 'pending'; + public const VERIFICATION_STATUS_INVALID = 'invalid'; + public const VERIFICATION_STATUS_REJECTED = 'rejected'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getResultAllowableValues() + { + return [ + self::RESULT_SUCCESS, + self::RESULT_FAILURE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getVerificationStatusAllowableValues() + { + return [ + self::VERIFICATION_STATUS_VALID, + self::VERIFICATION_STATUS_PENDING, + self::VERIFICATION_STATUS_INVALID, + self::VERIFICATION_STATUS_REJECTED, + ]; + } + /** + * 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('enabled', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchantId', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + $this->setIfExists('storeId', $data ?? [], null); + $this->setIfExists('type', $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 = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['merchantId'] === null) { + $invalidProperties[] = "'merchantId' can't be null"; + } + if ($this->container['result'] === null) { + $invalidProperties[] = "'result' can't be null"; + } + $allowedValues = $this->getResultAllowableValues(); + if (!is_null($this->container['result']) && !in_array($this->container['result'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'result', must be one of '%s'", + $this->container['result'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $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 receiving payments is allowed. This value is set to **true** by Adyen after screening your merchant account. + * + * @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 enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Indicates whether the payment method is enabled (**true**) or disabled (**false**). + * + * @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 + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The 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 merchantId + * + * @return string + */ + public function getMerchantId() + { + return $this->container['merchantId']; + } + + /** + * Sets merchantId + * + * @param string $merchantId The identifier of the merchant account. + * + * @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 reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the payment method. + * + * @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 result + * + * @return string + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param string $result The result of the request to create a payment method. + * + * @return self + */ + public function setResult($result) + { + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $allowedValues = $this->getResultAllowableValues(); + if (!in_array($result, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'result', must be one of '%s'", + $result, + implode("', '", $allowedValues) + ) + ); + } + $this->container['result'] = $result; + + return $this; + } + + /** + * Gets storeId + * + * @return string|null + */ + public function getStoreId() + { + return $this->container['storeId']; + } + + /** + * Sets storeId + * + * @param string|null $storeId The identifier of the [store](https://docs.adyen.com/api-explorer/#/ManagementService/latest/post/merchants/{id}/paymentMethodSettings__reqParam_storeId), if any. + * + * @return self + */ + public function setStoreId($storeId) + { + if (is_null($storeId)) { + throw new \InvalidArgumentException('non-nullable storeId cannot be null'); + } + $this->container['storeId'] = $storeId; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Payment method [variant](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). + * + * @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 verificationStatus + * + * @return string|null + */ + public function getVerificationStatus() + { + return $this->container['verificationStatus']; + } + + /** + * Sets verificationStatus + * + * @param string|null $verificationStatus Payment method status. Possible values: * **valid** * **pending** * **invalid** * **rejected** + * + * @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/ManagementWebhooks/ModelInterface.php b/src/Adyen/Model/ManagementWebhooks/ModelInterface.php new file mode 100644 index 000000000..3ef58c876 --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/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/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.php b/src/Adyen/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.php new file mode 100644 index 000000000..2c864ed54 --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.php @@ -0,0 +1,529 @@ + + */ +class PaymentMethodCreatedNotificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentMethodCreatedNotificationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'createdAt' => '\DateTime', + 'data' => '\Adyen\Model\ManagementWebhooks\MidServiceNotificationData', + '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 = [ + 'createdAt' => 'date-time', + 'data' => null, + 'environment' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'createdAt' => false, + '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 = [ + 'createdAt' => 'createdAt', + 'data' => 'data', + 'environment' => 'environment', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'createdAt' => 'setCreatedAt', + 'data' => 'setData', + 'environment' => 'setEnvironment', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'createdAt' => 'getCreatedAt', + '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_PAYMENT_METHOD_CREATED = 'paymentMethod.created'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_PAYMENT_METHOD_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('createdAt', $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['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + 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 createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Timestamp for when the webhook was created. + * + * @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 data + * + * @return \Adyen\Model\ManagementWebhooks\MidServiceNotificationData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\ManagementWebhooks\MidServiceNotificationData $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 notification. + * + * @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/ManagementWebhooks/PaymentMethodNotificationResponse.php b/src/Adyen/Model/ManagementWebhooks/PaymentMethodNotificationResponse.php new file mode 100644 index 000000000..93c237669 --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/PaymentMethodNotificationResponse.php @@ -0,0 +1,384 @@ + + */ +class PaymentMethodNotificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentMethodNotificationResponse'; + + /** + * 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/ManagementWebhooks/RemediatingAction.php b/src/Adyen/Model/ManagementWebhooks/RemediatingAction.php new file mode 100644 index 000000000..7957c3708 --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/RemediatingAction.php @@ -0,0 +1,418 @@ + + */ +class RemediatingAction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RemediatingAction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'code' => 'string', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => null, + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'code' => false, + 'message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The remediating action code. + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message A description of how you can resolve the verification 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; + } + /** + * 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/ManagementWebhooks/VerificationError.php b/src/Adyen/Model/ManagementWebhooks/VerificationError.php new file mode 100644 index 000000000..d7ce4c647 --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/VerificationError.php @@ -0,0 +1,555 @@ + + */ +class VerificationError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'VerificationError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'code' => 'string', + 'message' => 'string', + 'remediatingActions' => '\Adyen\Model\ManagementWebhooks\RemediatingAction[]', + 'subErrors' => '\Adyen\Model\ManagementWebhooks\VerificationErrorRecursive[]', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => null, + 'message' => null, + 'remediatingActions' => null, + 'subErrors' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'code' => false, + 'message' => false, + 'remediatingActions' => false, + 'subErrors' => 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 = [ + 'code' => 'code', + 'message' => 'message', + 'remediatingActions' => 'remediatingActions', + 'subErrors' => 'subErrors', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage', + 'remediatingActions' => 'setRemediatingActions', + 'subErrors' => 'setSubErrors', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage', + 'remediatingActions' => 'getRemediatingActions', + 'subErrors' => 'getSubErrors', + '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_DATA_MISSING = 'dataMissing'; + public const TYPE_INVALID_INPUT = 'invalidInput'; + public const TYPE_PENDING_STATUS = 'pendingStatus'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DATA_MISSING, + self::TYPE_INVALID_INPUT, + self::TYPE_PENDING_STATUS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('remediatingActions', $data ?? [], null); + $this->setIfExists('subErrors', $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 code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The verification error code. + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message The verification error message. + * + * @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 remediatingActions + * + * @return \Adyen\Model\ManagementWebhooks\RemediatingAction[]|null + */ + public function getRemediatingActions() + { + return $this->container['remediatingActions']; + } + + /** + * Sets remediatingActions + * + * @param \Adyen\Model\ManagementWebhooks\RemediatingAction[]|null $remediatingActions The actions that you can take to resolve the verification error. + * + * @return self + */ + public function setRemediatingActions($remediatingActions) + { + if (is_null($remediatingActions)) { + throw new \InvalidArgumentException('non-nullable remediatingActions cannot be null'); + } + $this->container['remediatingActions'] = $remediatingActions; + + return $this; + } + + /** + * Gets subErrors + * + * @return \Adyen\Model\ManagementWebhooks\VerificationErrorRecursive[]|null + */ + public function getSubErrors() + { + return $this->container['subErrors']; + } + + /** + * Sets subErrors + * + * @param \Adyen\Model\ManagementWebhooks\VerificationErrorRecursive[]|null $subErrors More granular information about the verification error. + * + * @return self + */ + public function setSubErrors($subErrors) + { + if (is_null($subErrors)) { + throw new \InvalidArgumentException('non-nullable subErrors cannot be null'); + } + $this->container['subErrors'] = $subErrors; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of verification error. Possible values: **invalidInput**, **dataMissing**, and **pendingStatus**. + * + * @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/ManagementWebhooks/VerificationErrorRecursive.php b/src/Adyen/Model/ManagementWebhooks/VerificationErrorRecursive.php new file mode 100644 index 000000000..deed34c90 --- /dev/null +++ b/src/Adyen/Model/ManagementWebhooks/VerificationErrorRecursive.php @@ -0,0 +1,521 @@ + + */ +class VerificationErrorRecursive implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'VerificationError-recursive'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'code' => 'string', + 'message' => 'string', + 'type' => 'string', + 'remediatingActions' => '\Adyen\Model\ManagementWebhooks\RemediatingAction[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => null, + 'message' => null, + 'type' => null, + 'remediatingActions' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'code' => false, + 'message' => false, + 'type' => false, + 'remediatingActions' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code', + 'message' => 'message', + 'type' => 'type', + 'remediatingActions' => 'remediatingActions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage', + 'type' => 'setType', + 'remediatingActions' => 'setRemediatingActions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage', + 'type' => 'getType', + 'remediatingActions' => 'getRemediatingActions' + ]; + + /** + * 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_DATA_MISSING = 'dataMissing'; + public const TYPE_INVALID_INPUT = 'invalidInput'; + public const TYPE_PENDING_STATUS = 'pendingStatus'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DATA_MISSING, + self::TYPE_INVALID_INPUT, + self::TYPE_PENDING_STATUS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('remediatingActions', $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 code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The verification error code. + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message The verification error message. + * + * @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 type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of verification error. Possible values: **invalidInput**, **dataMissing**, and **pendingStatus**. + * + * @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 remediatingActions + * + * @return \Adyen\Model\ManagementWebhooks\RemediatingAction[]|null + */ + public function getRemediatingActions() + { + return $this->container['remediatingActions']; + } + + /** + * Sets remediatingActions + * + * @param \Adyen\Model\ManagementWebhooks\RemediatingAction[]|null $remediatingActions The actions that you can take to resolve the verification error. + * + * @return self + */ + public function setRemediatingActions($remediatingActions) + { + if (is_null($remediatingActions)) { + throw new \InvalidArgumentException('non-nullable remediatingActions cannot be null'); + } + $this->container['remediatingActions'] = $remediatingActions; + + 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/AdditionalDataAirline.php b/src/Adyen/Model/Payments/AdditionalDataAirline.php index 71b161bf5..f74aedbd0 100644 --- a/src/Adyen/Model/Payments/AdditionalDataAirline.php +++ b/src/Adyen/Model/Payments/AdditionalDataAirline.php @@ -535,7 +535,7 @@ public function getAirlineAirlineCode() /** * Sets airlineAirlineCode * - * @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 + * @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 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 + * @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 */ @@ -724,7 +724,7 @@ public function getAirlineLegCarrierCode() /** * Sets airlineLegCarrierCode * - * @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 + * @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 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 + * @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 */ @@ -805,7 +805,7 @@ public function getAirlineLegDepartAirport() /** * Sets airlineLegDepartAirport * - * @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 + * @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 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 + * @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 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 + * @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 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 + * @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 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros + * @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 */ @@ -1102,7 +1102,7 @@ public function getAirlinePassengerName() /** * Sets airlinePassengerName * - * @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 + * @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 */ @@ -1156,7 +1156,7 @@ public function getAirlineTicketNumber() /** * Sets airlineTicketNumber * - * @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 + * @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 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 + * @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. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros + * @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 d7188693b..d47a9c04e 100644 --- a/src/Adyen/Model/Payments/AdditionalDataCarRental.php +++ b/src/Adyen/Model/Payments/AdditionalDataCarRental.php @@ -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 * 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 - + * @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 contain any special characters such as + or - *Must not be all zeros. * * @return self */ @@ -551,7 +551,7 @@ public function getCarRentalInsuranceCharges() /** * Sets carRentalInsuranceCharges * - * @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 + * @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 where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros + * @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 */ @@ -632,7 +632,7 @@ public function getCarRentalLocationStateProvince() /** * Sets carRentalLocationStateProvince * - * @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 + * @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 */ @@ -767,7 +767,7 @@ public function getCarRentalRentalAgreementNumber() /** * Sets carRentalRentalAgreementNumber * - * @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 + * @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 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 + * @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 * 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 + * @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 * Must not start with a space or be all spaces * Must not be all zeros + * @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 */ @@ -929,7 +929,7 @@ public function getCarRentalReturnLocationId() /** * Sets carRentalReturnLocationId * - * @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 + * @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 * Must not start with a space or be all spaces * Must not be all zeros + * @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 */ diff --git a/src/Adyen/Model/Payments/AdditionalDataLevel23.php b/src/Adyen/Model/Payments/AdditionalDataLevel23.php index 720404310..8347f4508 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 The customer code. Encoding: ASCII Max length: 25 characters Must not start with a space or be all spaces Must not be all zeros + * @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 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 + * @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 the destination address. Encoding: ASCII Max length: 10 characters Must not start with a space + * @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 Must not start with a space + * @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 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 + * @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 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 + * @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 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 + * @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 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 + * @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 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 + * @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 The product code. Encoding: ASCII. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros + * @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 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 + * @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 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 + * @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 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 + * @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 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 + * @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 * Must not be all zeros. * * @return self */ @@ -779,7 +779,7 @@ public function getEnhancedSchemeDataOrderDate() /** * Sets enhancedSchemeDataOrderDate * - * @param string|null $enhancedSchemeDataOrderDate The 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 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 + * @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 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 + * @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 * Must not be all zeros. * * @return self */ diff --git a/src/Adyen/Model/Payments/AdditionalDataLodging.php b/src/Adyen/Model/Payments/AdditionalDataLodging.php index 4978768c6..0e946694d 100644 --- a/src/Adyen/Model/Payments/AdditionalDataLodging.php +++ b/src/Adyen/Model/Payments/AdditionalDataLodging.php @@ -448,7 +448,7 @@ public function getLodgingCustomerServiceTollFreeNumber() /** * Sets lodgingCustomerServiceTollFreeNumber * - * @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 - + * @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 contain any special characters such as + or - *Must not be all zeros. * * @return self */ @@ -529,7 +529,7 @@ public function getLodgingFolioNumber() /** * Sets lodgingFolioNumber * - * @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 + * @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 */ @@ -637,7 +637,7 @@ public function getLodgingPropertyPhoneNumber() /** * Sets lodgingPropertyPhoneNumber * - * @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 - + * @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 contain any special characters such as + or - *Must not be all zeros. * * @return self */ diff --git a/src/Adyen/Model/Payments/AdditionalDataTemporaryServices.php b/src/Adyen/Model/Payments/AdditionalDataTemporaryServices.php index 27af74221..2f3810a0c 100644 --- a/src/Adyen/Model/Payments/AdditionalDataTemporaryServices.php +++ b/src/Adyen/Model/Payments/AdditionalDataTemporaryServices.php @@ -372,7 +372,7 @@ public function getEnhancedSchemeDataEmployeeName() /** * Sets enhancedSchemeDataEmployeeName * - * @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 + * @param string|null $enhancedSchemeDataEmployeeName The name or ID of the person working in a temporary capacity. * maxLength: 40. * Must not be all spaces. *Must not be all zeros. * * @return self */ @@ -399,7 +399,7 @@ public function getEnhancedSchemeDataJobDescription() /** * Sets enhancedSchemeDataJobDescription * - * @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 + * @param string|null $enhancedSchemeDataJobDescription The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all spaces. *Must not be all zeros. * * @return self */ diff --git a/src/Adyen/Model/Payments/Split.php b/src/Adyen/Model/Payments/Split.php index 0bc6de0c3..6f3a280b6 100644 --- a/src/Adyen/Model/Payments/Split.php +++ b/src/Adyen/Model/Payments/Split.php @@ -244,18 +244,10 @@ 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'; - public const TYPE_TOP_UP = 'TopUp'; public const TYPE_VAT = 'VAT'; - public const TYPE_VERIFICATION = 'Verification'; /** * Gets allowable values of the enum @@ -270,18 +262,10 @@ 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, - self::TYPE_TOP_UP, self::TYPE_VAT, - self::TYPE_VERIFICATION, ]; } /** diff --git a/src/Adyen/Service/Account.php b/src/Adyen/Service/Account.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/BankingWebhookParser.php b/src/Adyen/Service/BankingWebhookParser.php index 61bf718b0..5a3e5b301 100644 --- a/src/Adyen/Service/BankingWebhookParser.php +++ b/src/Adyen/Service/BankingWebhookParser.php @@ -2,6 +2,7 @@ namespace Adyen\Service; +use Adyen\Model\AcsWebhooks\AuthenticationNotificationRequest; use Adyen\Model\ConfigurationWebhooks\AccountHolderNotificationRequest; use Adyen\Model\ConfigurationWebhooks\BalanceAccountNotificationRequest; use Adyen\Model\ConfigurationWebhooks\ObjectSerializer; @@ -24,29 +25,42 @@ public function getGenericWebhook() $jsonPayload = json_decode($this->payload, true); $type = $jsonPayload['type']; - if (in_array($type, ($clazz = new AccountHolderNotificationRequest)->getTypeAllowableValues())) { + if (in_array($type, ($clazz = new AuthenticationNotificationRequest())->getTypeAllowableValues())) { return (object)$this->deserializewebhook($clazz); } + if (in_array($type, ($clazz = new AccountHolderNotificationRequest)->getTypeAllowableValues())) { + return (object)self::deserializewebhook($clazz); + } + if (in_array($type, ($clazz = new BalanceAccountNotificationRequest())->getTypeAllowableValues())) { - return (object)$this->deserializeWebhook($clazz); + return (object)self::deserializeWebhook($clazz); } if (in_array($type, ($clazz = new PaymentNotificationRequest())->getTypeAllowableValues())) { - return (object)$this->deserializeWebhook($clazz); + return (object)self::deserializeWebhook($clazz); } if (in_array($type, ($clazz = new SweepConfigurationNotificationRequest())->getTypeAllowableValues())) { - return (object)$this->deserializeWebhook($clazz); + return (object)self::deserializeWebhook($clazz); } if (in_array($type, ($clazz = new ReportNotificationRequest())->getTypeAllowableValues())) { - return (object)$this->deserializeWebhook($clazz); + return (object)self::deserializeWebhook($clazz); } if (in_array($type, ($clazz = new TransferNotificationRequest())->getTypeAllowableValues())) { - return(object)$this->deserializeWebhook($clazz); + return(object)self::deserializeWebhook($clazz); } + + // throw error in case the webhook can not be parsed + throw new \Error("Could not parse the payload:" . $this->payload); + } + + /** @noinspection PhpIncompatibleReturnTypeInspection */ + public function getAuthenticationNotificationRequest(): AuthenticationNotificationRequest + { + return $this->getGenericWebhook(); } /** @noinspection PhpIncompatibleReturnTypeInspection */ diff --git a/src/Adyen/Service/Builder/Address.php b/src/Adyen/Service/Builder/Address.php index 7f04aafaa..e260ac276 100644 --- a/src/Adyen/Service/Builder/Address.php +++ b/src/Adyen/Service/Builder/Address.php @@ -126,7 +126,7 @@ public function buildDeliveryAddress( } /** - * @param string self::$addressTypeBilling|self::$addressTypeDelivery + * @param string $addressType self::$addressTypeBilling|self::$addressTypeDelivery * @param string $street * @param string $houseNumberOrName * @param string $postalCode diff --git a/src/Adyen/Service/Builder/Browser.php b/src/Adyen/Service/Builder/Browser.php index dfe67dbad..794aef11e 100644 --- a/src/Adyen/Service/Builder/Browser.php +++ b/src/Adyen/Service/Builder/Browser.php @@ -36,7 +36,7 @@ class Browser * @param int $screenWidth * @param int $screenHeight * @param int $colorDepth - * @param int $timeZoneOffsetß + * @param int $timeZoneOffset * @param string $language * @param bool $javaEnabled * @param array $request diff --git a/src/Adyen/Service/Fund.php b/src/Adyen/Service/Fund.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ManagementWebhookParser.php b/src/Adyen/Service/ManagementWebhookParser.php new file mode 100644 index 000000000..7961ce16d --- /dev/null +++ b/src/Adyen/Service/ManagementWebhookParser.php @@ -0,0 +1,62 @@ +payload = $payload; + } + + public function getGenericWebhook() + { + $jsonPayload = json_decode($this->payload, true); + $type = $jsonPayload['type']; + + if (in_array($type, ($clazz = new MerchantCreatedNotificationRequest())->getTypeAllowableValues())) { + return (object)self::deserializewebhook($clazz); + } + + if (in_array($type, ($clazz = new MerchantUpdatedNotificationRequest())->getTypeAllowableValues())) { + return (object)self::deserializewebhook($clazz); + } + + if (in_array($type, ($clazz = new PaymentMethodCreatedNotificationRequest())->getTypeAllowableValues())) { + return (object)self::deserializewebhook($clazz); + } + + // throw error in case the webhook can not be parsed + throw new \Error("Could not parse the payload:" . $this->payload); + } + + /** @noinspection PhpIncompatibleReturnTypeInspection */ + public function getMerchantCreatedNotificationRequest(): MerchantCreatedNotificationRequest + { + return $this->getGenericWebhook(); + } + + /** @noinspection PhpIncompatibleReturnTypeInspection */ + public function getMerchantUpdatedNotificationRequest(): MerchantUpdatedNotificationRequest + { + return $this->getGenericWebhook(); + } + + /** @noinspection PhpIncompatibleReturnTypeInspection */ + public function getPaymentMethodCreatedNotificationRequest(): PaymentMethodCreatedNotificationRequest + { + return $this->getGenericWebhook(); + } + + private function deserializeWebhook($clazz) + { + return ObjectSerializer::deserialize($this->payload, get_class($clazz)); + } +} diff --git a/src/Adyen/Service/PosPayment.php b/src/Adyen/Service/PosPayment.php index 9498ca2a2..dfd8dd8b8 100644 --- a/src/Adyen/Service/PosPayment.php +++ b/src/Adyen/Service/PosPayment.php @@ -18,11 +18,6 @@ class PosPayment extends \Adyen\ApiKeyAuthenticatedService */ protected $runTenderAsync; - /** - * @var - */ - protected $txType; - /** * @var ResourceModel\Payment\ConnectedTerminals */ diff --git a/src/Adyen/Service/ResourceModel/Account/CloseAccount.php b/src/Adyen/Service/ResourceModel/Account/CloseAccount.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Account/CloseAccountHolder.php b/src/Adyen/Service/ResourceModel/Account/CloseAccountHolder.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Account/CreateAccount.php b/src/Adyen/Service/ResourceModel/Account/CreateAccount.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Account/CreateAccountHolder.php b/src/Adyen/Service/ResourceModel/Account/CreateAccountHolder.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Account/DeleteBankAccounts.php b/src/Adyen/Service/ResourceModel/Account/DeleteBankAccounts.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Account/DeleteShareholders.php b/src/Adyen/Service/ResourceModel/Account/DeleteShareholders.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Account/GetAccountHolder.php b/src/Adyen/Service/ResourceModel/Account/GetAccountHolder.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Account/GetUploadedDocuments.php b/src/Adyen/Service/ResourceModel/Account/GetUploadedDocuments.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Account/SuspendAccountHolder.php b/src/Adyen/Service/ResourceModel/Account/SuspendAccountHolder.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Account/UnSuspendAccountHolder.php b/src/Adyen/Service/ResourceModel/Account/UnSuspendAccountHolder.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Account/UpdateAccount.php b/src/Adyen/Service/ResourceModel/Account/UpdateAccount.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Account/UpdateAccountHolder.php b/src/Adyen/Service/ResourceModel/Account/UpdateAccountHolder.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Account/UpdateAccountHolderState.php b/src/Adyen/Service/ResourceModel/Account/UpdateAccountHolderState.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Account/UploadDocument.php b/src/Adyen/Service/ResourceModel/Account/UploadDocument.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Fund/AccountHolderBalance.php b/src/Adyen/Service/ResourceModel/Fund/AccountHolderBalance.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Fund/AccountHolderTransactionList.php b/src/Adyen/Service/ResourceModel/Fund/AccountHolderTransactionList.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Fund/PayoutAccountHolder.php b/src/Adyen/Service/ResourceModel/Fund/PayoutAccountHolder.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Fund/RefundNotPaidOutTransfers.php b/src/Adyen/Service/ResourceModel/Fund/RefundNotPaidOutTransfers.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Fund/SetupBeneficiary.php b/src/Adyen/Service/ResourceModel/Fund/SetupBeneficiary.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Fund/TransferFunds.php b/src/Adyen/Service/ResourceModel/Fund/TransferFunds.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Notification/CreateNotificationConfiguration.php b/src/Adyen/Service/ResourceModel/Notification/CreateNotificationConfiguration.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Notification/DeleteNotificationConfigurations.php b/src/Adyen/Service/ResourceModel/Notification/DeleteNotificationConfigurations.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Notification/GetNotificationConfiguration.php b/src/Adyen/Service/ResourceModel/Notification/GetNotificationConfiguration.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Notification/GetNotificationConfigurationList.php b/src/Adyen/Service/ResourceModel/Notification/GetNotificationConfigurationList.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Notification/TestNotificationConfiguration.php b/src/Adyen/Service/ResourceModel/Notification/TestNotificationConfiguration.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Service/ResourceModel/Notification/UpdateNotificationConfiguration.php b/src/Adyen/Service/ResourceModel/Notification/UpdateNotificationConfiguration.php old mode 100755 new mode 100644 diff --git a/src/Adyen/Util/IpAddress.php b/src/Adyen/Util/IpAddress.php index 9a35c76b0..e18194331 100644 --- a/src/Adyen/Util/IpAddress.php +++ b/src/Adyen/Util/IpAddress.php @@ -45,7 +45,7 @@ public function getAdyenIpAddresses() $ipAddresses = array(); foreach (self::$HOSTNAMES as $hostname) { $ipAddressesOfHostName = gethostbynamel($hostname); - + // gethostbynamel can return false if hostname could not be resolved if (false !== $ipAddressesOfHostName) { $ipAddresses = array_merge($ipAddresses, $ipAddressesOfHostName); diff --git a/templates/ObjectSerializer.mustache b/templates/ObjectSerializer.mustache index 97ae4b8a1..a4a0691d9 100644 --- a/templates/ObjectSerializer.mustache +++ b/templates/ObjectSerializer.mustache @@ -231,7 +231,7 @@ class ObjectSerializer // determine file name if ( is_array($httpHeaders) - && array_key_exists('Content-Disposition', $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]); diff --git a/templates/config.yaml b/templates/config.yaml index 7307552ee..47d2eaa1b 100644 --- a/templates/config.yaml +++ b/templates/config.yaml @@ -3,4 +3,4 @@ files: api-single.mustache: folder: api templateType: API - destinationFilename: Single.php \ No newline at end of file + destinationFilename: Single.php diff --git a/templates/model_generic.mustache b/templates/model_generic.mustache index c7d73c0b1..984f0e8da 100644 --- a/templates/model_generic.mustache +++ b/templates/model_generic.mustache @@ -38,7 +38,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par */ protected static $openAPINullables = [ {{#vars}}'{{name}}' => {{#isNullable}}true{{/isNullable}}{{^isNullable}}{{^isInteger}}false{{/isInteger}}{{/isNullable}}{{^isNullable}}{{#isInteger}}true{{/isInteger}}{{/isNullable}}{{^-last}}, - {{/-last}}{{/vars}} + {{/-last}}{{/vars}} ]; /** @@ -465,7 +465,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/tests/Resources/Account/create-account-success.json b/tests/Resources/Account/create-account-success.json old mode 100755 new mode 100644 diff --git a/tests/Resources/AccountHolder/create-account-holder-success.json b/tests/Resources/AccountHolder/create-account-holder-success.json old mode 100755 new mode 100644 diff --git a/tests/Resources/Checkout/cardDetails-success.json b/tests/Resources/Checkout/cardDetails-success.json index 4695393b4..026d95e6b 100644 --- a/tests/Resources/Checkout/cardDetails-success.json +++ b/tests/Resources/Checkout/cardDetails-success.json @@ -9,4 +9,4 @@ "supported" : true } ] -} +} \ No newline at end of file diff --git a/tests/Resources/Checkout/payment-links-expired.json b/tests/Resources/Checkout/payment-links-expired.json index ed91120ea..4e6c014f0 100644 --- a/tests/Resources/Checkout/payment-links-expired.json +++ b/tests/Resources/Checkout/payment-links-expired.json @@ -7,4 +7,4 @@ "expiresAt": "2020-06-30T08:23:18Z", "reference": "YOUR_ORDER_NUMBER", "url": "https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=PL0A6D6846DB347E59" -} +} \ No newline at end of file diff --git a/tests/Resources/Checkout/payment-links-invalid.json b/tests/Resources/Checkout/payment-links-invalid.json index d6a9efa4e..540ea247c 100644 --- a/tests/Resources/Checkout/payment-links-invalid.json +++ b/tests/Resources/Checkout/payment-links-invalid.json @@ -3,4 +3,4 @@ "errorCode": "130", "message": "Reference Missing", "errorType": "validation" -} +} \ No newline at end of file diff --git a/tests/Resources/Checkout/payment-links-success.json b/tests/Resources/Checkout/payment-links-success.json index 969c5ad00..e4a81c301 100644 --- a/tests/Resources/Checkout/payment-links-success.json +++ b/tests/Resources/Checkout/payment-links-success.json @@ -6,4 +6,4 @@ "expiresAt": "2020-06-30T08:23:18Z", "reference": "YOUR_ORDER_NUMBER", "url": "https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=PL0A6D6846DB347E59" -} +} \ No newline at end of file diff --git a/tests/Resources/Checkout/payments-success-3D.json b/tests/Resources/Checkout/payments-success-3D.json index 96ee11563..12eeecec2 100644 --- a/tests/Resources/Checkout/payments-success-3D.json +++ b/tests/Resources/Checkout/payments-success-3D.json @@ -1,20 +1,20 @@ { - "resultCode": "RedirectShopper", - "details": [{ - "key": "MD", - "type": "text" - }, { - "key": "PaRes", - "type": "text" - }], - "paymentData": "Ab02b4c0!BQABAgBnicwOBkouhPP08Qjg5E5clc0bGyemR...", - "redirect": { - "data": { - "PaReq": "eNpVUttygjAU\/BXbDyAXQZE5ZoZKZ+oD1lp97jDhjNKR...", - "TermUrl": "https:\/\/your-company.com\/...", - "MD": "djIhd29JYnByWUlsYkRuWndGakdkd0F5dz09IWSjFITvzeJZYp37u..." - }, - "method": "POST", - "url": "https:\/\/test.adyen.com\/hpp\/3d\/validate.shtml" - } + "resultCode": "RedirectShopper", + "details": [{ + "key": "MD", + "type": "text" + }, { + "key": "PaRes", + "type": "text" + }], + "paymentData": "Ab02b4c0!BQABAgBnicwOBkouhPP08Qjg5E5clc0bGyemR...", + "redirect": { + "data": { + "PaReq": "eNpVUttygjAU\/BXbDyAXQZE5ZoZKZ+oD1lp97jDhjNKR...", + "TermUrl": "https:\/\/your-company.com\/...", + "MD": "djIhd29JYnByWUlsYkRuWndGakdkd0F5dz09IWSjFITvzeJZYp37u..." + }, + "method": "POST", + "url": "https:\/\/test.adyen.com\/hpp\/3d\/validate.shtml" + } } \ No newline at end of file diff --git a/tests/Resources/Checkout/sessions-invalid.json b/tests/Resources/Checkout/sessions-invalid.json index 6bf8db0cb..23030e9cc 100644 --- a/tests/Resources/Checkout/sessions-invalid.json +++ b/tests/Resources/Checkout/sessions-invalid.json @@ -3,4 +3,4 @@ "errorCode": "702", "message": "Required field 'amount' is null", "errorType": "validation" -} +} \ No newline at end of file diff --git a/tests/Resources/Fund/accountHolderBalance-success.json b/tests/Resources/Fund/accountHolderBalance-success.json old mode 100755 new mode 100644 diff --git a/tests/Resources/Fund/accountHolderTransactionList-success.json b/tests/Resources/Fund/accountHolderTransactionList-success.json old mode 100755 new mode 100644 diff --git a/tests/Resources/Fund/payoutAccountHolder-success.json b/tests/Resources/Fund/payoutAccountHolder-success.json old mode 100755 new mode 100644 diff --git a/tests/Resources/Fund/refundNotPaidOutTransfers-success.json b/tests/Resources/Fund/refundNotPaidOutTransfers-success.json old mode 100755 new mode 100644 diff --git a/tests/Resources/Fund/setupBeneficiary-success.json b/tests/Resources/Fund/setupBeneficiary-success.json old mode 100755 new mode 100644 diff --git a/tests/Resources/Fund/transferFunds-success.json b/tests/Resources/Fund/transferFunds-success.json old mode 100755 new mode 100644 diff --git a/tests/Resources/ModelBasedCheckout/payments-success-3D.json b/tests/Resources/ModelBasedCheckout/payments-success-3D.json index 96ee11563..12eeecec2 100644 --- a/tests/Resources/ModelBasedCheckout/payments-success-3D.json +++ b/tests/Resources/ModelBasedCheckout/payments-success-3D.json @@ -1,20 +1,20 @@ { - "resultCode": "RedirectShopper", - "details": [{ - "key": "MD", - "type": "text" - }, { - "key": "PaRes", - "type": "text" - }], - "paymentData": "Ab02b4c0!BQABAgBnicwOBkouhPP08Qjg5E5clc0bGyemR...", - "redirect": { - "data": { - "PaReq": "eNpVUttygjAU\/BXbDyAXQZE5ZoZKZ+oD1lp97jDhjNKR...", - "TermUrl": "https:\/\/your-company.com\/...", - "MD": "djIhd29JYnByWUlsYkRuWndGakdkd0F5dz09IWSjFITvzeJZYp37u..." - }, - "method": "POST", - "url": "https:\/\/test.adyen.com\/hpp\/3d\/validate.shtml" - } + "resultCode": "RedirectShopper", + "details": [{ + "key": "MD", + "type": "text" + }, { + "key": "PaRes", + "type": "text" + }], + "paymentData": "Ab02b4c0!BQABAgBnicwOBkouhPP08Qjg5E5clc0bGyemR...", + "redirect": { + "data": { + "PaReq": "eNpVUttygjAU\/BXbDyAXQZE5ZoZKZ+oD1lp97jDhjNKR...", + "TermUrl": "https:\/\/your-company.com\/...", + "MD": "djIhd29JYnByWUlsYkRuWndGakdkd0F5dz09IWSjFITvzeJZYp37u..." + }, + "method": "POST", + "url": "https:\/\/test.adyen.com\/hpp\/3d\/validate.shtml" + } } \ No newline at end of file diff --git a/tests/Resources/Notification/create-success.json b/tests/Resources/Notification/create-success.json old mode 100755 new mode 100644 diff --git a/tests/Resources/Notification/delete-success.json b/tests/Resources/Notification/delete-success.json old mode 100755 new mode 100644 diff --git a/tests/Resources/Notification/get-success.json b/tests/Resources/Notification/get-success.json old mode 100755 new mode 100644 diff --git a/tests/Resources/Notification/getlist-success.json b/tests/Resources/Notification/getlist-success.json old mode 100755 new mode 100644 diff --git a/tests/Resources/Notification/test-success.json b/tests/Resources/Notification/test-success.json old mode 100755 new mode 100644 diff --git a/tests/Resources/Notification/update-success.json b/tests/Resources/Notification/update-success.json old mode 100755 new mode 100644 diff --git a/tests/Resources/StoredValue/void-transaction.json b/tests/Resources/StoredValue/void-transaction.json index 296528319..e8882ebdd 100644 --- a/tests/Resources/StoredValue/void-transaction.json +++ b/tests/Resources/StoredValue/void-transaction.json @@ -7,4 +7,4 @@ "refusalReason": "string", "resultCode": "NotEnoughBalance", "thirdPartyRefusalReason": "string" -} \ No newline at end of file +} diff --git a/tests/Resources/Tranfers/all-transactions-get.json b/tests/Resources/Tranfers/all-transactions-get.json index b55e6c2e7..7420951e6 100644 --- a/tests/Resources/Tranfers/all-transactions-get.json +++ b/tests/Resources/Tranfers/all-transactions-get.json @@ -69,4 +69,4 @@ "href": "https://balanceplatform-api-test.adyen.com/btl/v2/transactions?balancePlatform=Bastronaut&createdUntil=2022-03-21T00%3A00%3A00Z&createdSince=2022-03-11T00%3A00%3A00Z&limit=3&cursor=S2B-TSAjOkIrYlIlbjdqe0RreHRyM32lKRSxubXBHRkhHL2E32XitQQz5SfzpucD5HbHwpM1p6NDR1eXVQLFF6MmY33J32sobDxQYT90MHIud1hwLnd6JitcX32xJ" } } -} \ No newline at end of file +} diff --git a/tests/Resources/Tranfers/transfer-funds.json b/tests/Resources/Tranfers/transfer-funds.json index c78a7f6a8..1af2fcec2 100644 --- a/tests/Resources/Tranfers/transfer-funds.json +++ b/tests/Resources/Tranfers/transfer-funds.json @@ -32,4 +32,4 @@ "direction": "outgoing", "reason": "approved", "status": "authorised" -} \ No newline at end of file +} diff --git a/tests/TestCase.php b/tests/TestCase.php index 12d6ac6a5..d99c09e68 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -279,7 +279,7 @@ protected function needSkinCode() $this->skipTest("Skipped the test. Configure your SkinCode in the config"); } } - + public function validateApiPermission($e) { // it is possible you do not have permission to use full API then switch over to CSE diff --git a/tests/Unit/AccountHolderTest.php b/tests/Unit/AccountHolderTest.php old mode 100755 new mode 100644 diff --git a/tests/Unit/AccountTest.php b/tests/Unit/AccountTest.php old mode 100755 new mode 100644 diff --git a/tests/Unit/FundTest.php b/tests/Unit/FundTest.php old mode 100755 new mode 100644 diff --git a/tests/Unit/ModificationTest.php b/tests/Unit/ModificationTest.php index 0a6f9e4e4..38be32436 100644 --- a/tests/Unit/ModificationTest.php +++ b/tests/Unit/ModificationTest.php @@ -40,19 +40,19 @@ public function testRefundWithDataSuccess($jsonFile, $httpStatus) $params = json_decode( ' - { - "amount":{ - "value":1500, - "currency":"GBP" - }, - "selectedRecurringDetailReference":"8315535507322518", - "shopperReference":"myshopperreference", - "reference":"myreference", - "merchantAccount":"mymerchantaccount", - "recurring":{ - "contract":"RECURRING" - }, - "shopperInteraction":"ContAuth" + { + "amount": { + "value":1500, + "currency":"GBP" + }, + "selectedRecurringDetailReference":"8315535507322518", + "shopperReference":"myshopperreference", + "reference":"myreference", + "merchantAccount":"mymerchantaccount", + "recurring":{ + "contract":"RECURRING" + }, + "shopperInteraction":"ContAuth" }', true ); diff --git a/tests/Unit/NotificationTest.php b/tests/Unit/NotificationTest.php old mode 100755 new mode 100644 index 5076a7d9b..c936b94b3 --- a/tests/Unit/NotificationTest.php +++ b/tests/Unit/NotificationTest.php @@ -23,10 +23,11 @@ namespace Adyen\Tests\Unit; -use Adyen\Model\BalancePlatform\Balance; -use Adyen\Model\ConfigurationWebhooks\BalanceAccountNotificationRequest; use Adyen\Model\ConfigurationWebhooks\SweepConfigurationNotificationRequest; +use Adyen\Model\ManagementWebhooks\PaymentMethodCreatedNotificationRequest; +use Adyen\Model\AcsWebhooks\AuthenticationNotificationRequest; use Adyen\Service\BankingWebhookParser; +use Adyen\Service\ManagementWebhookParser; use Adyen\Service\Notification; class NotificationTest extends TestCaseMock @@ -94,7 +95,6 @@ public function testNotificationGetlistSuccess($jsonFile, $httpStatus) ' { "configurationDetails": { - } }', true @@ -277,4 +277,72 @@ public function testBankingWebhookParserBalanceAccount() self::assertEquals(SweepConfigurationNotificationRequest::class, get_class($result)); self::assertEquals("test", $result->getEnvironment()); } + + public function testManagementWebhookParser() + { + $jsonString = '{ + "createdAt": "2022-01-24T14:59:11+01:00", + "data": { + "id": "PM3224R223224K5FH4M2K9B86", + "merchantId": "MERCHANT_ACCOUNT", + "result": "SUCCESS", + "storeId": "ST322LJ223223K5F4SQNR9XL5", + "type": "visa" + }, + "environment": "test", + "type": "paymentMethod.created" + }'; + $webhookParser = new ManagementWebhookParser($jsonString); + $result = $webhookParser->getPaymentMethodCreatedNotificationRequest(); + self::assertEquals(PaymentMethodCreatedNotificationRequest::class, get_class($result)); + $paymentWebhook = new PaymentMethodCreatedNotificationRequest(); + self::assertEquals($paymentWebhook->getTypeAllowableValues()[0], $result->getType()); + } + + public function testBankingWebhookParserAuthenticationRequest() + { + $jsonString = '{ + "data": { + "authentication": { + "acsTransId": "6a4c1709-a42e-4c7f-96c7-1043adacfc97", + "challenge": { + "flow": "OOB", + "lastInteraction": "2022-12-22T15:49:03+01:00" + }, + "challengeIndicator": "01", + "createdAt": "2022-12-22T15:45:03+01:00", + "deviceChannel": "app", + "dsTransID": "a3b86754-444d-46ca-95a2-ada351d3f42c", + "exemptionIndicator": "lowValue", + "inPSD2Scope": true, + "messageCategory": "payment", + "messageVersion": "2.2.0", + "riskScore": 0, + "threeDSServerTransID": "6edcc246-23ee-4e94-ac5d-8ae620bea7d9", + "transStatus": "Y", + "type": "challenge" + }, + "balancePlatform": "YOUR_BALANCE_PLATFORM", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "paymentInstrumentId": "PI3227C223222B5BPCMFXD2XG", + "purchase": { + "date": "2022-12-22T15:49:03+01:00", + "merchantName": "TeaShop_NL", + "originalAmount": { + "currency": "EUR", + "value": 1000 + } + }, + "status": "authenticated" + }, + "environment": "test", + "type": "balancePlatform.authentication.created" + }'; + $webhookParser = new BankingWebhookParser($jsonString); + $result = $webhookParser->getGenericWebhook(); + self::assertEquals(AuthenticationNotificationRequest::class, get_class($result)); + self::assertEquals($webhookParser->getAuthenticationNotificationRequest(), $result); + $authenticationRequest = new AuthenticationNotificationRequest(); + self::assertEquals($authenticationRequest->getTypeAllowableValues()[0], $webhookParser->getAuthenticationNotificationRequest()->getType()); + } } diff --git a/tests/Unit/RecurringTest.php b/tests/Unit/RecurringTest.php index 3e859001b..9e1aa0e4f 100644 --- a/tests/Unit/RecurringTest.php +++ b/tests/Unit/RecurringTest.php @@ -39,15 +39,15 @@ public function testNotifyShopperSuccess($jsonFile, $httpStatus) $params = json_decode( '{ "merchantAccount": "YOUR_MERCHANT_ACCOUNT", - "storedPaymentMethodId": "8415995487234100", - "shopperReference": "YOUR_SHOPPER_REFERENCE", - "amount": { - "currency": "INR", - "value": 1000 - }, - "billingDate": "2021-03-16", - "reference": "Example reference", - "displayedReference": "Example displayed reference" + "storedPaymentMethodId": "8415995487234100", + "shopperReference": "YOUR_SHOPPER_REFERENCE", + "amount": { + "currency": "INR", + "value": 1000 + }, + "billingDate": "2021-03-16", + "reference": "Example reference", + "displayedReference": "Example displayed reference" }', true ); diff --git a/tests/Unit/Util/HmacSignatureTest.php b/tests/Unit/Util/HmacSignatureTest.php index c5a6bf43b..c615cc1b9 100644 --- a/tests/Unit/Util/HmacSignatureTest.php +++ b/tests/Unit/Util/HmacSignatureTest.php @@ -32,16 +32,16 @@ class HmacSignatureTest extends TestCase public function testNotificationRequestItemHmac() { $params = json_decode('{ - "pspReference": "7914073381342284", - "merchantAccountCode": "TestMerchant", - "merchantReference": "TestPayment-1407325143704", - "amount": { - "value": 1130, - "currency": "EUR" - }, - "eventCode": "AUTHORISATION", - "success": "true" - }', true); + "pspReference": "7914073381342284", + "merchantAccountCode": "TestMerchant", + "merchantReference": "TestPayment-1407325143704", + "amount": { + "value": 1130, + "currency": "EUR" + }, + "eventCode": "AUTHORISATION", + "success": "true" + }', true); $key = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00"; $hmac = new HmacSignature(); try { @@ -60,16 +60,16 @@ public function testNotificationRequestItemHmac() public function testHmacSignatureForRefundWithZeroValue() { $params = json_decode('{ - "pspReference": "7914073381342284", - "merchantAccountCode": "TestMerchant", - "merchantReference": "TestPayment-1407325143704", - "amount": { - "value": 0, - "currency": "EUR" - }, - "eventCode": "REFUND", - "success": "true" - }', true); + "pspReference": "7914073381342284", + "merchantAccountCode": "TestMerchant", + "merchantReference": "TestPayment-1407325143704", + "amount": { + "value": 0, + "currency": "EUR" + }, + "eventCode": "REFUND", + "success": "true" + }', true); $key = "44782DEF547AAA06C910C43932B1EB0C71FC68D9D0C057550C48EC2ACF6BA056"; $hmac = new HmacSignature(); try { @@ -133,16 +133,16 @@ public function testHmacSignatureEscaping() public function testIsHmacSupportedEventCode() { $params = json_decode('{ - "pspReference": "7914073381342284", - "merchantAccountCode": "TestMerchant", - "merchantReference": "TestPayment-1407325143704", - "amount": { - "value": 0, - "currency": "EUR" - }, - "eventCode": "AUTHORISATION", - "success": "true" - }', true); + "pspReference": "7914073381342284", + "merchantAccountCode": "TestMerchant", + "merchantReference": "TestPayment-1407325143704", + "amount": { + "value": 0, + "currency": "EUR" + }, + "eventCode": "AUTHORISATION", + "success": "true" + }', true); $hmac = new HmacSignature(); try { $hmacSupportedEventCode = $hmac->isHmacSupportedEventCode($params);