diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d171849..78e74f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,12 +19,12 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.3 + php-version: '8.1' - name: Install dependencies uses: php-actions/composer@v6 with: - php_version: 7.3 + php_version: '8.1' - name: Run tests env: diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index ec71086..c87a287 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,4 +1,4 @@ -.php_cs +.php-cs-fixer.dist.php docs/Api/AuditLogsApi.md docs/Api/BuyersApi.md docs/Api/DigitalWalletsApi.md @@ -8,6 +8,8 @@ docs/Api/PaymentOptionsApi.md docs/Api/PaymentServiceDefinitionsApi.md docs/Api/PaymentServicesApi.md docs/Api/TransactionsApi.md +docs/Model/Action.md +docs/Model/Actions.md docs/Model/Address.md docs/Model/ApplePayRequest.md docs/Model/ApplePaySessionRequest.md @@ -16,13 +18,21 @@ docs/Model/AuditLogResource.md docs/Model/AuditLogUser.md docs/Model/AuditLogs.md docs/Model/BillingDetails.md +docs/Model/BillingDetailsAddress.md docs/Model/BillingDetailsRequest.md +docs/Model/BillingDetailsRequestAddress.md +docs/Model/BillingDetailsTaxId.md docs/Model/BillingDetailsUpdateRequest.md +docs/Model/BillingDetailsUpdateRequestAddress.md docs/Model/BrowserInfo.md docs/Model/Buyer.md +docs/Model/BuyerBillingDetails.md docs/Model/BuyerRequest.md +docs/Model/BuyerRequestBillingDetails.md docs/Model/BuyerSnapshot.md +docs/Model/BuyerSnapshotBillingDetails.md docs/Model/BuyerUpdate.md +docs/Model/BuyerUpdateBillingDetails.md docs/Model/Buyers.md docs/Model/CardDetails.md docs/Model/CardRequest.md @@ -43,12 +53,18 @@ docs/Model/Error404PendingCreation.md docs/Model/Error409DuplicateRecord.md docs/Model/ErrorDetail.md docs/Model/ErrorGeneric.md +docs/Model/FlowPaymentOptionOutcome.md +docs/Model/FlowRuleBooleanOutcome.md +docs/Model/FlowRuleMethodOutcome.md +docs/Model/FlowRuleServiceOutcome.md docs/Model/GooglePayRequest.md docs/Model/GooglePaySessionRequest.md docs/Model/PaymentMethod.md +docs/Model/PaymentMethodBuyer.md docs/Model/PaymentMethodRequest.md docs/Model/PaymentMethodSnapshot.md docs/Model/PaymentMethodToken.md +docs/Model/PaymentMethodTokenPaymentService.md docs/Model/PaymentMethodTokenized.md docs/Model/PaymentMethodTokens.md docs/Model/PaymentMethods.md @@ -60,15 +76,15 @@ docs/Model/PaymentOptions.md docs/Model/PaymentService.md docs/Model/PaymentServiceDefinition.md docs/Model/PaymentServiceDefinitionConfiguration.md -docs/Model/PaymentServiceDefinitionFields.md +docs/Model/PaymentServiceDefinitionFieldsInner.md docs/Model/PaymentServiceDefinitionSupportedFeatures.md docs/Model/PaymentServiceDefinitions.md -docs/Model/PaymentServiceFields.md +docs/Model/PaymentServiceFieldsInner.md docs/Model/PaymentServiceRequest.md docs/Model/PaymentServiceRequestAllOf.md docs/Model/PaymentServiceSnapshot.md docs/Model/PaymentServiceUpdate.md -docs/Model/PaymentServiceUpdateFields.md +docs/Model/PaymentServiceUpdateFieldsInner.md docs/Model/PaymentServices.md docs/Model/RedirectRequest.md docs/Model/Refund.md @@ -86,10 +102,14 @@ docs/Model/ThreeDSecureDataV2AllOf.md docs/Model/ThreeDSecureSummary.md docs/Model/TokenizedRequest.md docs/Model/Transaction.md +docs/Model/TransactionBuyer.md docs/Model/TransactionCaptureRequest.md +docs/Model/TransactionPaymentMethod.md docs/Model/TransactionPaymentMethodRequest.md docs/Model/TransactionRefundRequest.md docs/Model/TransactionRequest.md +docs/Model/TransactionRequestBrowserInfo.md +docs/Model/TransactionStatementDescriptor.md docs/Model/TransactionSummary.md docs/Model/Transactions.md docs/Model/TransactionsBatchCaptureRequest.md @@ -107,6 +127,8 @@ lib/ApiException.php lib/Configuration.php lib/HeaderSelector.php lib/ObjectSerializer.php +lib/model/Action.php +lib/model/Actions.php lib/model/Address.php lib/model/ApplePayRequest.php lib/model/ApplePaySessionRequest.php @@ -115,13 +137,21 @@ lib/model/AuditLogResource.php lib/model/AuditLogUser.php lib/model/AuditLogs.php lib/model/BillingDetails.php +lib/model/BillingDetailsAddress.php lib/model/BillingDetailsRequest.php +lib/model/BillingDetailsRequestAddress.php +lib/model/BillingDetailsTaxId.php lib/model/BillingDetailsUpdateRequest.php +lib/model/BillingDetailsUpdateRequestAddress.php lib/model/BrowserInfo.php lib/model/Buyer.php +lib/model/BuyerBillingDetails.php lib/model/BuyerRequest.php +lib/model/BuyerRequestBillingDetails.php lib/model/BuyerSnapshot.php +lib/model/BuyerSnapshotBillingDetails.php lib/model/BuyerUpdate.php +lib/model/BuyerUpdateBillingDetails.php lib/model/Buyers.php lib/model/CardDetails.php lib/model/CardRequest.php @@ -142,13 +172,19 @@ lib/model/Error404PendingCreation.php lib/model/Error409DuplicateRecord.php lib/model/ErrorDetail.php lib/model/ErrorGeneric.php +lib/model/FlowPaymentOptionOutcome.php +lib/model/FlowRuleBooleanOutcome.php +lib/model/FlowRuleMethodOutcome.php +lib/model/FlowRuleServiceOutcome.php lib/model/GooglePayRequest.php lib/model/GooglePaySessionRequest.php lib/model/ModelInterface.php lib/model/PaymentMethod.php +lib/model/PaymentMethodBuyer.php lib/model/PaymentMethodRequest.php lib/model/PaymentMethodSnapshot.php lib/model/PaymentMethodToken.php +lib/model/PaymentMethodTokenPaymentService.php lib/model/PaymentMethodTokenized.php lib/model/PaymentMethodTokens.php lib/model/PaymentMethods.php @@ -160,15 +196,15 @@ lib/model/PaymentOptions.php lib/model/PaymentService.php lib/model/PaymentServiceDefinition.php lib/model/PaymentServiceDefinitionConfiguration.php -lib/model/PaymentServiceDefinitionFields.php +lib/model/PaymentServiceDefinitionFieldsInner.php lib/model/PaymentServiceDefinitionSupportedFeatures.php lib/model/PaymentServiceDefinitions.php -lib/model/PaymentServiceFields.php +lib/model/PaymentServiceFieldsInner.php lib/model/PaymentServiceRequest.php lib/model/PaymentServiceRequestAllOf.php lib/model/PaymentServiceSnapshot.php lib/model/PaymentServiceUpdate.php -lib/model/PaymentServiceUpdateFields.php +lib/model/PaymentServiceUpdateFieldsInner.php lib/model/PaymentServices.php lib/model/RedirectRequest.php lib/model/Refund.php @@ -186,10 +222,14 @@ lib/model/ThreeDSecureDataV2AllOf.php lib/model/ThreeDSecureSummary.php lib/model/TokenizedRequest.php lib/model/Transaction.php +lib/model/TransactionBuyer.php lib/model/TransactionCaptureRequest.php +lib/model/TransactionPaymentMethod.php lib/model/TransactionPaymentMethodRequest.php lib/model/TransactionRefundRequest.php lib/model/TransactionRequest.php +lib/model/TransactionRequestBrowserInfo.php +lib/model/TransactionStatementDescriptor.php lib/model/TransactionSummary.php lib/model/Transactions.php lib/model/TransactionsBatchCaptureRequest.php diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 1e20ec3..f4965a3 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -5.4.0 \ No newline at end of file +6.0.0 \ No newline at end of file diff --git a/.openapi-generator/replace.sh b/.openapi-generator/replace.sh index fb1e48b..eea40f9 100644 --- a/.openapi-generator/replace.sh +++ b/.openapi-generator/replace.sh @@ -15,6 +15,10 @@ var1="'buyer' => 'BuyerSnapshot'," rep1="'buyer' => '\\\Gr4vy\\\model\\\BuyerSnapshot'," sed -i '' "s/$var1/$rep1/g" lib/model/*.php +var1="'statement_descriptor' => 'StatementDescriptor'," +rep1="'statement_descriptor' => '\\\Gr4vy\\\model\\\StatementDescriptor'," +sed -i '' "s/$var1/$rep1/g" lib/model/*.php + var1="'billing_details' => 'BillingDetails'," rep1="'billing_details' => '\\\Gr4vy\\\model\\\BillingDetails'," sed -i '' "s/$var1/$rep1/g" lib/model/*.php diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..af9cf39 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,29 @@ +in(__DIR__) + ->exclude('vendor') + ->exclude('test') + ->exclude('tests') +; + +$config = new PhpCsFixer\Config(); +return $config->setRules([ + '@PSR12' => true, + 'phpdoc_order' => true, + 'array_syntax' => [ 'syntax' => 'short' ], + 'strict_comparison' => true, + 'strict_param' => true, + 'no_trailing_whitespace' => false, + 'no_trailing_whitespace_in_comment' => false, + 'braces' => false, + 'single_blank_line_at_eof' => false, + 'blank_line_after_namespace' => false, + 'no_leading_import_slash' => false, + ]) + ->setFinder($finder) +; diff --git a/composer.json b/composer.json index d5066de..b1e2b70 100644 --- a/composer.json +++ b/composer.json @@ -20,12 +20,12 @@ } ], "require": { - "php": ">=7.2", + "php": ">=7.3", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", "guzzlehttp/guzzle": "^7.4.4", - "lcobucci/jwt": "^3.4.6" + "lcobucci/jwt": "^4.1.5" }, "require-dev": { "phpunit/phpunit": "^9.5.20", diff --git a/composer.lock b/composer.lock index bf9df1b..687743e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,26 +4,26 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b649e87606da6766de24649d1ecc7bdf", + "content-hash": "db9da062b528dc7ae208fb30342728b1", "packages": [ { "name": "guzzlehttp/guzzle", - "version": "7.4.4", + "version": "7.4.5", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "e3ff079b22820c2029d4c2a87796b6a0b8716ad8" + "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82" }, "dist": { "type": "zip", - "url": "https://github.com/repos/guzzle/guzzle/zipball/e3ff079b22820c2029d4c2a87796b6a0b8716ad8", - "reference": "e3ff079b22820c2029d4c2a87796b6a0b8716ad8", + "url": "https://github.com/repos/guzzle/guzzle/zipball/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", + "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/promises": "^1.5", - "guzzlehttp/psr7": "^1.8.3 || ^2.1", + "guzzlehttp/psr7": "^1.9 || ^2.4", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -112,7 +112,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.4" + "source": "https://github.com/guzzle/guzzle/tree/7.4.5" }, "funding": [ { @@ -128,7 +128,7 @@ "type": "tidelift" } ], - "time": "2022-06-09T21:39:15+00:00" + "time": "2022-06-20T22:16:13+00:00" }, { "name": "guzzlehttp/promises", @@ -216,16 +216,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.3.0", + "version": "2.4.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "83260bb50b8fc753c72d14dc1621a2dac31877ee" + "reference": "13388f00956b1503577598873fffb5ae994b5737" }, "dist": { "type": "zip", - "url": "https://github.com/repos/guzzle/psr7/zipball/83260bb50b8fc753c72d14dc1621a2dac31877ee", - "reference": "83260bb50b8fc753c72d14dc1621a2dac31877ee", + "url": "https://github.com/repos/guzzle/psr7/zipball/13388f00956b1503577598873fffb5ae994b5737", + "reference": "13388f00956b1503577598873fffb5ae994b5737", "shasum": "" }, "require": { @@ -249,7 +249,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-master": "2.4-dev" } }, "autoload": { @@ -311,7 +311,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.3.0" + "source": "https://github.com/guzzle/psr7/tree/2.4.0" }, "funding": [ { @@ -327,49 +327,107 @@ "type": "tidelift" } ], - "time": "2022-06-09T08:26:02+00:00" + "time": "2022-06-20T21:43:11+00:00" + }, + { + "name": "lcobucci/clock", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/lcobucci/clock.git", + "reference": "fb533e093fd61321bfcbac08b131ce805fe183d3" + }, + "dist": { + "type": "zip", + "url": "https://github.com/repos/lcobucci/clock/zipball/fb533e093fd61321bfcbac08b131ce805fe183d3", + "reference": "fb533e093fd61321bfcbac08b131ce805fe183d3", + "shasum": "" + }, + "require": { + "php": "^8.0", + "stella-maris/clock": "^0.1.4" + }, + "require-dev": { + "infection/infection": "^0.26", + "lcobucci/coding-standard": "^8.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-deprecation-rules": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Lcobucci\\Clock\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Luís Cobucci", + "email": "lcobucci@gmail.com" + } + ], + "description": "Yet another clock abstraction", + "support": { + "issues": "https://github.com/lcobucci/clock/issues", + "source": "https://github.com/lcobucci/clock/tree/2.2.0" + }, + "funding": [ + { + "url": "https://github.com/lcobucci", + "type": "github" + }, + { + "url": "https://www.patreon.com/lcobucci", + "type": "patreon" + } + ], + "time": "2022-04-19T19:34:17+00:00" }, { "name": "lcobucci/jwt", - "version": "3.4.6", + "version": "4.1.5", "source": { "type": "git", "url": "https://github.com/lcobucci/jwt.git", - "reference": "3ef8657a78278dfeae7707d51747251db4176240" + "reference": "fe2d89f2eaa7087af4aa166c6f480ef04e000582" }, "dist": { "type": "zip", - "url": "https://github.com/repos/lcobucci/jwt/zipball/3ef8657a78278dfeae7707d51747251db4176240", - "reference": "3ef8657a78278dfeae7707d51747251db4176240", + "url": "https://github.com/repos/lcobucci/jwt/zipball/fe2d89f2eaa7087af4aa166c6f480ef04e000582", + "reference": "fe2d89f2eaa7087af4aa166c6f480ef04e000582", "shasum": "" }, "require": { + "ext-hash": "*", + "ext-json": "*", "ext-mbstring": "*", "ext-openssl": "*", - "php": "^5.6 || ^7.0" + "ext-sodium": "*", + "lcobucci/clock": "^2.0", + "php": "^7.4 || ^8.0" }, "require-dev": { - "mikey179/vfsstream": "~1.5", - "phpmd/phpmd": "~2.2", - "phpunit/php-invoker": "~1.1", - "phpunit/phpunit": "^5.7 || ^7.3", - "squizlabs/php_codesniffer": "~2.3" - }, - "suggest": { - "lcobucci/clock": "*" + "infection/infection": "^0.21", + "lcobucci/coding-standard": "^6.0", + "mikey179/vfsstream": "^1.6.7", + "phpbench/phpbench": "^1.0", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-deprecation-rules": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/php-invoker": "^3.1", + "phpunit/phpunit": "^9.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, "autoload": { - "files": [ - "compat/class-aliases.php", - "compat/json-exception-polyfill.php", - "compat/lcobucci-clock-polyfill.php" - ], "psr-4": { "Lcobucci\\JWT\\": "src" } @@ -380,7 +438,7 @@ ], "authors": [ { - "name": "Luís Otávio Cobucci Oblonczyk", + "name": "Luís Cobucci", "email": "lcobucci@gmail.com", "role": "Developer" } @@ -392,7 +450,7 @@ ], "support": { "issues": "https://github.com/lcobucci/jwt/issues", - "source": "https://github.com/lcobucci/jwt/tree/3.4.6" + "source": "https://github.com/lcobucci/jwt/tree/4.1.5" }, "funding": [ { @@ -404,7 +462,7 @@ "type": "patreon" } ], - "time": "2021-09-28T19:18:28+00:00" + "time": "2021-09-28T19:34:56+00:00" }, { "name": "psr/http-client", @@ -610,27 +668,74 @@ }, "time": "2019-03-08T08:55:37+00:00" }, + { + "name": "stella-maris/clock", + "version": "0.1.4", + "source": { + "type": "git", + "url": "https://gitlab.com/stella-maris/clock.git", + "reference": "8a0a967896df4c63417385dc69328a0aec84d9cf" + }, + "dist": { + "type": "zip", + "url": "https://gitlab.com/api/v4/projects/stella-maris%2Fclock/repository/archive.zip?sha=8a0a967896df4c63417385dc69328a0aec84d9cf", + "reference": "8a0a967896df4c63417385dc69328a0aec84d9cf", + "shasum": "" + }, + "require": { + "php": "^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "StellaMaris\\Clock\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Heigl", + "role": "Maintainer" + } + ], + "description": "A pre-release of the proposed PSR-20 Clock-Interface", + "homepage": "https://gitlab.com/stella-maris/clock", + "keywords": [ + "clock", + "datetime", + "point in time", + "psr20" + ], + "support": { + "issues": "https://gitlab.com/stella-maris/clock/-/issues", + "source": "https://gitlab.com/stella-maris/clock/-/tree/0.1.4" + }, + "time": "2022-04-17T14:12:26+00:00" + }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.1", + "version": "v3.1.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918" }, "dist": { "type": "zip", - "url": "https://github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "url": "https://github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.1-dev" }, "thanks": { "name": "symfony/contracts", @@ -659,7 +764,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.1" }, "funding": [ { @@ -675,36 +780,36 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-02-25T11:15:52+00:00" } ], "packages-dev": [ { "name": "composer/pcre", - "version": "1.0.1", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" + "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd" }, "dist": { "type": "zip", - "url": "https://github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "url": "https://github.com/repos/composer/pcre/zipball/e300eb6c535192decd27a85bc72a9290f0d6b3bd", + "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "phpstan/phpstan": "^1.3", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5" + "symfony/phpunit-bridge": "^5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { @@ -732,7 +837,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/1.0.1" + "source": "https://github.com/composer/pcre/tree/3.0.0" }, "funding": [ { @@ -748,7 +853,7 @@ "type": "tidelift" } ], - "time": "2022-01-21T20:24:37+00:00" + "time": "2022-02-25T20:21:48+00:00" }, { "name": "composer/semver", @@ -833,27 +938,27 @@ }, { "name": "composer/xdebug-handler", - "version": "2.0.5", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a" + "reference": "ced299686f41dce890debac69273b47ffe98a40c" }, "dist": { "type": "zip", - "url": "https://github.com/repos/composer/xdebug-handler/zipball/9e36aeed4616366d2b690bdce11f71e9178c579a", - "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a", + "url": "https://github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", "shasum": "" }, "require": { - "composer/pcre": "^1", - "php": "^5.3.2 || ^7.0 || ^8.0", + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", "psr/log": "^1 || ^2 || ^3" }, "require-dev": { "phpstan/phpstan": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" + "symfony/phpunit-bridge": "^6.0" }, "type": "library", "autoload": { @@ -879,7 +984,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.5" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" }, "funding": [ { @@ -895,7 +1000,7 @@ "type": "tidelift" } ], - "time": "2022-02-24T20:20:32+00:00" + "time": "2022-02-25T21:32:43+00:00" }, { "name": "doctrine/annotations", @@ -1117,52 +1222,52 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.4.0", + "version": "v3.8.0", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "47177af1cfb9dab5d1cc4daf91b7179c2efe7fad" + "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3" }, "dist": { "type": "zip", - "url": "https://github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/47177af1cfb9dab5d1cc4daf91b7179c2efe7fad", - "reference": "47177af1cfb9dab5d1cc4daf91b7179c2efe7fad", + "url": "https://github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3", + "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3", "shasum": "" }, "require": { "composer/semver": "^3.2", - "composer/xdebug-handler": "^2.0", - "doctrine/annotations": "^1.12", + "composer/xdebug-handler": "^3.0.3", + "doctrine/annotations": "^1.13", "ext-json": "*", "ext-tokenizer": "*", - "php": "^7.2.5 || ^8.0", + "php": "^7.4 || ^8.0", "php-cs-fixer/diff": "^2.0", - "symfony/console": "^4.4.20 || ^5.1.3 || ^6.0", - "symfony/event-dispatcher": "^4.4.20 || ^5.0 || ^6.0", - "symfony/filesystem": "^4.4.20 || ^5.0 || ^6.0", - "symfony/finder": "^4.4.20 || ^5.0 || ^6.0", - "symfony/options-resolver": "^4.4.20 || ^5.0 || ^6.0", + "symfony/console": "^5.4 || ^6.0", + "symfony/event-dispatcher": "^5.4 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0", + "symfony/options-resolver": "^5.4 || ^6.0", "symfony/polyfill-mbstring": "^1.23", - "symfony/polyfill-php80": "^1.23", - "symfony/polyfill-php81": "^1.23", - "symfony/process": "^4.4.20 || ^5.0 || ^6.0", - "symfony/stopwatch": "^4.4.20 || ^5.0 || ^6.0" + "symfony/polyfill-php80": "^1.25", + "symfony/polyfill-php81": "^1.25", + "symfony/process": "^5.4 || ^6.0", + "symfony/stopwatch": "^5.4 || ^6.0" }, "require-dev": { "justinrainbow/json-schema": "^5.2", "keradus/cli-executor": "^1.5", - "mikey179/vfsstream": "^1.6.8", + "mikey179/vfsstream": "^1.6.10", "php-coveralls/php-coveralls": "^2.5.2", "php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", "phpspec/prophecy": "^1.15", - "phpspec/prophecy-phpunit": "^1.1 || ^2.0", - "phpunit/phpunit": "^8.5.21 || ^9.5", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", "phpunitgoodpractices/polyfill": "^1.5", "phpunitgoodpractices/traits": "^1.9.1", - "symfony/phpunit-bridge": "^5.2.4 || ^6.0", - "symfony/yaml": "^4.4.20 || ^5.0 || ^6.0" + "symfony/phpunit-bridge": "^6.0", + "symfony/yaml": "^5.4 || ^6.0" }, "suggest": { "ext-dom": "For handling output formats in XML", @@ -1194,7 +1299,7 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.4.0" + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.8.0" }, "funding": [ { @@ -1202,7 +1307,7 @@ "type": "github" } ], - "time": "2021-12-11T16:25:08+00:00" + "time": "2022-03-18T17:20:59+00:00" }, { "name": "myclabs/deep-copy", @@ -2029,16 +2134,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.20", + "version": "9.5.21", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba" + "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1" }, "dist": { "type": "zip", - "url": "https://github.com/repos/sebastianbergmann/phpunit/zipball/12bc8879fb65aef2138b26fc633cb1e3620cffba", - "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba", + "url": "https://github.com/repos/sebastianbergmann/phpunit/zipball/0e32b76be457de00e83213528f6bb37e2a38fcb1", + "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1", "shasum": "" }, "require": { @@ -2072,7 +2177,6 @@ "sebastian/version": "^3.0.2" }, "require-dev": { - "ext-pdo": "*", "phpspec/prophecy-phpunit": "^2.0.1" }, "suggest": { @@ -2116,7 +2220,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.20" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.21" }, "funding": [ { @@ -2128,24 +2232,24 @@ "type": "github" } ], - "time": "2022-04-01T12:37:26+00:00" + "time": "2022-06-19T12:14:25+00:00" }, { "name": "psr/cache", - "version": "1.0.1", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/cache.git", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" }, "dist": { "type": "zip", - "url": "https://github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "url": "https://github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { @@ -2165,7 +2269,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for caching libraries", @@ -2175,28 +2279,33 @@ "psr-6" ], "support": { - "source": "https://github.com/php-fig/cache/tree/master" + "source": "https://github.com/php-fig/cache/tree/3.0.0" }, - "time": "2016-08-06T20:24:11+00:00" + "time": "2021-02-03T23:26:27+00:00" }, { "name": "psr/container", - "version": "1.1.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "url": "https://github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -2223,9 +2332,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2021-03-05T17:36:06+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { "name": "psr/event-dispatcher", @@ -2279,30 +2388,30 @@ }, { "name": "psr/log", - "version": "1.1.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" }, "dist": { "type": "zip", - "url": "https://github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -2323,9 +2432,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "source": "https://github.com/php-fig/log/tree/3.0.0" }, - "time": "2021-05-03T11:20:27+00:00" + "time": "2021-07-14T16:46:02+00:00" }, { "name": "sebastian/cli-parser", @@ -3293,46 +3402,43 @@ }, { "name": "symfony/console", - "version": "v5.4.9", + "version": "v6.1.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb" + "reference": "7a86c1c42fbcb69b59768504c7bca1d3767760b7" }, "dist": { "type": "zip", - "url": "https://github.com/repos/symfony/console/zipball/829d5d1bf60b2efeb0887b7436873becc71a45eb", - "reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb", + "url": "https://github.com/repos/symfony/console/zipball/7a86c1c42fbcb69b59768504c7bca1d3767760b7", + "reference": "7a86c1c42fbcb69b59768504c7bca1d3767760b7", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" + "symfony/string": "^5.4|^6.0" }, "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" }, "provide": { - "psr/log-implementation": "1.0|2.0" + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/event-dispatcher": "^5.4|^6.0", + "symfony/lock": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/var-dumper": "^5.4|^6.0" }, "suggest": { "psr/log": "For using the console logger", @@ -3372,7 +3478,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.9" + "source": "https://github.com/symfony/console/tree/v6.1.2" }, "funding": [ { @@ -3388,44 +3494,42 @@ "type": "tidelift" } ], - "time": "2022-05-18T06:17:34+00:00" + "time": "2022-06-26T13:01:30+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.4.9", + "version": "v6.1.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc" + "reference": "a0449a7ad7daa0f7c0acd508259f80544ab5a347" }, "dist": { "type": "zip", - "url": "https://github.com/repos/symfony/event-dispatcher/zipball/8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc", - "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc", + "url": "https://github.com/repos/symfony/event-dispatcher/zipball/a0449a7ad7daa0f7c0acd508259f80544ab5a347", + "reference": "a0449a7ad7daa0f7c0acd508259f80544ab5a347", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/event-dispatcher-contracts": "^2|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1", + "symfony/event-dispatcher-contracts": "^2|^3" }, "conflict": { - "symfony/dependency-injection": "<4.4" + "symfony/dependency-injection": "<5.4" }, "provide": { "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0" + "symfony/event-dispatcher-implementation": "2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/error-handler": "^5.4|^6.0", + "symfony/expression-language": "^5.4|^6.0", + "symfony/http-foundation": "^5.4|^6.0", "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^4.4|^5.0|^6.0" + "symfony/stopwatch": "^5.4|^6.0" }, "suggest": { "symfony/dependency-injection": "", @@ -3457,7 +3561,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.9" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.1.0" }, "funding": [ { @@ -3473,24 +3577,24 @@ "type": "tidelift" } ], - "time": "2022-05-05T16:45:39+00:00" + "time": "2022-05-05T16:51:07+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.5.1", + "version": "v3.1.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1" + "reference": "02ff5eea2f453731cfbc6bc215e456b781480448" }, "dist": { "type": "zip", - "url": "https://github.com/repos/symfony/event-dispatcher-contracts/zipball/f98b54df6ad059855739db6fcbc2d36995283fe1", - "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1", + "url": "https://github.com/repos/symfony/event-dispatcher-contracts/zipball/02ff5eea2f453731cfbc6bc215e456b781480448", + "reference": "02ff5eea2f453731cfbc6bc215e456b781480448", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "psr/event-dispatcher": "^1" }, "suggest": { @@ -3499,7 +3603,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.1-dev" }, "thanks": { "name": "symfony/contracts", @@ -3536,7 +3640,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.1" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.1.1" }, "funding": [ { @@ -3552,27 +3656,26 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-02-25T11:15:52+00:00" }, { "name": "symfony/filesystem", - "version": "v5.4.9", + "version": "v6.1.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "36a017fa4cce1eff1b8e8129ff53513abcef05ba" + "reference": "3132d2f43ca799c2aa099f9738d98228c56baa5d" }, "dist": { "type": "zip", - "url": "https://github.com/repos/symfony/filesystem/zipball/36a017fa4cce1eff1b8e8129ff53513abcef05ba", - "reference": "36a017fa4cce1eff1b8e8129ff53513abcef05ba", + "url": "https://github.com/repos/symfony/filesystem/zipball/3132d2f43ca799c2aa099f9738d98228c56baa5d", + "reference": "3132d2f43ca799c2aa099f9738d98228c56baa5d", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8", - "symfony/polyfill-php80": "^1.16" + "symfony/polyfill-mbstring": "~1.8" }, "type": "library", "autoload": { @@ -3600,7 +3703,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.9" + "source": "https://github.com/symfony/filesystem/tree/v6.1.0" }, "funding": [ { @@ -3616,26 +3719,27 @@ "type": "tidelift" } ], - "time": "2022-05-20T13:55:35+00:00" + "time": "2022-05-21T13:34:40+00:00" }, { "name": "symfony/finder", - "version": "v5.4.8", + "version": "v6.1.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9" + "reference": "45b8beb69d6eb3b05a65689ebfd4222326773f8f" }, "dist": { "type": "zip", - "url": "https://github.com/repos/symfony/finder/zipball/9b630f3427f3ebe7cd346c277a1408b00249dad9", - "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9", + "url": "https://github.com/repos/symfony/finder/zipball/45b8beb69d6eb3b05a65689ebfd4222326773f8f", + "reference": "45b8beb69d6eb3b05a65689ebfd4222326773f8f", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1" + }, + "require-dev": { + "symfony/filesystem": "^6.0" }, "type": "library", "autoload": { @@ -3663,7 +3767,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.8" + "source": "https://github.com/symfony/finder/tree/v6.1.0" }, "funding": [ { @@ -3679,27 +3783,25 @@ "type": "tidelift" } ], - "time": "2022-04-15T08:07:45+00:00" + "time": "2022-04-15T08:08:08+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.4.3", + "version": "v6.1.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "cc1147cb11af1b43f503ac18f31aa3bec213aba8" + "reference": "a3016f5442e28386ded73c43a32a5b68586dd1c4" }, "dist": { "type": "zip", - "url": "https://github.com/repos/symfony/options-resolver/zipball/cc1147cb11af1b43f503ac18f31aa3bec213aba8", - "reference": "cc1147cb11af1b43f503ac18f31aa3bec213aba8", + "url": "https://github.com/repos/symfony/options-resolver/zipball/a3016f5442e28386ded73c43a32a5b68586dd1c4", + "reference": "a3016f5442e28386ded73c43a32a5b68586dd1c4", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.1|^3" }, "type": "library", "autoload": { @@ -3732,7 +3834,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.3" + "source": "https://github.com/symfony/options-resolver/tree/v6.1.0" }, "funding": [ { @@ -3748,7 +3850,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-02-25T11:15:52+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4080,85 +4182,6 @@ ], "time": "2022-05-24T11:49:31+00:00" }, - { - "name": "symfony/polyfill-php73", - "version": "v1.26.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85" - }, - "dist": { - "type": "zip", - "url": "https://github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85", - "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-24T11:49:31+00:00" - }, { "name": "symfony/polyfill-php80", "version": "v1.26.0", @@ -4323,21 +4346,20 @@ }, { "name": "symfony/process", - "version": "v5.4.8", + "version": "v6.1.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "597f3fff8e3e91836bb0bd38f5718b56ddbde2f3" + "reference": "318718453c2be58266f1a9e74063d13cb8dd4165" }, "dist": { "type": "zip", - "url": "https://github.com/repos/symfony/process/zipball/597f3fff8e3e91836bb0bd38f5718b56ddbde2f3", - "reference": "597f3fff8e3e91836bb0bd38f5718b56ddbde2f3", + "url": "https://github.com/repos/symfony/process/zipball/318718453c2be58266f1a9e74063d13cb8dd4165", + "reference": "318718453c2be58266f1a9e74063d13cb8dd4165", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1" }, "type": "library", "autoload": { @@ -4365,7 +4387,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.8" + "source": "https://github.com/symfony/process/tree/v6.1.0" }, "funding": [ { @@ -4381,26 +4403,25 @@ "type": "tidelift" } ], - "time": "2022-04-08T05:07:18+00:00" + "time": "2022-05-11T12:12:29+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.5.1", + "version": "v3.1.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c" + "reference": "925e713fe8fcacf6bc05e936edd8dd5441a21239" }, "dist": { "type": "zip", - "url": "https://github.com/repos/symfony/service-contracts/zipball/24d9dc654b83e91aa59f9d167b131bc3b5bea24c", - "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c", + "url": "https://github.com/repos/symfony/service-contracts/zipball/925e713fe8fcacf6bc05e936edd8dd5441a21239", + "reference": "925e713fe8fcacf6bc05e936edd8dd5441a21239", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" + "php": ">=8.1", + "psr/container": "^2.0" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -4411,7 +4432,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.1-dev" }, "thanks": { "name": "symfony/contracts", @@ -4421,7 +4442,10 @@ "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4448,7 +4472,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.1.1" }, "funding": [ { @@ -4464,24 +4488,24 @@ "type": "tidelift" } ], - "time": "2022-03-13T20:07:29+00:00" + "time": "2022-05-30T19:18:58+00:00" }, { "name": "symfony/stopwatch", - "version": "v5.4.5", + "version": "v6.1.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "4d04b5c24f3c9a1a168a131f6cbe297155bc0d30" + "reference": "77dedae82ce2a26e2e9b481855473fc3b3e4e54d" }, "dist": { "type": "zip", - "url": "https://github.com/repos/symfony/stopwatch/zipball/4d04b5c24f3c9a1a168a131f6cbe297155bc0d30", - "reference": "4d04b5c24f3c9a1a168a131f6cbe297155bc0d30", + "url": "https://github.com/repos/symfony/stopwatch/zipball/77dedae82ce2a26e2e9b481855473fc3b3e4e54d", + "reference": "77dedae82ce2a26e2e9b481855473fc3b3e4e54d", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "symfony/service-contracts": "^1|^2|^3" }, "type": "library", @@ -4510,7 +4534,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.5" + "source": "https://github.com/symfony/stopwatch/tree/v6.1.0" }, "funding": [ { @@ -4526,38 +4550,37 @@ "type": "tidelift" } ], - "time": "2022-02-18T16:06:09+00:00" + "time": "2022-02-25T11:15:52+00:00" }, { "name": "symfony/string", - "version": "v5.4.9", + "version": "v6.1.2", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99" + "reference": "1903f2879875280c5af944625e8246d81c2f0604" }, "dist": { "type": "zip", - "url": "https://github.com/repos/symfony/string/zipball/985e6a9703ef5ce32ba617c9c7d97873bb7b2a99", - "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99", + "url": "https://github.com/repos/symfony/string/zipball/1903f2879875280c5af944625e8246d81c2f0604", + "reference": "1903f2879875280c5af944625e8246d81c2f0604", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": ">=3.0" + "symfony/translation-contracts": "<2.0" }, "require-dev": { - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0|^6.0" + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/translation-contracts": "^2.0|^3.0", + "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", "autoload": { @@ -4596,7 +4619,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.9" + "source": "https://github.com/symfony/string/tree/v6.1.2" }, "funding": [ { @@ -4612,7 +4635,7 @@ "type": "tidelift" } ], - "time": "2022-04-19T10:40:37+00:00" + "time": "2022-06-26T16:35:04+00:00" }, { "name": "theseer/tokenizer", @@ -4729,11 +4752,11 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.2", + "php": ">=7.3", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.0.0" } diff --git a/docs/Api/TransactionsApi.md b/docs/Api/TransactionsApi.md index 776c244..2061e0b 100644 --- a/docs/Api/TransactionsApi.md +++ b/docs/Api/TransactionsApi.md @@ -7,6 +7,7 @@ Method | HTTP request | Description [**authorizeNewTransaction()**](TransactionsApi.md#authorizeNewTransaction) | **POST** /transactions | New transaction [**captureTransaction()**](TransactionsApi.md#captureTransaction) | **POST** /transactions/{transaction_id}/capture | Capture transaction [**getTransaction()**](TransactionsApi.md#getTransaction) | **GET** /transactions/{transaction_id} | Get transaction +[**getTransactionActions()**](TransactionsApi.md#getTransactionActions) | **GET** /transactions/{transaction_id}/actions | Get transaction actions [**getTransactionRefund()**](TransactionsApi.md#getTransactionRefund) | **GET** /transactions/{transaction_id}/refunds/{refund_id} | Get transaction refund [**listTransactionRefunds()**](TransactionsApi.md#listTransactionRefunds) | **GET** /transactions/{transaction_id}/refunds | List transaction refunds [**listTransactions()**](TransactionsApi.md#listTransactions) | **GET** /transactions | List transactions @@ -196,6 +197,66 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `getTransactionActions()` + +```php +getTransactionActions($transaction_id): \Gr4vy\model\Actions +``` + +Get transaction actions + +Gets actions for a given transaction. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Gr4vy\Api\TransactionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$transaction_id = fe26475d-ec3e-4884-9553-f7356683f7f9; // string | The ID for the transaction to get the information for. + +try { + $result = $apiInstance->getTransactionActions($transaction_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TransactionsApi->getTransactionActions: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **transaction_id** | **string**| The ID for the transaction to get the information for. | + +### Return type + +[**\Gr4vy\model\Actions**](../Model/Actions.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `getTransactionRefund()` ```php diff --git a/docs/Model/Action.md b/docs/Model/Action.md new file mode 100644 index 0000000..ea83f6c --- /dev/null +++ b/docs/Model/Action.md @@ -0,0 +1,14 @@ +# # Action + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | The type of this resource. Is always `action`. | [optional] +**id** | **string** | The identifier for the action. | [optional] +**flow** | **string** | The related flow for the action. | [optional] +**rule_id** | **string** | The unique ID of the rule triggered. | [optional] +**created_at** | **\DateTime** | The date and time when this action was created. | [optional] +**outcome** | [**\Gr4vy\model\Undefined**](Undefined.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Actions.md b/docs/Model/Actions.md new file mode 100644 index 0000000..4211c95 --- /dev/null +++ b/docs/Model/Actions.md @@ -0,0 +1,9 @@ +# # Actions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**\Gr4vy\model\Action[]**](Action.md) | A list of actions. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BillingDetails.md b/docs/Model/BillingDetails.md index bd4b09d..c4054ec 100644 --- a/docs/Model/BillingDetails.md +++ b/docs/Model/BillingDetails.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **last_name** | **string** | The last name, or family name, of the buyer. | [optional] **email_address** | **string** | The email address of the buyer. | [optional] **phone_number** | **string** | The phone number of the buyer. This number is formatted according to the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). | [optional] -**address** | [**Address**](Address.md) | | [optional] -**tax_id** | [**TaxId**](TaxId.md) | | [optional] +**address** | [**\Gr4vy\model\BillingDetailsAddress**](BillingDetailsAddress.md) | | [optional] +**tax_id** | [**\Gr4vy\model\BillingDetailsTaxId**](BillingDetailsTaxId.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BillingDetailsAddress.md b/docs/Model/BillingDetailsAddress.md new file mode 100644 index 0000000..4cb5722 --- /dev/null +++ b/docs/Model/BillingDetailsAddress.md @@ -0,0 +1,17 @@ +# # BillingDetailsAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**city** | **string** | The city for the billing address. | [optional] +**country** | **string** | The country for the billing address. | [optional] +**postal_code** | **string** | The postal code or zip code for the billing address. | [optional] +**state** | **string** | The state, county, or province for the billing address. | [optional] +**state_code** | **string** | The code of state, county, or province for the billing address in ISO 3166-2 format. | [optional] +**house_number_or_name** | **string** | The house number or name for the billing address. Not all payment services use this field but some do. | [optional] +**line1** | **string** | The first line of the billing address. | [optional] +**line2** | **string** | The second line of the billing address. | [optional] +**organization** | **string** | The optional name of the company or organisation to add to the billing address. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BillingDetailsRequest.md b/docs/Model/BillingDetailsRequest.md index 8a118f6..cab19c8 100644 --- a/docs/Model/BillingDetailsRequest.md +++ b/docs/Model/BillingDetailsRequest.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **last_name** | **string** | The last name, or family name, of the buyer. | [optional] **email_address** | **string** | The email address for the buyer. | [optional] **phone_number** | **string** | The phone number for the buyer which should be formatted according to the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). | [optional] -**address** | [**Address**](Address.md) | The billing address for the buyer. | [optional] -**tax_id** | [**TaxId**](TaxId.md) | | [optional] +**address** | [**\Gr4vy\model\BillingDetailsRequestAddress**](BillingDetailsRequestAddress.md) | | [optional] +**tax_id** | [**\Gr4vy\model\BillingDetailsTaxId**](BillingDetailsTaxId.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BillingDetailsRequestAddress.md b/docs/Model/BillingDetailsRequestAddress.md new file mode 100644 index 0000000..8701f93 --- /dev/null +++ b/docs/Model/BillingDetailsRequestAddress.md @@ -0,0 +1,17 @@ +# # BillingDetailsRequestAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**city** | **string** | The city for the billing address. | +**country** | **string** | The country for the billing address. | +**postal_code** | **string** | The postal code or zip code for the billing address. | +**state** | **string** | The state, county, or province for the billing address. | +**state_code** | **string** | The code of state, county, or province for the billing address in ISO 3166-2 format. | [optional] +**house_number_or_name** | **string** | The house number or name for the billing address. Not all payment services use this field but some do. | [optional] +**line1** | **string** | The first line of the billing address. | +**line2** | **string** | The second line of the billing address. | [optional] +**organization** | **string** | The optional name of the company or organisation to add to the billing address. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BillingDetailsTaxId.md b/docs/Model/BillingDetailsTaxId.md new file mode 100644 index 0000000..7ce9a34 --- /dev/null +++ b/docs/Model/BillingDetailsTaxId.md @@ -0,0 +1,10 @@ +# # BillingDetailsTaxId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **string** | The tax ID for the buyer. | +**kind** | **string** | The kind of tax ID. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BillingDetailsUpdateRequest.md b/docs/Model/BillingDetailsUpdateRequest.md index d317ea8..f5a50af 100644 --- a/docs/Model/BillingDetailsUpdateRequest.md +++ b/docs/Model/BillingDetailsUpdateRequest.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **last_name** | **string** | The last name, or family name, of the buyer. | [optional] **email_address** | **string** | The email address for the buyer. | [optional] **phone_number** | **string** | The phone number for the buyer which should be formatted according to the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). | [optional] -**address** | [**Address**](Address.md) | The billing address for the buyer. | [optional] -**tax_id** | [**TaxId**](TaxId.md) | | [optional] +**address** | [**\Gr4vy\model\BillingDetailsUpdateRequestAddress**](BillingDetailsUpdateRequestAddress.md) | | [optional] +**tax_id** | [**\Gr4vy\model\BillingDetailsTaxId**](BillingDetailsTaxId.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BillingDetailsUpdateRequestAddress.md b/docs/Model/BillingDetailsUpdateRequestAddress.md new file mode 100644 index 0000000..084128e --- /dev/null +++ b/docs/Model/BillingDetailsUpdateRequestAddress.md @@ -0,0 +1,17 @@ +# # BillingDetailsUpdateRequestAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**city** | **string** | The city for the billing address. | [optional] +**country** | **string** | The country for the billing address. | [optional] +**postal_code** | **string** | The postal code or zip code for the billing address. | [optional] +**state** | **string** | The state, county, or province for the billing address. | [optional] +**state_code** | **string** | The code of state, county, or province for the billing address in ISO 3166-2 format. | [optional] +**house_number_or_name** | **string** | The house number or name for the billing address. Not all payment services use this field but some do. | [optional] +**line1** | **string** | The first line of the billing address. | [optional] +**line2** | **string** | The second line of the billing address. | [optional] +**organization** | **string** | The optional name of the company or organisation to add to the billing address. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Buyer.md b/docs/Model/Buyer.md index 75c8f8d..8d0c785 100644 --- a/docs/Model/Buyer.md +++ b/docs/Model/Buyer.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **id** | **string** | The unique Gr4vy ID for this buyer. | [optional] **external_identifier** | **string** | An external identifier that can be used to match the buyer against your own records. | [optional] **display_name** | **string** | A unique name for this buyer which is used in the Gr4vy admin panel to give a buyer a human readable name. | [optional] -**billing_details** | [**BillingDetails**](BillingDetails.md) | | [optional] +**billing_details** | [**\Gr4vy\model\BuyerBillingDetails**](BuyerBillingDetails.md) | | [optional] **created_at** | **\DateTime** | The date and time when this buyer was created in our system. | [optional] **updated_at** | **\DateTime** | The date and time when this buyer was last updated in our system. | [optional] diff --git a/docs/Model/BuyerBillingDetails.md b/docs/Model/BuyerBillingDetails.md new file mode 100644 index 0000000..8dd30d5 --- /dev/null +++ b/docs/Model/BuyerBillingDetails.md @@ -0,0 +1,15 @@ +# # BuyerBillingDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | The type of this resource. Is always `billing-details`. | [optional] +**first_name** | **string** | The first name(s) or given name of the buyer. | [optional] +**last_name** | **string** | The last name, or family name, of the buyer. | [optional] +**email_address** | **string** | The email address of the buyer. | [optional] +**phone_number** | **string** | The phone number of the buyer. This number is formatted according to the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). | [optional] +**address** | [**\Gr4vy\model\BillingDetailsAddress**](BillingDetailsAddress.md) | | [optional] +**tax_id** | [**\Gr4vy\model\BillingDetailsTaxId**](BillingDetailsTaxId.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BuyerRequest.md b/docs/Model/BuyerRequest.md index bb3f9d0..4a679e2 100644 --- a/docs/Model/BuyerRequest.md +++ b/docs/Model/BuyerRequest.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **external_identifier** | **string** | An external identifier that can be used to match the buyer against your own records. This value needs to be unique for all buyers. | [optional] **display_name** | **string** | A unique name for this buyer which is used in the Gr4vy admin panel to give a buyer a human readable name. | [optional] -**billing_details** | [**BillingDetailsRequest**](BillingDetailsRequest.md) | | [optional] +**billing_details** | [**\Gr4vy\model\BuyerRequestBillingDetails**](BuyerRequestBillingDetails.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BuyerRequestBillingDetails.md b/docs/Model/BuyerRequestBillingDetails.md new file mode 100644 index 0000000..8de6d6f --- /dev/null +++ b/docs/Model/BuyerRequestBillingDetails.md @@ -0,0 +1,14 @@ +# # BuyerRequestBillingDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**first_name** | **string** | The first name(s) or given name for the buyer. | [optional] +**last_name** | **string** | The last name, or family name, of the buyer. | [optional] +**email_address** | **string** | The email address for the buyer. | [optional] +**phone_number** | **string** | The phone number for the buyer which should be formatted according to the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). | [optional] +**address** | [**\Gr4vy\model\BillingDetailsRequestAddress**](BillingDetailsRequestAddress.md) | | [optional] +**tax_id** | [**\Gr4vy\model\BillingDetailsTaxId**](BillingDetailsTaxId.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BuyerSnapshot.md b/docs/Model/BuyerSnapshot.md index f4953b9..705bb9c 100644 --- a/docs/Model/BuyerSnapshot.md +++ b/docs/Model/BuyerSnapshot.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **id** | **string** | The unique Gr4vy ID for this buyer. | [optional] **external_identifier** | **string** | An external identifier that can be used to match the buyer against your own records. | [optional] **display_name** | **string** | A unique name for this buyer which is used in the Gr4vy admin panel to give a buyer a human readable name. | [optional] -**billing_details** | [**BillingDetails**](BillingDetails.md) | | [optional] +**billing_details** | [**\Gr4vy\model\BuyerSnapshotBillingDetails**](BuyerSnapshotBillingDetails.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BuyerSnapshotBillingDetails.md b/docs/Model/BuyerSnapshotBillingDetails.md new file mode 100644 index 0000000..ebfe427 --- /dev/null +++ b/docs/Model/BuyerSnapshotBillingDetails.md @@ -0,0 +1,15 @@ +# # BuyerSnapshotBillingDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | The type of this resource. Is always `billing-details`. | [optional] +**first_name** | **string** | The first name(s) or given name of the buyer. | [optional] +**last_name** | **string** | The last name, or family name, of the buyer. | [optional] +**email_address** | **string** | The email address of the buyer. | [optional] +**phone_number** | **string** | The phone number of the buyer. This number is formatted according to the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). | [optional] +**address** | [**\Gr4vy\model\BillingDetailsAddress**](BillingDetailsAddress.md) | | [optional] +**tax_id** | [**\Gr4vy\model\BillingDetailsTaxId**](BillingDetailsTaxId.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BuyerUpdate.md b/docs/Model/BuyerUpdate.md index 216f975..9ae866a 100644 --- a/docs/Model/BuyerUpdate.md +++ b/docs/Model/BuyerUpdate.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **external_identifier** | **string** | An external identifier that can be used to match the buyer against your own records. This value needs to be unique for all buyers. | [optional] **display_name** | **string** | A unique name for this buyer which is used in the Gr4vy admin panel to give a buyer a human readable name. | [optional] -**billing_details** | [**BillingDetailsUpdateRequest**](BillingDetailsUpdateRequest.md) | | [optional] +**billing_details** | [**\Gr4vy\model\BuyerUpdateBillingDetails**](BuyerUpdateBillingDetails.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BuyerUpdateBillingDetails.md b/docs/Model/BuyerUpdateBillingDetails.md new file mode 100644 index 0000000..34b4e0e --- /dev/null +++ b/docs/Model/BuyerUpdateBillingDetails.md @@ -0,0 +1,14 @@ +# # BuyerUpdateBillingDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**first_name** | **string** | The first name(s) or given name for the buyer. | [optional] +**last_name** | **string** | The last name, or family name, of the buyer. | [optional] +**email_address** | **string** | The email address for the buyer. | [optional] +**phone_number** | **string** | The phone number for the buyer which should be formatted according to the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). | [optional] +**address** | [**\Gr4vy\model\BillingDetailsUpdateRequestAddress**](BillingDetailsUpdateRequestAddress.md) | | [optional] +**tax_id** | [**\Gr4vy\model\BillingDetailsTaxId**](BillingDetailsTaxId.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DigitalWallet.md b/docs/Model/DigitalWallet.md index ad4855b..4f6d9c2 100644 --- a/docs/Model/DigitalWallet.md +++ b/docs/Model/DigitalWallet.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **provider** | **string** | The name of the digital wallet provider. | [optional] **id** | **string** | The ID of the registered digital wallet. | [optional] **merchant_name** | **string** | The name of the merchant the digital wallet is registered to. | [optional] -**merchant_url** | **string** | The main URL of the merchant. | [optional] [default to 'null'] +**merchant_url** | **string** | The main URL of the merchant. | [optional] **domain_names** | **string[]** | The list of domain names that a digital wallet can be used on. To use a digital wallet on a website, the domain of the site is required to be in this list. | [optional] **created_at** | **\DateTime** | The date and time when this digital wallet was registered. | [optional] **updated_at** | **\DateTime** | The date and time when this digital wallet was last updated. | [optional] diff --git a/docs/Model/DigitalWalletRequest.md b/docs/Model/DigitalWalletRequest.md index e6e91d6..65ff48f 100644 --- a/docs/Model/DigitalWalletRequest.md +++ b/docs/Model/DigitalWalletRequest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **provider** | **string** | The name of the digital wallet provider. | **merchant_name** | **string** | The name of the merchant. This is used to register the merchant with a digital wallet provider and this name is not displayed to the buyer. | -**merchant_url** | **string** | The main URL of the merchant. This is used to register the merchant with a digital wallet provider and this URL is not displayed to the buyer. | [optional] [default to 'null'] +**merchant_url** | **string** | The main URL of the merchant. This is used to register the merchant with a digital wallet provider and this URL is not displayed to the buyer. | [optional] **domain_names** | **string[]** | The list of domain names that a digital wallet can be used on. To use a digital wallet on a website, the domain of the site is required to be in this list. | **accept_terms_and_conditions** | **bool** | The explicit acceptance of the digital wallet provider's terms and conditions by the merchant. Needs to be `true` to register a new digital wallet. | diff --git a/docs/Model/FlowPaymentOptionOutcome.md b/docs/Model/FlowPaymentOptionOutcome.md new file mode 100644 index 0000000..068fc1c --- /dev/null +++ b/docs/Model/FlowPaymentOptionOutcome.md @@ -0,0 +1,14 @@ +# # FlowPaymentOptionOutcome + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | The type of this resource. Is always `action`. | [optional] +**id** | **string** | Payment option identifier. | [optional] +**label** | **string** | Verbose payment option name. | [optional] +**active** | **bool** | The status of the payment option, true if at least one underlying connection is active, otherwise false. | [optional] +**group** | **string** | Optional group label for a given payment option, e.g. `Bank`. | [optional] +**icon_url** | **string** | Payment option icon URL. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FlowRuleBooleanOutcome.md b/docs/Model/FlowRuleBooleanOutcome.md new file mode 100644 index 0000000..7af79db --- /dev/null +++ b/docs/Model/FlowRuleBooleanOutcome.md @@ -0,0 +1,10 @@ +# # FlowRuleBooleanOutcome + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | The type of action outcome for the given rule. | +**result** | **bool** | Results for a given flow action. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FlowRuleMethodOutcome.md b/docs/Model/FlowRuleMethodOutcome.md new file mode 100644 index 0000000..f1a6312 --- /dev/null +++ b/docs/Model/FlowRuleMethodOutcome.md @@ -0,0 +1,10 @@ +# # FlowRuleMethodOutcome + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | The type of action outcome for the given rule. | +**result** | **string[]** | Results for a given flow action. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FlowRuleServiceOutcome.md b/docs/Model/FlowRuleServiceOutcome.md new file mode 100644 index 0000000..f90ee4c --- /dev/null +++ b/docs/Model/FlowRuleServiceOutcome.md @@ -0,0 +1,10 @@ +# # FlowRuleServiceOutcome + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | The type of action outcome for the given rule. | +**result** | **string[]** | Results for a given flow action. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentMethod.md b/docs/Model/PaymentMethod.md index f4238d1..1b9e992 100644 --- a/docs/Model/PaymentMethod.md +++ b/docs/Model/PaymentMethod.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **created_at** | **\DateTime** | The date and time when this payment method was first created in our system. | [optional] **updated_at** | **\DateTime** | The date and time when this payment method was last updated in our system. | [optional] **external_identifier** | **string** | An external identifier that can be used to match the payment method against your own records. | [optional] -**buyer** | [**Buyer**](Buyer.md) | | [optional] +**buyer** | [**\Gr4vy\model\PaymentMethodBuyer**](PaymentMethodBuyer.md) | | [optional] **label** | **string** | A label for the card or the account. For a `paypal` payment method this is the user's email address. For a card it is the last 4 digits of the card. | [optional] **scheme** | **string** | The scheme of the card. Only applies to card payments. | [optional] **expiration_date** | **string** | The expiration date for the payment method. | [optional] diff --git a/docs/Model/PaymentMethodBuyer.md b/docs/Model/PaymentMethodBuyer.md new file mode 100644 index 0000000..e50e666 --- /dev/null +++ b/docs/Model/PaymentMethodBuyer.md @@ -0,0 +1,15 @@ +# # PaymentMethodBuyer + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | The type of this resource. Is always `buyer`. | [optional] +**id** | **string** | The unique Gr4vy ID for this buyer. | [optional] +**external_identifier** | **string** | An external identifier that can be used to match the buyer against your own records. | [optional] +**display_name** | **string** | A unique name for this buyer which is used in the Gr4vy admin panel to give a buyer a human readable name. | [optional] +**billing_details** | [**\Gr4vy\model\BuyerBillingDetails**](BuyerBillingDetails.md) | | [optional] +**created_at** | **\DateTime** | The date and time when this buyer was created in our system. | [optional] +**updated_at** | **\DateTime** | The date and time when this buyer was last updated in our system. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentMethodToken.md b/docs/Model/PaymentMethodToken.md index c57f412..0ec5836 100644 --- a/docs/Model/PaymentMethodToken.md +++ b/docs/Model/PaymentMethodToken.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **id** | **string** | The external ID of this payment method as it has been registered with the payment service, which can be used directly in combination with the `token` without the need to go through Gr4vy for a transaction. In some cases this is a different value to the `token` while in others this value is identical. Please see the documentation for the payment service for more details. | [optional] **token** | **string** | The token of this payment method as it has been registered with the payment service, which can be used directly in combination with the `id` without the need to go through Gr4vy for a transaction. In some cases this is a different value to the `id` while in others this value is identical. Please see the documentation for the payment service for more details. | [optional] **status** | **string** | The state of the payment method. - `processing` - The payment method is still being stored. - `buyer_approval_required` - The buyer still needs to provide approval before the payment method can be stored. - `succeeded` - The payment method is approved and stored with all relevant payment services. - `failed` - Storing the payment method did not succeed. | [optional] -**payment_service** | [**PaymentServiceSnapshot**](PaymentServiceSnapshot.md) | | [optional] +**payment_service** | [**\Gr4vy\model\PaymentMethodTokenPaymentService**](PaymentMethodTokenPaymentService.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentMethodTokenPaymentService.md b/docs/Model/PaymentMethodTokenPaymentService.md new file mode 100644 index 0000000..36cc807 --- /dev/null +++ b/docs/Model/PaymentMethodTokenPaymentService.md @@ -0,0 +1,13 @@ +# # PaymentMethodTokenPaymentService + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The ID of this payment service. | [optional] +**type** | **string** | The type of this resource. | [optional] +**payment_service_definition_id** | **string** | The ID of the payment service definition used to create this service. | [optional] +**method** | **string** | | [optional] +**display_name** | **string** | The custom name set for this service. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentService.md b/docs/Model/PaymentService.md index 8d1ac66..ffd5d75 100644 --- a/docs/Model/PaymentService.md +++ b/docs/Model/PaymentService.md @@ -28,6 +28,6 @@ Name | Type | Description | Notes **created_at** | **\DateTime** | The date and time when this service was created. | [optional] **updated_at** | **\DateTime** | The date and time when this service was last updated. | [optional] **webhook_url** | **string** | The URL that needs to be configured with this payment service as the receiving endpoint for webhooks from the service to Gr4vy. Currently, Gr4vy does not yet automatically register webhooks on setup, and therefore webhooks need to be registered manually by the merchant. | [optional] -**fields** | [**\Gr4vy\model\PaymentServiceFields[]**](PaymentServiceFields.md) | A list of fields, each containing a key-value pair for each field configured for this payment service. Fields marked as `secret` (see Payment Service Definition) are not returned. | [optional] +**fields** | [**\Gr4vy\model\PaymentServiceFieldsInner[]**](PaymentServiceFieldsInner.md) | A list of fields, each containing a key-value pair for each field configured for this payment service. Fields marked as `secret` (see Payment Service Definition) are not returned. | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentServiceDefinition.md b/docs/Model/PaymentServiceDefinition.md index ca15363..9a3d004 100644 --- a/docs/Model/PaymentServiceDefinition.md +++ b/docs/Model/PaymentServiceDefinition.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **type** | **string** | `payment-service-definition`. | [optional] [default to 'payment-service-definition'] **display_name** | **string** | The display name of this service. | [optional] **method** | **string** | | [optional] -**fields** | [**\Gr4vy\model\PaymentServiceDefinitionFields[]**](PaymentServiceDefinitionFields.md) | A list of fields that need to be submitted when activating the payment. service. | [optional] +**fields** | [**\Gr4vy\model\PaymentServiceDefinitionFieldsInner[]**](PaymentServiceDefinitionFieldsInner.md) | A list of fields that need to be submitted when activating the payment. service. | [optional] **supported_currencies** | **string[]** | A list of three-letter ISO currency codes that this service supports. | [optional] **supported_countries** | **string[]** | A list of two-letter ISO country codes that this service supports. | [optional] **mode** | **string** | | [optional] diff --git a/docs/Model/PaymentServiceDefinitionFieldsInner.md b/docs/Model/PaymentServiceDefinitionFieldsInner.md new file mode 100644 index 0000000..cbf1f3e --- /dev/null +++ b/docs/Model/PaymentServiceDefinitionFieldsInner.md @@ -0,0 +1,13 @@ +# # PaymentServiceDefinitionFieldsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **string** | The key of a field that needs to be submitted. | [optional] +**display_name** | **string** | The name to display for a field in the dashboard. | [optional] +**required** | **bool** | Defines if this field is required when the service is created. | [optional] +**format** | **string** | Defines the type of input that needs to be rendered for this field. | [optional] +**secret** | **bool** | Defines if this field is secret. When `true` the field is not returned when querying the payment service. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentServiceFieldsInner.md b/docs/Model/PaymentServiceFieldsInner.md new file mode 100644 index 0000000..2e8cbbd --- /dev/null +++ b/docs/Model/PaymentServiceFieldsInner.md @@ -0,0 +1,10 @@ +# # PaymentServiceFieldsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **string** | The key of the field. | [optional] +**value** | **string** | The value of the field. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentServiceRequest.md b/docs/Model/PaymentServiceRequest.md index 876df35..d9c7b81 100644 --- a/docs/Model/PaymentServiceRequest.md +++ b/docs/Model/PaymentServiceRequest.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **display_name** | **string** | A custom name for the payment service. This will be shown in the Admin UI. | -**fields** | [**\Gr4vy\model\PaymentServiceUpdateFields[]**](PaymentServiceUpdateFields.md) | A list of fields, each containing a key-value pair for each field defined by the definition for this payment service e.g. for stripe-card `secret_key` is required and so must be sent within this field. | +**fields** | [**\Gr4vy\model\PaymentServiceUpdateFieldsInner[]**](PaymentServiceUpdateFieldsInner.md) | A list of fields, each containing a key-value pair for each field defined by the definition for this payment service e.g. for stripe-card `secret_key` is required and so must be sent within this field. | **accepted_countries** | **string[]** | A list of countries that this payment service needs to support in ISO two-letter code format. | **accepted_currencies** | **string[]** | A list of currencies that this payment service needs to support in ISO 4217 three-letter code format. | **three_d_secure_enabled** | **bool** | Defines if 3-D Secure is enabled for the service (can only be enabled if the payment service definition supports the `three_d_secure_hosted` feature). This does not affect pass through 3-D Secure data. | [optional] [default to false] diff --git a/docs/Model/PaymentServiceUpdate.md b/docs/Model/PaymentServiceUpdate.md index a23c4f0..9c20084 100644 --- a/docs/Model/PaymentServiceUpdate.md +++ b/docs/Model/PaymentServiceUpdate.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **display_name** | **string** | A custom name for the payment service. This will be shown in the Admin UI. | [optional] -**fields** | [**\Gr4vy\model\PaymentServiceUpdateFields[]**](PaymentServiceUpdateFields.md) | A list of fields, each containing a key-value pair for each field defined by the definition for this payment service e.g. for stripe-card `secret_key` is required and so must be sent within this field. | [optional] +**fields** | [**\Gr4vy\model\PaymentServiceUpdateFieldsInner[]**](PaymentServiceUpdateFieldsInner.md) | A list of fields, each containing a key-value pair for each field defined by the definition for this payment service e.g. for stripe-card `secret_key` is required and so must be sent within this field. | [optional] **accepted_countries** | **string[]** | A list of countries that this payment service needs to support in ISO two-letter code format. | [optional] **accepted_currencies** | **string[]** | A list of currencies that this payment service needs to support in ISO 4217 three-letter code format. | [optional] **three_d_secure_enabled** | **bool** | Defines if 3-D Secure is enabled for the service (can only be enabled if the payment service definition supports the `three_d_secure_hosted` feature). This does not affect pass through 3-D Secure data. | [optional] [default to false] diff --git a/docs/Model/PaymentServiceUpdateFieldsInner.md b/docs/Model/PaymentServiceUpdateFieldsInner.md new file mode 100644 index 0000000..015e525 --- /dev/null +++ b/docs/Model/PaymentServiceUpdateFieldsInner.md @@ -0,0 +1,10 @@ +# # PaymentServiceUpdateFieldsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **string** | The key of the field to set a value for. | +**value** | **string** | The value of a field to set. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Transaction.md b/docs/Model/Transaction.md index 09eda83..cb8942d 100644 --- a/docs/Model/Transaction.md +++ b/docs/Model/Transaction.md @@ -13,18 +13,18 @@ Name | Type | Description | Notes **refunded_amount** | **int** | The refunded amount for this transaction. This can be the total or a portion of the captured amount. | [optional] **currency** | **string** | The currency code for this transaction. | [optional] **country** | **string** | The 2-letter ISO code of the country of the transaction. This is used to filter the payment services that is used to process the transaction. | [optional] -**payment_method** | [**PaymentMethodSnapshot**](PaymentMethodSnapshot.md) | | [optional] -**buyer** | [**BuyerSnapshot**](BuyerSnapshot.md) | | [optional] +**payment_method** | [**\Gr4vy\model\TransactionPaymentMethod**](TransactionPaymentMethod.md) | | [optional] +**buyer** | [**\Gr4vy\model\TransactionBuyer**](TransactionBuyer.md) | | [optional] **created_at** | **\DateTime** | The date and time when this transaction was created in our system. | [optional] **external_identifier** | **string** | An external identifier that can be used to match the transaction against your own records. | [optional] **updated_at** | **\DateTime** | Defines when the transaction was last updated. | [optional] -**payment_service** | [**PaymentServiceSnapshot**](PaymentServiceSnapshot.md) | | [optional] +**payment_service** | [**\Gr4vy\model\PaymentMethodTokenPaymentService**](PaymentMethodTokenPaymentService.md) | | [optional] **merchant_initiated** | **bool** | Indicates whether the transaction was initiated by the merchant (true) or customer (false). | [optional] [default to false] **payment_source** | **string** | The source of the transaction. Defaults to `ecommerce`. | [optional] **is_subsequent_payment** | **bool** | Indicates whether the transaction represents a subsequent payment coming from a setup recurring payment. Please note there are some restrictions on how this flag may be used. The flag can only be `false` (or not set) when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `card_on_file`. The flag can only be set to `true` when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `recurring` or `installment` and `merchant_initiated` is set to `true`. * `payment_source` is set to `card_on_file`. | [optional] [default to false] -**statement_descriptor** | [**StatementDescriptor**](StatementDescriptor.md) | | [optional] +**statement_descriptor** | [**\Gr4vy\model\TransactionStatementDescriptor**](TransactionStatementDescriptor.md) | | [optional] **cart_items** | [**\Gr4vy\model\CartItem[]**](CartItem.md) | An array of cart items that represents the line items of a transaction. | [optional] -**scheme_transaction_id** | **string** | An identifier for the transaction used by the scheme itself, when available. e.g. the Visa Transaction Identifier, or Mastercard Trace ID. | [optional] [default to 'null'] +**scheme_transaction_id** | **string** | An identifier for the transaction used by the scheme itself, when available. e.g. the Visa Transaction Identifier, or Mastercard Trace ID. | [optional] **raw_response_code** | **string** | This is the response code received from the payment service. This can be set to any value and is not standardized across different payment services. | [optional] **raw_response_description** | **string** | This is the response description received from the payment service. This can be set to any value and is not standardized across different payment services. | [optional] **avs_response_code** | **string** | The response code received from the payment service for the Address Verification Check (AVS). This code is mapped to a standardized Gr4vy AVS response code. - `no_match` - neither address or postal code match - `match` - both address and postal code match - `partial_match_address` - address matches but postal code does not - `partial_match_postcode` - postal code matches but address does not - `unavailable ` - AVS is unavailable for card/country The value of this field can be `null` if the payment service did not provide a response. | [optional] @@ -33,5 +33,8 @@ Name | Type | Description | Notes **payment_service_transaction_id** | **string** | The payment service's unique ID for the transaction. | [optional] **metadata** | **array** | Additional information about the transaction stored as key-value pairs. | [optional] **three_d_secure** | [**\Gr4vy\model\ThreeDSecureSummary**](ThreeDSecureSummary.md) | | [optional] +**authorized_at** | **\DateTime** | The date and time when this transaction was authorized in the payment service. Don't use this field to determine whether the transaction was authorized. A `null` value doesn't necessarily imply that the transaction wasn't authorized, it can mean that the payment service doesn't provide this value, that it didn't provide it at the time the transaction was authorized or that the transaction was authorized before the introduction of this field. | [optional] +**captured_at** | **\DateTime** | The date and time when this transaction was captured in the payment service. Don't use this field to determine whether the transaction was captured. A `null` value doesn't necessarily imply that the transaction wasn't captured, it can mean that the payment service doesn't provide this value, that it didn't provide it at the time the transaction was captured or that the transaction was captured before the introduction of this field. | [optional] +**voided_at** | **\DateTime** | The date and time when this transaction was voided in the payment service. Don't use this field to determine whether the transaction was voided. A `null` value doesn't necessarily imply that the transaction wasn't voided, it can mean that the payment service doesn't provide this value, that it didn't provide it at the time the transaction was voided or that the transaction was voided before the introduction of this field. | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TransactionBuyer.md b/docs/Model/TransactionBuyer.md new file mode 100644 index 0000000..35481d8 --- /dev/null +++ b/docs/Model/TransactionBuyer.md @@ -0,0 +1,13 @@ +# # TransactionBuyer + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | The type of this resource. Is always `buyer`. | [optional] +**id** | **string** | The unique Gr4vy ID for this buyer. | [optional] +**external_identifier** | **string** | An external identifier that can be used to match the buyer against your own records. | [optional] +**display_name** | **string** | A unique name for this buyer which is used in the Gr4vy admin panel to give a buyer a human readable name. | [optional] +**billing_details** | [**\Gr4vy\model\BuyerSnapshotBillingDetails**](BuyerSnapshotBillingDetails.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TransactionPaymentMethod.md b/docs/Model/TransactionPaymentMethod.md new file mode 100644 index 0000000..53b61ea --- /dev/null +++ b/docs/Model/TransactionPaymentMethod.md @@ -0,0 +1,19 @@ +# # TransactionPaymentMethod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | `payment-method`. | [optional] +**id** | **string** | The unique ID of the payment method. | [optional] +**method** | **string** | | [optional] +**external_identifier** | **string** | An external identifier that can be used to match the payment method against your own records. | [optional] +**label** | **string** | A label for the payment method. This can be the last 4 digits for a card, or the email address for an alternative payment method. | [optional] +**scheme** | **string** | An additional label used to differentiate different sub-types of a payment method. Most notably this can include the type of card used in a transaction. | [optional] +**expiration_date** | **string** | The expiration date for this payment method. This is mostly used by cards where the card might have an expiration date. | [optional] +**approval_target** | **string** | The browser target that an approval URL must be opened in. If `any` or `null`, then there is no specific requirement. | [optional] +**approval_url** | **string** | The optional URL that the buyer needs to be redirected to to further authorize their payment. | [optional] +**currency** | **string** | The ISO-4217 currency code that this payment method can be used for. If this value is `null` the payment method may be used for multiple currencies. | [optional] +**country** | **string** | The 2-letter ISO code of the country this payment method can be used for. If this value is `null` the payment method may be used in multiple countries. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TransactionRequest.md b/docs/Model/TransactionRequest.md index 63f58b4..8914e68 100644 --- a/docs/Model/TransactionRequest.md +++ b/docs/Model/TransactionRequest.md @@ -16,9 +16,9 @@ Name | Type | Description | Notes **payment_source** | **string** | The source of the transaction. Defaults to `ecommerce`. | [optional] **is_subsequent_payment** | **bool** | Indicates whether the transaction represents a subsequent payment coming from a setup recurring payment. Please note there are some restrictions on how this flag may be used. The flag can only be `false` (or not set) when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `card_on_file`. The flag can only be set to `true` when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `recurring` or `installment` and `merchant_initiated` is set to `true`. * `payment_source` is set to `card_on_file`. | [optional] [default to false] **metadata** | **array** | Any additional information about the transaction that you would like to store as key-value pairs. This data is passed to payment service providers that support it. Please visit https://gr4vy.com/docs/ under `Connections` for more information on how specific providers support metadata. | [optional] -**statement_descriptor** | [**StatementDescriptor**](StatementDescriptor.md) | | [optional] +**statement_descriptor** | [**\Gr4vy\model\TransactionStatementDescriptor**](TransactionStatementDescriptor.md) | | [optional] **cart_items** | [**\Gr4vy\model\CartItem[]**](CartItem.md) | An array of cart items that represents the line items of a transaction. | [optional] -**previous_scheme_transaction_id** | **string** | A scheme's transaction identifier to use in connecting a merchant initiated transaction to a previous customer initiated transaction. If not provided, and a qualifying customer initiated transaction has been previously made, then Gr4vy will populate this value with the identifier returned for that transaction. e.g. the Visa Transaction Identifier, or Mastercard Trace ID. | [optional] [default to 'null'] -**browser_info** | [**BrowserInfo**](BrowserInfo.md) | | [optional] +**previous_scheme_transaction_id** | **string** | A scheme's transaction identifier to use in connecting a merchant initiated transaction to a previous customer initiated transaction. If not provided, and a qualifying customer initiated transaction has been previously made, then Gr4vy will populate this value with the identifier returned for that transaction. e.g. the Visa Transaction Identifier, or Mastercard Trace ID. | [optional] +**browser_info** | [**\Gr4vy\model\TransactionRequestBrowserInfo**](TransactionRequestBrowserInfo.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TransactionRequestBrowserInfo.md b/docs/Model/TransactionRequestBrowserInfo.md new file mode 100644 index 0000000..6701825 --- /dev/null +++ b/docs/Model/TransactionRequestBrowserInfo.md @@ -0,0 +1,18 @@ +# # TransactionRequestBrowserInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**java_enabled** | **bool** | Indicates whether the client browser supports Java. | +**javascript_enabled** | **bool** | Indicates whether the client browser supports JavaScript. | +**language** | **string** | The preferred language of the buyer, usually the language of the browser UI. | +**color_depth** | **float** | The color depth of the screen. | +**screen_height** | **float** | The height of the screen in pixels. | +**screen_width** | **float** | The width of the screen in pixels. | +**time_zone_offset** | **float** | Time-zone offset in minutes between UTC and buyer location. | +**user_device** | **string** | The platform that is being used to access the website. | +**user_agent** | **string** | The user agent string for the current browser. | +**accept_header** | **string** | The `Accept` header of the request from the buyer's browser. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TransactionStatementDescriptor.md b/docs/Model/TransactionStatementDescriptor.md new file mode 100644 index 0000000..de35028 --- /dev/null +++ b/docs/Model/TransactionStatementDescriptor.md @@ -0,0 +1,13 @@ +# # TransactionStatementDescriptor + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Reflects your doing business as (DBA) name. Other validations: 1. Contains only Latin characters. 2. Contain at least one letter 3. Does not contain any of the special characters `< > \\ ' \" *` 4. Supports: 1. Lower case: `a-z` 2. Upper case: `A-Z` 3. Numbers: `0-9` 4. Spaces: ` ` 5. Special characters: `. , _ - ? + /`. | [optional] +**description** | **string** | A short description about the purchase. Other validations: 1. Contains only Latin characters. 2. Contain at least one letter 3. Does not contain any of the special characters `< > \\ ' \" *` 4. Supports: 1. Lower case: `a-z` 2. Upper case: `A-Z` 3. Numbers: `0-9` 4. Spaces: ` ` 5. Special characters: `. , _ - ? + /`. | [optional] +**city** | **string** | City from which the charge originated. | [optional] +**phone_number** | **string** | The value in the phone number field of a customer's statement which should be formatted according to the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). | [optional] +**url** | **string** | The value in the URL/web address field of a customer's statement. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TransactionSummary.md b/docs/Model/TransactionSummary.md index b103f81..b0cb5fb 100644 --- a/docs/Model/TransactionSummary.md +++ b/docs/Model/TransactionSummary.md @@ -13,12 +13,12 @@ Name | Type | Description | Notes **refunded_amount** | **int** | The refunded amount for this transaction. This can be the total or a portion of the captured amount. | [optional] **currency** | **string** | The currency code for this transaction. | [optional] **country** | **string** | The 2-letter ISO code of the country of the transaction. This is used to filter the payment services that is used to process the transaction. | [optional] -**payment_method** | [**PaymentMethodSnapshot**](PaymentMethodSnapshot.md) | | [optional] -**buyer** | [**BuyerSnapshot**](BuyerSnapshot.md) | | [optional] +**payment_method** | [**\Gr4vy\model\TransactionPaymentMethod**](TransactionPaymentMethod.md) | | [optional] +**buyer** | [**\Gr4vy\model\TransactionBuyer**](TransactionBuyer.md) | | [optional] **created_at** | **\DateTime** | The date and time when this transaction was created in our system. | [optional] **external_identifier** | **string** | An external identifier that can be used to match the transaction against your own records. | [optional] **updated_at** | **\DateTime** | Defines when the transaction was last updated. | [optional] -**payment_service** | [**PaymentServiceSnapshot**](PaymentServiceSnapshot.md) | | [optional] +**payment_service** | [**\Gr4vy\model\PaymentMethodTokenPaymentService**](PaymentMethodTokenPaymentService.md) | | [optional] **method** | **string** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/lib/ApiException.php b/lib/ApiException.php index 32132a6..cde2cc9 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -1,7 +1,7 @@ accessToken; } + /** + * Sets boolean format for query string. + * + * @param string $booleanFormatForQueryString Boolean format for query string + * + * @return $this + */ + public function setBooleanFormatForQueryString(string $booleanFormat) + { + $this->booleanFormatForQueryString = $booleanFormat; + + return $this; + } + + /** + * Gets boolean format for query string. + * + * @return string Boolean format for query string + */ + public function getBooleanFormatForQueryString(): string + { + return $this->booleanFormatForQueryString; + } + /** * Sets the username for HTTP basic authentication * diff --git a/lib/Gr4vyConfig.php b/lib/Gr4vyConfig.php index e701520..380bf5f 100644 --- a/lib/Gr4vyConfig.php +++ b/lib/Gr4vyConfig.php @@ -102,9 +102,9 @@ public static function getToken($private_key, $scopes = array(), $embed = array( $config = Configuration::forAsymmetricSigner( // You may use RSA or ECDSA and all their variations (256, 384, and 512) and EdDSA over Curve25519 - new Signer\Ecdsa\Sha512(), + Signer\Ecdsa\Sha512::create(), $key, - InMemory::base64Encoded('notused') + InMemory::base64Encoded('bm90dXNlZA==') ); @@ -113,7 +113,7 @@ public static function getToken($private_key, $scopes = array(), $embed = array( $now = new DateTimeImmutable(); $tokenBuilder = $config->builder() // Configures the issuer (iss claim) - ->issuedBy('Gr4vy SDK 0.0.1 - PHP 7.3') + ->issuedBy('Gr4vy SDK 0.13.0 - PHP 8.1') // Configures the id (jti claim) ->identifiedBy(self::gen_uuid()) // Configures the time that the token was issue (iat claim) @@ -131,7 +131,7 @@ public static function getToken($private_key, $scopes = array(), $embed = array( $tokenBuilder = $tokenBuilder->withClaim('embed', $embed); } - return $tokenBuilder->getToken($config->signer(), $config->signingKey()); + return $tokenBuilder->getToken($config->signer(), $config->signingKey())->toString(); } private static function gen_uuid() { diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index ce09753..b1c7e43 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -1,7 +1,7 @@ '']; + } else { + return []; + } + } + + $query = []; + $value = (in_array($openApiType, ['object', 'array'], true)) ? (array)$value : $value; + + // since \GuzzleHttp\Psr7\Query::build fails with nested arrays + // need to flatten array first + $flattenArray = function ($arr, $name, &$result = []) use (&$flattenArray, $style, $explode) { + if (!is_array($arr)) return $arr; + + foreach ($arr as $k => $v) { + $prop = ($style === 'deepObject') ? $prop = "{$name}[{$k}]" : $k; + + if (is_array($v)) { + $flattenArray($v, $prop, $result); + } else { + if ($style !== 'deepObject' && !$explode) { + // push key itself + $result[] = $prop; + } + $result[$prop] = $v; + } + } + return $result; + }; + + $value = $flattenArray($value, $paramName); + + if ($openApiType === 'object' && ($style === 'deepObject' || $explode)) { + return $value; + } + + if ('boolean' === $openApiType && is_bool($value)) { + $value = self::convertBoolToQueryStringFormat($value); + } + + // handle style in serializeCollection + $query[$paramName] = ($explode) ? $value : self::serializeCollection((array)$value, $style); + + return $query; + } + + /** + * Convert boolean value to format for query string. + * + * @param bool $value Boolean value + * + * @return int|string Boolean value in format */ - public static function toQueryValue($object) + public static function convertBoolToQueryStringFormat(bool $value) { - if (is_array($object)) { - return implode(',', $object); - } else { - return self::toString($object); + if (Configuration::BOOLEAN_FORMAT_STRING == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) { + return $value ? 'true' : 'false'; } + + return (int) $value; } /** @@ -230,7 +300,7 @@ public static function toString($value) } elseif (is_bool($value)) { return $value ? 'true' : 'false'; } else { - return $value; + return (string) $value; } } @@ -320,7 +390,7 @@ public static function deserialize($data, $class, $httpHeaders = null) if ($class === 'object') { settype($data, 'array'); return $data; - } else if ($class === 'mixed') { + } elseif ($class === 'mixed') { settype($data, gettype($data)); return $data; } @@ -347,6 +417,8 @@ public static function deserialize($data, $class, $httpHeaders = null) } if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name @@ -410,4 +482,24 @@ public static function deserialize($data, $class, $httpHeaders = null) return $instance; } } + + /** + * Native `http_build_query` wrapper. + * @see https://www.php.net/manual/en/function.http-build-query + * + * @param array|object $data May be an array or object containing properties. + * @param string $numeric_prefix If numeric indices are used in the base array and this parameter is provided, it will be prepended to the numeric index for elements in the base array only. + * @param string|null $arg_separator arg_separator.output is used to separate arguments but may be overridden by specifying this parameter. + * @param int $encoding_type Encoding type. By default, PHP_QUERY_RFC1738. + * + * @return string + */ + public static function buildQuery( + $data, + string $numeric_prefix = '', + ?string $arg_separator = null, + int $encoding_type = \PHP_QUERY_RFC3986 + ): string { + return \GuzzleHttp\Psr7\Query::build($data, $encoding_type); + } } diff --git a/lib/api/AuditLogsApi.php b/lib/api/AuditLogsApi.php index 830132b..a1ef6f4 100644 --- a/lib/api/AuditLogsApi.php +++ b/lib/api/AuditLogsApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\AuditLogs' !== 'string') { + $content = json_decode($content); + } } return [ @@ -203,6 +206,9 @@ public function listAuditLogsWithHttpInfo($limit = 20, $cursor = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -217,6 +223,9 @@ public function listAuditLogsWithHttpInfo($limit = 20, $cursor = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -293,6 +302,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -345,27 +357,23 @@ public function listAuditLogsRequest($limit = 20, $cursor = null) $multipart = false; // query params - if ($limit !== null) { - if('form' === 'form' && is_array($limit)) { - foreach($limit as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['limit'] = $limit; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($cursor !== null) { - if('form' === 'form' && is_array($cursor)) { - foreach($cursor as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['cursor'] = $cursor; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cursor, + 'cursor', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); @@ -402,12 +410,12 @@ public function listAuditLogsRequest($limit = 20, $cursor = null) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -422,7 +430,7 @@ public function listAuditLogsRequest($limit = 20, $cursor = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/api/BuyersApi.php b/lib/api/BuyersApi.php index 96f7c70..94129df 100644 --- a/lib/api/BuyersApi.php +++ b/lib/api/BuyersApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Buyer' !== 'string') { + $content = json_decode($content); + } } return [ @@ -201,6 +204,9 @@ public function addBuyerWithHttpInfo($buyer_request = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\ErrorGeneric' !== 'string') { + $content = json_decode($content); + } } return [ @@ -213,6 +219,9 @@ public function addBuyerWithHttpInfo($buyer_request = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -225,6 +234,9 @@ public function addBuyerWithHttpInfo($buyer_request = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error409DuplicateRecord' !== 'string') { + $content = json_decode($content); + } } return [ @@ -239,6 +251,9 @@ public function addBuyerWithHttpInfo($buyer_request = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -329,6 +344,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -414,12 +432,12 @@ public function addBuyerRequest($buyer_request = null) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -434,7 +452,7 @@ public function addBuyerRequest($buyer_request = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -660,12 +678,12 @@ public function deleteBuyerRequest($buyer_id) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -680,7 +698,7 @@ public function deleteBuyerRequest($buyer_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -762,6 +780,9 @@ public function getBuyerWithHttpInfo($buyer_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Buyer' !== 'string') { + $content = json_decode($content); + } } return [ @@ -774,6 +795,9 @@ public function getBuyerWithHttpInfo($buyer_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -786,6 +810,9 @@ public function getBuyerWithHttpInfo($buyer_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error404NotFound' !== 'string') { + $content = json_decode($content); + } } return [ @@ -798,6 +825,9 @@ public function getBuyerWithHttpInfo($buyer_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\ErrorGeneric' !== 'string') { + $content = json_decode($content); + } } return [ @@ -812,6 +842,9 @@ public function getBuyerWithHttpInfo($buyer_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -902,6 +935,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -995,12 +1031,12 @@ public function getBuyerRequest($buyer_id) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -1015,7 +1051,7 @@ public function getBuyerRequest($buyer_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1101,6 +1137,9 @@ public function listBuyersWithHttpInfo($search = null, $limit = 20, $cursor = nu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Buyers' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1113,6 +1152,9 @@ public function listBuyersWithHttpInfo($search = null, $limit = 20, $cursor = nu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1127,6 +1169,9 @@ public function listBuyersWithHttpInfo($search = null, $limit = 20, $cursor = nu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1205,6 +1250,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1258,38 +1306,32 @@ public function listBuyersRequest($search = null, $limit = 20, $cursor = null) $multipart = false; // query params - if ($search !== null) { - if('form' === 'form' && is_array($search)) { - foreach($search as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['search'] = $search; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $search, + 'search', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($limit !== null) { - if('form' === 'form' && is_array($limit)) { - foreach($limit as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['limit'] = $limit; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($cursor !== null) { - if('form' === 'form' && is_array($cursor)) { - foreach($cursor as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['cursor'] = $cursor; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cursor, + 'cursor', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); @@ -1326,12 +1368,12 @@ public function listBuyersRequest($search = null, $limit = 20, $cursor = null) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -1346,7 +1388,7 @@ public function listBuyersRequest($search = null, $limit = 20, $cursor = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1430,6 +1472,9 @@ public function updateBuyerWithHttpInfo($buyer_id, $buyer_update = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Buyer' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1442,6 +1487,9 @@ public function updateBuyerWithHttpInfo($buyer_id, $buyer_update = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\ErrorGeneric' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1454,6 +1502,9 @@ public function updateBuyerWithHttpInfo($buyer_id, $buyer_update = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1466,6 +1517,9 @@ public function updateBuyerWithHttpInfo($buyer_id, $buyer_update = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error404NotFound' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1480,6 +1534,9 @@ public function updateBuyerWithHttpInfo($buyer_id, $buyer_update = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1572,6 +1629,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1672,12 +1732,12 @@ public function updateBuyerRequest($buyer_id, $buyer_update = null) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -1692,7 +1752,7 @@ public function updateBuyerRequest($buyer_id, $buyer_update = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/api/DigitalWalletsApi.php b/lib/api/DigitalWalletsApi.php index 6d334e6..8e014e8 100644 --- a/lib/api/DigitalWalletsApi.php +++ b/lib/api/DigitalWalletsApi.php @@ -1,7 +1,7 @@ config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -353,7 +353,7 @@ public function deregisterDigitalWalletRequest($digital_wallet_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -435,6 +435,9 @@ public function getDigitalWalletWithHttpInfo($digital_wallet_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\DigitalWallet' !== 'string') { + $content = json_decode($content); + } } return [ @@ -447,6 +450,9 @@ public function getDigitalWalletWithHttpInfo($digital_wallet_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -459,6 +465,9 @@ public function getDigitalWalletWithHttpInfo($digital_wallet_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error404NotFound' !== 'string') { + $content = json_decode($content); + } } return [ @@ -473,6 +482,9 @@ public function getDigitalWalletWithHttpInfo($digital_wallet_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -555,6 +567,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -648,12 +663,12 @@ public function getDigitalWalletRequest($digital_wallet_id) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -668,7 +683,7 @@ public function getDigitalWalletRequest($digital_wallet_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -748,6 +763,9 @@ public function listDigitalWalletsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\DigitalWallets' !== 'string') { + $content = json_decode($content); + } } return [ @@ -760,6 +778,9 @@ public function listDigitalWalletsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -774,6 +795,9 @@ public function listDigitalWalletsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -846,6 +870,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -924,12 +951,12 @@ public function listDigitalWalletsRequest() } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -944,7 +971,7 @@ public function listDigitalWalletsRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1026,6 +1053,9 @@ public function registerDigitalWalletWithHttpInfo($digital_wallet_request = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\DigitalWallet' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1038,6 +1068,9 @@ public function registerDigitalWalletWithHttpInfo($digital_wallet_request = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\ErrorGeneric' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1050,6 +1083,9 @@ public function registerDigitalWalletWithHttpInfo($digital_wallet_request = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1064,6 +1100,9 @@ public function registerDigitalWalletWithHttpInfo($digital_wallet_request = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1146,6 +1185,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1231,12 +1273,12 @@ public function registerDigitalWalletRequest($digital_wallet_request = null) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -1251,7 +1293,7 @@ public function registerDigitalWalletRequest($digital_wallet_request = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1335,6 +1377,9 @@ public function updateDigitalWalletWithHttpInfo($digital_wallet_id, $digital_wal $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\DigitalWallet' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1347,6 +1392,9 @@ public function updateDigitalWalletWithHttpInfo($digital_wallet_id, $digital_wal $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\ErrorGeneric' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1359,6 +1407,9 @@ public function updateDigitalWalletWithHttpInfo($digital_wallet_id, $digital_wal $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1371,6 +1422,9 @@ public function updateDigitalWalletWithHttpInfo($digital_wallet_id, $digital_wal $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error404NotFound' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1385,6 +1439,9 @@ public function updateDigitalWalletWithHttpInfo($digital_wallet_id, $digital_wal $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1477,6 +1534,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1577,12 +1637,12 @@ public function updateDigitalWalletRequest($digital_wallet_id, $digital_wallet_u } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -1597,7 +1657,7 @@ public function updateDigitalWalletRequest($digital_wallet_id, $digital_wallet_u $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/api/PaymentMethodTokensApi.php b/lib/api/PaymentMethodTokensApi.php index f67a745..2eb5e64 100644 --- a/lib/api/PaymentMethodTokensApi.php +++ b/lib/api/PaymentMethodTokensApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\PaymentMethodTokens' !== 'string') { + $content = json_decode($content); + } } return [ @@ -201,6 +204,9 @@ public function listPaymentMethodTokensWithHttpInfo($payment_method_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -213,6 +219,9 @@ public function listPaymentMethodTokensWithHttpInfo($payment_method_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error404NotFound' !== 'string') { + $content = json_decode($content); + } } return [ @@ -227,6 +236,9 @@ public function listPaymentMethodTokensWithHttpInfo($payment_method_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -309,6 +321,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -402,12 +417,12 @@ public function listPaymentMethodTokensRequest($payment_method_id) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -422,7 +437,7 @@ public function listPaymentMethodTokensRequest($payment_method_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/api/PaymentMethodsApi.php b/lib/api/PaymentMethodsApi.php index 90e7093..c333b75 100644 --- a/lib/api/PaymentMethodsApi.php +++ b/lib/api/PaymentMethodsApi.php @@ -1,7 +1,7 @@ config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -353,7 +353,7 @@ public function deletePaymentMethodRequest($payment_method_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -435,6 +435,9 @@ public function getPaymentMethodWithHttpInfo($payment_method_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\PaymentMethod' !== 'string') { + $content = json_decode($content); + } } return [ @@ -447,6 +450,9 @@ public function getPaymentMethodWithHttpInfo($payment_method_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -459,6 +465,9 @@ public function getPaymentMethodWithHttpInfo($payment_method_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error404NotFound' !== 'string') { + $content = json_decode($content); + } } return [ @@ -473,6 +482,9 @@ public function getPaymentMethodWithHttpInfo($payment_method_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -555,6 +567,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -648,12 +663,12 @@ public function getPaymentMethodRequest($payment_method_id) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -668,7 +683,7 @@ public function getPaymentMethodRequest($payment_method_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -756,6 +771,9 @@ public function listBuyerPaymentMethodsWithHttpInfo($buyer_id = null, $buyer_ext $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\PaymentMethodsTokenized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -768,6 +786,9 @@ public function listBuyerPaymentMethodsWithHttpInfo($buyer_id = null, $buyer_ext $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -780,6 +801,9 @@ public function listBuyerPaymentMethodsWithHttpInfo($buyer_id = null, $buyer_ext $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error404NotFound' !== 'string') { + $content = json_decode($content); + } } return [ @@ -794,6 +818,9 @@ public function listBuyerPaymentMethodsWithHttpInfo($buyer_id = null, $buyer_ext $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -882,6 +909,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -929,49 +959,41 @@ public function listBuyerPaymentMethodsRequest($buyer_id = null, $buyer_external $multipart = false; // query params - if ($buyer_id !== null) { - if('form' === 'form' && is_array($buyer_id)) { - foreach($buyer_id as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['buyer_id'] = $buyer_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $buyer_id, + 'buyer_id', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($buyer_external_identifier !== null) { - if('form' === 'form' && is_array($buyer_external_identifier)) { - foreach($buyer_external_identifier as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['buyer_external_identifier'] = $buyer_external_identifier; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $buyer_external_identifier, + 'buyer_external_identifier', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($country !== null) { - if('form' === 'form' && is_array($country)) { - foreach($country as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['country'] = $country; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $country, + 'country', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($currency !== null) { - if('form' === 'form' && is_array($currency)) { - foreach($currency as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['currency'] = $currency; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $currency, + 'currency', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); @@ -1008,12 +1030,12 @@ public function listBuyerPaymentMethodsRequest($buyer_id = null, $buyer_external } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -1028,7 +1050,7 @@ public function listBuyerPaymentMethodsRequest($buyer_id = null, $buyer_external $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1118,6 +1140,9 @@ public function listPaymentMethodsWithHttpInfo($buyer_id = null, $buyer_external $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\PaymentMethods' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1130,6 +1155,9 @@ public function listPaymentMethodsWithHttpInfo($buyer_id = null, $buyer_external $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1144,6 +1172,9 @@ public function listPaymentMethodsWithHttpInfo($buyer_id = null, $buyer_external $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1226,6 +1257,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1281,60 +1315,50 @@ public function listPaymentMethodsRequest($buyer_id = null, $buyer_external_iden $multipart = false; // query params - if ($buyer_id !== null) { - if('form' === 'form' && is_array($buyer_id)) { - foreach($buyer_id as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['buyer_id'] = $buyer_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $buyer_id, + 'buyer_id', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($buyer_external_identifier !== null) { - if('form' === 'form' && is_array($buyer_external_identifier)) { - foreach($buyer_external_identifier as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['buyer_external_identifier'] = $buyer_external_identifier; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $buyer_external_identifier, + 'buyer_external_identifier', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($status !== null) { - if('form' === 'form' && is_array($status)) { - foreach($status as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['status'] = $status; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status, + 'status', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($limit !== null) { - if('form' === 'form' && is_array($limit)) { - foreach($limit as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['limit'] = $limit; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($cursor !== null) { - if('form' === 'form' && is_array($cursor)) { - foreach($cursor as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['cursor'] = $cursor; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cursor, + 'cursor', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); @@ -1371,12 +1395,12 @@ public function listPaymentMethodsRequest($buyer_id = null, $buyer_external_iden } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -1391,7 +1415,7 @@ public function listPaymentMethodsRequest($buyer_id = null, $buyer_external_iden $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1473,6 +1497,9 @@ public function storePaymentMethodWithHttpInfo($payment_method_request = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\PaymentMethod' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1485,6 +1512,9 @@ public function storePaymentMethodWithHttpInfo($payment_method_request = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\ErrorGeneric' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1497,6 +1527,9 @@ public function storePaymentMethodWithHttpInfo($payment_method_request = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1511,6 +1544,9 @@ public function storePaymentMethodWithHttpInfo($payment_method_request = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1593,6 +1629,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1678,12 +1717,12 @@ public function storePaymentMethodRequest($payment_method_request = null) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -1698,7 +1737,7 @@ public function storePaymentMethodRequest($payment_method_request = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/api/PaymentOptionsApi.php b/lib/api/PaymentOptionsApi.php index 91677aa..7e7c130 100644 --- a/lib/api/PaymentOptionsApi.php +++ b/lib/api/PaymentOptionsApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\PaymentOptions' !== 'string') { + $content = json_decode($content); + } } return [ @@ -209,6 +212,9 @@ public function listPaymentOptionsWithHttpInfo($country = null, $currency = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error400BadRequest' !== 'string') { + $content = json_decode($content); + } } return [ @@ -221,6 +227,9 @@ public function listPaymentOptionsWithHttpInfo($country = null, $currency = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -235,6 +244,9 @@ public function listPaymentOptionsWithHttpInfo($country = null, $currency = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -325,6 +337,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -377,60 +392,50 @@ public function listPaymentOptionsRequest($country = null, $currency = null, $am $multipart = false; // query params - if ($country !== null) { - if('form' === 'form' && is_array($country)) { - foreach($country as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['country'] = $country; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $country, + 'country', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($currency !== null) { - if('form' === 'form' && is_array($currency)) { - foreach($currency as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['currency'] = $currency; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $currency, + 'currency', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($amount !== null) { - if('form' === 'form' && is_array($amount)) { - foreach($amount as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['amount'] = $amount; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $amount, + 'amount', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($metadata !== null) { - if('form' === 'form' && is_array($metadata)) { - foreach($metadata as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['metadata'] = $metadata; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $metadata, + 'metadata', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); @@ -467,12 +472,12 @@ public function listPaymentOptionsRequest($country = null, $currency = null, $am } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -487,7 +492,7 @@ public function listPaymentOptionsRequest($country = null, $currency = null, $am $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/api/PaymentServiceDefinitionsApi.php b/lib/api/PaymentServiceDefinitionsApi.php index e258c96..af7167f 100644 --- a/lib/api/PaymentServiceDefinitionsApi.php +++ b/lib/api/PaymentServiceDefinitionsApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\PaymentServiceDefinition' !== 'string') { + $content = json_decode($content); + } } return [ @@ -201,6 +204,9 @@ public function getPaymentServiceDefinitionWithHttpInfo($payment_service_definit $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -213,6 +219,9 @@ public function getPaymentServiceDefinitionWithHttpInfo($payment_service_definit $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error404NotFound' !== 'string') { + $content = json_decode($content); + } } return [ @@ -227,6 +236,9 @@ public function getPaymentServiceDefinitionWithHttpInfo($payment_service_definit $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -309,6 +321,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -402,12 +417,12 @@ public function getPaymentServiceDefinitionRequest($payment_service_definition_i } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -422,7 +437,7 @@ public function getPaymentServiceDefinitionRequest($payment_service_definition_i $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -506,6 +521,9 @@ public function listPaymentServiceDefinitionsWithHttpInfo($limit = 20, $cursor = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\PaymentServiceDefinitions' !== 'string') { + $content = json_decode($content); + } } return [ @@ -518,6 +536,9 @@ public function listPaymentServiceDefinitionsWithHttpInfo($limit = 20, $cursor = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -532,6 +553,9 @@ public function listPaymentServiceDefinitionsWithHttpInfo($limit = 20, $cursor = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -608,6 +632,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -660,27 +687,23 @@ public function listPaymentServiceDefinitionsRequest($limit = 20, $cursor = null $multipart = false; // query params - if ($limit !== null) { - if('form' === 'form' && is_array($limit)) { - foreach($limit as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['limit'] = $limit; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($cursor !== null) { - if('form' === 'form' && is_array($cursor)) { - foreach($cursor as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['cursor'] = $cursor; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cursor, + 'cursor', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); @@ -717,12 +740,12 @@ public function listPaymentServiceDefinitionsRequest($limit = 20, $cursor = null } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -737,7 +760,7 @@ public function listPaymentServiceDefinitionsRequest($limit = 20, $cursor = null $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/api/PaymentServicesApi.php b/lib/api/PaymentServicesApi.php index d562bf2..45d29c2 100644 --- a/lib/api/PaymentServicesApi.php +++ b/lib/api/PaymentServicesApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\PaymentService' !== 'string') { + $content = json_decode($content); + } } return [ @@ -201,6 +204,9 @@ public function addPaymentServiceWithHttpInfo($payment_service_request = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\ErrorGeneric' !== 'string') { + $content = json_decode($content); + } } return [ @@ -213,6 +219,9 @@ public function addPaymentServiceWithHttpInfo($payment_service_request = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -227,6 +236,9 @@ public function addPaymentServiceWithHttpInfo($payment_service_request = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -309,6 +321,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -394,12 +409,12 @@ public function addPaymentServiceRequest($payment_service_request = null) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -414,7 +429,7 @@ public function addPaymentServiceRequest($payment_service_request = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -640,12 +655,12 @@ public function deletePaymentServiceRequest($payment_service_id) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -660,7 +675,7 @@ public function deletePaymentServiceRequest($payment_service_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -742,6 +757,9 @@ public function getPaymentServiceWithHttpInfo($payment_service_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\PaymentService' !== 'string') { + $content = json_decode($content); + } } return [ @@ -754,6 +772,9 @@ public function getPaymentServiceWithHttpInfo($payment_service_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -766,6 +787,9 @@ public function getPaymentServiceWithHttpInfo($payment_service_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error404NotFound' !== 'string') { + $content = json_decode($content); + } } return [ @@ -780,6 +804,9 @@ public function getPaymentServiceWithHttpInfo($payment_service_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -862,6 +889,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -955,12 +985,12 @@ public function getPaymentServiceRequest($payment_service_id) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -975,7 +1005,7 @@ public function getPaymentServiceRequest($payment_service_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1061,6 +1091,9 @@ public function listPaymentServicesWithHttpInfo($limit = 20, $cursor = null, $me $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\PaymentServices' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1073,6 +1106,9 @@ public function listPaymentServicesWithHttpInfo($limit = 20, $cursor = null, $me $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1087,6 +1123,9 @@ public function listPaymentServicesWithHttpInfo($limit = 20, $cursor = null, $me $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1165,6 +1204,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1218,38 +1260,32 @@ public function listPaymentServicesRequest($limit = 20, $cursor = null, $method $multipart = false; // query params - if ($limit !== null) { - if('form' === 'form' && is_array($limit)) { - foreach($limit as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['limit'] = $limit; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($cursor !== null) { - if('form' === 'form' && is_array($cursor)) { - foreach($cursor as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['cursor'] = $cursor; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cursor, + 'cursor', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($method !== null) { - if('form' === 'form' && is_array($method)) { - foreach($method as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['method'] = $method; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $method, + 'method', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); @@ -1286,12 +1322,12 @@ public function listPaymentServicesRequest($limit = 20, $cursor = null, $method } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -1306,7 +1342,7 @@ public function listPaymentServicesRequest($limit = 20, $cursor = null, $method $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1390,6 +1426,9 @@ public function updatePaymentServiceWithHttpInfo($payment_service_id, $payment_s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\PaymentService' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1402,6 +1441,9 @@ public function updatePaymentServiceWithHttpInfo($payment_service_id, $payment_s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\ErrorGeneric' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1414,6 +1456,9 @@ public function updatePaymentServiceWithHttpInfo($payment_service_id, $payment_s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1426,6 +1471,9 @@ public function updatePaymentServiceWithHttpInfo($payment_service_id, $payment_s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error404NotFound' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1440,6 +1488,9 @@ public function updatePaymentServiceWithHttpInfo($payment_service_id, $payment_s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1532,6 +1583,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1632,12 +1686,12 @@ public function updatePaymentServiceRequest($payment_service_id, $payment_servic } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -1652,7 +1706,7 @@ public function updatePaymentServiceRequest($payment_service_id, $payment_servic $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/api/TransactionsApi.php b/lib/api/TransactionsApi.php index 616706d..af8e45e 100644 --- a/lib/api/TransactionsApi.php +++ b/lib/api/TransactionsApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Transaction' !== 'string') { + $content = json_decode($content); + } } return [ @@ -201,6 +204,9 @@ public function authorizeNewTransactionWithHttpInfo($transaction_request = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\ErrorGeneric' !== 'string') { + $content = json_decode($content); + } } return [ @@ -213,6 +219,9 @@ public function authorizeNewTransactionWithHttpInfo($transaction_request = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -227,6 +236,9 @@ public function authorizeNewTransactionWithHttpInfo($transaction_request = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -309,6 +321,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -394,12 +409,12 @@ public function authorizeNewTransactionRequest($transaction_request = null) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -414,7 +429,7 @@ public function authorizeNewTransactionRequest($transaction_request = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -498,6 +513,9 @@ public function captureTransactionWithHttpInfo($transaction_id, $transaction_cap $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Transaction' !== 'string') { + $content = json_decode($content); + } } return [ @@ -510,6 +528,9 @@ public function captureTransactionWithHttpInfo($transaction_id, $transaction_cap $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\ErrorGeneric' !== 'string') { + $content = json_decode($content); + } } return [ @@ -522,6 +543,9 @@ public function captureTransactionWithHttpInfo($transaction_id, $transaction_cap $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -534,6 +558,9 @@ public function captureTransactionWithHttpInfo($transaction_id, $transaction_cap $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\ErrorGeneric' !== 'string') { + $content = json_decode($content); + } } return [ @@ -548,6 +575,9 @@ public function captureTransactionWithHttpInfo($transaction_id, $transaction_cap $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -640,6 +670,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -740,12 +773,12 @@ public function captureTransactionRequest($transaction_id, $transaction_capture_ } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -760,7 +793,7 @@ public function captureTransactionRequest($transaction_id, $transaction_capture_ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -842,6 +875,9 @@ public function getTransactionWithHttpInfo($transaction_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Transaction' !== 'string') { + $content = json_decode($content); + } } return [ @@ -854,6 +890,9 @@ public function getTransactionWithHttpInfo($transaction_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -866,6 +905,9 @@ public function getTransactionWithHttpInfo($transaction_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\ErrorGeneric' !== 'string') { + $content = json_decode($content); + } } return [ @@ -880,6 +922,9 @@ public function getTransactionWithHttpInfo($transaction_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -962,6 +1007,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1055,12 +1103,342 @@ public function getTransactionRequest($transaction_id) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTransactionActions + * + * Get transaction actions + * + * @param string $transaction_id The ID for the transaction to get the information for. (required) + * + * @throws \Gr4vy\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Gr4vy\model\Actions|\Gr4vy\model\Error401Unauthorized|\Gr4vy\model\Error404NotFound + */ + public function getTransactionActions($transaction_id) + { + list($response) = $this->getTransactionActionsWithHttpInfo($transaction_id); + return $response; + } + + /** + * Operation getTransactionActionsWithHttpInfo + * + * Get transaction actions + * + * @param string $transaction_id The ID for the transaction to get the information for. (required) + * + * @throws \Gr4vy\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Gr4vy\model\Actions|\Gr4vy\model\Error401Unauthorized|\Gr4vy\model\Error404NotFound, HTTP status code, HTTP response headers (array of strings) + */ + public function getTransactionActionsWithHttpInfo($transaction_id) + { + $request = $this->getTransactionActionsRequest($transaction_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Gr4vy\model\Actions' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Gr4vy\model\Actions' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Gr4vy\model\Actions', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Gr4vy\model\Error401Unauthorized' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Gr4vy\model\Error401Unauthorized', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Gr4vy\model\Error404NotFound' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error404NotFound' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Gr4vy\model\Error404NotFound', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Gr4vy\model\Actions'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gr4vy\model\Actions', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gr4vy\model\Error401Unauthorized', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Gr4vy\model\Error404NotFound', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTransactionActionsAsync + * + * Get transaction actions + * + * @param string $transaction_id The ID for the transaction to get the information for. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTransactionActionsAsync($transaction_id) + { + return $this->getTransactionActionsAsyncWithHttpInfo($transaction_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTransactionActionsAsyncWithHttpInfo + * + * Get transaction actions + * + * @param string $transaction_id The ID for the transaction to get the information for. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTransactionActionsAsyncWithHttpInfo($transaction_id) + { + $returnType = '\Gr4vy\model\Actions'; + $request = $this->getTransactionActionsRequest($transaction_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTransactionActions' + * + * @param string $transaction_id The ID for the transaction to get the information for. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTransactionActionsRequest($transaction_id) + { + // verify the required parameter 'transaction_id' is set + if ($transaction_id === null || (is_array($transaction_id) && count($transaction_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $transaction_id when calling getTransactionActions' + ); + } + + $resourcePath = '/transactions/{transaction_id}/actions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($transaction_id !== null) { + $resourcePath = str_replace( + '{' . 'transaction_id' . '}', + ObjectSerializer::toPathValue($transaction_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -1075,7 +1453,7 @@ public function getTransactionRequest($transaction_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1159,6 +1537,9 @@ public function getTransactionRefundWithHttpInfo($transaction_id, $refund_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Refund' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1171,6 +1552,9 @@ public function getTransactionRefundWithHttpInfo($transaction_id, $refund_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1183,6 +1567,9 @@ public function getTransactionRefundWithHttpInfo($transaction_id, $refund_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error404NotFound' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1197,6 +1584,9 @@ public function getTransactionRefundWithHttpInfo($transaction_id, $refund_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1281,6 +1671,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1389,12 +1782,12 @@ public function getTransactionRefundRequest($transaction_id, $refund_id) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -1409,7 +1802,7 @@ public function getTransactionRefundRequest($transaction_id, $refund_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1495,6 +1888,9 @@ public function listTransactionRefundsWithHttpInfo($transaction_id, $limit = 20, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Refunds' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1507,6 +1903,9 @@ public function listTransactionRefundsWithHttpInfo($transaction_id, $limit = 20, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1519,6 +1918,9 @@ public function listTransactionRefundsWithHttpInfo($transaction_id, $limit = 20, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error404NotFound' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1533,6 +1935,9 @@ public function listTransactionRefundsWithHttpInfo($transaction_id, $limit = 20, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1619,6 +2024,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1678,27 +2086,23 @@ public function listTransactionRefundsRequest($transaction_id, $limit = 20, $cur $multipart = false; // query params - if ($limit !== null) { - if('form' === 'form' && is_array($limit)) { - foreach($limit as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['limit'] = $limit; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($cursor !== null) { - if('form' === 'form' && is_array($cursor)) { - foreach($cursor as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['cursor'] = $cursor; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cursor, + 'cursor', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -1743,12 +2147,12 @@ public function listTransactionRefundsRequest($transaction_id, $limit = 20, $cur } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -1763,7 +2167,7 @@ public function listTransactionRefundsRequest($transaction_id, $limit = 20, $cur $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1863,6 +2267,9 @@ public function listTransactionsWithHttpInfo($search = null, $transaction_status $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Transactions' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1875,6 +2282,9 @@ public function listTransactionsWithHttpInfo($search = null, $transaction_status $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -1889,6 +2299,9 @@ public function listTransactionsWithHttpInfo($search = null, $transaction_status $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1981,6 +2394,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2041,115 +2457,95 @@ public function listTransactionsRequest($search = null, $transaction_status = nu $multipart = false; // query params - if ($search !== null) { - if('form' === 'form' && is_array($search)) { - foreach($search as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['search'] = $search; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $search, + 'search', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($transaction_status !== null) { - if('form' === 'form' && is_array($transaction_status)) { - foreach($transaction_status as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['transaction_status'] = $transaction_status; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $transaction_status, + 'transaction_status', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($buyer_id !== null) { - if('form' === 'form' && is_array($buyer_id)) { - foreach($buyer_id as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['buyer_id'] = $buyer_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $buyer_id, + 'buyer_id', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($buyer_external_identifier !== null) { - if('form' === 'form' && is_array($buyer_external_identifier)) { - foreach($buyer_external_identifier as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['buyer_external_identifier'] = $buyer_external_identifier; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $buyer_external_identifier, + 'buyer_external_identifier', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($before_created_at !== null) { - if('form' === 'form' && is_array($before_created_at)) { - foreach($before_created_at as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['before_created_at'] = $before_created_at; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $before_created_at, + 'before_created_at', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($after_created_at !== null) { - if('form' === 'form' && is_array($after_created_at)) { - foreach($after_created_at as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['after_created_at'] = $after_created_at; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $after_created_at, + 'after_created_at', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($before_updated_at !== null) { - if('form' === 'form' && is_array($before_updated_at)) { - foreach($before_updated_at as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['before_updated_at'] = $before_updated_at; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $before_updated_at, + 'before_updated_at', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($after_updated_at !== null) { - if('form' === 'form' && is_array($after_updated_at)) { - foreach($after_updated_at as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['after_updated_at'] = $after_updated_at; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $after_updated_at, + 'after_updated_at', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($limit !== null) { - if('form' === 'form' && is_array($limit)) { - foreach($limit as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['limit'] = $limit; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($cursor !== null) { - if('form' === 'form' && is_array($cursor)) { - foreach($cursor as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['cursor'] = $cursor; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cursor, + 'cursor', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); @@ -2186,12 +2582,12 @@ public function listTransactionsRequest($search = null, $transaction_status = nu } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -2206,7 +2602,7 @@ public function listTransactionsRequest($search = null, $transaction_status = nu $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -2290,6 +2686,9 @@ public function refundTransactionWithHttpInfo($transaction_id, $transaction_refu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Refund' !== 'string') { + $content = json_decode($content); + } } return [ @@ -2302,6 +2701,9 @@ public function refundTransactionWithHttpInfo($transaction_id, $transaction_refu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\ErrorGeneric' !== 'string') { + $content = json_decode($content); + } } return [ @@ -2314,6 +2716,9 @@ public function refundTransactionWithHttpInfo($transaction_id, $transaction_refu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -2326,6 +2731,9 @@ public function refundTransactionWithHttpInfo($transaction_id, $transaction_refu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error404NotFound' !== 'string') { + $content = json_decode($content); + } } return [ @@ -2340,6 +2748,9 @@ public function refundTransactionWithHttpInfo($transaction_id, $transaction_refu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2432,6 +2843,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2532,12 +2946,12 @@ public function refundTransactionRequest($transaction_id, $transaction_refund_re } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -2552,7 +2966,7 @@ public function refundTransactionRequest($transaction_id, $transaction_refund_re $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -2634,6 +3048,9 @@ public function voidTransactionWithHttpInfo($transaction_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Transaction' !== 'string') { + $content = json_decode($content); + } } return [ @@ -2646,6 +3063,9 @@ public function voidTransactionWithHttpInfo($transaction_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\ErrorGeneric' !== 'string') { + $content = json_decode($content); + } } return [ @@ -2658,6 +3078,9 @@ public function voidTransactionWithHttpInfo($transaction_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error401Unauthorized' !== 'string') { + $content = json_decode($content); + } } return [ @@ -2670,6 +3093,9 @@ public function voidTransactionWithHttpInfo($transaction_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\Gr4vy\model\Error404NotFound' !== 'string') { + $content = json_decode($content); + } } return [ @@ -2684,6 +3110,9 @@ public function voidTransactionWithHttpInfo($transaction_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2774,6 +3203,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2867,12 +3299,12 @@ public function voidTransactionRequest($transaction_id) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { + if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } @@ -2887,7 +3319,7 @@ public function voidTransactionRequest($transaction_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/lib/model/Action.php b/lib/model/Action.php new file mode 100644 index 0000000..8e1d3ca --- /dev/null +++ b/lib/model/Action.php @@ -0,0 +1,576 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Action implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Action'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'id' => 'string', + 'flow' => 'string', + 'rule_id' => 'string', + 'created_at' => '\DateTime', + 'outcome' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'id' => null, + 'flow' => null, + 'rule_id' => 'uuid', + 'created_at' => 'date-time', + 'outcome' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'id' => 'id', + 'flow' => 'flow', + 'rule_id' => 'rule_id', + 'created_at' => 'created_at', + 'outcome' => 'outcome' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'id' => 'setId', + 'flow' => 'setFlow', + 'rule_id' => 'setRuleId', + 'created_at' => 'setCreatedAt', + 'outcome' => 'setOutcome' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'id' => 'getId', + 'flow' => 'getFlow', + 'rule_id' => 'getRuleId', + 'created_at' => 'getCreatedAt', + 'outcome' => 'getOutcome' + ]; + + /** + * 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_ACTION = 'action'; + public const ID_DECLINE_EARLY = 'decline-early'; + public const ID_ROUTE_TRANSACTION = 'route-transaction'; + public const ID_SKIP_3DS = 'skip-3ds'; + public const FLOW_CHECKOUT = 'checkout'; + public const FLOW_CARD_TRANSACTION = 'card-transaction'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_ACTION, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getIdAllowableValues() + { + return [ + self::ID_DECLINE_EARLY, + self::ID_ROUTE_TRANSACTION, + self::ID_SKIP_3DS, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFlowAllowableValues() + { + return [ + self::FLOW_CHECKOUT, + self::FLOW_CARD_TRANSACTION, + ]; + } + + /** + * 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->container['type'] = $data['type'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['flow'] = $data['flow'] ?? null; + $this->container['rule_id'] = $data['rule_id'] ?? null; + $this->container['created_at'] = $data['created_at'] ?? null; + $this->container['outcome'] = $data['outcome'] ?? null; + } + + /** + * 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) + ); + } + + $allowedValues = $this->getIdAllowableValues(); + if (!is_null($this->container['id']) && !in_array($this->container['id'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'id', must be one of '%s'", + $this->container['id'], + implode("', '", $allowedValues) + ); + } + + $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) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of this resource. Is always `action`. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !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 id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The identifier for the action. + * + * @return self + */ + public function setId($id) + { + $allowedValues = $this->getIdAllowableValues(); + if (!is_null($id) && !in_array($id, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'id', must be one of '%s'", + $id, + implode("', '", $allowedValues) + ) + ); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets flow + * + * @return string|null + */ + public function getFlow() + { + return $this->container['flow']; + } + + /** + * Sets flow + * + * @param string|null $flow The related flow for the action. + * + * @return self + */ + public function setFlow($flow) + { + $allowedValues = $this->getFlowAllowableValues(); + if (!is_null($flow) && !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 rule_id + * + * @return string|null + */ + public function getRuleId() + { + return $this->container['rule_id']; + } + + /** + * Sets rule_id + * + * @param string|null $rule_id The unique ID of the rule triggered. + * + * @return self + */ + public function setRuleId($rule_id) + { + $this->container['rule_id'] = $rule_id; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime|null + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime|null $created_at The date and time when this action was created. + * + * @return self + */ + public function setCreatedAt($created_at) + { + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets outcome + * + * @return string|null + */ + public function getOutcome() + { + return $this->container['outcome']; + } + + /** + * Sets outcome + * + * @param string|null $outcome outcome + * + * @return self + */ + public function setOutcome($outcome) + { + $this->container['outcome'] = $outcome; + + 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 + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/Actions.php b/lib/model/Actions.php new file mode 100644 index 0000000..05116fc --- /dev/null +++ b/lib/model/Actions.php @@ -0,0 +1,324 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Actions implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Actions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'items' => '\Gr4vy\model\Action[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'items' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'items' => 'items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems' + ]; + + /** + * 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->container['items'] = $data['items'] ?? null; + } + + /** + * 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 items + * + * @return \Gr4vy\model\Action[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Gr4vy\model\Action[]|null $items A list of actions. + * + * @return self + */ + public function setItems($items) + { + $this->container['items'] = $items; + + 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 + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/Address.php b/lib/model/Address.php index 6116c67..4b68d48 100644 --- a/lib/model/Address.php +++ b/lib/model/Address.php @@ -2,7 +2,7 @@ /** * Address * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -612,7 +612,7 @@ public function setOrganization($organization) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -624,6 +624,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -637,7 +638,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -653,7 +654,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -665,6 +666,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/ApplePayRequest.php b/lib/model/ApplePayRequest.php index 2be1d07..c6ef27f 100644 --- a/lib/model/ApplePayRequest.php +++ b/lib/model/ApplePayRequest.php @@ -2,7 +2,7 @@ /** * ApplePayRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -169,7 +169,7 @@ public function getModelName() return self::$openAPIModelName; } - const METHOD_APPLEPAY = 'applepay'; + public const METHOD_APPLEPAY = 'applepay'; /** * Gets allowable values of the enum @@ -305,7 +305,7 @@ public function setToken($token) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -317,6 +317,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -330,7 +331,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -346,7 +347,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -358,6 +359,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/ApplePaySessionRequest.php b/lib/model/ApplePaySessionRequest.php index 8852280..59325c1 100644 --- a/lib/model/ApplePaySessionRequest.php +++ b/lib/model/ApplePaySessionRequest.php @@ -2,7 +2,7 @@ /** * ApplePaySessionRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -273,7 +273,7 @@ public function setDomainName($domain_name) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -285,6 +285,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -298,7 +299,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -314,7 +315,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -326,6 +327,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/AuditLog.php b/lib/model/AuditLog.php index 4139165..b1376ab 100644 --- a/lib/model/AuditLog.php +++ b/lib/model/AuditLog.php @@ -2,7 +2,7 @@ /** * AuditLog * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -189,10 +189,10 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_AUDIT_LOG = 'audit-log'; - const ACTION_CREATED = 'created'; - const ACTION_UPDATED = 'updated'; - const ACTION_DELETED = 'deleted'; + public const TYPE_AUDIT_LOG = 'audit-log'; + public const ACTION_CREATED = 'created'; + public const ACTION_UPDATED = 'updated'; + public const ACTION_DELETED = 'deleted'; /** * Gets allowable values of the enum @@ -455,7 +455,7 @@ public function setResource($resource) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -467,6 +467,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -480,7 +481,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -496,7 +497,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -508,6 +509,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/AuditLogResource.php b/lib/model/AuditLogResource.php index 75d718e..34cbed8 100644 --- a/lib/model/AuditLogResource.php +++ b/lib/model/AuditLogResource.php @@ -2,7 +2,7 @@ /** * AuditLogResource * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -297,7 +297,7 @@ public function setName($name) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -309,6 +309,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -322,7 +323,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -338,7 +339,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -350,6 +351,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/AuditLogUser.php b/lib/model/AuditLogUser.php index 8b04d54..eaf480a 100644 --- a/lib/model/AuditLogUser.php +++ b/lib/model/AuditLogUser.php @@ -2,7 +2,7 @@ /** * AuditLogUser * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -297,7 +297,7 @@ public function setStaff($staff) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -309,6 +309,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -322,7 +323,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -338,7 +339,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -350,6 +351,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/AuditLogs.php b/lib/model/AuditLogs.php index ed060be..71c893b 100644 --- a/lib/model/AuditLogs.php +++ b/lib/model/AuditLogs.php @@ -2,7 +2,7 @@ /** * AuditLogs * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -373,7 +373,7 @@ public function setPreviousCursor($previous_cursor) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -385,6 +385,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -398,7 +399,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -414,7 +415,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -426,6 +427,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/BillingDetails.php b/lib/model/BillingDetails.php index 3415741..e057c5a 100644 --- a/lib/model/BillingDetails.php +++ b/lib/model/BillingDetails.php @@ -2,7 +2,7 @@ /** * BillingDetails * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -66,8 +66,8 @@ class BillingDetails implements ModelInterface, ArrayAccess, \JsonSerializable 'last_name' => 'string', 'email_address' => 'string', 'phone_number' => 'string', - 'address' => '\Gr4vy\model\Address', - 'tax_id' => '\Gr4vy\model\TaxId' + 'address' => '\Gr4vy\model\BillingDetailsAddress', + 'tax_id' => '\Gr4vy\model\BillingDetailsTaxId' ]; /** @@ -194,7 +194,7 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_BILLING_DETAILS = 'billing-details'; + public const TYPE_BILLING_DETAILS = 'billing-details'; /** * Gets allowable values of the enum @@ -465,7 +465,7 @@ public function setPhoneNumber($phone_number) /** * Gets address * - * @return Address|null + * @return \Gr4vy\model\BillingDetailsAddress|null */ public function getAddress() { @@ -475,7 +475,7 @@ public function getAddress() /** * Sets address * - * @param Address|null $address address + * @param \Gr4vy\model\BillingDetailsAddress|null $address address * * @return self */ @@ -489,7 +489,7 @@ public function setAddress($address) /** * Gets tax_id * - * @return TaxId|null + * @return \Gr4vy\model\BillingDetailsTaxId|null */ public function getTaxId() { @@ -499,7 +499,7 @@ public function getTaxId() /** * Sets tax_id * - * @param TaxId|null $tax_id tax_id + * @param \Gr4vy\model\BillingDetailsTaxId|null $tax_id tax_id * * @return self */ @@ -516,7 +516,7 @@ public function setTaxId($tax_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -528,6 +528,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -541,7 +542,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -557,7 +558,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -569,6 +570,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/BillingDetailsAddress.php b/lib/model/BillingDetailsAddress.php new file mode 100644 index 0000000..2e84b8f --- /dev/null +++ b/lib/model/BillingDetailsAddress.php @@ -0,0 +1,698 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BillingDetailsAddress implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BillingDetails_address'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'country' => 'string', + 'postal_code' => 'string', + 'state' => 'string', + 'state_code' => 'string', + 'house_number_or_name' => 'string', + 'line1' => 'string', + 'line2' => 'string', + 'organization' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'city' => null, + 'country' => null, + 'postal_code' => null, + 'state' => null, + 'state_code' => null, + 'house_number_or_name' => null, + 'line1' => null, + 'line2' => null, + 'organization' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'country' => 'country', + 'postal_code' => 'postal_code', + 'state' => 'state', + 'state_code' => 'state_code', + 'house_number_or_name' => 'house_number_or_name', + 'line1' => 'line1', + 'line2' => 'line2', + 'organization' => 'organization' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'postal_code' => 'setPostalCode', + 'state' => 'setState', + 'state_code' => 'setStateCode', + 'house_number_or_name' => 'setHouseNumberOrName', + 'line1' => 'setLine1', + 'line2' => 'setLine2', + 'organization' => 'setOrganization' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'postal_code' => 'getPostalCode', + 'state' => 'getState', + 'state_code' => 'getStateCode', + 'house_number_or_name' => 'getHouseNumberOrName', + 'line1' => 'getLine1', + 'line2' => 'getLine2', + 'organization' => 'getOrganization' + ]; + + /** + * 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->container['city'] = $data['city'] ?? null; + $this->container['country'] = $data['country'] ?? null; + $this->container['postal_code'] = $data['postal_code'] ?? null; + $this->container['state'] = $data['state'] ?? null; + $this->container['state_code'] = $data['state_code'] ?? null; + $this->container['house_number_or_name'] = $data['house_number_or_name'] ?? null; + $this->container['line1'] = $data['line1'] ?? null; + $this->container['line2'] = $data['line2'] ?? null; + $this->container['organization'] = $data['organization'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['city']) && (mb_strlen($this->container['city']) > 100)) { + $invalidProperties[] = "invalid value for 'city', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['city']) && (mb_strlen($this->container['city']) < 1)) { + $invalidProperties[] = "invalid value for 'city', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['country']) && (mb_strlen($this->container['country']) > 2)) { + $invalidProperties[] = "invalid value for 'country', the character length must be smaller than or equal to 2."; + } + + if (!is_null($this->container['country']) && (mb_strlen($this->container['country']) < 1)) { + $invalidProperties[] = "invalid value for 'country', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['postal_code']) && (mb_strlen($this->container['postal_code']) > 50)) { + $invalidProperties[] = "invalid value for 'postal_code', the character length must be smaller than or equal to 50."; + } + + if (!is_null($this->container['postal_code']) && (mb_strlen($this->container['postal_code']) < 1)) { + $invalidProperties[] = "invalid value for 'postal_code', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['state']) && (mb_strlen($this->container['state']) > 255)) { + $invalidProperties[] = "invalid value for 'state', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['state']) && (mb_strlen($this->container['state']) < 1)) { + $invalidProperties[] = "invalid value for 'state', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['state_code']) && (mb_strlen($this->container['state_code']) > 6)) { + $invalidProperties[] = "invalid value for 'state_code', the character length must be smaller than or equal to 6."; + } + + if (!is_null($this->container['state_code']) && (mb_strlen($this->container['state_code']) < 4)) { + $invalidProperties[] = "invalid value for 'state_code', the character length must be bigger than or equal to 4."; + } + + if (!is_null($this->container['house_number_or_name']) && (mb_strlen($this->container['house_number_or_name']) > 255)) { + $invalidProperties[] = "invalid value for 'house_number_or_name', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['house_number_or_name']) && (mb_strlen($this->container['house_number_or_name']) < 1)) { + $invalidProperties[] = "invalid value for 'house_number_or_name', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['line1']) && (mb_strlen($this->container['line1']) > 255)) { + $invalidProperties[] = "invalid value for 'line1', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['line1']) && (mb_strlen($this->container['line1']) < 1)) { + $invalidProperties[] = "invalid value for 'line1', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['line2']) && (mb_strlen($this->container['line2']) > 255)) { + $invalidProperties[] = "invalid value for 'line2', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['line2']) && (mb_strlen($this->container['line2']) < 1)) { + $invalidProperties[] = "invalid value for 'line2', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['organization']) && (mb_strlen($this->container['organization']) > 255)) { + $invalidProperties[] = "invalid value for 'organization', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['organization']) && (mb_strlen($this->container['organization']) < 1)) { + $invalidProperties[] = "invalid value for 'organization', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city The city for the billing address. + * + * @return self + */ + public function setCity($city) + { + if (!is_null($city) && (mb_strlen($city) > 100)) { + throw new \InvalidArgumentException('invalid length for $city when calling BillingDetailsAddress., must be smaller than or equal to 100.'); + } + if (!is_null($city) && (mb_strlen($city) < 1)) { + throw new \InvalidArgumentException('invalid length for $city when calling BillingDetailsAddress., must be bigger than or equal to 1.'); + } + + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country The country for the billing address. + * + * @return self + */ + public function setCountry($country) + { + if (!is_null($country) && (mb_strlen($country) > 2)) { + throw new \InvalidArgumentException('invalid length for $country when calling BillingDetailsAddress., must be smaller than or equal to 2.'); + } + if (!is_null($country) && (mb_strlen($country) < 1)) { + throw new \InvalidArgumentException('invalid length for $country when calling BillingDetailsAddress., must be bigger than or equal to 1.'); + } + + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets postal_code + * + * @return string|null + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string|null $postal_code The postal code or zip code for the billing address. + * + * @return self + */ + public function setPostalCode($postal_code) + { + if (!is_null($postal_code) && (mb_strlen($postal_code) > 50)) { + throw new \InvalidArgumentException('invalid length for $postal_code when calling BillingDetailsAddress., must be smaller than or equal to 50.'); + } + if (!is_null($postal_code) && (mb_strlen($postal_code) < 1)) { + throw new \InvalidArgumentException('invalid length for $postal_code when calling BillingDetailsAddress., must be bigger than or equal to 1.'); + } + + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets state + * + * @return string|null + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param string|null $state The state, county, or province for the billing address. + * + * @return self + */ + public function setState($state) + { + if (!is_null($state) && (mb_strlen($state) > 255)) { + throw new \InvalidArgumentException('invalid length for $state when calling BillingDetailsAddress., must be smaller than or equal to 255.'); + } + if (!is_null($state) && (mb_strlen($state) < 1)) { + throw new \InvalidArgumentException('invalid length for $state when calling BillingDetailsAddress., must be bigger than or equal to 1.'); + } + + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets state_code + * + * @return string|null + */ + public function getStateCode() + { + return $this->container['state_code']; + } + + /** + * Sets state_code + * + * @param string|null $state_code The code of state, county, or province for the billing address in ISO 3166-2 format. + * + * @return self + */ + public function setStateCode($state_code) + { + if (!is_null($state_code) && (mb_strlen($state_code) > 6)) { + throw new \InvalidArgumentException('invalid length for $state_code when calling BillingDetailsAddress., must be smaller than or equal to 6.'); + } + if (!is_null($state_code) && (mb_strlen($state_code) < 4)) { + throw new \InvalidArgumentException('invalid length for $state_code when calling BillingDetailsAddress., must be bigger than or equal to 4.'); + } + + $this->container['state_code'] = $state_code; + + return $this; + } + + /** + * Gets house_number_or_name + * + * @return string|null + */ + public function getHouseNumberOrName() + { + return $this->container['house_number_or_name']; + } + + /** + * Sets house_number_or_name + * + * @param string|null $house_number_or_name The house number or name for the billing address. Not all payment services use this field but some do. + * + * @return self + */ + public function setHouseNumberOrName($house_number_or_name) + { + if (!is_null($house_number_or_name) && (mb_strlen($house_number_or_name) > 255)) { + throw new \InvalidArgumentException('invalid length for $house_number_or_name when calling BillingDetailsAddress., must be smaller than or equal to 255.'); + } + if (!is_null($house_number_or_name) && (mb_strlen($house_number_or_name) < 1)) { + throw new \InvalidArgumentException('invalid length for $house_number_or_name when calling BillingDetailsAddress., must be bigger than or equal to 1.'); + } + + $this->container['house_number_or_name'] = $house_number_or_name; + + return $this; + } + + /** + * Gets line1 + * + * @return string|null + */ + public function getLine1() + { + return $this->container['line1']; + } + + /** + * Sets line1 + * + * @param string|null $line1 The first line of the billing address. + * + * @return self + */ + public function setLine1($line1) + { + if (!is_null($line1) && (mb_strlen($line1) > 255)) { + throw new \InvalidArgumentException('invalid length for $line1 when calling BillingDetailsAddress., must be smaller than or equal to 255.'); + } + if (!is_null($line1) && (mb_strlen($line1) < 1)) { + throw new \InvalidArgumentException('invalid length for $line1 when calling BillingDetailsAddress., must be bigger than or equal to 1.'); + } + + $this->container['line1'] = $line1; + + return $this; + } + + /** + * Gets line2 + * + * @return string|null + */ + public function getLine2() + { + return $this->container['line2']; + } + + /** + * Sets line2 + * + * @param string|null $line2 The second line of the billing address. + * + * @return self + */ + public function setLine2($line2) + { + if (!is_null($line2) && (mb_strlen($line2) > 255)) { + throw new \InvalidArgumentException('invalid length for $line2 when calling BillingDetailsAddress., must be smaller than or equal to 255.'); + } + if (!is_null($line2) && (mb_strlen($line2) < 1)) { + throw new \InvalidArgumentException('invalid length for $line2 when calling BillingDetailsAddress., must be bigger than or equal to 1.'); + } + + $this->container['line2'] = $line2; + + return $this; + } + + /** + * Gets organization + * + * @return string|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param string|null $organization The optional name of the company or organisation to add to the billing address. + * + * @return self + */ + public function setOrganization($organization) + { + if (!is_null($organization) && (mb_strlen($organization) > 255)) { + throw new \InvalidArgumentException('invalid length for $organization when calling BillingDetailsAddress., must be smaller than or equal to 255.'); + } + if (!is_null($organization) && (mb_strlen($organization) < 1)) { + throw new \InvalidArgumentException('invalid length for $organization when calling BillingDetailsAddress., must be bigger than or equal to 1.'); + } + + $this->container['organization'] = $organization; + + 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 + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/BillingDetailsRequest.php b/lib/model/BillingDetailsRequest.php index 8265873..8c472fb 100644 --- a/lib/model/BillingDetailsRequest.php +++ b/lib/model/BillingDetailsRequest.php @@ -2,7 +2,7 @@ /** * BillingDetailsRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -65,8 +65,8 @@ class BillingDetailsRequest implements ModelInterface, ArrayAccess, \JsonSeriali 'last_name' => 'string', 'email_address' => 'string', 'phone_number' => 'string', - 'address' => '\Gr4vy\model\Address', - 'tax_id' => 'TaxId' + 'address' => '\Gr4vy\model\BillingDetailsRequestAddress', + 'tax_id' => '\Gr4vy\model\BillingDetailsTaxId' ]; /** @@ -403,7 +403,7 @@ public function setPhoneNumber($phone_number) /** * Gets address * - * @return Address|null + * @return \Gr4vy\model\BillingDetailsRequestAddress|null */ public function getAddress() { @@ -413,7 +413,7 @@ public function getAddress() /** * Sets address * - * @param Address|null $address The billing address for the buyer. + * @param \Gr4vy\model\BillingDetailsRequestAddress|null $address address * * @return self */ @@ -427,7 +427,7 @@ public function setAddress($address) /** * Gets tax_id * - * @return TaxId|null + * @return \Gr4vy\model\BillingDetailsTaxId|null */ public function getTaxId() { @@ -437,7 +437,7 @@ public function getTaxId() /** * Sets tax_id * - * @param TaxId|null $tax_id tax_id + * @param \Gr4vy\model\BillingDetailsTaxId|null $tax_id tax_id * * @return self */ @@ -454,7 +454,7 @@ public function setTaxId($tax_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -466,6 +466,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -479,7 +480,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -495,7 +496,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -507,6 +508,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/BillingDetailsRequestAddress.php b/lib/model/BillingDetailsRequestAddress.php new file mode 100644 index 0000000..89ae222 --- /dev/null +++ b/lib/model/BillingDetailsRequestAddress.php @@ -0,0 +1,714 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BillingDetailsRequestAddress implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BillingDetailsRequest_address'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'country' => 'string', + 'postal_code' => 'string', + 'state' => 'string', + 'state_code' => 'string', + 'house_number_or_name' => 'string', + 'line1' => 'string', + 'line2' => 'string', + 'organization' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'city' => null, + 'country' => null, + 'postal_code' => null, + 'state' => null, + 'state_code' => null, + 'house_number_or_name' => null, + 'line1' => null, + 'line2' => null, + 'organization' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'country' => 'country', + 'postal_code' => 'postal_code', + 'state' => 'state', + 'state_code' => 'state_code', + 'house_number_or_name' => 'house_number_or_name', + 'line1' => 'line1', + 'line2' => 'line2', + 'organization' => 'organization' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'postal_code' => 'setPostalCode', + 'state' => 'setState', + 'state_code' => 'setStateCode', + 'house_number_or_name' => 'setHouseNumberOrName', + 'line1' => 'setLine1', + 'line2' => 'setLine2', + 'organization' => 'setOrganization' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'postal_code' => 'getPostalCode', + 'state' => 'getState', + 'state_code' => 'getStateCode', + 'house_number_or_name' => 'getHouseNumberOrName', + 'line1' => 'getLine1', + 'line2' => 'getLine2', + 'organization' => 'getOrganization' + ]; + + /** + * 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->container['city'] = $data['city'] ?? null; + $this->container['country'] = $data['country'] ?? null; + $this->container['postal_code'] = $data['postal_code'] ?? null; + $this->container['state'] = $data['state'] ?? null; + $this->container['state_code'] = $data['state_code'] ?? null; + $this->container['house_number_or_name'] = $data['house_number_or_name'] ?? null; + $this->container['line1'] = $data['line1'] ?? null; + $this->container['line2'] = $data['line2'] ?? null; + $this->container['organization'] = $data['organization'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['city'] === null) { + $invalidProperties[] = "'city' can't be null"; + } + if ((mb_strlen($this->container['city']) > 100)) { + $invalidProperties[] = "invalid value for 'city', the character length must be smaller than or equal to 100."; + } + + if ((mb_strlen($this->container['city']) < 1)) { + $invalidProperties[] = "invalid value for 'city', the character length must be bigger than or equal to 1."; + } + + if ($this->container['country'] === null) { + $invalidProperties[] = "'country' can't be null"; + } + if ((mb_strlen($this->container['country']) > 2)) { + $invalidProperties[] = "invalid value for 'country', the character length must be smaller than or equal to 2."; + } + + if ((mb_strlen($this->container['country']) < 1)) { + $invalidProperties[] = "invalid value for 'country', the character length must be bigger than or equal to 1."; + } + + if ($this->container['postal_code'] === null) { + $invalidProperties[] = "'postal_code' can't be null"; + } + if ((mb_strlen($this->container['postal_code']) > 50)) { + $invalidProperties[] = "invalid value for 'postal_code', the character length must be smaller than or equal to 50."; + } + + if ((mb_strlen($this->container['postal_code']) < 1)) { + $invalidProperties[] = "invalid value for 'postal_code', the character length must be bigger than or equal to 1."; + } + + if ($this->container['state'] === null) { + $invalidProperties[] = "'state' can't be null"; + } + if ((mb_strlen($this->container['state']) > 255)) { + $invalidProperties[] = "invalid value for 'state', the character length must be smaller than or equal to 255."; + } + + if ((mb_strlen($this->container['state']) < 1)) { + $invalidProperties[] = "invalid value for 'state', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['state_code']) && (mb_strlen($this->container['state_code']) > 6)) { + $invalidProperties[] = "invalid value for 'state_code', the character length must be smaller than or equal to 6."; + } + + if (!is_null($this->container['state_code']) && (mb_strlen($this->container['state_code']) < 4)) { + $invalidProperties[] = "invalid value for 'state_code', the character length must be bigger than or equal to 4."; + } + + if (!is_null($this->container['house_number_or_name']) && (mb_strlen($this->container['house_number_or_name']) > 255)) { + $invalidProperties[] = "invalid value for 'house_number_or_name', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['house_number_or_name']) && (mb_strlen($this->container['house_number_or_name']) < 1)) { + $invalidProperties[] = "invalid value for 'house_number_or_name', the character length must be bigger than or equal to 1."; + } + + if ($this->container['line1'] === null) { + $invalidProperties[] = "'line1' can't be null"; + } + if ((mb_strlen($this->container['line1']) > 255)) { + $invalidProperties[] = "invalid value for 'line1', the character length must be smaller than or equal to 255."; + } + + if ((mb_strlen($this->container['line1']) < 1)) { + $invalidProperties[] = "invalid value for 'line1', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['line2']) && (mb_strlen($this->container['line2']) > 255)) { + $invalidProperties[] = "invalid value for 'line2', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['line2']) && (mb_strlen($this->container['line2']) < 1)) { + $invalidProperties[] = "invalid value for 'line2', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['organization']) && (mb_strlen($this->container['organization']) > 255)) { + $invalidProperties[] = "invalid value for 'organization', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['organization']) && (mb_strlen($this->container['organization']) < 1)) { + $invalidProperties[] = "invalid value for 'organization', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city The city for the billing address. + * + * @return self + */ + public function setCity($city) + { + if ((mb_strlen($city) > 100)) { + throw new \InvalidArgumentException('invalid length for $city when calling BillingDetailsRequestAddress., must be smaller than or equal to 100.'); + } + if ((mb_strlen($city) < 1)) { + throw new \InvalidArgumentException('invalid length for $city when calling BillingDetailsRequestAddress., must be bigger than or equal to 1.'); + } + + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country The country for the billing address. + * + * @return self + */ + public function setCountry($country) + { + if ((mb_strlen($country) > 2)) { + throw new \InvalidArgumentException('invalid length for $country when calling BillingDetailsRequestAddress., must be smaller than or equal to 2.'); + } + if ((mb_strlen($country) < 1)) { + throw new \InvalidArgumentException('invalid length for $country when calling BillingDetailsRequestAddress., must be bigger than or equal to 1.'); + } + + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets postal_code + * + * @return string + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string $postal_code The postal code or zip code for the billing address. + * + * @return self + */ + public function setPostalCode($postal_code) + { + if ((mb_strlen($postal_code) > 50)) { + throw new \InvalidArgumentException('invalid length for $postal_code when calling BillingDetailsRequestAddress., must be smaller than or equal to 50.'); + } + if ((mb_strlen($postal_code) < 1)) { + throw new \InvalidArgumentException('invalid length for $postal_code when calling BillingDetailsRequestAddress., must be bigger than or equal to 1.'); + } + + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets state + * + * @return string + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param string $state The state, county, or province for the billing address. + * + * @return self + */ + public function setState($state) + { + if ((mb_strlen($state) > 255)) { + throw new \InvalidArgumentException('invalid length for $state when calling BillingDetailsRequestAddress., must be smaller than or equal to 255.'); + } + if ((mb_strlen($state) < 1)) { + throw new \InvalidArgumentException('invalid length for $state when calling BillingDetailsRequestAddress., must be bigger than or equal to 1.'); + } + + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets state_code + * + * @return string|null + */ + public function getStateCode() + { + return $this->container['state_code']; + } + + /** + * Sets state_code + * + * @param string|null $state_code The code of state, county, or province for the billing address in ISO 3166-2 format. + * + * @return self + */ + public function setStateCode($state_code) + { + if (!is_null($state_code) && (mb_strlen($state_code) > 6)) { + throw new \InvalidArgumentException('invalid length for $state_code when calling BillingDetailsRequestAddress., must be smaller than or equal to 6.'); + } + if (!is_null($state_code) && (mb_strlen($state_code) < 4)) { + throw new \InvalidArgumentException('invalid length for $state_code when calling BillingDetailsRequestAddress., must be bigger than or equal to 4.'); + } + + $this->container['state_code'] = $state_code; + + return $this; + } + + /** + * Gets house_number_or_name + * + * @return string|null + */ + public function getHouseNumberOrName() + { + return $this->container['house_number_or_name']; + } + + /** + * Sets house_number_or_name + * + * @param string|null $house_number_or_name The house number or name for the billing address. Not all payment services use this field but some do. + * + * @return self + */ + public function setHouseNumberOrName($house_number_or_name) + { + if (!is_null($house_number_or_name) && (mb_strlen($house_number_or_name) > 255)) { + throw new \InvalidArgumentException('invalid length for $house_number_or_name when calling BillingDetailsRequestAddress., must be smaller than or equal to 255.'); + } + if (!is_null($house_number_or_name) && (mb_strlen($house_number_or_name) < 1)) { + throw new \InvalidArgumentException('invalid length for $house_number_or_name when calling BillingDetailsRequestAddress., must be bigger than or equal to 1.'); + } + + $this->container['house_number_or_name'] = $house_number_or_name; + + return $this; + } + + /** + * Gets line1 + * + * @return string + */ + public function getLine1() + { + return $this->container['line1']; + } + + /** + * Sets line1 + * + * @param string $line1 The first line of the billing address. + * + * @return self + */ + public function setLine1($line1) + { + if ((mb_strlen($line1) > 255)) { + throw new \InvalidArgumentException('invalid length for $line1 when calling BillingDetailsRequestAddress., must be smaller than or equal to 255.'); + } + if ((mb_strlen($line1) < 1)) { + throw new \InvalidArgumentException('invalid length for $line1 when calling BillingDetailsRequestAddress., must be bigger than or equal to 1.'); + } + + $this->container['line1'] = $line1; + + return $this; + } + + /** + * Gets line2 + * + * @return string|null + */ + public function getLine2() + { + return $this->container['line2']; + } + + /** + * Sets line2 + * + * @param string|null $line2 The second line of the billing address. + * + * @return self + */ + public function setLine2($line2) + { + if (!is_null($line2) && (mb_strlen($line2) > 255)) { + throw new \InvalidArgumentException('invalid length for $line2 when calling BillingDetailsRequestAddress., must be smaller than or equal to 255.'); + } + if (!is_null($line2) && (mb_strlen($line2) < 1)) { + throw new \InvalidArgumentException('invalid length for $line2 when calling BillingDetailsRequestAddress., must be bigger than or equal to 1.'); + } + + $this->container['line2'] = $line2; + + return $this; + } + + /** + * Gets organization + * + * @return string|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param string|null $organization The optional name of the company or organisation to add to the billing address. + * + * @return self + */ + public function setOrganization($organization) + { + if (!is_null($organization) && (mb_strlen($organization) > 255)) { + throw new \InvalidArgumentException('invalid length for $organization when calling BillingDetailsRequestAddress., must be smaller than or equal to 255.'); + } + if (!is_null($organization) && (mb_strlen($organization) < 1)) { + throw new \InvalidArgumentException('invalid length for $organization when calling BillingDetailsRequestAddress., must be bigger than or equal to 1.'); + } + + $this->container['organization'] = $organization; + + 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 + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/BillingDetailsTaxId.php b/lib/model/BillingDetailsTaxId.php new file mode 100644 index 0000000..4f0c056 --- /dev/null +++ b/lib/model/BillingDetailsTaxId.php @@ -0,0 +1,486 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BillingDetailsTaxId implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BillingDetails_tax_id'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'value' => 'string', + 'kind' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'kind' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'kind' => 'kind' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'kind' => 'setKind' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'kind' => 'getKind' + ]; + + /** + * 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 KIND_AE_TRN = 'ae.trn'; + public const KIND_AU_ABN = 'au.abn'; + public const KIND_AR_CUIT = 'ar.cuit'; + public const KIND_BR_CNPJ = 'br.cnpj'; + public const KIND_BR_CPF = 'br.cpf'; + public const KIND_CA_BN = 'ca.bn'; + public const KIND_CA_GST_HST = 'ca.gst_hst'; + public const KIND_CA_PST_BC = 'ca.pst_bc'; + public const KIND_CA_PST_MB = 'ca.pst_mb'; + public const KIND_CA_PST_SK = 'ca.pst_sk'; + public const KIND_CA_QST = 'ca.qst'; + public const KIND_CH_VAT = 'ch.vat'; + public const KIND_CL_TIN = 'cl.tin'; + public const KIND_ES_CIF = 'es.cif'; + public const KIND_EU_VAT = 'eu.vat'; + public const KIND_GB_VAT = 'gb.vat'; + public const KIND_HK_BR = 'hk.br'; + public const KIND_ID_NIK = 'id.nik'; + public const KIND_ID_NPWP = 'id.npwp'; + public const KIND_IN_GST = 'in.gst'; + public const KIND_JP_CN = 'jp.cn'; + public const KIND_JP_RN = 'jp.rn'; + public const KIND_KR_BRN = 'kr.brn'; + public const KIND_LI_UID = 'li.uid'; + public const KIND_MX_RFC = 'mx.rfc'; + public const KIND_MY_FRP = 'my.frp'; + public const KIND_MY_ITN = 'my.itn'; + public const KIND_MY_NRIC = 'my.nric'; + public const KIND_MY_SST = 'my.sst'; + public const KIND_NO_VAT = 'no.vat'; + public const KIND_NZ_GST = 'nz.gst'; + public const KIND_RU_INN = 'ru.inn'; + public const KIND_RU_KPP = 'ru.kpp'; + public const KIND_SA_VAT = 'sa.vat'; + public const KIND_SG_GST = 'sg.gst'; + public const KIND_SG_UEN = 'sg.uen'; + public const KIND_TH_ID = 'th.id'; + public const KIND_TH_VAT = 'th.vat'; + public const KIND_TW_VAT = 'tw.vat'; + public const KIND_US_EIN = 'us.ein'; + public const KIND_ZA_VAT = 'za.vat'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getKindAllowableValues() + { + return [ + self::KIND_AE_TRN, + self::KIND_AU_ABN, + self::KIND_AR_CUIT, + self::KIND_BR_CNPJ, + self::KIND_BR_CPF, + self::KIND_CA_BN, + self::KIND_CA_GST_HST, + self::KIND_CA_PST_BC, + self::KIND_CA_PST_MB, + self::KIND_CA_PST_SK, + self::KIND_CA_QST, + self::KIND_CH_VAT, + self::KIND_CL_TIN, + self::KIND_ES_CIF, + self::KIND_EU_VAT, + self::KIND_GB_VAT, + self::KIND_HK_BR, + self::KIND_ID_NIK, + self::KIND_ID_NPWP, + self::KIND_IN_GST, + self::KIND_JP_CN, + self::KIND_JP_RN, + self::KIND_KR_BRN, + self::KIND_LI_UID, + self::KIND_MX_RFC, + self::KIND_MY_FRP, + self::KIND_MY_ITN, + self::KIND_MY_NRIC, + self::KIND_MY_SST, + self::KIND_NO_VAT, + self::KIND_NZ_GST, + self::KIND_RU_INN, + self::KIND_RU_KPP, + self::KIND_SA_VAT, + self::KIND_SG_GST, + self::KIND_SG_UEN, + self::KIND_TH_ID, + self::KIND_TH_VAT, + self::KIND_TW_VAT, + self::KIND_US_EIN, + self::KIND_ZA_VAT, + ]; + } + + /** + * 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->container['value'] = $data['value'] ?? null; + $this->container['kind'] = $data['kind'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ((mb_strlen($this->container['value']) > 50)) { + $invalidProperties[] = "invalid value for 'value', the character length must be smaller than or equal to 50."; + } + + if ((mb_strlen($this->container['value']) < 1)) { + $invalidProperties[] = "invalid value for 'value', the character length must be bigger than or equal to 1."; + } + + if ($this->container['kind'] === null) { + $invalidProperties[] = "'kind' can't be null"; + } + $allowedValues = $this->getKindAllowableValues(); + if (!is_null($this->container['kind']) && !in_array($this->container['kind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'kind', must be one of '%s'", + $this->container['kind'], + 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 value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value The tax ID for the buyer. + * + * @return self + */ + public function setValue($value) + { + if ((mb_strlen($value) > 50)) { + throw new \InvalidArgumentException('invalid length for $value when calling BillingDetailsTaxId., must be smaller than or equal to 50.'); + } + if ((mb_strlen($value) < 1)) { + throw new \InvalidArgumentException('invalid length for $value when calling BillingDetailsTaxId., must be bigger than or equal to 1.'); + } + + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets kind + * + * @return string + */ + public function getKind() + { + return $this->container['kind']; + } + + /** + * Sets kind + * + * @param string $kind The kind of tax ID. + * + * @return self + */ + public function setKind($kind) + { + $allowedValues = $this->getKindAllowableValues(); + if (!in_array($kind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'kind', must be one of '%s'", + $kind, + implode("', '", $allowedValues) + ) + ); + } + $this->container['kind'] = $kind; + + 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 + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/BillingDetailsUpdateRequest.php b/lib/model/BillingDetailsUpdateRequest.php index 78a262f..b61a994 100644 --- a/lib/model/BillingDetailsUpdateRequest.php +++ b/lib/model/BillingDetailsUpdateRequest.php @@ -2,7 +2,7 @@ /** * BillingDetailsUpdateRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -64,8 +64,8 @@ class BillingDetailsUpdateRequest implements ModelInterface, ArrayAccess, \JsonS 'last_name' => 'string', 'email_address' => 'string', 'phone_number' => 'string', - 'address' => '\Gr4vy\model\Address', - 'tax_id' => 'TaxId' + 'address' => '\Gr4vy\model\BillingDetailsUpdateRequestAddress', + 'tax_id' => '\Gr4vy\model\BillingDetailsTaxId' ]; /** @@ -402,7 +402,7 @@ public function setPhoneNumber($phone_number) /** * Gets address * - * @return Address|null + * @return \Gr4vy\model\BillingDetailsUpdateRequestAddress|null */ public function getAddress() { @@ -412,7 +412,7 @@ public function getAddress() /** * Sets address * - * @param Address|null $address The billing address for the buyer. + * @param \Gr4vy\model\BillingDetailsUpdateRequestAddress|null $address address * * @return self */ @@ -426,7 +426,7 @@ public function setAddress($address) /** * Gets tax_id * - * @return TaxId|null + * @return \Gr4vy\model\BillingDetailsTaxId|null */ public function getTaxId() { @@ -436,7 +436,7 @@ public function getTaxId() /** * Sets tax_id * - * @param TaxId|null $tax_id tax_id + * @param \Gr4vy\model\BillingDetailsTaxId|null $tax_id tax_id * * @return self */ @@ -453,7 +453,7 @@ public function setTaxId($tax_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -465,6 +465,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -478,7 +479,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -494,7 +495,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -506,6 +507,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/BillingDetailsUpdateRequestAddress.php b/lib/model/BillingDetailsUpdateRequestAddress.php new file mode 100644 index 0000000..8217f2f --- /dev/null +++ b/lib/model/BillingDetailsUpdateRequestAddress.php @@ -0,0 +1,699 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BillingDetailsUpdateRequestAddress implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BillingDetailsUpdateRequest_address'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'country' => 'string', + 'postal_code' => 'string', + 'state' => 'string', + 'state_code' => 'string', + 'house_number_or_name' => 'string', + 'line1' => 'string', + 'line2' => 'string', + 'organization' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'city' => null, + 'country' => null, + 'postal_code' => null, + 'state' => null, + 'state_code' => null, + 'house_number_or_name' => null, + 'line1' => null, + 'line2' => null, + 'organization' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'country' => 'country', + 'postal_code' => 'postal_code', + 'state' => 'state', + 'state_code' => 'state_code', + 'house_number_or_name' => 'house_number_or_name', + 'line1' => 'line1', + 'line2' => 'line2', + 'organization' => 'organization' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'postal_code' => 'setPostalCode', + 'state' => 'setState', + 'state_code' => 'setStateCode', + 'house_number_or_name' => 'setHouseNumberOrName', + 'line1' => 'setLine1', + 'line2' => 'setLine2', + 'organization' => 'setOrganization' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'postal_code' => 'getPostalCode', + 'state' => 'getState', + 'state_code' => 'getStateCode', + 'house_number_or_name' => 'getHouseNumberOrName', + 'line1' => 'getLine1', + 'line2' => 'getLine2', + 'organization' => 'getOrganization' + ]; + + /** + * 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->container['city'] = $data['city'] ?? null; + $this->container['country'] = $data['country'] ?? null; + $this->container['postal_code'] = $data['postal_code'] ?? null; + $this->container['state'] = $data['state'] ?? null; + $this->container['state_code'] = $data['state_code'] ?? null; + $this->container['house_number_or_name'] = $data['house_number_or_name'] ?? null; + $this->container['line1'] = $data['line1'] ?? null; + $this->container['line2'] = $data['line2'] ?? null; + $this->container['organization'] = $data['organization'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['city']) && (mb_strlen($this->container['city']) > 100)) { + $invalidProperties[] = "invalid value for 'city', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['city']) && (mb_strlen($this->container['city']) < 1)) { + $invalidProperties[] = "invalid value for 'city', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['country']) && (mb_strlen($this->container['country']) > 2)) { + $invalidProperties[] = "invalid value for 'country', the character length must be smaller than or equal to 2."; + } + + if (!is_null($this->container['country']) && (mb_strlen($this->container['country']) < 1)) { + $invalidProperties[] = "invalid value for 'country', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['postal_code']) && (mb_strlen($this->container['postal_code']) > 50)) { + $invalidProperties[] = "invalid value for 'postal_code', the character length must be smaller than or equal to 50."; + } + + if (!is_null($this->container['postal_code']) && (mb_strlen($this->container['postal_code']) < 1)) { + $invalidProperties[] = "invalid value for 'postal_code', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['state']) && (mb_strlen($this->container['state']) > 255)) { + $invalidProperties[] = "invalid value for 'state', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['state']) && (mb_strlen($this->container['state']) < 1)) { + $invalidProperties[] = "invalid value for 'state', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['state_code']) && (mb_strlen($this->container['state_code']) > 6)) { + $invalidProperties[] = "invalid value for 'state_code', the character length must be smaller than or equal to 6."; + } + + if (!is_null($this->container['state_code']) && (mb_strlen($this->container['state_code']) < 4)) { + $invalidProperties[] = "invalid value for 'state_code', the character length must be bigger than or equal to 4."; + } + + if (!is_null($this->container['house_number_or_name']) && (mb_strlen($this->container['house_number_or_name']) > 255)) { + $invalidProperties[] = "invalid value for 'house_number_or_name', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['house_number_or_name']) && (mb_strlen($this->container['house_number_or_name']) < 1)) { + $invalidProperties[] = "invalid value for 'house_number_or_name', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['line1']) && (mb_strlen($this->container['line1']) > 255)) { + $invalidProperties[] = "invalid value for 'line1', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['line1']) && (mb_strlen($this->container['line1']) < 1)) { + $invalidProperties[] = "invalid value for 'line1', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['line2']) && (mb_strlen($this->container['line2']) > 255)) { + $invalidProperties[] = "invalid value for 'line2', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['line2']) && (mb_strlen($this->container['line2']) < 1)) { + $invalidProperties[] = "invalid value for 'line2', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['organization']) && (mb_strlen($this->container['organization']) > 255)) { + $invalidProperties[] = "invalid value for 'organization', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['organization']) && (mb_strlen($this->container['organization']) < 1)) { + $invalidProperties[] = "invalid value for 'organization', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city The city for the billing address. + * + * @return self + */ + public function setCity($city) + { + if (!is_null($city) && (mb_strlen($city) > 100)) { + throw new \InvalidArgumentException('invalid length for $city when calling BillingDetailsUpdateRequestAddress., must be smaller than or equal to 100.'); + } + if (!is_null($city) && (mb_strlen($city) < 1)) { + throw new \InvalidArgumentException('invalid length for $city when calling BillingDetailsUpdateRequestAddress., must be bigger than or equal to 1.'); + } + + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country The country for the billing address. + * + * @return self + */ + public function setCountry($country) + { + if (!is_null($country) && (mb_strlen($country) > 2)) { + throw new \InvalidArgumentException('invalid length for $country when calling BillingDetailsUpdateRequestAddress., must be smaller than or equal to 2.'); + } + if (!is_null($country) && (mb_strlen($country) < 1)) { + throw new \InvalidArgumentException('invalid length for $country when calling BillingDetailsUpdateRequestAddress., must be bigger than or equal to 1.'); + } + + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets postal_code + * + * @return string|null + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string|null $postal_code The postal code or zip code for the billing address. + * + * @return self + */ + public function setPostalCode($postal_code) + { + if (!is_null($postal_code) && (mb_strlen($postal_code) > 50)) { + throw new \InvalidArgumentException('invalid length for $postal_code when calling BillingDetailsUpdateRequestAddress., must be smaller than or equal to 50.'); + } + if (!is_null($postal_code) && (mb_strlen($postal_code) < 1)) { + throw new \InvalidArgumentException('invalid length for $postal_code when calling BillingDetailsUpdateRequestAddress., must be bigger than or equal to 1.'); + } + + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets state + * + * @return string|null + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param string|null $state The state, county, or province for the billing address. + * + * @return self + */ + public function setState($state) + { + if (!is_null($state) && (mb_strlen($state) > 255)) { + throw new \InvalidArgumentException('invalid length for $state when calling BillingDetailsUpdateRequestAddress., must be smaller than or equal to 255.'); + } + if (!is_null($state) && (mb_strlen($state) < 1)) { + throw new \InvalidArgumentException('invalid length for $state when calling BillingDetailsUpdateRequestAddress., must be bigger than or equal to 1.'); + } + + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets state_code + * + * @return string|null + */ + public function getStateCode() + { + return $this->container['state_code']; + } + + /** + * Sets state_code + * + * @param string|null $state_code The code of state, county, or province for the billing address in ISO 3166-2 format. + * + * @return self + */ + public function setStateCode($state_code) + { + if (!is_null($state_code) && (mb_strlen($state_code) > 6)) { + throw new \InvalidArgumentException('invalid length for $state_code when calling BillingDetailsUpdateRequestAddress., must be smaller than or equal to 6.'); + } + if (!is_null($state_code) && (mb_strlen($state_code) < 4)) { + throw new \InvalidArgumentException('invalid length for $state_code when calling BillingDetailsUpdateRequestAddress., must be bigger than or equal to 4.'); + } + + $this->container['state_code'] = $state_code; + + return $this; + } + + /** + * Gets house_number_or_name + * + * @return string|null + */ + public function getHouseNumberOrName() + { + return $this->container['house_number_or_name']; + } + + /** + * Sets house_number_or_name + * + * @param string|null $house_number_or_name The house number or name for the billing address. Not all payment services use this field but some do. + * + * @return self + */ + public function setHouseNumberOrName($house_number_or_name) + { + if (!is_null($house_number_or_name) && (mb_strlen($house_number_or_name) > 255)) { + throw new \InvalidArgumentException('invalid length for $house_number_or_name when calling BillingDetailsUpdateRequestAddress., must be smaller than or equal to 255.'); + } + if (!is_null($house_number_or_name) && (mb_strlen($house_number_or_name) < 1)) { + throw new \InvalidArgumentException('invalid length for $house_number_or_name when calling BillingDetailsUpdateRequestAddress., must be bigger than or equal to 1.'); + } + + $this->container['house_number_or_name'] = $house_number_or_name; + + return $this; + } + + /** + * Gets line1 + * + * @return string|null + */ + public function getLine1() + { + return $this->container['line1']; + } + + /** + * Sets line1 + * + * @param string|null $line1 The first line of the billing address. + * + * @return self + */ + public function setLine1($line1) + { + if (!is_null($line1) && (mb_strlen($line1) > 255)) { + throw new \InvalidArgumentException('invalid length for $line1 when calling BillingDetailsUpdateRequestAddress., must be smaller than or equal to 255.'); + } + if (!is_null($line1) && (mb_strlen($line1) < 1)) { + throw new \InvalidArgumentException('invalid length for $line1 when calling BillingDetailsUpdateRequestAddress., must be bigger than or equal to 1.'); + } + + $this->container['line1'] = $line1; + + return $this; + } + + /** + * Gets line2 + * + * @return string|null + */ + public function getLine2() + { + return $this->container['line2']; + } + + /** + * Sets line2 + * + * @param string|null $line2 The second line of the billing address. + * + * @return self + */ + public function setLine2($line2) + { + if (!is_null($line2) && (mb_strlen($line2) > 255)) { + throw new \InvalidArgumentException('invalid length for $line2 when calling BillingDetailsUpdateRequestAddress., must be smaller than or equal to 255.'); + } + if (!is_null($line2) && (mb_strlen($line2) < 1)) { + throw new \InvalidArgumentException('invalid length for $line2 when calling BillingDetailsUpdateRequestAddress., must be bigger than or equal to 1.'); + } + + $this->container['line2'] = $line2; + + return $this; + } + + /** + * Gets organization + * + * @return string|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param string|null $organization The optional name of the company or organisation to add to the billing address. + * + * @return self + */ + public function setOrganization($organization) + { + if (!is_null($organization) && (mb_strlen($organization) > 255)) { + throw new \InvalidArgumentException('invalid length for $organization when calling BillingDetailsUpdateRequestAddress., must be smaller than or equal to 255.'); + } + if (!is_null($organization) && (mb_strlen($organization) < 1)) { + throw new \InvalidArgumentException('invalid length for $organization when calling BillingDetailsUpdateRequestAddress., must be bigger than or equal to 1.'); + } + + $this->container['organization'] = $organization; + + 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 + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/BrowserInfo.php b/lib/model/BrowserInfo.php index 91a6692..fff6163 100644 --- a/lib/model/BrowserInfo.php +++ b/lib/model/BrowserInfo.php @@ -2,7 +2,7 @@ /** * BrowserInfo * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -208,8 +208,8 @@ public function getModelName() return self::$openAPIModelName; } - const USER_DEVICE_DESKTOP = 'desktop'; - const USER_DEVICE_MOBILE = 'mobile'; + public const USER_DEVICE_DESKTOP = 'desktop'; + public const USER_DEVICE_MOBILE = 'mobile'; /** * Gets allowable values of the enum @@ -567,7 +567,7 @@ public function setAcceptHeader($accept_header) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -579,6 +579,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -592,7 +593,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -608,7 +609,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -620,6 +621,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/Buyer.php b/lib/model/Buyer.php index 7afc1f3..6cf7cc7 100644 --- a/lib/model/Buyer.php +++ b/lib/model/Buyer.php @@ -2,7 +2,7 @@ /** * Buyer * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -64,7 +64,7 @@ class Buyer implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'string', 'external_identifier' => 'string', 'display_name' => 'string', - 'billing_details' => '\Gr4vy\model\BillingDetails', + 'billing_details' => '\Gr4vy\model\BuyerBillingDetails', 'created_at' => '\DateTime', 'updated_at' => '\DateTime' ]; @@ -193,7 +193,7 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_BUYER = 'buyer'; + public const TYPE_BUYER = 'buyer'; /** * Gets allowable values of the enum @@ -403,7 +403,7 @@ public function setDisplayName($display_name) /** * Gets billing_details * - * @return BillingDetails|null + * @return \Gr4vy\model\BuyerBillingDetails|null */ public function getBillingDetails() { @@ -413,7 +413,7 @@ public function getBillingDetails() /** * Sets billing_details * - * @param BillingDetails|null $billing_details billing_details + * @param \Gr4vy\model\BuyerBillingDetails|null $billing_details billing_details * * @return self */ @@ -478,7 +478,7 @@ public function setUpdatedAt($updated_at) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -490,6 +490,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -503,7 +504,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -519,7 +520,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -531,6 +532,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/BuyerBillingDetails.php b/lib/model/BuyerBillingDetails.php new file mode 100644 index 0000000..8fb0237 --- /dev/null +++ b/lib/model/BuyerBillingDetails.php @@ -0,0 +1,602 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BuyerBillingDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Buyer_billing_details'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'first_name' => 'string', + 'last_name' => 'string', + 'email_address' => 'string', + 'phone_number' => 'string', + 'address' => '\Gr4vy\model\BillingDetailsAddress', + 'tax_id' => '\Gr4vy\model\BillingDetailsTaxId' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'first_name' => null, + 'last_name' => null, + 'email_address' => null, + 'phone_number' => null, + 'address' => null, + 'tax_id' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'first_name' => 'first_name', + 'last_name' => 'last_name', + 'email_address' => 'email_address', + 'phone_number' => 'phone_number', + 'address' => 'address', + 'tax_id' => 'tax_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'email_address' => 'setEmailAddress', + 'phone_number' => 'setPhoneNumber', + 'address' => 'setAddress', + 'tax_id' => 'setTaxId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'email_address' => 'getEmailAddress', + 'phone_number' => 'getPhoneNumber', + 'address' => 'getAddress', + 'tax_id' => 'getTaxId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_BILLING_DETAILS = 'billing-details'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BILLING_DETAILS, + ]; + } + + /** + * 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->container['type'] = $data['type'] ?? null; + $this->container['first_name'] = $data['first_name'] ?? null; + $this->container['last_name'] = $data['last_name'] ?? null; + $this->container['email_address'] = $data['email_address'] ?? null; + $this->container['phone_number'] = $data['phone_number'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['tax_id'] = $data['tax_id'] ?? null; + } + + /** + * 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) + ); + } + + if (!is_null($this->container['first_name']) && (mb_strlen($this->container['first_name']) > 255)) { + $invalidProperties[] = "invalid value for 'first_name', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['first_name']) && (mb_strlen($this->container['first_name']) < 1)) { + $invalidProperties[] = "invalid value for 'first_name', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['last_name']) && (mb_strlen($this->container['last_name']) > 255)) { + $invalidProperties[] = "invalid value for 'last_name', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['last_name']) && (mb_strlen($this->container['last_name']) < 1)) { + $invalidProperties[] = "invalid value for 'last_name', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['email_address']) && (mb_strlen($this->container['email_address']) > 320)) { + $invalidProperties[] = "invalid value for 'email_address', the character length must be smaller than or equal to 320."; + } + + if (!is_null($this->container['email_address']) && (mb_strlen($this->container['email_address']) < 1)) { + $invalidProperties[] = "invalid value for 'email_address', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['phone_number']) && (mb_strlen($this->container['phone_number']) > 50)) { + $invalidProperties[] = "invalid value for 'phone_number', the character length must be smaller than or equal to 50."; + } + + if (!is_null($this->container['phone_number']) && (mb_strlen($this->container['phone_number']) < 1)) { + $invalidProperties[] = "invalid value for 'phone_number', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['phone_number']) && !preg_match("/^\\+[1-9]\\d{1,14}$/", $this->container['phone_number'])) { + $invalidProperties[] = "invalid value for 'phone_number', must be conform to the pattern /^\\+[1-9]\\d{1,14}$/."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of this resource. Is always `billing-details`. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !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 first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name The first name(s) or given name of the buyer. + * + * @return self + */ + public function setFirstName($first_name) + { + if (!is_null($first_name) && (mb_strlen($first_name) > 255)) { + throw new \InvalidArgumentException('invalid length for $first_name when calling BuyerBillingDetails., must be smaller than or equal to 255.'); + } + if (!is_null($first_name) && (mb_strlen($first_name) < 1)) { + throw new \InvalidArgumentException('invalid length for $first_name when calling BuyerBillingDetails., must be bigger than or equal to 1.'); + } + + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string|null + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string|null $last_name The last name, or family name, of the buyer. + * + * @return self + */ + public function setLastName($last_name) + { + if (!is_null($last_name) && (mb_strlen($last_name) > 255)) { + throw new \InvalidArgumentException('invalid length for $last_name when calling BuyerBillingDetails., must be smaller than or equal to 255.'); + } + if (!is_null($last_name) && (mb_strlen($last_name) < 1)) { + throw new \InvalidArgumentException('invalid length for $last_name when calling BuyerBillingDetails., must be bigger than or equal to 1.'); + } + + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets email_address + * + * @return string|null + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string|null $email_address The email address of the buyer. + * + * @return self + */ + public function setEmailAddress($email_address) + { + if (!is_null($email_address) && (mb_strlen($email_address) > 320)) { + throw new \InvalidArgumentException('invalid length for $email_address when calling BuyerBillingDetails., must be smaller than or equal to 320.'); + } + if (!is_null($email_address) && (mb_strlen($email_address) < 1)) { + throw new \InvalidArgumentException('invalid length for $email_address when calling BuyerBillingDetails., must be bigger than or equal to 1.'); + } + + $this->container['email_address'] = $email_address; + + return $this; + } + + /** + * Gets phone_number + * + * @return string|null + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string|null $phone_number The phone number of the buyer. This number is formatted according to the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (!is_null($phone_number) && (mb_strlen($phone_number) > 50)) { + throw new \InvalidArgumentException('invalid length for $phone_number when calling BuyerBillingDetails., must be smaller than or equal to 50.'); + } + if (!is_null($phone_number) && (mb_strlen($phone_number) < 1)) { + throw new \InvalidArgumentException('invalid length for $phone_number when calling BuyerBillingDetails., must be bigger than or equal to 1.'); + } + if (!is_null($phone_number) && (!preg_match("/^\\+[1-9]\\d{1,14}$/", $phone_number))) { + throw new \InvalidArgumentException("invalid value for $phone_number when calling BuyerBillingDetails., must conform to the pattern /^\\+[1-9]\\d{1,14}$/."); + } + + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets address + * + * @return \Gr4vy\model\BillingDetailsAddress|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Gr4vy\model\BillingDetailsAddress|null $address address + * + * @return self + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets tax_id + * + * @return \Gr4vy\model\BillingDetailsTaxId|null + */ + public function getTaxId() + { + return $this->container['tax_id']; + } + + /** + * Sets tax_id + * + * @param \Gr4vy\model\BillingDetailsTaxId|null $tax_id tax_id + * + * @return self + */ + public function setTaxId($tax_id) + { + $this->container['tax_id'] = $tax_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 + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/BuyerRequest.php b/lib/model/BuyerRequest.php index 7c27eea..afa0177 100644 --- a/lib/model/BuyerRequest.php +++ b/lib/model/BuyerRequest.php @@ -2,7 +2,7 @@ /** * BuyerRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -63,7 +63,7 @@ class BuyerRequest implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'external_identifier' => 'string', 'display_name' => 'string', - 'billing_details' => 'BillingDetailsRequest' + 'billing_details' => '\Gr4vy\model\BuyerRequestBillingDetails' ]; /** @@ -300,7 +300,7 @@ public function setDisplayName($display_name) /** * Gets billing_details * - * @return BillingDetailsRequest|null + * @return \Gr4vy\model\BuyerRequestBillingDetails|null */ public function getBillingDetails() { @@ -310,7 +310,7 @@ public function getBillingDetails() /** * Sets billing_details * - * @param BillingDetailsRequest|null $billing_details billing_details + * @param \Gr4vy\model\BuyerRequestBillingDetails|null $billing_details billing_details * * @return self */ @@ -327,7 +327,7 @@ public function setBillingDetails($billing_details) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -339,6 +339,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -352,7 +353,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -368,7 +369,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -380,6 +381,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/BuyerRequestBillingDetails.php b/lib/model/BuyerRequestBillingDetails.php new file mode 100644 index 0000000..9b6445b --- /dev/null +++ b/lib/model/BuyerRequestBillingDetails.php @@ -0,0 +1,540 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BuyerRequestBillingDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BuyerRequest_billing_details'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'first_name' => 'string', + 'last_name' => 'string', + 'email_address' => 'string', + 'phone_number' => 'string', + 'address' => '\Gr4vy\model\BillingDetailsRequestAddress', + 'tax_id' => '\Gr4vy\model\BillingDetailsTaxId' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'first_name' => null, + 'last_name' => null, + 'email_address' => null, + 'phone_number' => null, + 'address' => null, + 'tax_id' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'first_name' => 'first_name', + 'last_name' => 'last_name', + 'email_address' => 'email_address', + 'phone_number' => 'phone_number', + 'address' => 'address', + 'tax_id' => 'tax_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'email_address' => 'setEmailAddress', + 'phone_number' => 'setPhoneNumber', + 'address' => 'setAddress', + 'tax_id' => 'setTaxId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'email_address' => 'getEmailAddress', + 'phone_number' => 'getPhoneNumber', + 'address' => 'getAddress', + 'tax_id' => 'getTaxId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['first_name'] = $data['first_name'] ?? null; + $this->container['last_name'] = $data['last_name'] ?? null; + $this->container['email_address'] = $data['email_address'] ?? null; + $this->container['phone_number'] = $data['phone_number'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['tax_id'] = $data['tax_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['first_name']) && (mb_strlen($this->container['first_name']) > 255)) { + $invalidProperties[] = "invalid value for 'first_name', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['first_name']) && (mb_strlen($this->container['first_name']) < 1)) { + $invalidProperties[] = "invalid value for 'first_name', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['last_name']) && (mb_strlen($this->container['last_name']) > 255)) { + $invalidProperties[] = "invalid value for 'last_name', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['last_name']) && (mb_strlen($this->container['last_name']) < 1)) { + $invalidProperties[] = "invalid value for 'last_name', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['email_address']) && (mb_strlen($this->container['email_address']) > 320)) { + $invalidProperties[] = "invalid value for 'email_address', the character length must be smaller than or equal to 320."; + } + + if (!is_null($this->container['email_address']) && (mb_strlen($this->container['email_address']) < 1)) { + $invalidProperties[] = "invalid value for 'email_address', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['phone_number']) && (mb_strlen($this->container['phone_number']) > 50)) { + $invalidProperties[] = "invalid value for 'phone_number', the character length must be smaller than or equal to 50."; + } + + if (!is_null($this->container['phone_number']) && (mb_strlen($this->container['phone_number']) < 1)) { + $invalidProperties[] = "invalid value for 'phone_number', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['phone_number']) && !preg_match("/^\\+[1-9]\\d{1,14}$/", $this->container['phone_number'])) { + $invalidProperties[] = "invalid value for 'phone_number', must be conform to the pattern /^\\+[1-9]\\d{1,14}$/."; + } + + 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 first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name The first name(s) or given name for the buyer. + * + * @return self + */ + public function setFirstName($first_name) + { + if (!is_null($first_name) && (mb_strlen($first_name) > 255)) { + throw new \InvalidArgumentException('invalid length for $first_name when calling BuyerRequestBillingDetails., must be smaller than or equal to 255.'); + } + if (!is_null($first_name) && (mb_strlen($first_name) < 1)) { + throw new \InvalidArgumentException('invalid length for $first_name when calling BuyerRequestBillingDetails., must be bigger than or equal to 1.'); + } + + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string|null + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string|null $last_name The last name, or family name, of the buyer. + * + * @return self + */ + public function setLastName($last_name) + { + if (!is_null($last_name) && (mb_strlen($last_name) > 255)) { + throw new \InvalidArgumentException('invalid length for $last_name when calling BuyerRequestBillingDetails., must be smaller than or equal to 255.'); + } + if (!is_null($last_name) && (mb_strlen($last_name) < 1)) { + throw new \InvalidArgumentException('invalid length for $last_name when calling BuyerRequestBillingDetails., must be bigger than or equal to 1.'); + } + + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets email_address + * + * @return string|null + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string|null $email_address The email address for the buyer. + * + * @return self + */ + public function setEmailAddress($email_address) + { + if (!is_null($email_address) && (mb_strlen($email_address) > 320)) { + throw new \InvalidArgumentException('invalid length for $email_address when calling BuyerRequestBillingDetails., must be smaller than or equal to 320.'); + } + if (!is_null($email_address) && (mb_strlen($email_address) < 1)) { + throw new \InvalidArgumentException('invalid length for $email_address when calling BuyerRequestBillingDetails., must be bigger than or equal to 1.'); + } + + $this->container['email_address'] = $email_address; + + return $this; + } + + /** + * Gets phone_number + * + * @return string|null + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string|null $phone_number The phone number for the buyer which should be formatted according to the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (!is_null($phone_number) && (mb_strlen($phone_number) > 50)) { + throw new \InvalidArgumentException('invalid length for $phone_number when calling BuyerRequestBillingDetails., must be smaller than or equal to 50.'); + } + if (!is_null($phone_number) && (mb_strlen($phone_number) < 1)) { + throw new \InvalidArgumentException('invalid length for $phone_number when calling BuyerRequestBillingDetails., must be bigger than or equal to 1.'); + } + if (!is_null($phone_number) && (!preg_match("/^\\+[1-9]\\d{1,14}$/", $phone_number))) { + throw new \InvalidArgumentException("invalid value for $phone_number when calling BuyerRequestBillingDetails., must conform to the pattern /^\\+[1-9]\\d{1,14}$/."); + } + + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets address + * + * @return \Gr4vy\model\BillingDetailsRequestAddress|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Gr4vy\model\BillingDetailsRequestAddress|null $address address + * + * @return self + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets tax_id + * + * @return \Gr4vy\model\BillingDetailsTaxId|null + */ + public function getTaxId() + { + return $this->container['tax_id']; + } + + /** + * Sets tax_id + * + * @param \Gr4vy\model\BillingDetailsTaxId|null $tax_id tax_id + * + * @return self + */ + public function setTaxId($tax_id) + { + $this->container['tax_id'] = $tax_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 + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/BuyerSnapshot.php b/lib/model/BuyerSnapshot.php index 1efefa1..85608bc 100644 --- a/lib/model/BuyerSnapshot.php +++ b/lib/model/BuyerSnapshot.php @@ -2,7 +2,7 @@ /** * BuyerSnapshot * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -65,7 +65,7 @@ class BuyerSnapshot implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'string', 'external_identifier' => 'string', 'display_name' => 'string', - 'billing_details' => '\Gr4vy\model\BillingDetails' + 'billing_details' => '\Gr4vy\model\BuyerSnapshotBillingDetails' ]; /** @@ -184,7 +184,7 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_BUYER = 'buyer'; + public const TYPE_BUYER = 'buyer'; /** * Gets allowable values of the enum @@ -392,7 +392,7 @@ public function setDisplayName($display_name) /** * Gets billing_details * - * @return BillingDetails|null + * @return \Gr4vy\model\BuyerSnapshotBillingDetails|null */ public function getBillingDetails() { @@ -402,7 +402,7 @@ public function getBillingDetails() /** * Sets billing_details * - * @param BillingDetails|null $billing_details billing_details + * @param \Gr4vy\model\BuyerSnapshotBillingDetails|null $billing_details billing_details * * @return self */ @@ -419,7 +419,7 @@ public function setBillingDetails($billing_details) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -431,6 +431,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -444,7 +445,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -460,7 +461,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -472,6 +473,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/BuyerSnapshotBillingDetails.php b/lib/model/BuyerSnapshotBillingDetails.php new file mode 100644 index 0000000..febac32 --- /dev/null +++ b/lib/model/BuyerSnapshotBillingDetails.php @@ -0,0 +1,602 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BuyerSnapshotBillingDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Buyer__Snapshot_billing_details'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'first_name' => 'string', + 'last_name' => 'string', + 'email_address' => 'string', + 'phone_number' => 'string', + 'address' => '\Gr4vy\model\BillingDetailsAddress', + 'tax_id' => '\Gr4vy\model\BillingDetailsTaxId' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'first_name' => null, + 'last_name' => null, + 'email_address' => null, + 'phone_number' => null, + 'address' => null, + 'tax_id' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'first_name' => 'first_name', + 'last_name' => 'last_name', + 'email_address' => 'email_address', + 'phone_number' => 'phone_number', + 'address' => 'address', + 'tax_id' => 'tax_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'email_address' => 'setEmailAddress', + 'phone_number' => 'setPhoneNumber', + 'address' => 'setAddress', + 'tax_id' => 'setTaxId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'email_address' => 'getEmailAddress', + 'phone_number' => 'getPhoneNumber', + 'address' => 'getAddress', + 'tax_id' => 'getTaxId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_BILLING_DETAILS = 'billing-details'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BILLING_DETAILS, + ]; + } + + /** + * 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->container['type'] = $data['type'] ?? null; + $this->container['first_name'] = $data['first_name'] ?? null; + $this->container['last_name'] = $data['last_name'] ?? null; + $this->container['email_address'] = $data['email_address'] ?? null; + $this->container['phone_number'] = $data['phone_number'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['tax_id'] = $data['tax_id'] ?? null; + } + + /** + * 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) + ); + } + + if (!is_null($this->container['first_name']) && (mb_strlen($this->container['first_name']) > 255)) { + $invalidProperties[] = "invalid value for 'first_name', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['first_name']) && (mb_strlen($this->container['first_name']) < 1)) { + $invalidProperties[] = "invalid value for 'first_name', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['last_name']) && (mb_strlen($this->container['last_name']) > 255)) { + $invalidProperties[] = "invalid value for 'last_name', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['last_name']) && (mb_strlen($this->container['last_name']) < 1)) { + $invalidProperties[] = "invalid value for 'last_name', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['email_address']) && (mb_strlen($this->container['email_address']) > 320)) { + $invalidProperties[] = "invalid value for 'email_address', the character length must be smaller than or equal to 320."; + } + + if (!is_null($this->container['email_address']) && (mb_strlen($this->container['email_address']) < 1)) { + $invalidProperties[] = "invalid value for 'email_address', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['phone_number']) && (mb_strlen($this->container['phone_number']) > 50)) { + $invalidProperties[] = "invalid value for 'phone_number', the character length must be smaller than or equal to 50."; + } + + if (!is_null($this->container['phone_number']) && (mb_strlen($this->container['phone_number']) < 1)) { + $invalidProperties[] = "invalid value for 'phone_number', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['phone_number']) && !preg_match("/^\\+[1-9]\\d{1,14}$/", $this->container['phone_number'])) { + $invalidProperties[] = "invalid value for 'phone_number', must be conform to the pattern /^\\+[1-9]\\d{1,14}$/."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of this resource. Is always `billing-details`. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !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 first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name The first name(s) or given name of the buyer. + * + * @return self + */ + public function setFirstName($first_name) + { + if (!is_null($first_name) && (mb_strlen($first_name) > 255)) { + throw new \InvalidArgumentException('invalid length for $first_name when calling BuyerSnapshotBillingDetails., must be smaller than or equal to 255.'); + } + if (!is_null($first_name) && (mb_strlen($first_name) < 1)) { + throw new \InvalidArgumentException('invalid length for $first_name when calling BuyerSnapshotBillingDetails., must be bigger than or equal to 1.'); + } + + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string|null + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string|null $last_name The last name, or family name, of the buyer. + * + * @return self + */ + public function setLastName($last_name) + { + if (!is_null($last_name) && (mb_strlen($last_name) > 255)) { + throw new \InvalidArgumentException('invalid length for $last_name when calling BuyerSnapshotBillingDetails., must be smaller than or equal to 255.'); + } + if (!is_null($last_name) && (mb_strlen($last_name) < 1)) { + throw new \InvalidArgumentException('invalid length for $last_name when calling BuyerSnapshotBillingDetails., must be bigger than or equal to 1.'); + } + + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets email_address + * + * @return string|null + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string|null $email_address The email address of the buyer. + * + * @return self + */ + public function setEmailAddress($email_address) + { + if (!is_null($email_address) && (mb_strlen($email_address) > 320)) { + throw new \InvalidArgumentException('invalid length for $email_address when calling BuyerSnapshotBillingDetails., must be smaller than or equal to 320.'); + } + if (!is_null($email_address) && (mb_strlen($email_address) < 1)) { + throw new \InvalidArgumentException('invalid length for $email_address when calling BuyerSnapshotBillingDetails., must be bigger than or equal to 1.'); + } + + $this->container['email_address'] = $email_address; + + return $this; + } + + /** + * Gets phone_number + * + * @return string|null + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string|null $phone_number The phone number of the buyer. This number is formatted according to the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (!is_null($phone_number) && (mb_strlen($phone_number) > 50)) { + throw new \InvalidArgumentException('invalid length for $phone_number when calling BuyerSnapshotBillingDetails., must be smaller than or equal to 50.'); + } + if (!is_null($phone_number) && (mb_strlen($phone_number) < 1)) { + throw new \InvalidArgumentException('invalid length for $phone_number when calling BuyerSnapshotBillingDetails., must be bigger than or equal to 1.'); + } + if (!is_null($phone_number) && (!preg_match("/^\\+[1-9]\\d{1,14}$/", $phone_number))) { + throw new \InvalidArgumentException("invalid value for $phone_number when calling BuyerSnapshotBillingDetails., must conform to the pattern /^\\+[1-9]\\d{1,14}$/."); + } + + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets address + * + * @return \Gr4vy\model\BillingDetailsAddress|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Gr4vy\model\BillingDetailsAddress|null $address address + * + * @return self + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets tax_id + * + * @return \Gr4vy\model\BillingDetailsTaxId|null + */ + public function getTaxId() + { + return $this->container['tax_id']; + } + + /** + * Sets tax_id + * + * @param \Gr4vy\model\BillingDetailsTaxId|null $tax_id tax_id + * + * @return self + */ + public function setTaxId($tax_id) + { + $this->container['tax_id'] = $tax_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 + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/BuyerUpdate.php b/lib/model/BuyerUpdate.php index 94d7de0..5d9e0f5 100644 --- a/lib/model/BuyerUpdate.php +++ b/lib/model/BuyerUpdate.php @@ -2,7 +2,7 @@ /** * BuyerUpdate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -63,7 +63,7 @@ class BuyerUpdate implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'external_identifier' => 'string', 'display_name' => 'string', - 'billing_details' => 'BillingDetailsUpdateRequest' + 'billing_details' => '\Gr4vy\model\BuyerUpdateBillingDetails' ]; /** @@ -300,7 +300,7 @@ public function setDisplayName($display_name) /** * Gets billing_details * - * @return BillingDetailsUpdateRequest|null + * @return \Gr4vy\model\BuyerUpdateBillingDetails|null */ public function getBillingDetails() { @@ -310,7 +310,7 @@ public function getBillingDetails() /** * Sets billing_details * - * @param BillingDetailsUpdateRequest|null $billing_details billing_details + * @param \Gr4vy\model\BuyerUpdateBillingDetails|null $billing_details billing_details * * @return self */ @@ -327,7 +327,7 @@ public function setBillingDetails($billing_details) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -339,6 +339,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -352,7 +353,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -368,7 +369,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -380,6 +381,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/BuyerUpdateBillingDetails.php b/lib/model/BuyerUpdateBillingDetails.php new file mode 100644 index 0000000..cc0b4f3 --- /dev/null +++ b/lib/model/BuyerUpdateBillingDetails.php @@ -0,0 +1,540 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BuyerUpdateBillingDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BuyerUpdate_billing_details'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'first_name' => 'string', + 'last_name' => 'string', + 'email_address' => 'string', + 'phone_number' => 'string', + 'address' => '\Gr4vy\model\BillingDetailsUpdateRequestAddress', + 'tax_id' => '\Gr4vy\model\BillingDetailsTaxId' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'first_name' => null, + 'last_name' => null, + 'email_address' => null, + 'phone_number' => null, + 'address' => null, + 'tax_id' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'first_name' => 'first_name', + 'last_name' => 'last_name', + 'email_address' => 'email_address', + 'phone_number' => 'phone_number', + 'address' => 'address', + 'tax_id' => 'tax_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'email_address' => 'setEmailAddress', + 'phone_number' => 'setPhoneNumber', + 'address' => 'setAddress', + 'tax_id' => 'setTaxId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'email_address' => 'getEmailAddress', + 'phone_number' => 'getPhoneNumber', + 'address' => 'getAddress', + 'tax_id' => 'getTaxId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['first_name'] = $data['first_name'] ?? null; + $this->container['last_name'] = $data['last_name'] ?? null; + $this->container['email_address'] = $data['email_address'] ?? null; + $this->container['phone_number'] = $data['phone_number'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['tax_id'] = $data['tax_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['first_name']) && (mb_strlen($this->container['first_name']) > 255)) { + $invalidProperties[] = "invalid value for 'first_name', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['first_name']) && (mb_strlen($this->container['first_name']) < 1)) { + $invalidProperties[] = "invalid value for 'first_name', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['last_name']) && (mb_strlen($this->container['last_name']) > 255)) { + $invalidProperties[] = "invalid value for 'last_name', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['last_name']) && (mb_strlen($this->container['last_name']) < 1)) { + $invalidProperties[] = "invalid value for 'last_name', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['email_address']) && (mb_strlen($this->container['email_address']) > 320)) { + $invalidProperties[] = "invalid value for 'email_address', the character length must be smaller than or equal to 320."; + } + + if (!is_null($this->container['email_address']) && (mb_strlen($this->container['email_address']) < 1)) { + $invalidProperties[] = "invalid value for 'email_address', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['phone_number']) && (mb_strlen($this->container['phone_number']) > 50)) { + $invalidProperties[] = "invalid value for 'phone_number', the character length must be smaller than or equal to 50."; + } + + if (!is_null($this->container['phone_number']) && (mb_strlen($this->container['phone_number']) < 1)) { + $invalidProperties[] = "invalid value for 'phone_number', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['phone_number']) && !preg_match("/^\\+[1-9]\\d{1,14}$/", $this->container['phone_number'])) { + $invalidProperties[] = "invalid value for 'phone_number', must be conform to the pattern /^\\+[1-9]\\d{1,14}$/."; + } + + 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 first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name The first name(s) or given name for the buyer. + * + * @return self + */ + public function setFirstName($first_name) + { + if (!is_null($first_name) && (mb_strlen($first_name) > 255)) { + throw new \InvalidArgumentException('invalid length for $first_name when calling BuyerUpdateBillingDetails., must be smaller than or equal to 255.'); + } + if (!is_null($first_name) && (mb_strlen($first_name) < 1)) { + throw new \InvalidArgumentException('invalid length for $first_name when calling BuyerUpdateBillingDetails., must be bigger than or equal to 1.'); + } + + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string|null + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string|null $last_name The last name, or family name, of the buyer. + * + * @return self + */ + public function setLastName($last_name) + { + if (!is_null($last_name) && (mb_strlen($last_name) > 255)) { + throw new \InvalidArgumentException('invalid length for $last_name when calling BuyerUpdateBillingDetails., must be smaller than or equal to 255.'); + } + if (!is_null($last_name) && (mb_strlen($last_name) < 1)) { + throw new \InvalidArgumentException('invalid length for $last_name when calling BuyerUpdateBillingDetails., must be bigger than or equal to 1.'); + } + + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets email_address + * + * @return string|null + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string|null $email_address The email address for the buyer. + * + * @return self + */ + public function setEmailAddress($email_address) + { + if (!is_null($email_address) && (mb_strlen($email_address) > 320)) { + throw new \InvalidArgumentException('invalid length for $email_address when calling BuyerUpdateBillingDetails., must be smaller than or equal to 320.'); + } + if (!is_null($email_address) && (mb_strlen($email_address) < 1)) { + throw new \InvalidArgumentException('invalid length for $email_address when calling BuyerUpdateBillingDetails., must be bigger than or equal to 1.'); + } + + $this->container['email_address'] = $email_address; + + return $this; + } + + /** + * Gets phone_number + * + * @return string|null + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string|null $phone_number The phone number for the buyer which should be formatted according to the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (!is_null($phone_number) && (mb_strlen($phone_number) > 50)) { + throw new \InvalidArgumentException('invalid length for $phone_number when calling BuyerUpdateBillingDetails., must be smaller than or equal to 50.'); + } + if (!is_null($phone_number) && (mb_strlen($phone_number) < 1)) { + throw new \InvalidArgumentException('invalid length for $phone_number when calling BuyerUpdateBillingDetails., must be bigger than or equal to 1.'); + } + if (!is_null($phone_number) && (!preg_match("/^\\+[1-9]\\d{1,14}$/", $phone_number))) { + throw new \InvalidArgumentException("invalid value for $phone_number when calling BuyerUpdateBillingDetails., must conform to the pattern /^\\+[1-9]\\d{1,14}$/."); + } + + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets address + * + * @return \Gr4vy\model\BillingDetailsUpdateRequestAddress|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Gr4vy\model\BillingDetailsUpdateRequestAddress|null $address address + * + * @return self + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets tax_id + * + * @return \Gr4vy\model\BillingDetailsTaxId|null + */ + public function getTaxId() + { + return $this->container['tax_id']; + } + + /** + * Sets tax_id + * + * @param \Gr4vy\model\BillingDetailsTaxId|null $tax_id tax_id + * + * @return self + */ + public function setTaxId($tax_id) + { + $this->container['tax_id'] = $tax_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 + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/Buyers.php b/lib/model/Buyers.php index 81b06e6..b87e652 100644 --- a/lib/model/Buyers.php +++ b/lib/model/Buyers.php @@ -2,7 +2,7 @@ /** * Buyers * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -373,7 +373,7 @@ public function setPreviousCursor($previous_cursor) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -385,6 +385,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -398,7 +399,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -414,7 +415,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -426,6 +427,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/CardDetails.php b/lib/model/CardDetails.php index dcf55bd..8b7a54d 100644 --- a/lib/model/CardDetails.php +++ b/lib/model/CardDetails.php @@ -2,7 +2,7 @@ /** * CardDetails * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -189,9 +189,9 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_CARD_DETAIL = 'card-detail'; - const CARD_TYPE_CREDIT = 'credit'; - const CARD_TYPE_DEBIT = 'debit'; + public const TYPE_CARD_DETAIL = 'card-detail'; + public const CARD_TYPE_CREDIT = 'credit'; + public const CARD_TYPE_DEBIT = 'debit'; /** * Gets allowable values of the enum @@ -468,7 +468,7 @@ public function setRequiredFields($required_fields) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -480,6 +480,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -493,7 +494,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -509,7 +510,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -521,6 +522,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/CardRequest.php b/lib/model/CardRequest.php index 6c93c6a..766befd 100644 --- a/lib/model/CardRequest.php +++ b/lib/model/CardRequest.php @@ -2,7 +2,7 @@ /** * CardRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -194,7 +194,7 @@ public function getModelName() return self::$openAPIModelName; } - const METHOD_CARD = 'card'; + public const METHOD_CARD = 'card'; /** * Gets allowable values of the enum @@ -527,7 +527,7 @@ public function setBuyerExternalIdentifier($buyer_external_identifier) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -539,6 +539,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -552,7 +553,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -568,7 +569,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -580,6 +581,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/CardRequiredFields.php b/lib/model/CardRequiredFields.php index 0b6f067..40084db 100644 --- a/lib/model/CardRequiredFields.php +++ b/lib/model/CardRequiredFields.php @@ -2,7 +2,7 @@ /** * CardRequiredFields * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -387,7 +387,7 @@ public function setTaxId($tax_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -399,6 +399,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -412,7 +413,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -428,7 +429,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -440,6 +441,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/CardRequiredFieldsAddress.php b/lib/model/CardRequiredFieldsAddress.php index 86aa7a2..0aa58fa 100644 --- a/lib/model/CardRequiredFieldsAddress.php +++ b/lib/model/CardRequiredFieldsAddress.php @@ -2,7 +2,7 @@ /** * CardRequiredFieldsAddress * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -387,7 +387,7 @@ public function setLine1($line1) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -399,6 +399,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -412,7 +413,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -428,7 +429,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -440,6 +441,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/CartItem.php b/lib/model/CartItem.php index 05e0392..f074f0d 100644 --- a/lib/model/CartItem.php +++ b/lib/model/CartItem.php @@ -2,7 +2,7 @@ /** * CartItem * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -214,14 +214,14 @@ public function getModelName() return self::$openAPIModelName; } - const PRODUCT_TYPE_PHYSICAL = 'physical'; - const PRODUCT_TYPE_DISCOUNT = 'discount'; - const PRODUCT_TYPE_SHIPPING_FEE = 'shipping_fee'; - const PRODUCT_TYPE_SALES_TAX = 'sales_tax'; - const PRODUCT_TYPE_DIGITAL = 'digital'; - const PRODUCT_TYPE_GIFT_CARD = 'gift_card'; - const PRODUCT_TYPE_STORE_CREDIT = 'store_credit'; - const PRODUCT_TYPE_SURCHARGE = 'surcharge'; + public const PRODUCT_TYPE_PHYSICAL = 'physical'; + public const PRODUCT_TYPE_DISCOUNT = 'discount'; + public const PRODUCT_TYPE_SHIPPING_FEE = 'shipping_fee'; + public const PRODUCT_TYPE_SALES_TAX = 'sales_tax'; + public const PRODUCT_TYPE_DIGITAL = 'digital'; + public const PRODUCT_TYPE_GIFT_CARD = 'gift_card'; + public const PRODUCT_TYPE_STORE_CREDIT = 'store_credit'; + public const PRODUCT_TYPE_SURCHARGE = 'surcharge'; /** * Gets allowable values of the enum @@ -704,7 +704,7 @@ public function setProductType($product_type) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -716,6 +716,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -729,7 +730,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -745,7 +746,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -757,6 +758,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/DigitalWallet.php b/lib/model/DigitalWallet.php index 36f87de..15f2df3 100644 --- a/lib/model/DigitalWallet.php +++ b/lib/model/DigitalWallet.php @@ -2,7 +2,7 @@ /** * DigitalWallet * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -199,9 +199,9 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_DIGITAL_WALLET = 'digital-wallet'; - const PROVIDER_APPLE = 'apple'; - const PROVIDER_GOOGLE = 'google'; + public const TYPE_DIGITAL_WALLET = 'digital-wallet'; + public const PROVIDER_APPLE = 'apple'; + public const PROVIDER_GOOGLE = 'google'; /** * Gets allowable values of the enum @@ -247,7 +247,7 @@ public function __construct(array $data = null) $this->container['provider'] = $data['provider'] ?? null; $this->container['id'] = $data['id'] ?? null; $this->container['merchant_name'] = $data['merchant_name'] ?? null; - $this->container['merchant_url'] = $data['merchant_url'] ?? 'null'; + $this->container['merchant_url'] = $data['merchant_url'] ?? null; $this->container['domain_names'] = $data['domain_names'] ?? null; $this->container['created_at'] = $data['created_at'] ?? null; $this->container['updated_at'] = $data['updated_at'] ?? null; @@ -528,7 +528,7 @@ public function setUpdatedAt($updated_at) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -540,6 +540,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -553,7 +554,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -569,7 +570,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -581,6 +582,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/DigitalWalletRequest.php b/lib/model/DigitalWalletRequest.php index 44b27ce..98e91a7 100644 --- a/lib/model/DigitalWalletRequest.php +++ b/lib/model/DigitalWalletRequest.php @@ -2,7 +2,7 @@ /** * DigitalWalletRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -184,8 +184,8 @@ public function getModelName() return self::$openAPIModelName; } - const PROVIDER_APPLE = 'apple'; - const PROVIDER_GOOGLE = 'google'; + public const PROVIDER_APPLE = 'apple'; + public const PROVIDER_GOOGLE = 'google'; /** * Gets allowable values of the enum @@ -217,7 +217,7 @@ public function __construct(array $data = null) { $this->container['provider'] = $data['provider'] ?? null; $this->container['merchant_name'] = $data['merchant_name'] ?? null; - $this->container['merchant_url'] = $data['merchant_url'] ?? 'null'; + $this->container['merchant_url'] = $data['merchant_url'] ?? null; $this->container['domain_names'] = $data['domain_names'] ?? null; $this->container['accept_terms_and_conditions'] = $data['accept_terms_and_conditions'] ?? null; } @@ -418,7 +418,7 @@ public function setAcceptTermsAndConditions($accept_terms_and_conditions) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -430,6 +430,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -443,7 +444,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -459,7 +460,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -471,6 +472,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/DigitalWalletUpdate.php b/lib/model/DigitalWalletUpdate.php index 93e0402..ac519fe 100644 --- a/lib/model/DigitalWalletUpdate.php +++ b/lib/model/DigitalWalletUpdate.php @@ -2,7 +2,7 @@ /** * DigitalWalletUpdate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -282,7 +282,7 @@ public function setDomainNames($domain_names) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -294,6 +294,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -307,7 +308,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -323,7 +324,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -335,6 +336,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/DigitalWallets.php b/lib/model/DigitalWallets.php index 3252c74..0737c38 100644 --- a/lib/model/DigitalWallets.php +++ b/lib/model/DigitalWallets.php @@ -2,7 +2,7 @@ /** * DigitalWallets * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -237,7 +237,7 @@ public function setItems($items) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -249,6 +249,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -262,7 +263,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -278,7 +279,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -290,6 +291,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/Error400BadRequest.php b/lib/model/Error400BadRequest.php index 7146201..94a3fbd 100644 --- a/lib/model/Error400BadRequest.php +++ b/lib/model/Error400BadRequest.php @@ -2,7 +2,7 @@ /** * Error400BadRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -184,9 +184,9 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_ERROR = 'error'; - const CODE_BAD_REQUEST = 'bad_request'; - const STATUS_400 = 400; + public const TYPE_ERROR = 'error'; + public const CODE_BAD_REQUEST = 'bad_request'; + public const STATUS_400 = 400; /** * Gets allowable values of the enum @@ -453,7 +453,7 @@ public function setDetails($details) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -465,6 +465,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -478,7 +479,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -494,7 +495,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -506,6 +507,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/Error400IncorrectJson.php b/lib/model/Error400IncorrectJson.php index 00e84ab..cae3474 100644 --- a/lib/model/Error400IncorrectJson.php +++ b/lib/model/Error400IncorrectJson.php @@ -2,7 +2,7 @@ /** * Error400IncorrectJson * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -184,9 +184,9 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_ERROR = 'error'; - const CODE_INCORRECT_JSON = 'incorrect_json'; - const STATUS_400 = 400; + public const TYPE_ERROR = 'error'; + public const CODE_INCORRECT_JSON = 'incorrect_json'; + public const STATUS_400 = 400; /** * Gets allowable values of the enum @@ -453,7 +453,7 @@ public function setDetails($details) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -465,6 +465,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -478,7 +479,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -494,7 +495,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -506,6 +507,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/Error400InvalidCredentials.php b/lib/model/Error400InvalidCredentials.php index d0a6901..3ee1def 100644 --- a/lib/model/Error400InvalidCredentials.php +++ b/lib/model/Error400InvalidCredentials.php @@ -2,7 +2,7 @@ /** * Error400InvalidCredentials * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -179,9 +179,9 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_ERROR = 'error'; - const CODE_INVALID_CREDENTIALS = 'invalid_credentials'; - const STATUS_400 = 400; + public const TYPE_ERROR = 'error'; + public const CODE_INVALID_CREDENTIALS = 'invalid_credentials'; + public const STATUS_400 = 400; /** * Gets allowable values of the enum @@ -423,7 +423,7 @@ public function setMessage($message) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -435,6 +435,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -448,7 +449,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -464,7 +465,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -476,6 +477,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/Error401Unauthorized.php b/lib/model/Error401Unauthorized.php index cda2f72..1176282 100644 --- a/lib/model/Error401Unauthorized.php +++ b/lib/model/Error401Unauthorized.php @@ -2,7 +2,7 @@ /** * Error401Unauthorized * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -184,10 +184,10 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_ERROR = 'error'; - const CODE_UNAUTHORIZED = 'unauthorized'; - const STATUS_401 = 401; - const MESSAGE_NO_VALID_API_AUTHENTICATION_FOUND = 'No valid API authentication found'; + public const TYPE_ERROR = 'error'; + public const CODE_UNAUTHORIZED = 'unauthorized'; + public const STATUS_401 = 401; + public const MESSAGE_NO_VALID_API_AUTHENTICATION_FOUND = 'No valid API authentication found'; /** * Gets allowable values of the enum @@ -485,7 +485,7 @@ public function setDetails($details) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -497,6 +497,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -510,7 +511,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -526,7 +527,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -538,6 +539,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/Error403Forbidden.php b/lib/model/Error403Forbidden.php index 23ab46d..eb58dba 100644 --- a/lib/model/Error403Forbidden.php +++ b/lib/model/Error403Forbidden.php @@ -2,7 +2,7 @@ /** * Error403Forbidden * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -184,10 +184,10 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_ERROR = 'error'; - const CODE_FORBIDDEN = 'forbidden'; - const STATUS_403 = 403; - const MESSAGE_INVALID_CREDENTIALS = 'Invalid credentials'; + public const TYPE_ERROR = 'error'; + public const CODE_FORBIDDEN = 'forbidden'; + public const STATUS_403 = 403; + public const MESSAGE_INVALID_CREDENTIALS = 'Invalid credentials'; /** * Gets allowable values of the enum @@ -485,7 +485,7 @@ public function setDetails($details) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -497,6 +497,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -510,7 +511,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -526,7 +527,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -538,6 +539,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/Error404NotFound.php b/lib/model/Error404NotFound.php index 802c94d..d98963c 100644 --- a/lib/model/Error404NotFound.php +++ b/lib/model/Error404NotFound.php @@ -2,7 +2,7 @@ /** * Error404NotFound * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -184,10 +184,10 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_ERROR = 'error'; - const CODE_NOT_FOUND = 'not_found'; - const STATUS_404 = 404; - const MESSAGE_THE_RESOURCE_COULD_NOT_BE_FOUND = 'The resource could not be found'; + public const TYPE_ERROR = 'error'; + public const CODE_NOT_FOUND = 'not_found'; + public const STATUS_404 = 404; + public const MESSAGE_THE_RESOURCE_COULD_NOT_BE_FOUND = 'The resource could not be found'; /** * Gets allowable values of the enum @@ -485,7 +485,7 @@ public function setDetails($details) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -497,6 +497,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -510,7 +511,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -526,7 +527,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -538,6 +539,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/Error404PendingCreation.php b/lib/model/Error404PendingCreation.php index 33ed46a..ab62f0d 100644 --- a/lib/model/Error404PendingCreation.php +++ b/lib/model/Error404PendingCreation.php @@ -2,7 +2,7 @@ /** * Error404PendingCreation * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -184,10 +184,10 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_ERROR = 'error'; - const CODE_PENDING_CREATION = 'pending_creation'; - const STATUS_404 = 404; - const MESSAGE_THE_RESOURCE_IS_STILL_PENDING = 'The resource is still pending'; + public const TYPE_ERROR = 'error'; + public const CODE_PENDING_CREATION = 'pending_creation'; + public const STATUS_404 = 404; + public const MESSAGE_THE_RESOURCE_IS_STILL_PENDING = 'The resource is still pending'; /** * Gets allowable values of the enum @@ -485,7 +485,7 @@ public function setDetails($details) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -497,6 +497,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -510,7 +511,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -526,7 +527,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -538,6 +539,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/Error409DuplicateRecord.php b/lib/model/Error409DuplicateRecord.php index 3aa700c..c2c29b7 100644 --- a/lib/model/Error409DuplicateRecord.php +++ b/lib/model/Error409DuplicateRecord.php @@ -2,7 +2,7 @@ /** * Error409DuplicateRecord * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -184,9 +184,9 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_ERROR = 'error'; - const CODE_DUPLICATE_RECORD = 'duplicate_record'; - const STATUS_409 = 409; + public const TYPE_ERROR = 'error'; + public const CODE_DUPLICATE_RECORD = 'duplicate_record'; + public const STATUS_409 = 409; /** * Gets allowable values of the enum @@ -453,7 +453,7 @@ public function setDetails($details) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -465,6 +465,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -478,7 +479,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -494,7 +495,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -506,6 +507,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/ErrorDetail.php b/lib/model/ErrorDetail.php index 5ad12d2..dbe5075 100644 --- a/lib/model/ErrorDetail.php +++ b/lib/model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -179,10 +179,10 @@ public function getModelName() return self::$openAPIModelName; } - const LOCATION_QUERY = 'query'; - const LOCATION_BODY = 'body'; - const LOCATION_PATH = 'path'; - const LOCATION_HEADER = 'header'; + public const LOCATION_QUERY = 'query'; + public const LOCATION_BODY = 'body'; + public const LOCATION_PATH = 'path'; + public const LOCATION_HEADER = 'header'; /** * Gets allowable values of the enum @@ -365,7 +365,7 @@ public function setMessage($message) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -377,6 +377,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,7 +391,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -406,7 +407,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -418,6 +419,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/ErrorGeneric.php b/lib/model/ErrorGeneric.php index c919bbb..86cfeeb 100644 --- a/lib/model/ErrorGeneric.php +++ b/lib/model/ErrorGeneric.php @@ -2,7 +2,7 @@ /** * ErrorGeneric * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -184,7 +184,7 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_ERROR = 'error'; + public const TYPE_ERROR = 'error'; /** * Gets allowable values of the enum @@ -405,7 +405,7 @@ public function setDetails($details) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -417,6 +417,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -430,7 +431,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -446,7 +447,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -458,6 +459,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/FlowPaymentOptionOutcome.php b/lib/model/FlowPaymentOptionOutcome.php new file mode 100644 index 0000000..5d04075 --- /dev/null +++ b/lib/model/FlowPaymentOptionOutcome.php @@ -0,0 +1,506 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FlowPaymentOptionOutcome implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FlowPaymentOptionOutcome'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'id' => 'string', + 'label' => 'string', + 'active' => 'bool', + 'group' => 'string', + 'icon_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'id' => null, + 'label' => null, + 'active' => null, + 'group' => null, + 'icon_url' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'id' => 'id', + 'label' => 'label', + 'active' => 'active', + 'group' => 'group', + 'icon_url' => 'icon_url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'id' => 'setId', + 'label' => 'setLabel', + 'active' => 'setActive', + 'group' => 'setGroup', + 'icon_url' => 'setIconUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'id' => 'getId', + 'label' => 'getLabel', + 'active' => 'getActive', + 'group' => 'getGroup', + 'icon_url' => 'getIconUrl' + ]; + + /** + * 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_ACTION = 'action'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_ACTION, + ]; + } + + /** + * 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->container['type'] = $data['type'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['label'] = $data['label'] ?? null; + $this->container['active'] = $data['active'] ?? null; + $this->container['group'] = $data['group'] ?? null; + $this->container['icon_url'] = $data['icon_url'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of this resource. Is always `action`. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !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 id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Payment option identifier. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label Verbose payment option name. + * + * @return self + */ + public function setLabel($label) + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active The status of the payment option, true if at least one underlying connection is active, otherwise false. + * + * @return self + */ + public function setActive($active) + { + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets group + * + * @return string|null + */ + public function getGroup() + { + return $this->container['group']; + } + + /** + * Sets group + * + * @param string|null $group Optional group label for a given payment option, e.g. `Bank`. + * + * @return self + */ + public function setGroup($group) + { + $this->container['group'] = $group; + + return $this; + } + + /** + * Gets icon_url + * + * @return string|null + */ + public function getIconUrl() + { + return $this->container['icon_url']; + } + + /** + * Sets icon_url + * + * @param string|null $icon_url Payment option icon URL. + * + * @return self + */ + public function setIconUrl($icon_url) + { + $this->container['icon_url'] = $icon_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/FlowRuleBooleanOutcome.php b/lib/model/FlowRuleBooleanOutcome.php new file mode 100644 index 0000000..38e6255 --- /dev/null +++ b/lib/model/FlowRuleBooleanOutcome.php @@ -0,0 +1,424 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FlowRuleBooleanOutcome implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FlowRuleBooleanOutcome'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'result' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'result' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'result' => 'getResult' + ]; + + /** + * 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_BOOLEAN = 'boolean'; + public const RESULT_TRUE = 'true'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BOOLEAN, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getResultAllowableValues() + { + return [ + self::RESULT_TRUE, + ]; + } + + /** + * 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->container['type'] = $data['type'] ?? null; + $this->container['result'] = $data['result'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of action outcome for the given rule. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets result + * + * @return bool + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param bool $result Results for a given flow action. + * + * @return self + */ + public function setResult($result) + { + $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; + } + /** + * 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 + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/FlowRuleMethodOutcome.php b/lib/model/FlowRuleMethodOutcome.php new file mode 100644 index 0000000..22350c0 --- /dev/null +++ b/lib/model/FlowRuleMethodOutcome.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FlowRuleMethodOutcome implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FlowRuleMethodOutcome'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'result' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'result' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'result' => 'getResult' + ]; + + /** + * 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__LIST = 'list'; + public const RESULT_AFTERPAY = 'afterpay'; + public const RESULT_APPLEPAY = 'applepay'; + public const RESULT_BANKED = 'banked'; + public const RESULT_BITPAY = 'bitpay'; + public const RESULT_BOLETO = 'boleto'; + public const RESULT_CARD = 'card'; + public const RESULT_CLEARPAY = 'clearpay'; + public const RESULT_DANA = 'dana'; + public const RESULT_FORTUMO = 'fortumo'; + public const RESULT_GCASH = 'gcash'; + public const RESULT_GOCARDLESS = 'gocardless'; + public const RESULT_GOOGLEPAY = 'googlepay'; + public const RESULT_GOOGLEPAY_PAN_ONLY = 'googlepay_pan_only'; + public const RESULT_GRABPAY = 'grabpay'; + public const RESULT_KLARNA = 'klarna'; + public const RESULT_OVO = 'ovo'; + public const RESULT_PAYMAYA = 'paymaya'; + public const RESULT_PAYPAL = 'paypal'; + public const RESULT_PIX = 'pix'; + public const RESULT_RABBITLINEPAY = 'rabbitlinepay'; + public const RESULT_SHOPEEPAY = 'shopeepay'; + public const RESULT_STRIPEDD = 'stripedd'; + public const RESULT_TRUEMONEY = 'truemoney'; + public const RESULT_TRUSTLY = 'trustly'; + public const RESULT_ZIPPAY = 'zippay'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE__LIST, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getResultAllowableValues() + { + return [ + self::RESULT_AFTERPAY, + self::RESULT_APPLEPAY, + self::RESULT_BANKED, + self::RESULT_BITPAY, + self::RESULT_BOLETO, + self::RESULT_CARD, + self::RESULT_CLEARPAY, + self::RESULT_DANA, + self::RESULT_FORTUMO, + self::RESULT_GCASH, + self::RESULT_GOCARDLESS, + self::RESULT_GOOGLEPAY, + self::RESULT_GOOGLEPAY_PAN_ONLY, + self::RESULT_GRABPAY, + self::RESULT_KLARNA, + self::RESULT_OVO, + self::RESULT_PAYMAYA, + self::RESULT_PAYPAL, + self::RESULT_PIX, + self::RESULT_RABBITLINEPAY, + self::RESULT_SHOPEEPAY, + self::RESULT_STRIPEDD, + self::RESULT_TRUEMONEY, + self::RESULT_TRUSTLY, + self::RESULT_ZIPPAY, + ]; + } + + /** + * 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->container['type'] = $data['type'] ?? null; + $this->container['result'] = $data['result'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['result'] === null) { + $invalidProperties[] = "'result' 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 type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of action outcome for the given rule. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets result + * + * @return string[] + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param string[] $result Results for a given flow action. + * + * @return self + */ + public function setResult($result) + { + $allowedValues = $this->getResultAllowableValues(); + if (array_diff($result, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'result', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['result'] = $result; + + 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 + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/FlowRuleServiceOutcome.php b/lib/model/FlowRuleServiceOutcome.php new file mode 100644 index 0000000..dcc5dbd --- /dev/null +++ b/lib/model/FlowRuleServiceOutcome.php @@ -0,0 +1,392 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FlowRuleServiceOutcome implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FlowRuleServiceOutcome'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'result' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'result' => 'uuid' + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'result' => 'getResult' + ]; + + /** + * 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__LIST = 'list'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE__LIST, + ]; + } + + /** + * 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->container['type'] = $data['type'] ?? null; + $this->container['result'] = $data['result'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['result'] === null) { + $invalidProperties[] = "'result' 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 type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of action outcome for the given rule. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets result + * + * @return string[] + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param string[] $result Results for a given flow action. + * + * @return self + */ + public function setResult($result) + { + $this->container['result'] = $result; + + 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 + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/GooglePayRequest.php b/lib/model/GooglePayRequest.php index 2dc45b5..6441454 100644 --- a/lib/model/GooglePayRequest.php +++ b/lib/model/GooglePayRequest.php @@ -2,7 +2,7 @@ /** * GooglePayRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -169,7 +169,7 @@ public function getModelName() return self::$openAPIModelName; } - const METHOD_GOOGLEPAY = 'googlepay'; + public const METHOD_GOOGLEPAY = 'googlepay'; /** * Gets allowable values of the enum @@ -305,7 +305,7 @@ public function setToken($token) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -317,6 +317,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -330,7 +331,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -346,7 +347,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -358,6 +359,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/GooglePaySessionRequest.php b/lib/model/GooglePaySessionRequest.php index 3d8d651..c828a8c 100644 --- a/lib/model/GooglePaySessionRequest.php +++ b/lib/model/GooglePaySessionRequest.php @@ -2,7 +2,7 @@ /** * GooglePaySessionRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -240,7 +240,7 @@ public function setOriginDomain($origin_domain) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -252,6 +252,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -265,7 +266,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -281,7 +282,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -293,6 +294,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/ModelInterface.php b/lib/model/ModelInterface.php index 6e96a18..d96e3df 100644 --- a/lib/model/ModelInterface.php +++ b/lib/model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy\model @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** diff --git a/lib/model/PaymentMethod.php b/lib/model/PaymentMethod.php index 6643eb0..3153d65 100644 --- a/lib/model/PaymentMethod.php +++ b/lib/model/PaymentMethod.php @@ -2,7 +2,7 @@ /** * PaymentMethod * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -69,7 +69,7 @@ class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'external_identifier' => 'string', - 'buyer' => '\Gr4vy\model\Buyer', + 'buyer' => '\Gr4vy\model\PaymentMethodBuyer', 'label' => 'string', 'scheme' => 'string', 'expiration_date' => 'string', @@ -239,13 +239,13 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_PAYMENT_METHOD = 'payment-method'; - const STATUS_PROCESSING = 'processing'; - const STATUS_BUYER_APPROVAL_REQUIRED = 'buyer_approval_required'; - const STATUS_SUCCEEDED = 'succeeded'; - const STATUS_FAILED = 'failed'; - const APPROVAL_TARGET_ANY = 'any'; - const APPROVAL_TARGET_NEW_WINDOW = 'new_window'; + public const TYPE_PAYMENT_METHOD = 'payment-method'; + public const STATUS_PROCESSING = 'processing'; + public const STATUS_BUYER_APPROVAL_REQUIRED = 'buyer_approval_required'; + public const STATUS_SUCCEEDED = 'succeeded'; + public const STATUS_FAILED = 'failed'; + public const APPROVAL_TARGET_ANY = 'any'; + public const APPROVAL_TARGET_NEW_WINDOW = 'new_window'; /** * Gets allowable values of the enum @@ -598,7 +598,7 @@ public function setExternalIdentifier($external_identifier) /** * Gets buyer * - * @return Buyer|null + * @return \Gr4vy\model\PaymentMethodBuyer|null */ public function getBuyer() { @@ -608,7 +608,7 @@ public function getBuyer() /** * Sets buyer * - * @param Buyer|null $buyer buyer + * @param \Gr4vy\model\PaymentMethodBuyer|null $buyer buyer * * @return self */ @@ -813,7 +813,7 @@ public function setCountry($country) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -825,6 +825,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -838,7 +839,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -854,7 +855,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -866,6 +867,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentMethodBuyer.php b/lib/model/PaymentMethodBuyer.php new file mode 100644 index 0000000..85f2373 --- /dev/null +++ b/lib/model/PaymentMethodBuyer.php @@ -0,0 +1,565 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PaymentMethodBuyer implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentMethod_buyer'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'id' => 'string', + 'external_identifier' => 'string', + 'display_name' => 'string', + 'billing_details' => '\Gr4vy\model\BuyerBillingDetails', + 'created_at' => '\DateTime', + 'updated_at' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'id' => 'uuid', + 'external_identifier' => null, + 'display_name' => null, + 'billing_details' => null, + 'created_at' => 'date-time', + 'updated_at' => 'date-time' + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'id' => 'id', + 'external_identifier' => 'external_identifier', + 'display_name' => 'display_name', + 'billing_details' => 'billing_details', + 'created_at' => 'created_at', + 'updated_at' => 'updated_at' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'id' => 'setId', + 'external_identifier' => 'setExternalIdentifier', + 'display_name' => 'setDisplayName', + 'billing_details' => 'setBillingDetails', + 'created_at' => 'setCreatedAt', + 'updated_at' => 'setUpdatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'id' => 'getId', + 'external_identifier' => 'getExternalIdentifier', + 'display_name' => 'getDisplayName', + 'billing_details' => 'getBillingDetails', + 'created_at' => 'getCreatedAt', + 'updated_at' => 'getUpdatedAt' + ]; + + /** + * 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_BUYER = 'buyer'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BUYER, + ]; + } + + /** + * 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->container['type'] = $data['type'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['external_identifier'] = $data['external_identifier'] ?? null; + $this->container['display_name'] = $data['display_name'] ?? null; + $this->container['billing_details'] = $data['billing_details'] ?? null; + $this->container['created_at'] = $data['created_at'] ?? null; + $this->container['updated_at'] = $data['updated_at'] ?? null; + } + + /** + * 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) + ); + } + + if (!is_null($this->container['external_identifier']) && (mb_strlen($this->container['external_identifier']) > 200)) { + $invalidProperties[] = "invalid value for 'external_identifier', the character length must be smaller than or equal to 200."; + } + + if (!is_null($this->container['external_identifier']) && (mb_strlen($this->container['external_identifier']) < 1)) { + $invalidProperties[] = "invalid value for 'external_identifier', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['display_name']) && (mb_strlen($this->container['display_name']) > 200)) { + $invalidProperties[] = "invalid value for 'display_name', the character length must be smaller than or equal to 200."; + } + + if (!is_null($this->container['display_name']) && (mb_strlen($this->container['display_name']) < 1)) { + $invalidProperties[] = "invalid value for 'display_name', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of this resource. Is always `buyer`. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !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 id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique Gr4vy ID for this buyer. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets external_identifier + * + * @return string|null + */ + public function getExternalIdentifier() + { + return $this->container['external_identifier']; + } + + /** + * Sets external_identifier + * + * @param string|null $external_identifier An external identifier that can be used to match the buyer against your own records. + * + * @return self + */ + public function setExternalIdentifier($external_identifier) + { + if (!is_null($external_identifier) && (mb_strlen($external_identifier) > 200)) { + throw new \InvalidArgumentException('invalid length for $external_identifier when calling PaymentMethodBuyer., must be smaller than or equal to 200.'); + } + if (!is_null($external_identifier) && (mb_strlen($external_identifier) < 1)) { + throw new \InvalidArgumentException('invalid length for $external_identifier when calling PaymentMethodBuyer., must be bigger than or equal to 1.'); + } + + $this->container['external_identifier'] = $external_identifier; + + return $this; + } + + /** + * Gets display_name + * + * @return string|null + */ + public function getDisplayName() + { + return $this->container['display_name']; + } + + /** + * Sets display_name + * + * @param string|null $display_name A unique name for this buyer which is used in the Gr4vy admin panel to give a buyer a human readable name. + * + * @return self + */ + public function setDisplayName($display_name) + { + if (!is_null($display_name) && (mb_strlen($display_name) > 200)) { + throw new \InvalidArgumentException('invalid length for $display_name when calling PaymentMethodBuyer., must be smaller than or equal to 200.'); + } + if (!is_null($display_name) && (mb_strlen($display_name) < 1)) { + throw new \InvalidArgumentException('invalid length for $display_name when calling PaymentMethodBuyer., must be bigger than or equal to 1.'); + } + + $this->container['display_name'] = $display_name; + + return $this; + } + + /** + * Gets billing_details + * + * @return \Gr4vy\model\BuyerBillingDetails|null + */ + public function getBillingDetails() + { + return $this->container['billing_details']; + } + + /** + * Sets billing_details + * + * @param \Gr4vy\model\BuyerBillingDetails|null $billing_details billing_details + * + * @return self + */ + public function setBillingDetails($billing_details) + { + $this->container['billing_details'] = $billing_details; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime|null + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime|null $created_at The date and time when this buyer was created in our system. + * + * @return self + */ + public function setCreatedAt($created_at) + { + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets updated_at + * + * @return \DateTime|null + */ + public function getUpdatedAt() + { + return $this->container['updated_at']; + } + + /** + * Sets updated_at + * + * @param \DateTime|null $updated_at The date and time when this buyer was last updated in our system. + * + * @return self + */ + public function setUpdatedAt($updated_at) + { + $this->container['updated_at'] = $updated_at; + + 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 + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/PaymentMethodRequest.php b/lib/model/PaymentMethodRequest.php index cdbe375..5aa6d69 100644 --- a/lib/model/PaymentMethodRequest.php +++ b/lib/model/PaymentMethodRequest.php @@ -2,7 +2,7 @@ /** * PaymentMethodRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -576,7 +576,7 @@ public function setCountry($country) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -588,6 +588,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -601,7 +602,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -617,7 +618,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -629,6 +630,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentMethodSnapshot.php b/lib/model/PaymentMethodSnapshot.php index cfa8f5f..8aaa928 100644 --- a/lib/model/PaymentMethodSnapshot.php +++ b/lib/model/PaymentMethodSnapshot.php @@ -2,7 +2,7 @@ /** * PaymentMethodSnapshot * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -214,9 +214,9 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_PAYMENT_METHOD = 'payment-method'; - const APPROVAL_TARGET_ANY = 'any'; - const APPROVAL_TARGET_NEW_WINDOW = 'new_window'; + public const TYPE_PAYMENT_METHOD = 'payment-method'; + public const APPROVAL_TARGET_ANY = 'any'; + public const APPROVAL_TARGET_NEW_WINDOW = 'new_window'; /** * Gets allowable values of the enum @@ -625,7 +625,7 @@ public function setCountry($country) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -637,6 +637,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -650,7 +651,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -666,7 +667,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -678,6 +679,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentMethodToken.php b/lib/model/PaymentMethodToken.php index ced3a73..fa12db9 100644 --- a/lib/model/PaymentMethodToken.php +++ b/lib/model/PaymentMethodToken.php @@ -2,7 +2,7 @@ /** * PaymentMethodToken * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -65,7 +65,7 @@ class PaymentMethodToken implements ModelInterface, ArrayAccess, \JsonSerializab 'id' => 'string', 'token' => 'string', 'status' => 'string', - 'payment_service' => '\Gr4vy\model\PaymentService' + 'payment_service' => '\Gr4vy\model\PaymentMethodTokenPaymentService' ]; /** @@ -184,11 +184,11 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_PAYMENT_METHOD_TOKEN = 'payment-method-token'; - const STATUS_PROCESSING = 'processing'; - const STATUS_BUYER_APPROVAL_REQUIRED = 'buyer_approval_required'; - const STATUS_SUCCEEDED = 'succeeded'; - const STATUS_FAILED = 'failed'; + public const TYPE_PAYMENT_METHOD_TOKEN = 'payment-method-token'; + public const STATUS_PROCESSING = 'processing'; + public const STATUS_BUYER_APPROVAL_REQUIRED = 'buyer_approval_required'; + public const STATUS_SUCCEEDED = 'succeeded'; + public const STATUS_FAILED = 'failed'; /** * Gets allowable values of the enum @@ -400,7 +400,7 @@ public function setStatus($status) /** * Gets payment_service * - * @return PaymentServiceSnapshot|null + * @return \Gr4vy\model\PaymentMethodTokenPaymentService|null */ public function getPaymentService() { @@ -410,7 +410,7 @@ public function getPaymentService() /** * Sets payment_service * - * @param PaymentServiceSnapshot|null $payment_service payment_service + * @param \Gr4vy\model\PaymentMethodTokenPaymentService|null $payment_service payment_service * * @return self */ @@ -427,7 +427,7 @@ public function setPaymentService($payment_service) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -439,6 +439,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -452,7 +453,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -468,7 +469,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -480,6 +481,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentMethodTokenPaymentService.php b/lib/model/PaymentMethodTokenPaymentService.php new file mode 100644 index 0000000..fdb3d0d --- /dev/null +++ b/lib/model/PaymentMethodTokenPaymentService.php @@ -0,0 +1,520 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PaymentMethodTokenPaymentService implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentMethodToken_payment_service'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'type' => 'string', + 'payment_service_definition_id' => 'string', + 'method' => 'string', + 'display_name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'payment_service_definition_id' => null, + 'method' => null, + 'display_name' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'payment_service_definition_id' => 'payment_service_definition_id', + 'method' => 'method', + 'display_name' => 'display_name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'payment_service_definition_id' => 'setPaymentServiceDefinitionId', + 'method' => 'setMethod', + 'display_name' => 'setDisplayName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'payment_service_definition_id' => 'getPaymentServiceDefinitionId', + 'method' => 'getMethod', + 'display_name' => 'getDisplayName' + ]; + + /** + * 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_SERVICE = 'payment-service'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_PAYMENT_SERVICE, + ]; + } + + /** + * 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->container['id'] = $data['id'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['payment_service_definition_id'] = $data['payment_service_definition_id'] ?? null; + $this->container['method'] = $data['method'] ?? null; + $this->container['display_name'] = $data['display_name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['id']) && (mb_strlen($this->container['id']) > 200)) { + $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 200."; + } + + if (!is_null($this->container['id']) && (mb_strlen($this->container['id']) < 1)) { + $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 1."; + } + + $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) + ); + } + + if (!is_null($this->container['payment_service_definition_id']) && (mb_strlen($this->container['payment_service_definition_id']) > 50)) { + $invalidProperties[] = "invalid value for 'payment_service_definition_id', the character length must be smaller than or equal to 50."; + } + + if (!is_null($this->container['payment_service_definition_id']) && (mb_strlen($this->container['payment_service_definition_id']) < 1)) { + $invalidProperties[] = "invalid value for 'payment_service_definition_id', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['display_name']) && (mb_strlen($this->container['display_name']) > 50)) { + $invalidProperties[] = "invalid value for 'display_name', the character length must be smaller than or equal to 50."; + } + + if (!is_null($this->container['display_name']) && (mb_strlen($this->container['display_name']) < 1)) { + $invalidProperties[] = "invalid value for 'display_name', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The ID of this payment service. + * + * @return self + */ + public function setId($id) + { + if (!is_null($id) && (mb_strlen($id) > 200)) { + throw new \InvalidArgumentException('invalid length for $id when calling PaymentMethodTokenPaymentService., must be smaller than or equal to 200.'); + } + if (!is_null($id) && (mb_strlen($id) < 1)) { + throw new \InvalidArgumentException('invalid length for $id when calling PaymentMethodTokenPaymentService., must be bigger than or equal to 1.'); + } + + $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 this resource. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !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 payment_service_definition_id + * + * @return string|null + */ + public function getPaymentServiceDefinitionId() + { + return $this->container['payment_service_definition_id']; + } + + /** + * Sets payment_service_definition_id + * + * @param string|null $payment_service_definition_id The ID of the payment service definition used to create this service. + * + * @return self + */ + public function setPaymentServiceDefinitionId($payment_service_definition_id) + { + if (!is_null($payment_service_definition_id) && (mb_strlen($payment_service_definition_id) > 50)) { + throw new \InvalidArgumentException('invalid length for $payment_service_definition_id when calling PaymentMethodTokenPaymentService., must be smaller than or equal to 50.'); + } + if (!is_null($payment_service_definition_id) && (mb_strlen($payment_service_definition_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $payment_service_definition_id when calling PaymentMethodTokenPaymentService., must be bigger than or equal to 1.'); + } + + $this->container['payment_service_definition_id'] = $payment_service_definition_id; + + return $this; + } + + /** + * Gets method + * + * @return string|null + */ + public function getMethod() + { + return $this->container['method']; + } + + /** + * Sets method + * + * @param string|null $method method + * + * @return self + */ + public function setMethod($method) + { + $this->container['method'] = $method; + + return $this; + } + + /** + * Gets display_name + * + * @return string|null + */ + public function getDisplayName() + { + return $this->container['display_name']; + } + + /** + * Sets display_name + * + * @param string|null $display_name The custom name set for this service. + * + * @return self + */ + public function setDisplayName($display_name) + { + if (!is_null($display_name) && (mb_strlen($display_name) > 50)) { + throw new \InvalidArgumentException('invalid length for $display_name when calling PaymentMethodTokenPaymentService., must be smaller than or equal to 50.'); + } + if (!is_null($display_name) && (mb_strlen($display_name) < 1)) { + throw new \InvalidArgumentException('invalid length for $display_name when calling PaymentMethodTokenPaymentService., must be bigger than or equal to 1.'); + } + + $this->container['display_name'] = $display_name; + + 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 + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/PaymentMethodTokenized.php b/lib/model/PaymentMethodTokenized.php index 18144e3..b99518f 100644 --- a/lib/model/PaymentMethodTokenized.php +++ b/lib/model/PaymentMethodTokenized.php @@ -2,7 +2,7 @@ /** * PaymentMethodTokenized * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -209,21 +209,21 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_PAYMENT_METHOD = 'payment-method'; - const SCHEME_VISA = 'visa'; - const SCHEME_MASTERCARD = 'mastercard'; - const SCHEME_AMERICAN_EXPRESS = 'american-express'; - const SCHEME_DINERS_CLUB = 'diners-club'; - const SCHEME_DISCOVER = 'discover'; - const SCHEME_JCB = 'jcb'; - const SCHEME_UNIONPAY = 'unionpay'; - const SCHEME_MAESTRO = 'maestro'; - const SCHEME_ELO = 'elo'; - const SCHEME_MIR = 'mir'; - const SCHEME_HIPER = 'hiper'; - const SCHEME_HIPERCARD = 'hipercard'; - const APPROVAL_TARGET_ANY = 'any'; - const APPROVAL_TARGET_NEW_WINDOW = 'new_window'; + public const TYPE_PAYMENT_METHOD = 'payment-method'; + public const SCHEME_VISA = 'visa'; + public const SCHEME_MASTERCARD = 'mastercard'; + public const SCHEME_AMERICAN_EXPRESS = 'american-express'; + public const SCHEME_DINERS_CLUB = 'diners-club'; + public const SCHEME_DISCOVER = 'discover'; + public const SCHEME_JCB = 'jcb'; + public const SCHEME_UNIONPAY = 'unionpay'; + public const SCHEME_MAESTRO = 'maestro'; + public const SCHEME_ELO = 'elo'; + public const SCHEME_MIR = 'mir'; + public const SCHEME_HIPER = 'hiper'; + public const SCHEME_HIPERCARD = 'hipercard'; + public const APPROVAL_TARGET_ANY = 'any'; + public const APPROVAL_TARGET_NEW_WINDOW = 'new_window'; /** * Gets allowable values of the enum @@ -649,7 +649,7 @@ public function setCountry($country) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -661,6 +661,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -674,7 +675,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -690,7 +691,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -702,6 +703,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentMethodTokens.php b/lib/model/PaymentMethodTokens.php index 0e6f709..296dc3d 100644 --- a/lib/model/PaymentMethodTokens.php +++ b/lib/model/PaymentMethodTokens.php @@ -2,7 +2,7 @@ /** * PaymentMethodTokens * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -237,7 +237,7 @@ public function setItems($items) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -249,6 +249,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -262,7 +263,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -278,7 +279,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -290,6 +291,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentMethods.php b/lib/model/PaymentMethods.php index 2267d7a..538b47b 100644 --- a/lib/model/PaymentMethods.php +++ b/lib/model/PaymentMethods.php @@ -2,7 +2,7 @@ /** * PaymentMethods * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -373,7 +373,7 @@ public function setPreviousCursor($previous_cursor) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -385,6 +385,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -398,7 +399,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -414,7 +415,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -426,6 +427,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentMethodsTokenized.php b/lib/model/PaymentMethodsTokenized.php index d45c7d1..4164506 100644 --- a/lib/model/PaymentMethodsTokenized.php +++ b/lib/model/PaymentMethodsTokenized.php @@ -2,7 +2,7 @@ /** * PaymentMethodsTokenized * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -237,7 +237,7 @@ public function setItems($items) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -249,6 +249,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -262,7 +263,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -278,7 +279,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -290,6 +291,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentOption.php b/lib/model/PaymentOption.php index 76acd3c..9f1003b 100644 --- a/lib/model/PaymentOption.php +++ b/lib/model/PaymentOption.php @@ -2,7 +2,7 @@ /** * PaymentOption * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -199,7 +199,7 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_PAYMENT_OPTION = 'payment-option'; + public const TYPE_PAYMENT_OPTION = 'payment-option'; /** * Gets allowable values of the enum @@ -479,7 +479,7 @@ public function setPaymentMethodTokenizationEnabled($payment_method_tokenization * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -491,6 +491,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -504,7 +505,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -520,7 +521,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -532,6 +533,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentOptionApprovalUI.php b/lib/model/PaymentOptionApprovalUI.php index d93f2ae..f2212fc 100644 --- a/lib/model/PaymentOptionApprovalUI.php +++ b/lib/model/PaymentOptionApprovalUI.php @@ -2,7 +2,7 @@ /** * PaymentOptionApprovalUI * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -267,7 +267,7 @@ public function setWidth($width) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -279,6 +279,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -292,7 +293,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -308,7 +309,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -320,6 +321,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentOptionContext.php b/lib/model/PaymentOptionContext.php index cce59e1..21ae25a 100644 --- a/lib/model/PaymentOptionContext.php +++ b/lib/model/PaymentOptionContext.php @@ -2,7 +2,7 @@ /** * PaymentOptionContext * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -297,7 +297,7 @@ public function setApprovalUi($approval_ui) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -309,6 +309,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -322,7 +323,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -338,7 +339,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -350,6 +351,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentOptions.php b/lib/model/PaymentOptions.php index 68f3e34..7a64d28 100644 --- a/lib/model/PaymentOptions.php +++ b/lib/model/PaymentOptions.php @@ -2,7 +2,7 @@ /** * PaymentOptions * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -237,7 +237,7 @@ public function setItems($items) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -249,6 +249,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -262,7 +263,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -278,7 +279,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -290,6 +291,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentService.php b/lib/model/PaymentService.php index 9d5a585..d2672b1 100644 --- a/lib/model/PaymentService.php +++ b/lib/model/PaymentService.php @@ -2,7 +2,7 @@ /** * PaymentService * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -85,7 +85,7 @@ class PaymentService implements ModelInterface, ArrayAccess, \JsonSerializable 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'webhook_url' => 'string', - 'fields' => '\Gr4vy\model\PaymentServiceFields[]' + 'fields' => '\Gr4vy\model\PaymentServiceFieldsInner[]' ]; /** @@ -284,10 +284,10 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_PAYMENT_SERVICE = 'payment-service'; - const STATUS_PENDING = 'pending'; - const STATUS_CREATED = 'created'; - const STATUS_FAILED = 'failed'; + public const TYPE_PAYMENT_SERVICE = 'payment-service'; + public const STATUS_PENDING = 'pending'; + public const STATUS_CREATED = 'created'; + public const STATUS_FAILED = 'failed'; /** * Gets allowable values of the enum @@ -1141,7 +1141,7 @@ public function setWebhookUrl($webhook_url) /** * Gets fields * - * @return \Gr4vy\model\PaymentServiceFields[]|null + * @return \Gr4vy\model\PaymentServiceFieldsInner[]|null */ public function getFields() { @@ -1151,7 +1151,7 @@ public function getFields() /** * Sets fields * - * @param \Gr4vy\model\PaymentServiceFields[]|null $fields A list of fields, each containing a key-value pair for each field configured for this payment service. Fields marked as `secret` (see Payment Service Definition) are not returned. + * @param \Gr4vy\model\PaymentServiceFieldsInner[]|null $fields A list of fields, each containing a key-value pair for each field configured for this payment service. Fields marked as `secret` (see Payment Service Definition) are not returned. * * @return self */ @@ -1168,7 +1168,7 @@ public function setFields($fields) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1180,6 +1180,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1193,7 +1194,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1209,7 +1210,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1221,6 +1222,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentServiceDefinition.php b/lib/model/PaymentServiceDefinition.php index ca8859a..bebcaee 100644 --- a/lib/model/PaymentServiceDefinition.php +++ b/lib/model/PaymentServiceDefinition.php @@ -2,7 +2,7 @@ /** * PaymentServiceDefinition * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -65,7 +65,7 @@ class PaymentServiceDefinition implements ModelInterface, ArrayAccess, \JsonSeri 'type' => 'string', 'display_name' => 'string', 'method' => 'string', - 'fields' => '\Gr4vy\model\PaymentServiceDefinitionFields[]', + 'fields' => '\Gr4vy\model\PaymentServiceDefinitionFieldsInner[]', 'supported_currencies' => 'string[]', 'supported_countries' => 'string[]', 'mode' => 'string', @@ -378,7 +378,7 @@ public function setMethod($method) /** * Gets fields * - * @return \Gr4vy\model\PaymentServiceDefinitionFields[]|null + * @return \Gr4vy\model\PaymentServiceDefinitionFieldsInner[]|null */ public function getFields() { @@ -388,7 +388,7 @@ public function getFields() /** * Sets fields * - * @param \Gr4vy\model\PaymentServiceDefinitionFields[]|null $fields A list of fields that need to be submitted when activating the payment. service. + * @param \Gr4vy\model\PaymentServiceDefinitionFieldsInner[]|null $fields A list of fields that need to be submitted when activating the payment. service. * * @return self */ @@ -564,7 +564,7 @@ public function setConfiguration($configuration) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -576,6 +576,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -589,7 +590,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -605,7 +606,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -617,6 +618,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentServiceDefinitionConfiguration.php b/lib/model/PaymentServiceDefinitionConfiguration.php index a791214..6086dad 100644 --- a/lib/model/PaymentServiceDefinitionConfiguration.php +++ b/lib/model/PaymentServiceDefinitionConfiguration.php @@ -2,7 +2,7 @@ /** * PaymentServiceDefinitionConfiguration * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -174,8 +174,8 @@ public function getModelName() return self::$openAPIModelName; } - const APPROVAL_UI_TARGET_ANY = 'any'; - const APPROVAL_UI_TARGET_NEW_WINDOW = 'new_window'; + public const APPROVAL_UI_TARGET_ANY = 'any'; + public const APPROVAL_UI_TARGET_NEW_WINDOW = 'new_window'; /** * Gets allowable values of the enum @@ -331,7 +331,7 @@ public function setApprovalUiTarget($approval_ui_target) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -343,6 +343,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -356,7 +357,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -372,7 +373,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -384,6 +385,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentServiceDefinitionFields.php b/lib/model/PaymentServiceDefinitionFieldsInner.php similarity index 94% rename from lib/model/PaymentServiceDefinitionFields.php rename to lib/model/PaymentServiceDefinitionFieldsInner.php index 2d4e089..efcc8e2 100644 --- a/lib/model/PaymentServiceDefinitionFields.php +++ b/lib/model/PaymentServiceDefinitionFieldsInner.php @@ -1,8 +1,8 @@ container[$offset]); } @@ -405,6 +405,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -418,7 +419,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -434,7 +435,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -446,6 +447,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentServiceDefinitionSupportedFeatures.php b/lib/model/PaymentServiceDefinitionSupportedFeatures.php index 6f3cf64..ac518c2 100644 --- a/lib/model/PaymentServiceDefinitionSupportedFeatures.php +++ b/lib/model/PaymentServiceDefinitionSupportedFeatures.php @@ -2,7 +2,7 @@ /** * PaymentServiceDefinitionSupportedFeatures * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -507,7 +507,7 @@ public function setVoid($void) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -519,6 +519,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -532,7 +533,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -548,7 +549,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -560,6 +561,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentServiceDefinitions.php b/lib/model/PaymentServiceDefinitions.php index 37d5f3f..65106bd 100644 --- a/lib/model/PaymentServiceDefinitions.php +++ b/lib/model/PaymentServiceDefinitions.php @@ -2,7 +2,7 @@ /** * PaymentServiceDefinitions * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -373,7 +373,7 @@ public function setPreviousCursor($previous_cursor) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -385,6 +385,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -398,7 +399,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -414,7 +415,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -426,6 +427,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentServiceFields.php b/lib/model/PaymentServiceFieldsInner.php similarity index 90% rename from lib/model/PaymentServiceFields.php rename to lib/model/PaymentServiceFieldsInner.php index 9289fc2..fdf3733 100644 --- a/lib/model/PaymentServiceFields.php +++ b/lib/model/PaymentServiceFieldsInner.php @@ -1,8 +1,8 @@ 50)) { - throw new \InvalidArgumentException('invalid length for $key when calling PaymentServiceFields., must be smaller than or equal to 50.'); + throw new \InvalidArgumentException('invalid length for $key when calling PaymentServiceFieldsInner., must be smaller than or equal to 50.'); } if (!is_null($key) && (mb_strlen($key) < 1)) { - throw new \InvalidArgumentException('invalid length for $key when calling PaymentServiceFields., must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid length for $key when calling PaymentServiceFieldsInner., must be bigger than or equal to 1.'); } $this->container['key'] = $key; @@ -279,10 +279,10 @@ public function getValue() public function setValue($value) { if (!is_null($value) && (mb_strlen($value) > 5000)) { - throw new \InvalidArgumentException('invalid length for $value when calling PaymentServiceFields., must be smaller than or equal to 5000.'); + throw new \InvalidArgumentException('invalid length for $value when calling PaymentServiceFieldsInner., must be smaller than or equal to 5000.'); } if (!is_null($value) && (mb_strlen($value) < 0)) { - throw new \InvalidArgumentException('invalid length for $value when calling PaymentServiceFields., must be bigger than or equal to 0.'); + throw new \InvalidArgumentException('invalid length for $value when calling PaymentServiceFieldsInner., must be bigger than or equal to 0.'); } $this->container['value'] = $value; @@ -296,7 +296,7 @@ public function setValue($value) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -308,6 +308,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -321,7 +322,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -337,7 +338,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -349,6 +350,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentServiceRequest.php b/lib/model/PaymentServiceRequest.php index 560b997..fb54204 100644 --- a/lib/model/PaymentServiceRequest.php +++ b/lib/model/PaymentServiceRequest.php @@ -2,7 +2,7 @@ /** * PaymentServiceRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -62,7 +62,7 @@ class PaymentServiceRequest implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPITypes = [ 'display_name' => 'string', - 'fields' => '\Gr4vy\model\PaymentServiceUpdateFields[]', + 'fields' => '\Gr4vy\model\PaymentServiceUpdateFieldsInner[]', 'accepted_countries' => 'string[]', 'accepted_currencies' => 'string[]', 'three_d_secure_enabled' => 'bool', @@ -422,7 +422,7 @@ public function setDisplayName($display_name) /** * Gets fields * - * @return \Gr4vy\model\PaymentServiceUpdateFields[] + * @return \Gr4vy\model\PaymentServiceUpdateFieldsInner[] */ public function getFields() { @@ -432,7 +432,7 @@ public function getFields() /** * Sets fields * - * @param \Gr4vy\model\PaymentServiceUpdateFields[] $fields A list of fields, each containing a key-value pair for each field defined by the definition for this payment service e.g. for stripe-card `secret_key` is required and so must be sent within this field. + * @param \Gr4vy\model\PaymentServiceUpdateFieldsInner[] $fields A list of fields, each containing a key-value pair for each field defined by the definition for this payment service e.g. for stripe-card `secret_key` is required and so must be sent within this field. * * @return self */ @@ -890,7 +890,7 @@ public function setPaymentServiceDefinitionId($payment_service_definition_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -902,6 +902,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -915,7 +916,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -931,7 +932,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -943,6 +944,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentServiceRequestAllOf.php b/lib/model/PaymentServiceRequestAllOf.php index c674a20..3b049d3 100644 --- a/lib/model/PaymentServiceRequestAllOf.php +++ b/lib/model/PaymentServiceRequestAllOf.php @@ -2,7 +2,7 @@ /** * PaymentServiceRequestAllOf * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -251,7 +251,7 @@ public function setPaymentServiceDefinitionId($payment_service_definition_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -263,6 +263,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -276,7 +277,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -292,7 +293,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -304,6 +305,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentServiceSnapshot.php b/lib/model/PaymentServiceSnapshot.php index 10b8579..e174908 100644 --- a/lib/model/PaymentServiceSnapshot.php +++ b/lib/model/PaymentServiceSnapshot.php @@ -2,7 +2,7 @@ /** * PaymentServiceSnapshot * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -184,7 +184,7 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_PAYMENT_SERVICE = 'payment-service'; + public const TYPE_PAYMENT_SERVICE = 'payment-service'; /** * Gets allowable values of the enum @@ -434,7 +434,7 @@ public function setDisplayName($display_name) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -446,6 +446,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -459,7 +460,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -475,7 +476,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -487,6 +488,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentServiceUpdate.php b/lib/model/PaymentServiceUpdate.php index 7c6ada8..113e2c9 100644 --- a/lib/model/PaymentServiceUpdate.php +++ b/lib/model/PaymentServiceUpdate.php @@ -2,7 +2,7 @@ /** * PaymentServiceUpdate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -62,7 +62,7 @@ class PaymentServiceUpdate implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPITypes = [ 'display_name' => 'string', - 'fields' => '\Gr4vy\model\PaymentServiceUpdateFields[]', + 'fields' => '\Gr4vy\model\PaymentServiceUpdateFieldsInner[]', 'accepted_countries' => 'string[]', 'accepted_currencies' => 'string[]', 'three_d_secure_enabled' => 'bool', @@ -393,7 +393,7 @@ public function setDisplayName($display_name) /** * Gets fields * - * @return \Gr4vy\model\PaymentServiceUpdateFields[]|null + * @return \Gr4vy\model\PaymentServiceUpdateFieldsInner[]|null */ public function getFields() { @@ -403,7 +403,7 @@ public function getFields() /** * Sets fields * - * @param \Gr4vy\model\PaymentServiceUpdateFields[]|null $fields A list of fields, each containing a key-value pair for each field defined by the definition for this payment service e.g. for stripe-card `secret_key` is required and so must be sent within this field. + * @param \Gr4vy\model\PaymentServiceUpdateFieldsInner[]|null $fields A list of fields, each containing a key-value pair for each field defined by the definition for this payment service e.g. for stripe-card `secret_key` is required and so must be sent within this field. * * @return self */ @@ -830,7 +830,7 @@ public function setPaymentMethodTokenizationEnabled($payment_method_tokenization * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -842,6 +842,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -855,7 +856,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -871,7 +872,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -883,6 +884,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentServiceUpdateFields.php b/lib/model/PaymentServiceUpdateFieldsInner.php similarity index 91% rename from lib/model/PaymentServiceUpdateFields.php rename to lib/model/PaymentServiceUpdateFieldsInner.php index 0c7a4f0..8202d44 100644 --- a/lib/model/PaymentServiceUpdateFields.php +++ b/lib/model/PaymentServiceUpdateFieldsInner.php @@ -1,8 +1,8 @@ 50)) { - throw new \InvalidArgumentException('invalid length for $key when calling PaymentServiceUpdateFields., must be smaller than or equal to 50.'); + throw new \InvalidArgumentException('invalid length for $key when calling PaymentServiceUpdateFieldsInner., must be smaller than or equal to 50.'); } if ((mb_strlen($key) < 1)) { - throw new \InvalidArgumentException('invalid length for $key when calling PaymentServiceUpdateFields., must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid length for $key when calling PaymentServiceUpdateFieldsInner., must be bigger than or equal to 1.'); } $this->container['key'] = $key; @@ -286,10 +286,10 @@ public function getValue() public function setValue($value) { if ((mb_strlen($value) > 5000)) { - throw new \InvalidArgumentException('invalid length for $value when calling PaymentServiceUpdateFields., must be smaller than or equal to 5000.'); + throw new \InvalidArgumentException('invalid length for $value when calling PaymentServiceUpdateFieldsInner., must be smaller than or equal to 5000.'); } if ((mb_strlen($value) < 1)) { - throw new \InvalidArgumentException('invalid length for $value when calling PaymentServiceUpdateFields., must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid length for $value when calling PaymentServiceUpdateFieldsInner., must be bigger than or equal to 1.'); } $this->container['value'] = $value; @@ -303,7 +303,7 @@ public function setValue($value) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -315,6 +315,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -328,7 +329,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -344,7 +345,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -356,6 +357,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/PaymentServices.php b/lib/model/PaymentServices.php index ce1154d..4cd2c9b 100644 --- a/lib/model/PaymentServices.php +++ b/lib/model/PaymentServices.php @@ -2,7 +2,7 @@ /** * PaymentServices * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -373,7 +373,7 @@ public function setPreviousCursor($previous_cursor) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -385,6 +385,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -398,7 +399,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -414,7 +415,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -426,6 +427,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/RedirectRequest.php b/lib/model/RedirectRequest.php index 29e991f..00e6c52 100644 --- a/lib/model/RedirectRequest.php +++ b/lib/model/RedirectRequest.php @@ -2,7 +2,7 @@ /** * RedirectRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -429,7 +429,7 @@ public function setBuyerExternalIdentifier($buyer_external_identifier) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -441,6 +441,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -454,7 +455,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -470,7 +471,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -482,6 +483,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/Refund.php b/lib/model/Refund.php index c51f8bd..1d80056 100644 --- a/lib/model/Refund.php +++ b/lib/model/Refund.php @@ -2,7 +2,7 @@ /** * Refund * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -199,12 +199,12 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_REFUND = 'refund'; - const STATUS_PROCESSING = 'processing'; - const STATUS_SUCCEEDED = 'succeeded'; - const STATUS_DECLINED = 'declined'; - const STATUS_FAILED = 'failed'; - const STATUS_VOIDED = 'voided'; + public const TYPE_REFUND = 'refund'; + public const STATUS_PROCESSING = 'processing'; + public const STATUS_SUCCEEDED = 'succeeded'; + public const STATUS_DECLINED = 'declined'; + public const STATUS_FAILED = 'failed'; + public const STATUS_VOIDED = 'voided'; /** * Gets allowable values of the enum @@ -535,7 +535,7 @@ public function setUpdatedAt($updated_at) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -547,6 +547,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -560,7 +561,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -576,7 +577,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -588,6 +589,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/Refunds.php b/lib/model/Refunds.php index 922ef85..ffee741 100644 --- a/lib/model/Refunds.php +++ b/lib/model/Refunds.php @@ -2,7 +2,7 @@ /** * Refunds * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -373,7 +373,7 @@ public function setPreviousCursor($previous_cursor) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -385,6 +385,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -398,7 +399,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -414,7 +415,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -426,6 +427,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/ResetPasswordRequest.php b/lib/model/ResetPasswordRequest.php index 5d5fd39..6c94caa 100644 --- a/lib/model/ResetPasswordRequest.php +++ b/lib/model/ResetPasswordRequest.php @@ -2,7 +2,7 @@ /** * ResetPasswordRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -237,7 +237,7 @@ public function setEmailAddress($email_address) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -249,6 +249,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -262,7 +263,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -278,7 +279,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -290,6 +291,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/SetPasswordRequest.php b/lib/model/SetPasswordRequest.php index a931a0f..2edfe25 100644 --- a/lib/model/SetPasswordRequest.php +++ b/lib/model/SetPasswordRequest.php @@ -2,7 +2,7 @@ /** * SetPasswordRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -282,7 +282,7 @@ public function setPassword($password) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -294,6 +294,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -307,7 +308,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -323,7 +324,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -335,6 +336,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/StatementDescriptor.php b/lib/model/StatementDescriptor.php index 65d199e..84f0a5b 100644 --- a/lib/model/StatementDescriptor.php +++ b/lib/model/StatementDescriptor.php @@ -2,7 +2,7 @@ /** * StatementDescriptor * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -439,7 +439,7 @@ public function setUrl($url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -451,6 +451,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -464,7 +465,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -480,7 +481,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -492,6 +493,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/TaxId.php b/lib/model/TaxId.php index 7c3901c..3127ccc 100644 --- a/lib/model/TaxId.php +++ b/lib/model/TaxId.php @@ -2,7 +2,7 @@ /** * TaxId * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -169,47 +169,47 @@ public function getModelName() return self::$openAPIModelName; } - const KIND_AE_TRN = 'ae.trn'; - const KIND_AU_ABN = 'au.abn'; - const KIND_AR_CUIT = 'ar.cuit'; - const KIND_BR_CNPJ = 'br.cnpj'; - const KIND_BR_CPF = 'br.cpf'; - const KIND_CA_BN = 'ca.bn'; - const KIND_CA_GST_HST = 'ca.gst_hst'; - const KIND_CA_PST_BC = 'ca.pst_bc'; - const KIND_CA_PST_MB = 'ca.pst_mb'; - const KIND_CA_PST_SK = 'ca.pst_sk'; - const KIND_CA_QST = 'ca.qst'; - const KIND_CH_VAT = 'ch.vat'; - const KIND_CL_TIN = 'cl.tin'; - const KIND_ES_CIF = 'es.cif'; - const KIND_EU_VAT = 'eu.vat'; - const KIND_GB_VAT = 'gb.vat'; - const KIND_HK_BR = 'hk.br'; - const KIND_ID_NIK = 'id.nik'; - const KIND_ID_NPWP = 'id.npwp'; - const KIND_IN_GST = 'in.gst'; - const KIND_JP_CN = 'jp.cn'; - const KIND_JP_RN = 'jp.rn'; - const KIND_KR_BRN = 'kr.brn'; - const KIND_LI_UID = 'li.uid'; - const KIND_MX_RFC = 'mx.rfc'; - const KIND_MY_FRP = 'my.frp'; - const KIND_MY_ITN = 'my.itn'; - const KIND_MY_NRIC = 'my.nric'; - const KIND_MY_SST = 'my.sst'; - const KIND_NO_VAT = 'no.vat'; - const KIND_NZ_GST = 'nz.gst'; - const KIND_RU_INN = 'ru.inn'; - const KIND_RU_KPP = 'ru.kpp'; - const KIND_SA_VAT = 'sa.vat'; - const KIND_SG_GST = 'sg.gst'; - const KIND_SG_UEN = 'sg.uen'; - const KIND_TH_ID = 'th.id'; - const KIND_TH_VAT = 'th.vat'; - const KIND_TW_VAT = 'tw.vat'; - const KIND_US_EIN = 'us.ein'; - const KIND_ZA_VAT = 'za.vat'; + public const KIND_AE_TRN = 'ae.trn'; + public const KIND_AU_ABN = 'au.abn'; + public const KIND_AR_CUIT = 'ar.cuit'; + public const KIND_BR_CNPJ = 'br.cnpj'; + public const KIND_BR_CPF = 'br.cpf'; + public const KIND_CA_BN = 'ca.bn'; + public const KIND_CA_GST_HST = 'ca.gst_hst'; + public const KIND_CA_PST_BC = 'ca.pst_bc'; + public const KIND_CA_PST_MB = 'ca.pst_mb'; + public const KIND_CA_PST_SK = 'ca.pst_sk'; + public const KIND_CA_QST = 'ca.qst'; + public const KIND_CH_VAT = 'ch.vat'; + public const KIND_CL_TIN = 'cl.tin'; + public const KIND_ES_CIF = 'es.cif'; + public const KIND_EU_VAT = 'eu.vat'; + public const KIND_GB_VAT = 'gb.vat'; + public const KIND_HK_BR = 'hk.br'; + public const KIND_ID_NIK = 'id.nik'; + public const KIND_ID_NPWP = 'id.npwp'; + public const KIND_IN_GST = 'in.gst'; + public const KIND_JP_CN = 'jp.cn'; + public const KIND_JP_RN = 'jp.rn'; + public const KIND_KR_BRN = 'kr.brn'; + public const KIND_LI_UID = 'li.uid'; + public const KIND_MX_RFC = 'mx.rfc'; + public const KIND_MY_FRP = 'my.frp'; + public const KIND_MY_ITN = 'my.itn'; + public const KIND_MY_NRIC = 'my.nric'; + public const KIND_MY_SST = 'my.sst'; + public const KIND_NO_VAT = 'no.vat'; + public const KIND_NZ_GST = 'nz.gst'; + public const KIND_RU_INN = 'ru.inn'; + public const KIND_RU_KPP = 'ru.kpp'; + public const KIND_SA_VAT = 'sa.vat'; + public const KIND_SG_GST = 'sg.gst'; + public const KIND_SG_UEN = 'sg.uen'; + public const KIND_TH_ID = 'th.id'; + public const KIND_TH_VAT = 'th.vat'; + public const KIND_TW_VAT = 'tw.vat'; + public const KIND_US_EIN = 'us.ein'; + public const KIND_ZA_VAT = 'za.vat'; /** * Gets allowable values of the enum @@ -400,7 +400,7 @@ public function setKind($kind) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -412,6 +412,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -425,7 +426,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -441,7 +442,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -453,6 +454,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/ThreeDSecureData.php b/lib/model/ThreeDSecureData.php index 4d3220a..2565cf9 100644 --- a/lib/model/ThreeDSecureData.php +++ b/lib/model/ThreeDSecureData.php @@ -2,7 +2,7 @@ /** * ThreeDSecureData * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -377,7 +377,7 @@ public function setDirectoryResponse($directory_response) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -389,6 +389,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -402,7 +403,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -418,7 +419,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -430,6 +431,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/ThreeDSecureDataV1.php b/lib/model/ThreeDSecureDataV1.php index 8978ece..c7315a6 100644 --- a/lib/model/ThreeDSecureDataV1.php +++ b/lib/model/ThreeDSecureDataV1.php @@ -2,7 +2,7 @@ /** * ThreeDSecureDataV1 * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -492,7 +492,7 @@ public function setXid($xid) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -504,6 +504,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -517,7 +518,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -533,7 +534,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -545,6 +546,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/ThreeDSecureDataV1AllOf.php b/lib/model/ThreeDSecureDataV1AllOf.php index 9399e65..7d96124 100644 --- a/lib/model/ThreeDSecureDataV1AllOf.php +++ b/lib/model/ThreeDSecureDataV1AllOf.php @@ -2,7 +2,7 @@ /** * ThreeDSecureDataV1AllOf * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -321,7 +321,7 @@ public function setXid($xid) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -333,6 +333,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -346,7 +347,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -362,7 +363,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -374,6 +375,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/ThreeDSecureDataV1V2.php b/lib/model/ThreeDSecureDataV1V2.php index 6baf1b6..7cae61f 100644 --- a/lib/model/ThreeDSecureDataV1V2.php +++ b/lib/model/ThreeDSecureDataV1V2.php @@ -2,7 +2,7 @@ /** * ThreeDSecureDataV1V2 * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -525,7 +525,7 @@ public function setDirectoryTransactionId($directory_transaction_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -537,6 +537,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -550,7 +551,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -566,7 +567,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -578,6 +579,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/ThreeDSecureDataV2.php b/lib/model/ThreeDSecureDataV2.php index a3c0eec..b9966dd 100644 --- a/lib/model/ThreeDSecureDataV2.php +++ b/lib/model/ThreeDSecureDataV2.php @@ -2,7 +2,7 @@ /** * ThreeDSecureDataV2 * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -448,7 +448,7 @@ public function setDirectoryTransactionId($directory_transaction_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -460,6 +460,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -473,7 +474,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -489,7 +490,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -501,6 +502,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/ThreeDSecureDataV2AllOf.php b/lib/model/ThreeDSecureDataV2AllOf.php index d314601..6bc87aa 100644 --- a/lib/model/ThreeDSecureDataV2AllOf.php +++ b/lib/model/ThreeDSecureDataV2AllOf.php @@ -2,7 +2,7 @@ /** * ThreeDSecureDataV2AllOf * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -277,7 +277,7 @@ public function setDirectoryTransactionId($directory_transaction_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -289,6 +289,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -302,7 +303,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -318,7 +319,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -330,6 +331,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/ThreeDSecureSummary.php b/lib/model/ThreeDSecureSummary.php index 8a25092..0002820 100644 --- a/lib/model/ThreeDSecureSummary.php +++ b/lib/model/ThreeDSecureSummary.php @@ -2,7 +2,7 @@ /** * ThreeDSecureSummary * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -179,13 +179,13 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_SETUP_ERROR = 'setup_error'; - const STATUS_ERROR = 'error'; - const STATUS_DECLINED = 'declined'; - const STATUS_CANCELLED = 'cancelled'; - const STATUS_COMPLETE = 'complete'; - const METHOD_CHALLENGE = 'challenge'; - const METHOD_FRICTIONLESS = 'frictionless'; + public const STATUS_SETUP_ERROR = 'setup_error'; + public const STATUS_ERROR = 'error'; + public const STATUS_DECLINED = 'declined'; + public const STATUS_CANCELLED = 'cancelled'; + public const STATUS_COMPLETE = 'complete'; + public const METHOD_CHALLENGE = 'challenge'; + public const METHOD_FRICTIONLESS = 'frictionless'; /** * Gets allowable values of the enum @@ -410,7 +410,7 @@ public function setResponseData($response_data) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -422,6 +422,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -435,7 +436,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -451,7 +452,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -463,6 +464,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/TokenizedRequest.php b/lib/model/TokenizedRequest.php index aea016c..68fc819 100644 --- a/lib/model/TokenizedRequest.php +++ b/lib/model/TokenizedRequest.php @@ -2,7 +2,7 @@ /** * TokenizedRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -174,7 +174,7 @@ public function getModelName() return self::$openAPIModelName; } - const METHOD_ID = 'id'; + public const METHOD_ID = 'id'; /** * Gets allowable values of the enum @@ -335,7 +335,7 @@ public function setRedirectUrl($redirect_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -347,6 +347,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -360,7 +361,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -376,7 +377,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -388,6 +389,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/Transaction.php b/lib/model/Transaction.php index 78f99ee..36258d4 100644 --- a/lib/model/Transaction.php +++ b/lib/model/Transaction.php @@ -2,7 +2,7 @@ /** * Transaction * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -70,16 +70,16 @@ class Transaction implements ModelInterface, ArrayAccess, \JsonSerializable 'refunded_amount' => 'int', 'currency' => 'string', 'country' => 'string', - 'payment_method' => '\Gr4vy\model\PaymentMethodSnapshot', - 'buyer' => '\Gr4vy\model\BuyerSnapshot', + 'payment_method' => '\Gr4vy\model\TransactionPaymentMethod', + 'buyer' => '\Gr4vy\model\TransactionBuyer', 'created_at' => '\DateTime', 'external_identifier' => 'string', 'updated_at' => '\DateTime', - 'payment_service' => '\Gr4vy\model\PaymentService', + 'payment_service' => '\Gr4vy\model\PaymentMethodTokenPaymentService', 'merchant_initiated' => 'bool', 'payment_source' => 'string', 'is_subsequent_payment' => 'bool', - 'statement_descriptor' => 'StatementDescriptor', + 'statement_descriptor' => '\Gr4vy\model\TransactionStatementDescriptor', 'cart_items' => '\Gr4vy\model\CartItem[]', 'scheme_transaction_id' => 'string', 'raw_response_code' => 'string', @@ -89,7 +89,10 @@ class Transaction implements ModelInterface, ArrayAccess, \JsonSerializable 'method' => 'string', 'payment_service_transaction_id' => 'string', 'metadata' => 'array', - 'three_d_secure' => '\Gr4vy\model\ThreeDSecureSummary' + 'three_d_secure' => '\Gr4vy\model\ThreeDSecureSummary', + 'authorized_at' => '\DateTime', + 'captured_at' => '\DateTime', + 'voided_at' => '\DateTime' ]; /** @@ -128,7 +131,10 @@ class Transaction implements ModelInterface, ArrayAccess, \JsonSerializable 'method' => null, 'payment_service_transaction_id' => null, 'metadata' => null, - 'three_d_secure' => null + 'three_d_secure' => null, + 'authorized_at' => 'date-time', + 'captured_at' => 'date-time', + 'voided_at' => 'date-time' ]; /** @@ -186,7 +192,10 @@ public static function openAPIFormats() 'method' => 'method', 'payment_service_transaction_id' => 'payment_service_transaction_id', 'metadata' => 'metadata', - 'three_d_secure' => 'three_d_secure' + 'three_d_secure' => 'three_d_secure', + 'authorized_at' => 'authorized_at', + 'captured_at' => 'captured_at', + 'voided_at' => 'voided_at' ]; /** @@ -223,7 +232,10 @@ public static function openAPIFormats() 'method' => 'setMethod', 'payment_service_transaction_id' => 'setPaymentServiceTransactionId', 'metadata' => 'setMetadata', - 'three_d_secure' => 'setThreeDSecure' + 'three_d_secure' => 'setThreeDSecure', + 'authorized_at' => 'setAuthorizedAt', + 'captured_at' => 'setCapturedAt', + 'voided_at' => 'setVoidedAt' ]; /** @@ -260,7 +272,10 @@ public static function openAPIFormats() 'method' => 'getMethod', 'payment_service_transaction_id' => 'getPaymentServiceTransactionId', 'metadata' => 'getMetadata', - 'three_d_secure' => 'getThreeDSecure' + 'three_d_secure' => 'getThreeDSecure', + 'authorized_at' => 'getAuthorizedAt', + 'captured_at' => 'getCapturedAt', + 'voided_at' => 'getVoidedAt' ]; /** @@ -304,56 +319,57 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_TRANSACTION = 'transaction'; - const STATUS_PROCESSING = 'processing'; - const STATUS_BUYER_APPROVAL_PENDING = 'buyer_approval_pending'; - const STATUS_AUTHORIZATION_SUCCEEDED = 'authorization_succeeded'; - const STATUS_AUTHORIZATION_FAILED = 'authorization_failed'; - const STATUS_AUTHORIZATION_DECLINED = 'authorization_declined'; - const STATUS_CAPTURE_PENDING = 'capture_pending'; - const STATUS_CAPTURE_SUCCEEDED = 'capture_succeeded'; - const STATUS_AUTHORIZATION_VOID_PENDING = 'authorization_void_pending'; - const STATUS_AUTHORIZATION_VOIDED = 'authorization_voided'; - const INTENT_AUTHORIZE = 'authorize'; - const INTENT_CAPTURE = 'capture'; - const PAYMENT_SOURCE_ECOMMERCE = 'ecommerce'; - const PAYMENT_SOURCE_MOTO = 'moto'; - const PAYMENT_SOURCE_RECURRING = 'recurring'; - const PAYMENT_SOURCE_INSTALLMENT = 'installment'; - const PAYMENT_SOURCE_CARD_ON_FILE = 'card_on_file'; - const AVS_RESPONSE_CODE_NO_MATCH = 'no_match'; - const AVS_RESPONSE_CODE_MATCH = 'match'; - const AVS_RESPONSE_CODE_PARTIAL_MATCH_ADDRESS = 'partial_match_address'; - const AVS_RESPONSE_CODE_PARTIAL_MATCH_POSTCODE = 'partial_match_postcode'; - const AVS_RESPONSE_CODE_UNAVAILABLE = 'unavailable'; - const CVV_RESPONSE_CODE_NO_MATCH = 'no_match'; - const CVV_RESPONSE_CODE_MATCH = 'match'; - const CVV_RESPONSE_CODE_UNAVAILABLE = 'unavailable'; - const CVV_RESPONSE_CODE_NOT_PROVIDED = 'not_provided'; - const METHOD_AFTERPAY = 'afterpay'; - const METHOD_APPLEPAY = 'applepay'; - const METHOD_BANKED = 'banked'; - const METHOD_BOLETO = 'boleto'; - const METHOD_CARD = 'card'; - const METHOD_CLEARPAY = 'clearpay'; - const METHOD_DANA = 'dana'; - const METHOD_FORTUMO = 'fortumo'; - const METHOD_GCASH = 'gcash'; - const METHOD_GOCARDLESS = 'gocardless'; - const METHOD_GOOGLEPAY = 'googlepay'; - const METHOD_GOOGLEPAY_PAN_ONLY = 'googlepay_pan_only'; - const METHOD_GRABPAY = 'grabpay'; - const METHOD_KLARNA = 'klarna'; - const METHOD_OVO = 'ovo'; - const METHOD_PAYMAYA = 'paymaya'; - const METHOD_PAYPAL = 'paypal'; - const METHOD_PIX = 'pix'; - const METHOD_RABBITLINEPAY = 'rabbitlinepay'; - const METHOD_SHOPEEPAY = 'shopeepay'; - const METHOD_STRIPEDD = 'stripedd'; - const METHOD_TRUEMONEY = 'truemoney'; - const METHOD_TRUSTLY = 'trustly'; - const METHOD_ZIPPAY = 'zippay'; + public const TYPE_TRANSACTION = 'transaction'; + public const STATUS_PROCESSING = 'processing'; + public const STATUS_BUYER_APPROVAL_PENDING = 'buyer_approval_pending'; + public const STATUS_AUTHORIZATION_SUCCEEDED = 'authorization_succeeded'; + public const STATUS_AUTHORIZATION_FAILED = 'authorization_failed'; + public const STATUS_AUTHORIZATION_DECLINED = 'authorization_declined'; + public const STATUS_CAPTURE_PENDING = 'capture_pending'; + public const STATUS_CAPTURE_SUCCEEDED = 'capture_succeeded'; + public const STATUS_AUTHORIZATION_VOID_PENDING = 'authorization_void_pending'; + public const STATUS_AUTHORIZATION_VOIDED = 'authorization_voided'; + public const INTENT_AUTHORIZE = 'authorize'; + public const INTENT_CAPTURE = 'capture'; + public const PAYMENT_SOURCE_ECOMMERCE = 'ecommerce'; + public const PAYMENT_SOURCE_MOTO = 'moto'; + public const PAYMENT_SOURCE_RECURRING = 'recurring'; + public const PAYMENT_SOURCE_INSTALLMENT = 'installment'; + public const PAYMENT_SOURCE_CARD_ON_FILE = 'card_on_file'; + public const AVS_RESPONSE_CODE_NO_MATCH = 'no_match'; + public const AVS_RESPONSE_CODE_MATCH = 'match'; + public const AVS_RESPONSE_CODE_PARTIAL_MATCH_ADDRESS = 'partial_match_address'; + public const AVS_RESPONSE_CODE_PARTIAL_MATCH_POSTCODE = 'partial_match_postcode'; + public const AVS_RESPONSE_CODE_UNAVAILABLE = 'unavailable'; + public const CVV_RESPONSE_CODE_NO_MATCH = 'no_match'; + public const CVV_RESPONSE_CODE_MATCH = 'match'; + public const CVV_RESPONSE_CODE_UNAVAILABLE = 'unavailable'; + public const CVV_RESPONSE_CODE_NOT_PROVIDED = 'not_provided'; + public const METHOD_AFTERPAY = 'afterpay'; + public const METHOD_APPLEPAY = 'applepay'; + public const METHOD_BANKED = 'banked'; + public const METHOD_BITPAY = 'bitpay'; + public const METHOD_BOLETO = 'boleto'; + public const METHOD_CARD = 'card'; + public const METHOD_CLEARPAY = 'clearpay'; + public const METHOD_DANA = 'dana'; + public const METHOD_FORTUMO = 'fortumo'; + public const METHOD_GCASH = 'gcash'; + public const METHOD_GOCARDLESS = 'gocardless'; + public const METHOD_GOOGLEPAY = 'googlepay'; + public const METHOD_GOOGLEPAY_PAN_ONLY = 'googlepay_pan_only'; + public const METHOD_GRABPAY = 'grabpay'; + public const METHOD_KLARNA = 'klarna'; + public const METHOD_OVO = 'ovo'; + public const METHOD_PAYMAYA = 'paymaya'; + public const METHOD_PAYPAL = 'paypal'; + public const METHOD_PIX = 'pix'; + public const METHOD_RABBITLINEPAY = 'rabbitlinepay'; + public const METHOD_SHOPEEPAY = 'shopeepay'; + public const METHOD_STRIPEDD = 'stripedd'; + public const METHOD_TRUEMONEY = 'truemoney'; + public const METHOD_TRUSTLY = 'trustly'; + public const METHOD_ZIPPAY = 'zippay'; /** * Gets allowable values of the enum @@ -458,6 +474,7 @@ public function getMethodAllowableValues() self::METHOD_AFTERPAY, self::METHOD_APPLEPAY, self::METHOD_BANKED, + self::METHOD_BITPAY, self::METHOD_BOLETO, self::METHOD_CARD, self::METHOD_CLEARPAY, @@ -517,7 +534,7 @@ public function __construct(array $data = null) $this->container['is_subsequent_payment'] = $data['is_subsequent_payment'] ?? false; $this->container['statement_descriptor'] = $data['statement_descriptor'] ?? null; $this->container['cart_items'] = $data['cart_items'] ?? null; - $this->container['scheme_transaction_id'] = $data['scheme_transaction_id'] ?? 'null'; + $this->container['scheme_transaction_id'] = $data['scheme_transaction_id'] ?? null; $this->container['raw_response_code'] = $data['raw_response_code'] ?? null; $this->container['raw_response_description'] = $data['raw_response_description'] ?? null; $this->container['avs_response_code'] = $data['avs_response_code'] ?? null; @@ -526,6 +543,9 @@ public function __construct(array $data = null) $this->container['payment_service_transaction_id'] = $data['payment_service_transaction_id'] ?? null; $this->container['metadata'] = $data['metadata'] ?? null; $this->container['three_d_secure'] = $data['three_d_secure'] ?? null; + $this->container['authorized_at'] = $data['authorized_at'] ?? null; + $this->container['captured_at'] = $data['captured_at'] ?? null; + $this->container['voided_at'] = $data['voided_at'] ?? null; } /** @@ -912,7 +932,7 @@ public function setCountry($country) /** * Gets payment_method * - * @return PaymentMethodSnapshot|null + * @return \Gr4vy\model\TransactionPaymentMethod|null */ public function getPaymentMethod() { @@ -922,7 +942,7 @@ public function getPaymentMethod() /** * Sets payment_method * - * @param PaymentMethodSnapshot|null $payment_method payment_method + * @param \Gr4vy\model\TransactionPaymentMethod|null $payment_method payment_method * * @return self */ @@ -936,7 +956,7 @@ public function setPaymentMethod($payment_method) /** * Gets buyer * - * @return BuyerSnapshot|null + * @return \Gr4vy\model\TransactionBuyer|null */ public function getBuyer() { @@ -946,7 +966,7 @@ public function getBuyer() /** * Sets buyer * - * @param BuyerSnapshot|null $buyer buyer + * @param \Gr4vy\model\TransactionBuyer|null $buyer buyer * * @return self */ @@ -1032,7 +1052,7 @@ public function setUpdatedAt($updated_at) /** * Gets payment_service * - * @return PaymentServiceSnapshot|null + * @return \Gr4vy\model\PaymentMethodTokenPaymentService|null */ public function getPaymentService() { @@ -1042,7 +1062,7 @@ public function getPaymentService() /** * Sets payment_service * - * @param PaymentServiceSnapshot|null $payment_service payment_service + * @param \Gr4vy\model\PaymentMethodTokenPaymentService|null $payment_service payment_service * * @return self */ @@ -1138,7 +1158,7 @@ public function setIsSubsequentPayment($is_subsequent_payment) /** * Gets statement_descriptor * - * @return StatementDescriptor|null + * @return \Gr4vy\model\TransactionStatementDescriptor|null */ public function getStatementDescriptor() { @@ -1148,7 +1168,7 @@ public function getStatementDescriptor() /** * Sets statement_descriptor * - * @param StatementDescriptor|null $statement_descriptor statement_descriptor + * @param \Gr4vy\model\TransactionStatementDescriptor|null $statement_descriptor statement_descriptor * * @return self */ @@ -1430,6 +1450,78 @@ public function setThreeDSecure($three_d_secure) return $this; } + + /** + * Gets authorized_at + * + * @return \DateTime|null + */ + public function getAuthorizedAt() + { + return $this->container['authorized_at']; + } + + /** + * Sets authorized_at + * + * @param \DateTime|null $authorized_at The date and time when this transaction was authorized in the payment service. Don't use this field to determine whether the transaction was authorized. A `null` value doesn't necessarily imply that the transaction wasn't authorized, it can mean that the payment service doesn't provide this value, that it didn't provide it at the time the transaction was authorized or that the transaction was authorized before the introduction of this field. + * + * @return self + */ + public function setAuthorizedAt($authorized_at) + { + $this->container['authorized_at'] = $authorized_at; + + return $this; + } + + /** + * Gets captured_at + * + * @return \DateTime|null + */ + public function getCapturedAt() + { + return $this->container['captured_at']; + } + + /** + * Sets captured_at + * + * @param \DateTime|null $captured_at The date and time when this transaction was captured in the payment service. Don't use this field to determine whether the transaction was captured. A `null` value doesn't necessarily imply that the transaction wasn't captured, it can mean that the payment service doesn't provide this value, that it didn't provide it at the time the transaction was captured or that the transaction was captured before the introduction of this field. + * + * @return self + */ + public function setCapturedAt($captured_at) + { + $this->container['captured_at'] = $captured_at; + + return $this; + } + + /** + * Gets voided_at + * + * @return \DateTime|null + */ + public function getVoidedAt() + { + return $this->container['voided_at']; + } + + /** + * Sets voided_at + * + * @param \DateTime|null $voided_at The date and time when this transaction was voided in the payment service. Don't use this field to determine whether the transaction was voided. A `null` value doesn't necessarily imply that the transaction wasn't voided, it can mean that the payment service doesn't provide this value, that it didn't provide it at the time the transaction was voided or that the transaction was voided before the introduction of this field. + * + * @return self + */ + public function setVoidedAt($voided_at) + { + $this->container['voided_at'] = $voided_at; + + return $this; + } /** * Returns true if offset exists. False otherwise. * @@ -1437,7 +1529,7 @@ public function setThreeDSecure($three_d_secure) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1449,6 +1541,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1462,7 +1555,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1478,7 +1571,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1490,6 +1583,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/TransactionBuyer.php b/lib/model/TransactionBuyer.php new file mode 100644 index 0000000..22f6eef --- /dev/null +++ b/lib/model/TransactionBuyer.php @@ -0,0 +1,505 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class TransactionBuyer implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Transaction_buyer'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'id' => 'string', + 'external_identifier' => 'string', + 'display_name' => 'string', + 'billing_details' => '\Gr4vy\model\BuyerSnapshotBillingDetails' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'id' => 'uuid', + 'external_identifier' => null, + 'display_name' => null, + 'billing_details' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'id' => 'id', + 'external_identifier' => 'external_identifier', + 'display_name' => 'display_name', + 'billing_details' => 'billing_details' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'id' => 'setId', + 'external_identifier' => 'setExternalIdentifier', + 'display_name' => 'setDisplayName', + 'billing_details' => 'setBillingDetails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'id' => 'getId', + 'external_identifier' => 'getExternalIdentifier', + 'display_name' => 'getDisplayName', + 'billing_details' => 'getBillingDetails' + ]; + + /** + * 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_BUYER = 'buyer'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BUYER, + ]; + } + + /** + * 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->container['type'] = $data['type'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['external_identifier'] = $data['external_identifier'] ?? null; + $this->container['display_name'] = $data['display_name'] ?? null; + $this->container['billing_details'] = $data['billing_details'] ?? null; + } + + /** + * 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) + ); + } + + if (!is_null($this->container['external_identifier']) && (mb_strlen($this->container['external_identifier']) > 200)) { + $invalidProperties[] = "invalid value for 'external_identifier', the character length must be smaller than or equal to 200."; + } + + if (!is_null($this->container['external_identifier']) && (mb_strlen($this->container['external_identifier']) < 1)) { + $invalidProperties[] = "invalid value for 'external_identifier', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['display_name']) && (mb_strlen($this->container['display_name']) > 200)) { + $invalidProperties[] = "invalid value for 'display_name', the character length must be smaller than or equal to 200."; + } + + if (!is_null($this->container['display_name']) && (mb_strlen($this->container['display_name']) < 1)) { + $invalidProperties[] = "invalid value for 'display_name', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of this resource. Is always `buyer`. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !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 id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique Gr4vy ID for this buyer. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets external_identifier + * + * @return string|null + */ + public function getExternalIdentifier() + { + return $this->container['external_identifier']; + } + + /** + * Sets external_identifier + * + * @param string|null $external_identifier An external identifier that can be used to match the buyer against your own records. + * + * @return self + */ + public function setExternalIdentifier($external_identifier) + { + if (!is_null($external_identifier) && (mb_strlen($external_identifier) > 200)) { + throw new \InvalidArgumentException('invalid length for $external_identifier when calling TransactionBuyer., must be smaller than or equal to 200.'); + } + if (!is_null($external_identifier) && (mb_strlen($external_identifier) < 1)) { + throw new \InvalidArgumentException('invalid length for $external_identifier when calling TransactionBuyer., must be bigger than or equal to 1.'); + } + + $this->container['external_identifier'] = $external_identifier; + + return $this; + } + + /** + * Gets display_name + * + * @return string|null + */ + public function getDisplayName() + { + return $this->container['display_name']; + } + + /** + * Sets display_name + * + * @param string|null $display_name A unique name for this buyer which is used in the Gr4vy admin panel to give a buyer a human readable name. + * + * @return self + */ + public function setDisplayName($display_name) + { + if (!is_null($display_name) && (mb_strlen($display_name) > 200)) { + throw new \InvalidArgumentException('invalid length for $display_name when calling TransactionBuyer., must be smaller than or equal to 200.'); + } + if (!is_null($display_name) && (mb_strlen($display_name) < 1)) { + throw new \InvalidArgumentException('invalid length for $display_name when calling TransactionBuyer., must be bigger than or equal to 1.'); + } + + $this->container['display_name'] = $display_name; + + return $this; + } + + /** + * Gets billing_details + * + * @return \Gr4vy\model\BuyerSnapshotBillingDetails|null + */ + public function getBillingDetails() + { + return $this->container['billing_details']; + } + + /** + * Sets billing_details + * + * @param \Gr4vy\model\BuyerSnapshotBillingDetails|null $billing_details billing_details + * + * @return self + */ + public function setBillingDetails($billing_details) + { + $this->container['billing_details'] = $billing_details; + + 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 + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/TransactionCaptureRequest.php b/lib/model/TransactionCaptureRequest.php index e683dc9..e45f53f 100644 --- a/lib/model/TransactionCaptureRequest.php +++ b/lib/model/TransactionCaptureRequest.php @@ -2,7 +2,7 @@ /** * TransactionCaptureRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -253,7 +253,7 @@ public function setAmount($amount) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,6 +265,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -278,7 +279,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -294,7 +295,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -306,6 +307,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/TransactionPaymentMethod.php b/lib/model/TransactionPaymentMethod.php new file mode 100644 index 0000000..4fde358 --- /dev/null +++ b/lib/model/TransactionPaymentMethod.php @@ -0,0 +1,711 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class TransactionPaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Transaction_payment_method'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'id' => 'string', + 'method' => 'string', + 'external_identifier' => 'string', + 'label' => 'string', + 'scheme' => 'string', + 'expiration_date' => 'string', + 'approval_target' => 'string', + 'approval_url' => 'string', + 'currency' => 'string', + 'country' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'id' => 'uuid', + 'method' => null, + 'external_identifier' => null, + 'label' => null, + 'scheme' => null, + 'expiration_date' => null, + 'approval_target' => null, + 'approval_url' => null, + 'currency' => null, + 'country' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'id' => 'id', + 'method' => 'method', + 'external_identifier' => 'external_identifier', + 'label' => 'label', + 'scheme' => 'scheme', + 'expiration_date' => 'expiration_date', + 'approval_target' => 'approval_target', + 'approval_url' => 'approval_url', + 'currency' => 'currency', + 'country' => 'country' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'id' => 'setId', + 'method' => 'setMethod', + 'external_identifier' => 'setExternalIdentifier', + 'label' => 'setLabel', + 'scheme' => 'setScheme', + 'expiration_date' => 'setExpirationDate', + 'approval_target' => 'setApprovalTarget', + 'approval_url' => 'setApprovalUrl', + 'currency' => 'setCurrency', + 'country' => 'setCountry' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'id' => 'getId', + 'method' => 'getMethod', + 'external_identifier' => 'getExternalIdentifier', + 'label' => 'getLabel', + 'scheme' => 'getScheme', + 'expiration_date' => 'getExpirationDate', + 'approval_target' => 'getApprovalTarget', + 'approval_url' => 'getApprovalUrl', + 'currency' => 'getCurrency', + 'country' => 'getCountry' + ]; + + /** + * 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 = 'payment-method'; + public const APPROVAL_TARGET_ANY = 'any'; + public const APPROVAL_TARGET_NEW_WINDOW = 'new_window'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_PAYMENT_METHOD, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getApprovalTargetAllowableValues() + { + return [ + self::APPROVAL_TARGET_ANY, + self::APPROVAL_TARGET_NEW_WINDOW, + ]; + } + + /** + * 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->container['type'] = $data['type'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['method'] = $data['method'] ?? null; + $this->container['external_identifier'] = $data['external_identifier'] ?? null; + $this->container['label'] = $data['label'] ?? null; + $this->container['scheme'] = $data['scheme'] ?? null; + $this->container['expiration_date'] = $data['expiration_date'] ?? null; + $this->container['approval_target'] = $data['approval_target'] ?? null; + $this->container['approval_url'] = $data['approval_url'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['country'] = $data['country'] ?? null; + } + + /** + * 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) + ); + } + + if (!is_null($this->container['expiration_date']) && (mb_strlen($this->container['expiration_date']) > 5)) { + $invalidProperties[] = "invalid value for 'expiration_date', the character length must be smaller than or equal to 5."; + } + + if (!is_null($this->container['expiration_date']) && (mb_strlen($this->container['expiration_date']) < 5)) { + $invalidProperties[] = "invalid value for 'expiration_date', the character length must be bigger than or equal to 5."; + } + + if (!is_null($this->container['expiration_date']) && !preg_match("/^\\d{2}\/\\d{2}$/", $this->container['expiration_date'])) { + $invalidProperties[] = "invalid value for 'expiration_date', must be conform to the pattern /^\\d{2}\/\\d{2}$/."; + } + + $allowedValues = $this->getApprovalTargetAllowableValues(); + if (!is_null($this->container['approval_target']) && !in_array($this->container['approval_target'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'approval_target', must be one of '%s'", + $this->container['approval_target'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type `payment-method`. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !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 id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique ID of the payment method. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets method + * + * @return string|null + */ + public function getMethod() + { + return $this->container['method']; + } + + /** + * Sets method + * + * @param string|null $method method + * + * @return self + */ + public function setMethod($method) + { + $this->container['method'] = $method; + + return $this; + } + + /** + * Gets external_identifier + * + * @return string|null + */ + public function getExternalIdentifier() + { + return $this->container['external_identifier']; + } + + /** + * Sets external_identifier + * + * @param string|null $external_identifier An external identifier that can be used to match the payment method against your own records. + * + * @return self + */ + public function setExternalIdentifier($external_identifier) + { + $this->container['external_identifier'] = $external_identifier; + + return $this; + } + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label A label for the payment method. This can be the last 4 digits for a card, or the email address for an alternative payment method. + * + * @return self + */ + public function setLabel($label) + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets scheme + * + * @return string|null + */ + public function getScheme() + { + return $this->container['scheme']; + } + + /** + * Sets scheme + * + * @param string|null $scheme An additional label used to differentiate different sub-types of a payment method. Most notably this can include the type of card used in a transaction. + * + * @return self + */ + public function setScheme($scheme) + { + $this->container['scheme'] = $scheme; + + return $this; + } + + /** + * Gets expiration_date + * + * @return string|null + */ + public function getExpirationDate() + { + return $this->container['expiration_date']; + } + + /** + * Sets expiration_date + * + * @param string|null $expiration_date The expiration date for this payment method. This is mostly used by cards where the card might have an expiration date. + * + * @return self + */ + public function setExpirationDate($expiration_date) + { + if (!is_null($expiration_date) && (mb_strlen($expiration_date) > 5)) { + throw new \InvalidArgumentException('invalid length for $expiration_date when calling TransactionPaymentMethod., must be smaller than or equal to 5.'); + } + if (!is_null($expiration_date) && (mb_strlen($expiration_date) < 5)) { + throw new \InvalidArgumentException('invalid length for $expiration_date when calling TransactionPaymentMethod., must be bigger than or equal to 5.'); + } + if (!is_null($expiration_date) && (!preg_match("/^\\d{2}\/\\d{2}$/", $expiration_date))) { + throw new \InvalidArgumentException("invalid value for $expiration_date when calling TransactionPaymentMethod., must conform to the pattern /^\\d{2}\/\\d{2}$/."); + } + + $this->container['expiration_date'] = $expiration_date; + + return $this; + } + + /** + * Gets approval_target + * + * @return string|null + */ + public function getApprovalTarget() + { + return $this->container['approval_target']; + } + + /** + * Sets approval_target + * + * @param string|null $approval_target The browser target that an approval URL must be opened in. If `any` or `null`, then there is no specific requirement. + * + * @return self + */ + public function setApprovalTarget($approval_target) + { + $allowedValues = $this->getApprovalTargetAllowableValues(); + if (!is_null($approval_target) && !in_array($approval_target, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'approval_target', must be one of '%s'", + $approval_target, + implode("', '", $allowedValues) + ) + ); + } + $this->container['approval_target'] = $approval_target; + + return $this; + } + + /** + * Gets approval_url + * + * @return string|null + */ + public function getApprovalUrl() + { + return $this->container['approval_url']; + } + + /** + * Sets approval_url + * + * @param string|null $approval_url The optional URL that the buyer needs to be redirected to to further authorize their payment. + * + * @return self + */ + public function setApprovalUrl($approval_url) + { + $this->container['approval_url'] = $approval_url; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The ISO-4217 currency code that this payment method can be used for. If this value is `null` the payment method may be used for multiple currencies. + * + * @return self + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country The 2-letter ISO code of the country this payment method can be used for. If this value is `null` the payment method may be used in multiple countries. + * + * @return self + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + 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 + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/TransactionPaymentMethodRequest.php b/lib/model/TransactionPaymentMethodRequest.php index c8a40f1..1a641bc 100644 --- a/lib/model/TransactionPaymentMethodRequest.php +++ b/lib/model/TransactionPaymentMethodRequest.php @@ -2,7 +2,7 @@ /** * TransactionPaymentMethodRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -546,7 +546,7 @@ public function setId($id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -558,6 +558,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -571,7 +572,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -587,7 +588,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -599,6 +600,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/TransactionRefundRequest.php b/lib/model/TransactionRefundRequest.php index 515216b..d105643 100644 --- a/lib/model/TransactionRefundRequest.php +++ b/lib/model/TransactionRefundRequest.php @@ -2,7 +2,7 @@ /** * TransactionRefundRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -253,7 +253,7 @@ public function setAmount($amount) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,6 +265,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -278,7 +279,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -294,7 +295,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -306,6 +307,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/TransactionRequest.php b/lib/model/TransactionRequest.php index 510cce1..63ecc36 100644 --- a/lib/model/TransactionRequest.php +++ b/lib/model/TransactionRequest.php @@ -2,7 +2,7 @@ /** * TransactionRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -73,10 +73,10 @@ class TransactionRequest implements ModelInterface, ArrayAccess, \JsonSerializab 'payment_source' => 'string', 'is_subsequent_payment' => 'bool', 'metadata' => 'array', - 'statement_descriptor' => 'StatementDescriptor', + 'statement_descriptor' => '\Gr4vy\model\TransactionStatementDescriptor', 'cart_items' => '\Gr4vy\model\CartItem[]', 'previous_scheme_transaction_id' => 'string', - 'browser_info' => 'BrowserInfo' + 'browser_info' => '\Gr4vy\model\TransactionRequestBrowserInfo' ]; /** @@ -239,13 +239,13 @@ public function getModelName() return self::$openAPIModelName; } - const INTENT_AUTHORIZE = 'authorize'; - const INTENT_CAPTURE = 'capture'; - const PAYMENT_SOURCE_ECOMMERCE = 'ecommerce'; - const PAYMENT_SOURCE_MOTO = 'moto'; - const PAYMENT_SOURCE_RECURRING = 'recurring'; - const PAYMENT_SOURCE_INSTALLMENT = 'installment'; - const PAYMENT_SOURCE_CARD_ON_FILE = 'card_on_file'; + public const INTENT_AUTHORIZE = 'authorize'; + public const INTENT_CAPTURE = 'capture'; + public const PAYMENT_SOURCE_ECOMMERCE = 'ecommerce'; + public const PAYMENT_SOURCE_MOTO = 'moto'; + public const PAYMENT_SOURCE_RECURRING = 'recurring'; + public const PAYMENT_SOURCE_INSTALLMENT = 'installment'; + public const PAYMENT_SOURCE_CARD_ON_FILE = 'card_on_file'; /** * Gets allowable values of the enum @@ -305,7 +305,7 @@ public function __construct(array $data = null) $this->container['metadata'] = $data['metadata'] ?? null; $this->container['statement_descriptor'] = $data['statement_descriptor'] ?? null; $this->container['cart_items'] = $data['cart_items'] ?? null; - $this->container['previous_scheme_transaction_id'] = $data['previous_scheme_transaction_id'] ?? 'null'; + $this->container['previous_scheme_transaction_id'] = $data['previous_scheme_transaction_id'] ?? null; $this->container['browser_info'] = $data['browser_info'] ?? null; } @@ -699,7 +699,7 @@ public function setMetadata($metadata) /** * Gets statement_descriptor * - * @return StatementDescriptor|null + * @return \Gr4vy\model\TransactionStatementDescriptor|null */ public function getStatementDescriptor() { @@ -709,7 +709,7 @@ public function getStatementDescriptor() /** * Sets statement_descriptor * - * @param StatementDescriptor|null $statement_descriptor statement_descriptor + * @param \Gr4vy\model\TransactionStatementDescriptor|null $statement_descriptor statement_descriptor * * @return self */ @@ -775,7 +775,7 @@ public function setPreviousSchemeTransactionId($previous_scheme_transaction_id) /** * Gets browser_info * - * @return BrowserInfo|null + * @return \Gr4vy\model\TransactionRequestBrowserInfo|null */ public function getBrowserInfo() { @@ -785,7 +785,7 @@ public function getBrowserInfo() /** * Sets browser_info * - * @param BrowserInfo|null $browser_info browser_info + * @param \Gr4vy\model\TransactionRequestBrowserInfo|null $browser_info browser_info * * @return self */ @@ -802,7 +802,7 @@ public function setBrowserInfo($browser_info) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -814,6 +814,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -827,7 +828,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -843,7 +844,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -855,6 +856,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/TransactionRequestBrowserInfo.php b/lib/model/TransactionRequestBrowserInfo.php new file mode 100644 index 0000000..5cd1846 --- /dev/null +++ b/lib/model/TransactionRequestBrowserInfo.php @@ -0,0 +1,654 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class TransactionRequestBrowserInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransactionRequest_browser_info'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'java_enabled' => 'bool', + 'javascript_enabled' => 'bool', + 'language' => 'string', + 'color_depth' => 'float', + 'screen_height' => 'float', + 'screen_width' => 'float', + 'time_zone_offset' => 'float', + 'user_device' => 'string', + 'user_agent' => 'string', + 'accept_header' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'java_enabled' => null, + 'javascript_enabled' => null, + 'language' => null, + 'color_depth' => null, + 'screen_height' => null, + 'screen_width' => null, + 'time_zone_offset' => null, + 'user_device' => null, + 'user_agent' => null, + 'accept_header' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'java_enabled' => 'java_enabled', + 'javascript_enabled' => 'javascript_enabled', + 'language' => 'language', + 'color_depth' => 'color_depth', + 'screen_height' => 'screen_height', + 'screen_width' => 'screen_width', + 'time_zone_offset' => 'time_zone_offset', + 'user_device' => 'user_device', + 'user_agent' => 'user_agent', + 'accept_header' => 'accept_header' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'java_enabled' => 'setJavaEnabled', + 'javascript_enabled' => 'setJavascriptEnabled', + 'language' => 'setLanguage', + 'color_depth' => 'setColorDepth', + 'screen_height' => 'setScreenHeight', + 'screen_width' => 'setScreenWidth', + 'time_zone_offset' => 'setTimeZoneOffset', + 'user_device' => 'setUserDevice', + 'user_agent' => 'setUserAgent', + 'accept_header' => 'setAcceptHeader' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'java_enabled' => 'getJavaEnabled', + 'javascript_enabled' => 'getJavascriptEnabled', + 'language' => 'getLanguage', + 'color_depth' => 'getColorDepth', + 'screen_height' => 'getScreenHeight', + 'screen_width' => 'getScreenWidth', + 'time_zone_offset' => 'getTimeZoneOffset', + 'user_device' => 'getUserDevice', + 'user_agent' => 'getUserAgent', + 'accept_header' => 'getAcceptHeader' + ]; + + /** + * 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 USER_DEVICE_DESKTOP = 'desktop'; + public const USER_DEVICE_MOBILE = 'mobile'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getUserDeviceAllowableValues() + { + return [ + self::USER_DEVICE_DESKTOP, + self::USER_DEVICE_MOBILE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['java_enabled'] = $data['java_enabled'] ?? null; + $this->container['javascript_enabled'] = $data['javascript_enabled'] ?? null; + $this->container['language'] = $data['language'] ?? null; + $this->container['color_depth'] = $data['color_depth'] ?? null; + $this->container['screen_height'] = $data['screen_height'] ?? null; + $this->container['screen_width'] = $data['screen_width'] ?? null; + $this->container['time_zone_offset'] = $data['time_zone_offset'] ?? null; + $this->container['user_device'] = $data['user_device'] ?? null; + $this->container['user_agent'] = $data['user_agent'] ?? null; + $this->container['accept_header'] = $data['accept_header'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['java_enabled'] === null) { + $invalidProperties[] = "'java_enabled' can't be null"; + } + if ($this->container['javascript_enabled'] === null) { + $invalidProperties[] = "'javascript_enabled' can't be null"; + } + if ($this->container['language'] === null) { + $invalidProperties[] = "'language' can't be null"; + } + if ($this->container['color_depth'] === null) { + $invalidProperties[] = "'color_depth' can't be null"; + } + if ($this->container['screen_height'] === null) { + $invalidProperties[] = "'screen_height' can't be null"; + } + if ($this->container['screen_width'] === null) { + $invalidProperties[] = "'screen_width' can't be null"; + } + if ($this->container['time_zone_offset'] === null) { + $invalidProperties[] = "'time_zone_offset' can't be null"; + } + if ($this->container['user_device'] === null) { + $invalidProperties[] = "'user_device' can't be null"; + } + $allowedValues = $this->getUserDeviceAllowableValues(); + if (!is_null($this->container['user_device']) && !in_array($this->container['user_device'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'user_device', must be one of '%s'", + $this->container['user_device'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['user_agent'] === null) { + $invalidProperties[] = "'user_agent' 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 java_enabled + * + * @return bool + */ + public function getJavaEnabled() + { + return $this->container['java_enabled']; + } + + /** + * Sets java_enabled + * + * @param bool $java_enabled Indicates whether the client browser supports Java. + * + * @return self + */ + public function setJavaEnabled($java_enabled) + { + $this->container['java_enabled'] = $java_enabled; + + return $this; + } + + /** + * Gets javascript_enabled + * + * @return bool + */ + public function getJavascriptEnabled() + { + return $this->container['javascript_enabled']; + } + + /** + * Sets javascript_enabled + * + * @param bool $javascript_enabled Indicates whether the client browser supports JavaScript. + * + * @return self + */ + public function setJavascriptEnabled($javascript_enabled) + { + $this->container['javascript_enabled'] = $javascript_enabled; + + return $this; + } + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language The preferred language of the buyer, usually the language of the browser UI. + * + * @return self + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + /** + * Gets color_depth + * + * @return float + */ + public function getColorDepth() + { + return $this->container['color_depth']; + } + + /** + * Sets color_depth + * + * @param float $color_depth The color depth of the screen. + * + * @return self + */ + public function setColorDepth($color_depth) + { + $this->container['color_depth'] = $color_depth; + + return $this; + } + + /** + * Gets screen_height + * + * @return float + */ + public function getScreenHeight() + { + return $this->container['screen_height']; + } + + /** + * Sets screen_height + * + * @param float $screen_height The height of the screen in pixels. + * + * @return self + */ + public function setScreenHeight($screen_height) + { + $this->container['screen_height'] = $screen_height; + + return $this; + } + + /** + * Gets screen_width + * + * @return float + */ + public function getScreenWidth() + { + return $this->container['screen_width']; + } + + /** + * Sets screen_width + * + * @param float $screen_width The width of the screen in pixels. + * + * @return self + */ + public function setScreenWidth($screen_width) + { + $this->container['screen_width'] = $screen_width; + + return $this; + } + + /** + * Gets time_zone_offset + * + * @return float + */ + public function getTimeZoneOffset() + { + return $this->container['time_zone_offset']; + } + + /** + * Sets time_zone_offset + * + * @param float $time_zone_offset Time-zone offset in minutes between UTC and buyer location. + * + * @return self + */ + public function setTimeZoneOffset($time_zone_offset) + { + $this->container['time_zone_offset'] = $time_zone_offset; + + return $this; + } + + /** + * Gets user_device + * + * @return string + */ + public function getUserDevice() + { + return $this->container['user_device']; + } + + /** + * Sets user_device + * + * @param string $user_device The platform that is being used to access the website. + * + * @return self + */ + public function setUserDevice($user_device) + { + $allowedValues = $this->getUserDeviceAllowableValues(); + if (!in_array($user_device, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'user_device', must be one of '%s'", + $user_device, + implode("', '", $allowedValues) + ) + ); + } + $this->container['user_device'] = $user_device; + + return $this; + } + + /** + * Gets user_agent + * + * @return string + */ + public function getUserAgent() + { + return $this->container['user_agent']; + } + + /** + * Sets user_agent + * + * @param string $user_agent The user agent string for the current browser. + * + * @return self + */ + public function setUserAgent($user_agent) + { + $this->container['user_agent'] = $user_agent; + + return $this; + } + + /** + * Gets accept_header + * + * @return string|null + */ + public function getAcceptHeader() + { + return $this->container['accept_header']; + } + + /** + * Sets accept_header + * + * @param string|null $accept_header The `Accept` header of the request from the buyer's browser. + * + * @return self + */ + public function setAcceptHeader($accept_header) + { + $this->container['accept_header'] = $accept_header; + + 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 + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/TransactionStatementDescriptor.php b/lib/model/TransactionStatementDescriptor.php new file mode 100644 index 0000000..cccf81c --- /dev/null +++ b/lib/model/TransactionStatementDescriptor.php @@ -0,0 +1,525 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class TransactionStatementDescriptor implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Transaction_statement_descriptor'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'description' => 'string', + 'city' => 'string', + 'phone_number' => 'string', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'description' => null, + 'city' => null, + 'phone_number' => null, + 'url' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'description' => 'description', + 'city' => 'city', + 'phone_number' => 'phone_number', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'description' => 'setDescription', + 'city' => 'setCity', + 'phone_number' => 'setPhoneNumber', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'description' => 'getDescription', + 'city' => 'getCity', + 'phone_number' => 'getPhoneNumber', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * 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->container['name'] = $data['name'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['city'] = $data['city'] ?? null; + $this->container['phone_number'] = $data['phone_number'] ?? null; + $this->container['url'] = $data['url'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 22)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 22."; + } + + if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) < 5)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 5."; + } + + if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 22)) { + $invalidProperties[] = "invalid value for 'description', the character length must be smaller than or equal to 22."; + } + + if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) < 5)) { + $invalidProperties[] = "invalid value for 'description', the character length must be bigger than or equal to 5."; + } + + if (!is_null($this->container['city']) && (mb_strlen($this->container['city']) > 13)) { + $invalidProperties[] = "invalid value for 'city', the character length must be smaller than or equal to 13."; + } + + if (!is_null($this->container['city']) && (mb_strlen($this->container['city']) < 1)) { + $invalidProperties[] = "invalid value for 'city', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['phone_number']) && (mb_strlen($this->container['phone_number']) > 20)) { + $invalidProperties[] = "invalid value for 'phone_number', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['phone_number']) && (mb_strlen($this->container['phone_number']) < 5)) { + $invalidProperties[] = "invalid value for 'phone_number', the character length must be bigger than or equal to 5."; + } + + if (!is_null($this->container['phone_number']) && !preg_match("/^\\+[1-9]\\d{1,14}$/", $this->container['phone_number'])) { + $invalidProperties[] = "invalid value for 'phone_number', must be conform to the pattern /^\\+[1-9]\\d{1,14}$/."; + } + + if (!is_null($this->container['url']) && (mb_strlen($this->container['url']) > 13)) { + $invalidProperties[] = "invalid value for 'url', the character length must be smaller than or equal to 13."; + } + + if (!is_null($this->container['url']) && (mb_strlen($this->container['url']) < 1)) { + $invalidProperties[] = "invalid value for 'url', the character length must be bigger than or equal to 1."; + } + + 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 name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Reflects your doing business as (DBA) name. Other validations: 1. Contains only Latin characters. 2. Contain at least one letter 3. Does not contain any of the special characters `< > \\ ' \" *` 4. Supports: 1. Lower case: `a-z` 2. Upper case: `A-Z` 3. Numbers: `0-9` 4. Spaces: ` ` 5. Special characters: `. , _ - ? + /`. + * + * @return self + */ + public function setName($name) + { + if (!is_null($name) && (mb_strlen($name) > 22)) { + throw new \InvalidArgumentException('invalid length for $name when calling TransactionStatementDescriptor., must be smaller than or equal to 22.'); + } + if (!is_null($name) && (mb_strlen($name) < 5)) { + throw new \InvalidArgumentException('invalid length for $name when calling TransactionStatementDescriptor., must be bigger than or equal to 5.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A short description about the purchase. Other validations: 1. Contains only Latin characters. 2. Contain at least one letter 3. Does not contain any of the special characters `< > \\ ' \" *` 4. Supports: 1. Lower case: `a-z` 2. Upper case: `A-Z` 3. Numbers: `0-9` 4. Spaces: ` ` 5. Special characters: `. , _ - ? + /`. + * + * @return self + */ + public function setDescription($description) + { + if (!is_null($description) && (mb_strlen($description) > 22)) { + throw new \InvalidArgumentException('invalid length for $description when calling TransactionStatementDescriptor., must be smaller than or equal to 22.'); + } + if (!is_null($description) && (mb_strlen($description) < 5)) { + throw new \InvalidArgumentException('invalid length for $description when calling TransactionStatementDescriptor., must be bigger than or equal to 5.'); + } + + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city City from which the charge originated. + * + * @return self + */ + public function setCity($city) + { + if (!is_null($city) && (mb_strlen($city) > 13)) { + throw new \InvalidArgumentException('invalid length for $city when calling TransactionStatementDescriptor., must be smaller than or equal to 13.'); + } + if (!is_null($city) && (mb_strlen($city) < 1)) { + throw new \InvalidArgumentException('invalid length for $city when calling TransactionStatementDescriptor., must be bigger than or equal to 1.'); + } + + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets phone_number + * + * @return string|null + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string|null $phone_number The value in the phone number field of a customer's statement which should be formatted according to the [E164 number standard](https://www.twilio.com/docs/glossary/what-e164). + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (!is_null($phone_number) && (mb_strlen($phone_number) > 20)) { + throw new \InvalidArgumentException('invalid length for $phone_number when calling TransactionStatementDescriptor., must be smaller than or equal to 20.'); + } + if (!is_null($phone_number) && (mb_strlen($phone_number) < 5)) { + throw new \InvalidArgumentException('invalid length for $phone_number when calling TransactionStatementDescriptor., must be bigger than or equal to 5.'); + } + if (!is_null($phone_number) && (!preg_match("/^\\+[1-9]\\d{1,14}$/", $phone_number))) { + throw new \InvalidArgumentException("invalid value for $phone_number when calling TransactionStatementDescriptor., must conform to the pattern /^\\+[1-9]\\d{1,14}$/."); + } + + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url The value in the URL/web address field of a customer's statement. + * + * @return self + */ + public function setUrl($url) + { + if (!is_null($url) && (mb_strlen($url) > 13)) { + throw new \InvalidArgumentException('invalid length for $url when calling TransactionStatementDescriptor., must be smaller than or equal to 13.'); + } + if (!is_null($url) && (mb_strlen($url) < 1)) { + throw new \InvalidArgumentException('invalid length for $url when calling TransactionStatementDescriptor., must be bigger than or equal to 1.'); + } + + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/TransactionSummary.php b/lib/model/TransactionSummary.php index 93867e3..15e3b7f 100644 --- a/lib/model/TransactionSummary.php +++ b/lib/model/TransactionSummary.php @@ -2,7 +2,7 @@ /** * TransactionSummary * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -70,12 +70,12 @@ class TransactionSummary implements ModelInterface, ArrayAccess, \JsonSerializab 'refunded_amount' => 'int', 'currency' => 'string', 'country' => 'string', - 'payment_method' => '\Gr4vy\model\PaymentMethodSnapshot', - 'buyer' => '\Gr4vy\model\BuyerSnapshot', + 'payment_method' => '\Gr4vy\model\TransactionPaymentMethod', + 'buyer' => '\Gr4vy\model\TransactionBuyer', 'created_at' => '\DateTime', 'external_identifier' => 'string', 'updated_at' => '\DateTime', - 'payment_service' => '\Gr4vy\model\PaymentService', + 'payment_service' => '\Gr4vy\model\PaymentMethodTokenPaymentService', 'method' => 'string' ]; @@ -239,42 +239,43 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_TRANSACTION = 'transaction'; - const STATUS_PROCESSING = 'processing'; - const STATUS_BUYER_APPROVAL_PENDING = 'buyer_approval_pending'; - const STATUS_AUTHORIZATION_SUCCEEDED = 'authorization_succeeded'; - const STATUS_AUTHORIZATION_FAILED = 'authorization_failed'; - const STATUS_AUTHORIZATION_DECLINED = 'authorization_declined'; - const STATUS_CAPTURE_PENDING = 'capture_pending'; - const STATUS_CAPTURE_SUCCEEDED = 'capture_succeeded'; - const STATUS_AUTHORIZATION_VOID_PENDING = 'authorization_void_pending'; - const STATUS_AUTHORIZATION_VOIDED = 'authorization_voided'; - const INTENT_AUTHORIZE = 'authorize'; - const INTENT_CAPTURE = 'capture'; - const METHOD_AFTERPAY = 'afterpay'; - const METHOD_APPLEPAY = 'applepay'; - const METHOD_BANKED = 'banked'; - const METHOD_BOLETO = 'boleto'; - const METHOD_CARD = 'card'; - const METHOD_CLEARPAY = 'clearpay'; - const METHOD_DANA = 'dana'; - const METHOD_FORTUMO = 'fortumo'; - const METHOD_GCASH = 'gcash'; - const METHOD_GOCARDLESS = 'gocardless'; - const METHOD_GOOGLEPAY = 'googlepay'; - const METHOD_GOOGLEPAY_PAN_ONLY = 'googlepay_pan_only'; - const METHOD_GRABPAY = 'grabpay'; - const METHOD_KLARNA = 'klarna'; - const METHOD_OVO = 'ovo'; - const METHOD_PAYMAYA = 'paymaya'; - const METHOD_PAYPAL = 'paypal'; - const METHOD_PIX = 'pix'; - const METHOD_RABBITLINEPAY = 'rabbitlinepay'; - const METHOD_SHOPEEPAY = 'shopeepay'; - const METHOD_STRIPEDD = 'stripedd'; - const METHOD_TRUEMONEY = 'truemoney'; - const METHOD_TRUSTLY = 'trustly'; - const METHOD_ZIPPAY = 'zippay'; + public const TYPE_TRANSACTION = 'transaction'; + public const STATUS_PROCESSING = 'processing'; + public const STATUS_BUYER_APPROVAL_PENDING = 'buyer_approval_pending'; + public const STATUS_AUTHORIZATION_SUCCEEDED = 'authorization_succeeded'; + public const STATUS_AUTHORIZATION_FAILED = 'authorization_failed'; + public const STATUS_AUTHORIZATION_DECLINED = 'authorization_declined'; + public const STATUS_CAPTURE_PENDING = 'capture_pending'; + public const STATUS_CAPTURE_SUCCEEDED = 'capture_succeeded'; + public const STATUS_AUTHORIZATION_VOID_PENDING = 'authorization_void_pending'; + public const STATUS_AUTHORIZATION_VOIDED = 'authorization_voided'; + public const INTENT_AUTHORIZE = 'authorize'; + public const INTENT_CAPTURE = 'capture'; + public const METHOD_AFTERPAY = 'afterpay'; + public const METHOD_APPLEPAY = 'applepay'; + public const METHOD_BANKED = 'banked'; + public const METHOD_BITPAY = 'bitpay'; + public const METHOD_BOLETO = 'boleto'; + public const METHOD_CARD = 'card'; + public const METHOD_CLEARPAY = 'clearpay'; + public const METHOD_DANA = 'dana'; + public const METHOD_FORTUMO = 'fortumo'; + public const METHOD_GCASH = 'gcash'; + public const METHOD_GOCARDLESS = 'gocardless'; + public const METHOD_GOOGLEPAY = 'googlepay'; + public const METHOD_GOOGLEPAY_PAN_ONLY = 'googlepay_pan_only'; + public const METHOD_GRABPAY = 'grabpay'; + public const METHOD_KLARNA = 'klarna'; + public const METHOD_OVO = 'ovo'; + public const METHOD_PAYMAYA = 'paymaya'; + public const METHOD_PAYPAL = 'paypal'; + public const METHOD_PIX = 'pix'; + public const METHOD_RABBITLINEPAY = 'rabbitlinepay'; + public const METHOD_SHOPEEPAY = 'shopeepay'; + public const METHOD_STRIPEDD = 'stripedd'; + public const METHOD_TRUEMONEY = 'truemoney'; + public const METHOD_TRUSTLY = 'trustly'; + public const METHOD_ZIPPAY = 'zippay'; /** * Gets allowable values of the enum @@ -332,6 +333,7 @@ public function getMethodAllowableValues() self::METHOD_AFTERPAY, self::METHOD_APPLEPAY, self::METHOD_BANKED, + self::METHOD_BITPAY, self::METHOD_BOLETO, self::METHOD_CARD, self::METHOD_CLEARPAY, @@ -746,7 +748,7 @@ public function setCountry($country) /** * Gets payment_method * - * @return PaymentMethodSnapshot|null + * @return \Gr4vy\model\TransactionPaymentMethod|null */ public function getPaymentMethod() { @@ -756,7 +758,7 @@ public function getPaymentMethod() /** * Sets payment_method * - * @param PaymentMethodSnapshot|null $payment_method payment_method + * @param \Gr4vy\model\TransactionPaymentMethod|null $payment_method payment_method * * @return self */ @@ -770,7 +772,7 @@ public function setPaymentMethod($payment_method) /** * Gets buyer * - * @return BuyerSnapshot|null + * @return \Gr4vy\model\TransactionBuyer|null */ public function getBuyer() { @@ -780,7 +782,7 @@ public function getBuyer() /** * Sets buyer * - * @param BuyerSnapshot|null $buyer buyer + * @param \Gr4vy\model\TransactionBuyer|null $buyer buyer * * @return self */ @@ -866,7 +868,7 @@ public function setUpdatedAt($updated_at) /** * Gets payment_service * - * @return PaymentServiceSnapshot|null + * @return \Gr4vy\model\PaymentMethodTokenPaymentService|null */ public function getPaymentService() { @@ -876,7 +878,7 @@ public function getPaymentService() /** * Sets payment_service * - * @param PaymentServiceSnapshot|null $payment_service payment_service + * @param \Gr4vy\model\PaymentMethodTokenPaymentService|null $payment_service payment_service * * @return self */ @@ -927,7 +929,7 @@ public function setMethod($method) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -939,6 +941,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -952,7 +955,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -968,7 +971,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -980,6 +983,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/Transactions.php b/lib/model/Transactions.php index df139df..bb73359 100644 --- a/lib/model/Transactions.php +++ b/lib/model/Transactions.php @@ -2,7 +2,7 @@ /** * Transactions * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -373,7 +373,7 @@ public function setPreviousCursor($previous_cursor) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -385,6 +385,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -398,7 +399,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -414,7 +415,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -426,6 +427,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/TransactionsBatchCaptureRequest.php b/lib/model/TransactionsBatchCaptureRequest.php index bbb3d12..679784d 100644 --- a/lib/model/TransactionsBatchCaptureRequest.php +++ b/lib/model/TransactionsBatchCaptureRequest.php @@ -2,7 +2,7 @@ /** * TransactionsBatchCaptureRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -352,7 +352,7 @@ public function setTransactionId($transaction_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -364,6 +364,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -377,7 +378,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -393,7 +394,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -405,6 +406,7 @@ public function offsetUnset($offset) * @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); diff --git a/lib/model/UserRequest.php b/lib/model/UserRequest.php index b6344f1..44274b0 100644 --- a/lib/model/UserRequest.php +++ b/lib/model/UserRequest.php @@ -2,7 +2,7 @@ /** * UserRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package Gr4vy @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.1.0-beta * Contact: code@gr4vy.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 6.0.0 */ /** @@ -297,7 +297,7 @@ public function setEmailAddress($email_address) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -309,6 +309,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -322,7 +323,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -338,7 +339,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -350,6 +351,7 @@ public function offsetUnset($offset) * @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); diff --git a/openapi-generator-generate.sh b/openapi-generator-generate.sh index a8c7793..bad03fd 100755 --- a/openapi-generator-generate.sh +++ b/openapi-generator-generate.sh @@ -1,6 +1,6 @@ rm -rf lib/api lib/model docker run --rm \ - -v ${PWD}:/local openapitools/openapi-generator-cli:v5.4.0 generate \ + -v ${PWD}:/local openapitools/openapi-generator-cli:v6.0.0 generate \ -i https://raw.githubusercontent.com/gr4vy/gr4vy-openapi/sdks/openapi.v1.json \ -g php \ --git-user-id gr4vy \ diff --git a/test/Api/BuyersApiTest.php b/test/Api/BuyersApiTest.php index 7ca4632..4cbaeea 100644 --- a/test/Api/BuyersApiTest.php +++ b/test/Api/BuyersApiTest.php @@ -89,7 +89,7 @@ public function testAddBuyer() $config = new Gr4vyConfig(self::$gr4vyId, self::$privateKeyLocation); $apiInstance = new BuyersApi(new Client(),$config->getConfig()); - $buyer_request = array("external_identifier"=>"testAddBuyer","display_name"=>"🐶"); + $buyer_request = array("external_identifier"=>"testAddBuyer2","display_name"=>"🐶"); $result = $apiInstance->addBuyer($buyer_request); $this->assertArrayHasKey("id", $result); $this->assertEquals($result->getDisplayName(), "🐶"); @@ -184,7 +184,7 @@ public function testUpdateBuyer() $config = new Gr4vyConfig(self::$gr4vyId, self::$privateKeyLocation); $apiInstance = new BuyersApi(new Client(),$config->getConfig()); - $buyer_request = array("external_identifier"=>"testAddBuyer","display_name"=>"abc"); + $buyer_request = array("external_identifier"=>"testAddBuyer3","display_name"=>"abc"); $result = $apiInstance->addBuyer($buyer_request); $buyer_update = array("external_identifier"=>"testUpdateBuyer");